From: Vadim Zeitlin Date: Sat, 27 Nov 2010 11:34:34 +0000 (+0000) Subject: Add wx(Simple)HtmlListBox unit test. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/68ebe2620fba0e8702af9e7afa4dcc69263433fb Add wx(Simple)HtmlListBox unit test. For now just test the wxItemContainer methods. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/Makefile.in b/tests/Makefile.in index 64b4e3ee6b..217973f281 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -168,6 +168,7 @@ TEST_GUI_OBJECTS = \ test_gui_gaugetest.o \ test_gui_gridtest.o \ test_gui_headerctrltest.o \ + test_gui_htmllboxtest.o \ test_gui_hyperlinkctrltest.o \ test_gui_itemcontainertest.o \ test_gui_label.o \ @@ -726,6 +727,9 @@ test_gui_gridtest.o: $(srcdir)/controls/gridtest.cpp $(TEST_GUI_ODEP) test_gui_headerctrltest.o: $(srcdir)/controls/headerctrltest.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/headerctrltest.cpp +test_gui_htmllboxtest.o: $(srcdir)/controls/htmllboxtest.cpp $(TEST_GUI_ODEP) + $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/htmllboxtest.cpp + test_gui_hyperlinkctrltest.o: $(srcdir)/controls/hyperlinkctrltest.cpp $(TEST_GUI_ODEP) $(CXXC) -c -o $@ $(TEST_GUI_CXXFLAGS) $(srcdir)/controls/hyperlinkctrltest.cpp diff --git a/tests/controls/htmllboxtest.cpp b/tests/controls/htmllboxtest.cpp new file mode 100644 index 0000000000..2fa17aabad --- /dev/null +++ b/tests/controls/htmllboxtest.cpp @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: tests/controls/htmllboxtest.cpp +// Purpose: wxSimpleHtmlListBoxNameStr unit test +// Author: Vadim Zeitlin +// Created: 2010-11-27 +// RCS-ID: $Id$ +// Copyright: (c) 2010 Vadim Zeitlin +/////////////////////////////////////////////////////////////////////////////// + +#include "testprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + +#include "wx/htmllbox.h" +#include "itemcontainertest.h" + +class HtmlListBoxTestCase : public ItemContainerTestCase, + public CppUnit::TestCase +{ +public: + HtmlListBoxTestCase() { } + + virtual void setUp(); + virtual void tearDown(); + +private: + virtual wxItemContainer *GetContainer() const { return m_htmllbox; } + virtual wxWindow *GetContainerWindow() const { return m_htmllbox; } + + CPPUNIT_TEST_SUITE( HtmlListBoxTestCase ); + wxITEM_CONTAINER_TESTS(); + CPPUNIT_TEST_SUITE_END(); + + wxSimpleHtmlListBox* m_htmllbox; + + DECLARE_NO_COPY_CLASS(HtmlListBoxTestCase) +}; + +// register in the unnamed registry so that these tests are run by default +CPPUNIT_TEST_SUITE_REGISTRATION( HtmlListBoxTestCase ); + +// also include in it's own registry so that these tests can be run alone +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlListBoxTestCase, "HtmlListBoxTestCase" ); + +void HtmlListBoxTestCase::setUp() +{ + m_htmllbox = new wxSimpleHtmlListBox(wxTheApp->GetTopWindow(), wxID_ANY); +} + +void HtmlListBoxTestCase::tearDown() +{ + wxDELETE(m_htmllbox); +} diff --git a/tests/makefile.bcc b/tests/makefile.bcc index c7f9b74cb0..19850fd94c 100644 --- a/tests/makefile.bcc +++ b/tests/makefile.bcc @@ -153,6 +153,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_gaugetest.obj \ $(OBJS)\test_gui_gridtest.obj \ $(OBJS)\test_gui_headerctrltest.obj \ + $(OBJS)\test_gui_htmllboxtest.obj \ $(OBJS)\test_gui_hyperlinkctrltest.obj \ $(OBJS)\test_gui_itemcontainertest.obj \ $(OBJS)\test_gui_label.obj \ @@ -772,6 +773,9 @@ $(OBJS)\test_gui_gridtest.obj: .\controls\gridtest.cpp $(OBJS)\test_gui_headerctrltest.obj: .\controls\headerctrltest.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\headerctrltest.cpp +$(OBJS)\test_gui_htmllboxtest.obj: .\controls\htmllboxtest.cpp + $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\htmllboxtest.cpp + $(OBJS)\test_gui_hyperlinkctrltest.obj: .\controls\hyperlinkctrltest.cpp $(CXX) -q -c -P -o$@ $(TEST_GUI_CXXFLAGS) .\controls\hyperlinkctrltest.cpp diff --git a/tests/makefile.gcc b/tests/makefile.gcc index d5c284bff5..33975f40e0 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -146,6 +146,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_gaugetest.o \ $(OBJS)\test_gui_gridtest.o \ $(OBJS)\test_gui_headerctrltest.o \ + $(OBJS)\test_gui_htmllboxtest.o \ $(OBJS)\test_gui_hyperlinkctrltest.o \ $(OBJS)\test_gui_itemcontainertest.o \ $(OBJS)\test_gui_label.o \ @@ -753,6 +754,9 @@ $(OBJS)\test_gui_gridtest.o: ./controls/gridtest.cpp $(OBJS)\test_gui_headerctrltest.o: ./controls/headerctrltest.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_gui_htmllboxtest.o: ./controls/htmllboxtest.cpp + $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_gui_hyperlinkctrltest.o: ./controls/hyperlinkctrltest.cpp $(CXX) -c -o $@ $(TEST_GUI_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index 8552144003..a51e353775 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -148,6 +148,7 @@ TEST_GUI_OBJECTS = \ $(OBJS)\test_gui_gaugetest.obj \ $(OBJS)\test_gui_gridtest.obj \ $(OBJS)\test_gui_headerctrltest.obj \ + $(OBJS)\test_gui_htmllboxtest.obj \ $(OBJS)\test_gui_hyperlinkctrltest.obj \ $(OBJS)\test_gui_itemcontainertest.obj \ $(OBJS)\test_gui_label.obj \ @@ -898,6 +899,9 @@ $(OBJS)\test_gui_gridtest.obj: .\controls\gridtest.cpp $(OBJS)\test_gui_headerctrltest.obj: .\controls\headerctrltest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\headerctrltest.cpp +$(OBJS)\test_gui_htmllboxtest.obj: .\controls\htmllboxtest.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\htmllboxtest.cpp + $(OBJS)\test_gui_hyperlinkctrltest.obj: .\controls\hyperlinkctrltest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_GUI_CXXFLAGS) .\controls\hyperlinkctrltest.cpp diff --git a/tests/makefile.wat b/tests/makefile.wat index b3eb973032..2fc3f6f60d 100644 --- a/tests/makefile.wat +++ b/tests/makefile.wat @@ -388,6 +388,7 @@ TEST_GUI_OBJECTS = & $(OBJS)\test_gui_gaugetest.obj & $(OBJS)\test_gui_gridtest.obj & $(OBJS)\test_gui_headerctrltest.obj & + $(OBJS)\test_gui_htmllboxtest.obj & $(OBJS)\test_gui_hyperlinkctrltest.obj & $(OBJS)\test_gui_itemcontainertest.obj & $(OBJS)\test_gui_label.obj & @@ -811,6 +812,9 @@ $(OBJS)\test_gui_gridtest.obj : .AUTODEPEND .\controls\gridtest.cpp $(OBJS)\test_gui_headerctrltest.obj : .AUTODEPEND .\controls\headerctrltest.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< +$(OBJS)\test_gui_htmllboxtest.obj : .AUTODEPEND .\controls\htmllboxtest.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< + $(OBJS)\test_gui_hyperlinkctrltest.obj : .AUTODEPEND .\controls\hyperlinkctrltest.cpp $(CXX) -bt=nt -zq -fo=$^@ $(TEST_GUI_CXXFLAGS) $< diff --git a/tests/test.bkl b/tests/test.bkl index 9b8f76833d..99836fa7ca 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -149,6 +149,7 @@ controls/gaugetest.cpp controls/gridtest.cpp controls/headerctrltest.cpp + controls/htmllboxtest.cpp controls/hyperlinkctrltest.cpp controls/itemcontainertest.cpp controls/label.cpp diff --git a/tests/test_test_gui.dsp b/tests/test_test_gui.dsp index 6b6b845b56..44d463f451 100644 --- a/tests/test_test_gui.dsp +++ b/tests/test_test_gui.dsp @@ -337,6 +337,10 @@ SOURCE=.\controls\headerctrltest.cpp # End Source File # Begin Source File +SOURCE=.\controls\htmllboxtest.cpp +# End Source File +# Begin Source File + SOURCE=.\html\htmlwindow.cpp # End Source File # Begin Source File diff --git a/tests/test_vc7_test_gui.vcproj b/tests/test_vc7_test_gui.vcproj index 4b506325a8..e26c3f7326 100644 --- a/tests/test_vc7_test_gui.vcproj +++ b/tests/test_vc7_test_gui.vcproj @@ -689,6 +689,9 @@ RelativePath=".\controls\headerctrltest.cpp"> + + + + diff --git a/tests/test_vc9_test_gui.vcproj b/tests/test_vc9_test_gui.vcproj index 939d0453af..357af51354 100644 --- a/tests/test_vc9_test_gui.vcproj +++ b/tests/test_vc9_test_gui.vcproj @@ -964,6 +964,10 @@ > + +