From 59177921e8c81c1604e4154503a63190db66989c Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Wed, 3 Dec 2014 00:04:05 +0100 Subject: continued work on XML parser and underlying ParserStack class --- test/plugins/xml/XmlParserTest.cpp | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'test/plugins') diff --git a/test/plugins/xml/XmlParserTest.cpp b/test/plugins/xml/XmlParserTest.cpp index 98a5a34..ecc9438 100644 --- a/test/plugins/xml/XmlParserTest.cpp +++ b/test/plugins/xml/XmlParserTest.cpp @@ -26,26 +26,14 @@ namespace ousia { namespace parser { namespace xml { -struct TestParserContext : public ParserContext { - -private: - Logger log; - Registry r; - Scope s; - -public: - TestParserContext() : ParserContext(s, r, log), r(log), s(nullptr) {}; - -}; - TEST(XmlParser, mismatchedTagException) { - TestParserContext ctx; + StandaloneParserContext ctx; XmlParser p; bool hadException = false; try { - p.parse("data\n", ctx); + p.parse("\n", ctx); } catch (ParserException ex) { ASSERT_EQ(2, ex.line); @@ -55,19 +43,27 @@ TEST(XmlParser, mismatchedTagException) ASSERT_TRUE(hadException); } -const char* TEST_DATA = "\n" - "\n" - " \n" - "\n"; +const char *TEST_DATA = + "\n" + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " Dies ist ein Test>\n" + " \n" + "\n"; TEST(XmlParser, namespaces) { - TestParserContext ctx; + StandaloneParserContext ctx; XmlParser p; p.parse(TEST_DATA, ctx); } - } } } -- cgit v1.2.3