]>
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
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 ///////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
25 #include "wx/html/htmlpars.h"
27 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
31 class HtmlParserTestCase
: public CppUnit::TestCase
34 HtmlParserTestCase() { }
37 CPPUNIT_TEST_SUITE( HtmlParserTestCase
);
38 CPPUNIT_TEST( Invalid
);
39 CPPUNIT_TEST_SUITE_END();
43 wxDECLARE_NO_COPY_CLASS(HtmlParserTestCase
);
46 // register in the unnamed registry so that these tests are run by default
47 CPPUNIT_TEST_SUITE_REGISTRATION( HtmlParserTestCase
);
49 // also include in it's own registry so that these tests can be run alone
50 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlParserTestCase
, "HtmlParserTestCase" );
52 // ----------------------------------------------------------------------------
54 // ----------------------------------------------------------------------------
56 // Test that parsing invalid HTML simply fails but doesn't crash for example.
57 void HtmlParserTestCase::Invalid()
59 class NullParser
: public wxHtmlParser
62 virtual wxObject
*GetProduct() { return NULL
; }
65 virtual void AddText(const wxString
& WXUNUSED(txt
)) { }