]>
git.saurik.com Git - wxWidgets.git/blob - tests/html/htmlparser.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: tests/html/htmlparser.cpp
3 // Purpose: wxHtmlParser tests
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 ///////////////////////////////////////////////////////////////////////////////
9 // ----------------------------------------------------------------------------
11 // ----------------------------------------------------------------------------
24 #include "wx/html/htmlpars.h"
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 class HtmlParserTestCase
: public CppUnit::TestCase
33 HtmlParserTestCase() { }
36 CPPUNIT_TEST_SUITE( HtmlParserTestCase
);
37 CPPUNIT_TEST( Invalid
);
38 CPPUNIT_TEST_SUITE_END();
42 wxDECLARE_NO_COPY_CLASS(HtmlParserTestCase
);
45 // register in the unnamed registry so that these tests are run by default
46 CPPUNIT_TEST_SUITE_REGISTRATION( HtmlParserTestCase
);
48 // also include in its own registry so that these tests can be run alone
49 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlParserTestCase
, "HtmlParserTestCase" );
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
55 // Test that parsing invalid HTML simply fails but doesn't crash for example.
56 void HtmlParserTestCase::Invalid()
58 class NullParser
: public wxHtmlParser
61 virtual wxObject
*GetProduct() { return NULL
; }
64 virtual void AddText(const wxString
& WXUNUSED(txt
)) { }