]>
git.saurik.com Git - wxWidgets.git/blob - tests/controls/searchctrltest.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/searchctrltest.cpp
3 // Purpose: wxSearchCtrl unit test
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
7 ///////////////////////////////////////////////////////////////////////////////
21 #include "wx/srchctrl.h"
23 class SearchCtrlTestCase
: public CppUnit::TestCase
26 SearchCtrlTestCase() { }
29 virtual void tearDown();
32 CPPUNIT_TEST_SUITE( SearchCtrlTestCase
);
33 CPPUNIT_TEST( Focus
);
34 CPPUNIT_TEST_SUITE_END();
38 wxSearchCtrl
* m_search
;
40 DECLARE_NO_COPY_CLASS(SearchCtrlTestCase
)
43 // register in the unnamed registry so that these tests are run by default
44 CPPUNIT_TEST_SUITE_REGISTRATION( SearchCtrlTestCase
);
46 // also include in its own registry so that these tests can be run alone
47 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SearchCtrlTestCase
, "SearchCtrlTestCase" );
49 void SearchCtrlTestCase::setUp()
51 m_search
= new wxSearchCtrl(wxTheApp
->GetTopWindow(), wxID_ANY
);
54 void SearchCtrlTestCase::tearDown()
60 void SearchCtrlTestCase::Focus()
62 // TODO OS X test only passes when run solo ...
65 CPPUNIT_ASSERT( m_search
->HasFocus() );
69 #endif // wxUSE_SEARCHCTRL