From 2629c62e415e9c02fe73f61c92d8148b8dad5bf9 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 25 Jan 2015 23:16:54 +0100 Subject: Adapted tests to StandaloneEnvironment, using complete pipeline in XmlParserTest --- test/core/parser/ParserStackTest.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test/core') diff --git a/test/core/parser/ParserStackTest.cpp b/test/core/parser/ParserStackTest.cpp index 81160da..e0c68cc 100644 --- a/test/core/parser/ParserStackTest.cpp +++ b/test/core/parser/ParserStackTest.cpp @@ -21,10 +21,12 @@ #include #include -#include +#include namespace ousia { +ConcreteLogger logger; + static const State STATE_DOCUMENT = 0; static const State STATE_BODY = 1; static const State STATE_EMPTY = 2; @@ -67,8 +69,8 @@ static const std::multimap TEST_HANDLERS{ TEST(ParserStack, simpleTest) { - StandaloneParserContext ctx; - ParserStack s{ctx.context, TEST_HANDLERS}; + StandaloneEnvironment env(logger); + ParserStack s{env.context, TEST_HANDLERS}; startCount = 0; endCount = 0; @@ -130,8 +132,8 @@ TEST(ParserStack, simpleTest) TEST(ParserStack, errorHandling) { - StandaloneParserContext ctx; - ParserStack s{ctx.context, TEST_HANDLERS}; + StandaloneEnvironment env(logger); + ParserStack s{env.context, TEST_HANDLERS}; ASSERT_THROW(s.start("body", {}), OusiaException); s.start("document", {}); @@ -149,9 +151,8 @@ TEST(ParserStack, errorHandling) TEST(ParserStack, validation) { - ConcreteLogger logger; - StandaloneParserContext ctx(logger); - ParserStack s{ctx.context, TEST_HANDLERS}; + StandaloneEnvironment env(logger); + ParserStack s{env.context, TEST_HANDLERS}; s.start("arguments", {}); ASSERT_TRUE(logger.hasError()); -- cgit v1.2.3