htmllboxtest.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: tests/controls/htmllboxtest.cpp
  3. // Purpose: wxSimpleHtmlListBoxNameStr unit test
  4. // Author: Vadim Zeitlin
  5. // Created: 2010-11-27
  6. // Copyright: (c) 2010 Vadim Zeitlin <vadim@wxwidgets.org>
  7. ///////////////////////////////////////////////////////////////////////////////
  8. #include "testprec.h"
  9. #ifdef __BORLANDC__
  10. #pragma hdrstop
  11. #endif
  12. #ifndef WX_PRECOMP
  13. #include "wx/app.h"
  14. #endif // WX_PRECOMP
  15. #include "wx/htmllbox.h"
  16. #include "itemcontainertest.h"
  17. class HtmlListBoxTestCase : public ItemContainerTestCase,
  18. public CppUnit::TestCase
  19. {
  20. public:
  21. HtmlListBoxTestCase() { }
  22. virtual void setUp();
  23. virtual void tearDown();
  24. private:
  25. virtual wxItemContainer *GetContainer() const { return m_htmllbox; }
  26. virtual wxWindow *GetContainerWindow() const { return m_htmllbox; }
  27. CPPUNIT_TEST_SUITE( HtmlListBoxTestCase );
  28. wxITEM_CONTAINER_TESTS();
  29. CPPUNIT_TEST_SUITE_END();
  30. wxSimpleHtmlListBox* m_htmllbox;
  31. DECLARE_NO_COPY_CLASS(HtmlListBoxTestCase)
  32. };
  33. // register in the unnamed registry so that these tests are run by default
  34. CPPUNIT_TEST_SUITE_REGISTRATION( HtmlListBoxTestCase );
  35. // also include in its own registry so that these tests can be run alone
  36. CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlListBoxTestCase, "HtmlListBoxTestCase" );
  37. void HtmlListBoxTestCase::setUp()
  38. {
  39. m_htmllbox = new wxSimpleHtmlListBox(wxTheApp->GetTopWindow(), wxID_ANY);
  40. }
  41. void HtmlListBoxTestCase::tearDown()
  42. {
  43. wxDELETE(m_htmllbox);
  44. }