diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-18 21:42:49 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-18 21:42:49 +0100 |
commit | 2eec59a47ec36e5e4f921ca91284942b4d7d521b (patch) | |
tree | 8847623e9b9b1571150142c236b5ab2d8413ce77 /test/core/parser | |
parent | 677d6830a0252e7478c2f5d6f75cfb845d33ad23 (diff) |
Fixed bugs in definition of Project, added reference to Project to ParserContext
Diffstat (limited to 'test/core/parser')
-rw-r--r-- | test/core/parser/ParserStackTest.cpp | 6 | ||||
-rw-r--r-- | test/core/parser/StandaloneParserContext.hpp | 23 |
2 files changed, 18 insertions, 11 deletions
diff --git a/test/core/parser/ParserStackTest.cpp b/test/core/parser/ParserStackTest.cpp index ed57260..69978b0 100644 --- a/test/core/parser/ParserStackTest.cpp +++ b/test/core/parser/ParserStackTest.cpp @@ -69,7 +69,7 @@ static const std::multimap<std::string, HandlerDescriptor> TEST_HANDLERS{ TEST(ParserStack, simpleTest) { StandaloneParserContext ctx; - ParserStack s{ctx, TEST_HANDLERS}; + ParserStack s{ctx.context, TEST_HANDLERS}; startCount = 0; endCount = 0; @@ -132,7 +132,7 @@ TEST(ParserStack, simpleTest) TEST(ParserStack, errorHandling) { StandaloneParserContext ctx; - ParserStack s{ctx, TEST_HANDLERS}; + ParserStack s{ctx.context, TEST_HANDLERS}; ASSERT_THROW(s.start("body", {}), OusiaException); s.start("document", {}); @@ -152,7 +152,7 @@ TEST(ParserStack, validation) { ConcreteLogger logger; StandaloneParserContext ctx(logger); - ParserStack s{ctx, TEST_HANDLERS}; + ParserStack s{ctx.context, TEST_HANDLERS}; s.start("arguments", {}); ASSERT_TRUE(logger.hasError()); diff --git a/test/core/parser/StandaloneParserContext.hpp b/test/core/parser/StandaloneParserContext.hpp index 78d148d..aca056e 100644 --- a/test/core/parser/StandaloneParserContext.hpp +++ b/test/core/parser/StandaloneParserContext.hpp @@ -19,28 +19,35 @@ #ifndef _OUSIA_STANDALONE_PARSER_CONTEXT_ #define _OUSIA_STANDALONE_PARSER_CONTEXT_ +#include <memory> + +#include <core/model/Project.hpp> #include <core/parser/Parser.hpp> namespace ousia { namespace parser { -struct StandaloneParserContext : public ParserContext { -private: +struct StandaloneParserContext { +public: Manager manager; Logger logger; Scope scope; Registry registry; + Rooted<model::Project> project; + ParserContext context; -public: StandaloneParserContext() - : ParserContext(scope, registry, logger, manager), - registry(logger){}; + : registry(logger), + project(new model::Project(manager)), + context(scope, registry, logger, manager, project) + { + } StandaloneParserContext(Logger &externalLogger) - : ParserContext(scope, registry, externalLogger, manager), - registry(externalLogger){}; + : registry(externalLogger), + project(new model::Project(manager)), + context(scope, registry, externalLogger, manager, project){}; }; - } } |