Fix assertion in the HtmlParser unit test case

Use wxHtmlWinParser instead of wxHtmlParser which can't be actually used
without being initialized with the tag handlers (it's not clear whether this
is really intentional...).
This commit is contained in:
Vadim Zeitlin
2016-02-26 20:11:55 +01:00
parent fde8f93a49
commit ea489e1a7d

View File

@@ -19,9 +19,10 @@
#endif #endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/dcmemory.h"
#endif // WX_PRECOMP #endif // WX_PRECOMP
#include "wx/html/htmlpars.h" #include "wx/html/winpars.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// test class // test class
@@ -55,7 +56,7 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlParserTestCase, "HtmlParserTestCase"
// Test that parsing invalid HTML simply fails but doesn't crash for example. // Test that parsing invalid HTML simply fails but doesn't crash for example.
void HtmlParserTestCase::Invalid() void HtmlParserTestCase::Invalid()
{ {
class NullParser : public wxHtmlParser class NullParser : public wxHtmlWinParser
{ {
public: public:
virtual wxObject *GetProduct() { return NULL; } virtual wxObject *GetProduct() { return NULL; }
@@ -65,6 +66,9 @@ void HtmlParserTestCase::Invalid()
}; };
NullParser p; NullParser p;
wxMemoryDC dc;
p.SetDC(&dc);
p.Parse("<"); p.Parse("<");
p.Parse("<foo"); p.Parse("<foo");
p.Parse("<!--"); p.Parse("<!--");