1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/simplebooktest.cpp
3 // Purpose: wxSimplebook unit test
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
7 ///////////////////////////////////////////////////////////////////////////////
22 #include "wx/simplebook.h"
23 #include "bookctrlbasetest.h"
25 class SimplebookTestCase
: public BookCtrlBaseTestCase
, public CppUnit::TestCase
28 SimplebookTestCase() { }
31 virtual void tearDown();
34 virtual wxBookCtrlBase
*GetBase() const { return m_simplebook
; }
36 virtual wxEventType
GetChangedEvent() const
37 { return wxEVT_BOOKCTRL_PAGE_CHANGED
; }
39 virtual wxEventType
GetChangingEvent() const
40 { return wxEVT_BOOKCTRL_PAGE_CHANGING
; }
42 CPPUNIT_TEST_SUITE( SimplebookTestCase
);
43 wxBOOK_CTRL_BASE_TESTS();
44 CPPUNIT_TEST_SUITE_END();
46 wxSimplebook
*m_simplebook
;
48 DECLARE_NO_COPY_CLASS(SimplebookTestCase
)
51 // register in the unnamed registry so that these tests are run by default
52 CPPUNIT_TEST_SUITE_REGISTRATION( SimplebookTestCase
);
54 // also include in its own registry so that these tests can be run alone
55 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SimplebookTestCase
, "SimplebookTestCase" );
57 void SimplebookTestCase::setUp()
59 m_simplebook
= new wxSimplebook(wxTheApp
->GetTopWindow(), wxID_ANY
);
63 void SimplebookTestCase::tearDown()
65 wxDELETE(m_simplebook
);
68 #endif // wxUSE_BOOKCTRL