]>
git.saurik.com Git - wxWidgets.git/blob - tests/controls/comboboxtest.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/controls/comboboxtest.cpp
3 // Purpose: wxComboBox unit test
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
8 ///////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
22 #include "wx/combobox.h"
25 #include "textentrytest.h"
27 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
31 class ComboBoxTestCase
: public TextEntryTestCase
34 ComboBoxTestCase() { }
37 virtual void tearDown();
40 virtual wxTextEntry
*GetTestEntry() const { return m_combo
; }
41 virtual wxWindow
*GetTestWindow() const { return m_combo
; }
43 virtual void CheckStringSelection(const char * WXUNUSED(sel
))
45 // do nothing here, as explained in TextEntryTestCase comment, our
46 // GetStringSelection() is the wxChoice, not wxTextEntry, one and there
47 // is no way to return the selection contents directly
50 CPPUNIT_TEST_SUITE( ComboBoxTestCase
);
52 CPPUNIT_TEST_SUITE_END();
56 DECLARE_NO_COPY_CLASS(ComboBoxTestCase
)
59 // register in the unnamed registry so that these tests are run by default
60 CPPUNIT_TEST_SUITE_REGISTRATION( ComboBoxTestCase
);
62 // also include in it's own registry so that these tests can be run alone
63 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ComboBoxTestCase
, "ComboBoxTestCase" );
65 // ----------------------------------------------------------------------------
66 // test initialization
67 // ----------------------------------------------------------------------------
69 void ComboBoxTestCase::setUp()
71 m_combo
= new wxComboBox(wxTheApp
->GetTopWindow(), wxID_ANY
);
74 void ComboBoxTestCase::tearDown()
80 // ----------------------------------------------------------------------------
82 // ----------------------------------------------------------------------------