Add a minimal unit test for wxSimplebook.
This is just a test running the common wxBookCtrlBase tests for wxSimplebook. See #15188. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
015a04705d
commit
10e6908dd3
@ -192,6 +192,7 @@ TEST_GUI_OBJECTS = \
|
||||
test_gui_rearrangelisttest.o \
|
||||
test_gui_richtextctrltest.o \
|
||||
test_gui_searchctrltest.o \
|
||||
test_gui_simplebooktest.o \
|
||||
test_gui_slidertest.o \
|
||||
test_gui_spinctrldbltest.o \
|
||||
test_gui_spinctrltest.o \
|
||||
@ -832,6 +833,9 @@ test_gui_richtextctrltest.o: $(srcdir)/controls/richtextctrltest.cpp $(TEST_GUI_
|
||||
test_gui_searchctrltest.o: $(srcdir)/controls/searchctrltest.cpp $(TEST_GUI_ODEP)
|
||||
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/searchctrltest.cpp
|
||||
|
||||
test_gui_simplebooktest.o: $(srcdir)/controls/simplebooktest.cpp $(TEST_GUI_ODEP)
|
||||
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/simplebooktest.cpp
|
||||
|
||||
test_gui_slidertest.o: $(srcdir)/controls/slidertest.cpp $(TEST_GUI_ODEP)
|
||||
$(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/slidertest.cpp
|
||||
|
||||
|
70
tests/controls/simplebooktest.cpp
Normal file
70
tests/controls/simplebooktest.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tests/controls/simplebooktest.cpp
|
||||
// Purpose: wxSimplebook unit test
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2013-06-23
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "testprec.h"
|
||||
|
||||
#if wxUSE_BOOKCTRL
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/panel.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/simplebook.h"
|
||||
#include "bookctrlbasetest.h"
|
||||
|
||||
class SimplebookTestCase : public BookCtrlBaseTestCase, public CppUnit::TestCase
|
||||
{
|
||||
public:
|
||||
SimplebookTestCase() { }
|
||||
|
||||
virtual void setUp();
|
||||
virtual void tearDown();
|
||||
|
||||
private:
|
||||
virtual wxBookCtrlBase *GetBase() const { return m_simplebook; }
|
||||
|
||||
virtual wxEventType GetChangedEvent() const
|
||||
{ return wxEVT_BOOKCTRL_PAGE_CHANGED; }
|
||||
|
||||
virtual wxEventType GetChangingEvent() const
|
||||
{ return wxEVT_BOOKCTRL_PAGE_CHANGING; }
|
||||
|
||||
CPPUNIT_TEST_SUITE( SimplebookTestCase );
|
||||
wxBOOK_CTRL_BASE_TESTS();
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
wxSimplebook *m_simplebook;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(SimplebookTestCase)
|
||||
};
|
||||
|
||||
// register in the unnamed registry so that these tests are run by default
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION( SimplebookTestCase );
|
||||
|
||||
// also include in its own registry so that these tests can be run alone
|
||||
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SimplebookTestCase, "SimplebookTestCase" );
|
||||
|
||||
void SimplebookTestCase::setUp()
|
||||
{
|
||||
m_simplebook = new wxSimplebook(wxTheApp->GetTopWindow(), wxID_ANY);
|
||||
AddPanels();
|
||||
}
|
||||
|
||||
void SimplebookTestCase::tearDown()
|
||||
{
|
||||
wxDELETE(m_simplebook);
|
||||
}
|
||||
|
||||
#endif // wxUSE_BOOKCTRL
|
||||
|
@ -178,6 +178,7 @@ TEST_GUI_OBJECTS = \
|
||||
$(OBJS)\test_gui_rearrangelisttest.obj \
|
||||
$(OBJS)\test_gui_richtextctrltest.obj \
|
||||
$(OBJS)\test_gui_searchctrltest.obj \
|
||||
$(OBJS)\test_gui_simplebooktest.obj \
|
||||
$(OBJS)\test_gui_slidertest.obj \
|
||||
$(OBJS)\test_gui_spinctrldbltest.obj \
|
||||
$(OBJS)\test_gui_spinctrltest.obj \
|
||||
@ -890,6 +891,9 @@ $(OBJS)\test_gui_richtextctrltest.obj: .\controls\richtextctrltest.cpp
|
||||
$(OBJS)\test_gui_searchctrltest.obj: .\controls\searchctrltest.cpp
|
||||
$(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\searchctrltest.cpp
|
||||
|
||||
$(OBJS)\test_gui_simplebooktest.obj: .\controls\simplebooktest.cpp
|
||||
$(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\simplebooktest.cpp
|
||||
|
||||
$(OBJS)\test_gui_slidertest.obj: .\controls\slidertest.cpp
|
||||
$(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\slidertest.cpp
|
||||
|
||||
|
@ -172,6 +172,7 @@ TEST_GUI_OBJECTS = \
|
||||
$(OBJS)\test_gui_rearrangelisttest.o \
|
||||
$(OBJS)\test_gui_richtextctrltest.o \
|
||||
$(OBJS)\test_gui_searchctrltest.o \
|
||||
$(OBJS)\test_gui_simplebooktest.o \
|
||||
$(OBJS)\test_gui_slidertest.o \
|
||||
$(OBJS)\test_gui_spinctrldbltest.o \
|
||||
$(OBJS)\test_gui_spinctrltest.o \
|
||||
@ -879,6 +880,9 @@ $(OBJS)\test_gui_richtextctrltest.o: ./controls/richtextctrltest.cpp
|
||||
$(OBJS)\test_gui_searchctrltest.o: ./controls/searchctrltest.cpp
|
||||
$(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\test_gui_simplebooktest.o: ./controls/simplebooktest.cpp
|
||||
$(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
$(OBJS)\test_gui_slidertest.o: ./controls/slidertest.cpp
|
||||
$(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
|
@ -175,6 +175,7 @@ TEST_GUI_OBJECTS = \
|
||||
$(OBJS)\test_gui_rearrangelisttest.obj \
|
||||
$(OBJS)\test_gui_richtextctrltest.obj \
|
||||
$(OBJS)\test_gui_searchctrltest.obj \
|
||||
$(OBJS)\test_gui_simplebooktest.obj \
|
||||
$(OBJS)\test_gui_slidertest.obj \
|
||||
$(OBJS)\test_gui_spinctrldbltest.obj \
|
||||
$(OBJS)\test_gui_spinctrltest.obj \
|
||||
@ -1030,6 +1031,9 @@ $(OBJS)\test_gui_richtextctrltest.obj: .\controls\richtextctrltest.cpp
|
||||
$(OBJS)\test_gui_searchctrltest.obj: .\controls\searchctrltest.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\searchctrltest.cpp
|
||||
|
||||
$(OBJS)\test_gui_simplebooktest.obj: .\controls\simplebooktest.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\simplebooktest.cpp
|
||||
|
||||
$(OBJS)\test_gui_slidertest.obj: .\controls\slidertest.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\slidertest.cpp
|
||||
|
||||
|
@ -447,6 +447,7 @@ TEST_GUI_OBJECTS = &
|
||||
$(OBJS)\test_gui_rearrangelisttest.obj &
|
||||
$(OBJS)\test_gui_richtextctrltest.obj &
|
||||
$(OBJS)\test_gui_searchctrltest.obj &
|
||||
$(OBJS)\test_gui_simplebooktest.obj &
|
||||
$(OBJS)\test_gui_slidertest.obj &
|
||||
$(OBJS)\test_gui_spinctrldbltest.obj &
|
||||
$(OBJS)\test_gui_spinctrltest.obj &
|
||||
@ -939,6 +940,9 @@ $(OBJS)\test_gui_richtextctrltest.obj : .AUTODEPEND .\controls\richtextctrltest
|
||||
$(OBJS)\test_gui_searchctrltest.obj : .AUTODEPEND .\controls\searchctrltest.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\test_gui_simplebooktest.obj : .AUTODEPEND .\controls\simplebooktest.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
|
||||
|
||||
$(OBJS)\test_gui_slidertest.obj : .AUTODEPEND .\controls\slidertest.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $<
|
||||
|
||||
|
@ -173,6 +173,7 @@
|
||||
controls/rearrangelisttest.cpp
|
||||
controls/richtextctrltest.cpp
|
||||
controls/searchctrltest.cpp
|
||||
controls/simplebooktest.cpp
|
||||
controls/slidertest.cpp
|
||||
controls/spinctrldbltest.cpp
|
||||
controls/spinctrltest.cpp
|
||||
|
@ -393,6 +393,10 @@ SOURCE=.\misc\settings.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\controls\simplebooktest.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\geometry\size.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -508,6 +508,9 @@
|
||||
<File
|
||||
RelativePath=".\misc\settings.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\controls\simplebooktest.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\geometry\size.cpp">
|
||||
</File>
|
||||
|
@ -713,6 +713,10 @@
|
||||
RelativePath=".\misc\settings.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\controls\simplebooktest.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\geometry\size.cpp"
|
||||
>
|
||||
|
@ -699,6 +699,10 @@
|
||||
RelativePath=".\misc\settings.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\controls\simplebooktest.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\geometry\size.cpp"
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user