diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-25 23:16:54 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-25 23:16:54 +0100 |
commit | 2629c62e415e9c02fe73f61c92d8148b8dad5bf9 (patch) | |
tree | 2585582a39a70610318810578b69ce9368372ef5 /test/core/parser | |
parent | e86c292967d85b571344b74fb5eeedf5ebf95aa8 (diff) |
Adapted tests to StandaloneEnvironment, using complete pipeline in XmlParserTest
Diffstat (limited to 'test/core/parser')
-rw-r--r-- | test/core/parser/ParserStackTest.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
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 <gtest/gtest.h> #include <core/parser/ParserStack.hpp> -#include <core/parser/StandaloneParserContext.hpp> +#include <core/StandaloneEnvironment.hpp> 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<std::string, HandlerDescriptor> 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()); |