1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/simplebooktest.cpp
3 // Purpose: wxSimplebook unit test
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
8 ///////////////////////////////////////////////////////////////////////////////
23 #include "wx/simplebook.h"
24 #include "bookctrlbasetest.h"
26 class SimplebookTestCase
: public BookCtrlBaseTestCase
, public CppUnit::TestCase
29 SimplebookTestCase() { }
32 virtual void tearDown();
35 virtual wxBookCtrlBase
*GetBase() const { return m_simplebook
; }
37 virtual wxEventType
GetChangedEvent() const
38 { return wxEVT_BOOKCTRL_PAGE_CHANGED
; }
40 virtual wxEventType
GetChangingEvent() const
41 { return wxEVT_BOOKCTRL_PAGE_CHANGING
; }
43 CPPUNIT_TEST_SUITE( SimplebookTestCase
);
44 wxBOOK_CTRL_BASE_TESTS();
45 CPPUNIT_TEST_SUITE_END();
47 wxSimplebook
*m_simplebook
;
49 DECLARE_NO_COPY_CLASS(SimplebookTestCase
)
52 // register in the unnamed registry so that these tests are run by default
53 CPPUNIT_TEST_SUITE_REGISTRATION( SimplebookTestCase
);
55 // also include in its own registry so that these tests can be run alone
56 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SimplebookTestCase
, "SimplebookTestCase" );
58 void SimplebookTestCase::setUp()
60 m_simplebook
= new wxSimplebook(wxTheApp
->GetTopWindow(), wxID_ANY
);
64 void SimplebookTestCase::tearDown()
66 wxDELETE(m_simplebook
);
69 #endif // wxUSE_BOOKCTRL