3f66f6a5b3
This keyword is not expanded by Git which means it's not replaced with the correct revision value in the releases made using git-based scripts and it's confusing to have lines with unexpanded "$Id$" in the released files. As expanding them with Git is not that simple (it could be done with git archive and export-subst attribute) and there are not many benefits in having them in the first place, just remove all these lines. If nothing else, this will make an eventual transition to Git simpler. Closes #14487. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
75 lines
2.0 KiB
C++
75 lines
2.0 KiB
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Name: tests/html/htmlparser.cpp
|
|
// Purpose: wxHtmlParser tests
|
|
// Author: Vadim Zeitlin
|
|
// Created: 2011-01-13
|
|
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// headers
|
|
// ----------------------------------------------------------------------------
|
|
|
|
#include "testprec.h"
|
|
|
|
#if wxUSE_HTML
|
|
|
|
#ifdef __BORLANDC__
|
|
#pragma hdrstop
|
|
#endif
|
|
|
|
#ifndef WX_PRECOMP
|
|
#endif // WX_PRECOMP
|
|
|
|
#include "wx/html/htmlpars.h"
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// test class
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class HtmlParserTestCase : public CppUnit::TestCase
|
|
{
|
|
public:
|
|
HtmlParserTestCase() { }
|
|
|
|
private:
|
|
CPPUNIT_TEST_SUITE( HtmlParserTestCase );
|
|
CPPUNIT_TEST( Invalid );
|
|
CPPUNIT_TEST_SUITE_END();
|
|
|
|
void Invalid();
|
|
|
|
wxDECLARE_NO_COPY_CLASS(HtmlParserTestCase);
|
|
};
|
|
|
|
// register in the unnamed registry so that these tests are run by default
|
|
CPPUNIT_TEST_SUITE_REGISTRATION( HtmlParserTestCase );
|
|
|
|
// also include in its own registry so that these tests can be run alone
|
|
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( HtmlParserTestCase, "HtmlParserTestCase" );
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// tests themselves
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Test that parsing invalid HTML simply fails but doesn't crash for example.
|
|
void HtmlParserTestCase::Invalid()
|
|
{
|
|
class NullParser : public wxHtmlParser
|
|
{
|
|
public:
|
|
virtual wxObject *GetProduct() { return NULL; }
|
|
|
|
protected:
|
|
virtual void AddText(const wxString& WXUNUSED(txt)) { }
|
|
};
|
|
|
|
NullParser p;
|
|
p.Parse("<");
|
|
p.Parse("<foo");
|
|
p.Parse("<!--");
|
|
p.Parse("<!---");
|
|
}
|
|
|
|
#endif //wxUSE_HTML
|