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/plugins | |
parent | 677d6830a0252e7478c2f5d6f75cfb845d33ad23 (diff) |
Fixed bugs in definition of Project, added reference to Project to ParserContext
Diffstat (limited to 'test/plugins')
-rw-r--r-- | test/plugins/css/CSSParserTest.cpp | 12 | ||||
-rw-r--r-- | test/plugins/xml/XmlParserTest.cpp | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/test/plugins/css/CSSParserTest.cpp b/test/plugins/css/CSSParserTest.cpp index 54c359b..84522b3 100644 --- a/test/plugins/css/CSSParserTest.cpp +++ b/test/plugins/css/CSSParserTest.cpp @@ -45,7 +45,8 @@ TEST(CSSParser, testParseSelectors) // parse the data. CSSParser instance; - Rooted<SelectorNode> root = instance.parse(data, ctx).cast<SelectorNode>(); + Rooted<SelectorNode> root = + instance.parse(data, ctx.context).cast<SelectorNode>(); // we expect three children of the root node overall. ASSERT_EQ(3U, root->getEdges().size()); @@ -156,7 +157,7 @@ TEST(CSSParser, testParseCSS) CSSParser instance; CharReader reader{input}; Rooted<SelectorNode> root = - instance.parse(reader, ctx).cast<SelectorNode>(); + instance.parse(reader, ctx.context).cast<SelectorNode>(); // we expect three children of the root node overall. ASSERT_EQ(3U, root->getEdges().size()); @@ -269,14 +270,11 @@ void assertException(std::string css) { ScopedLogger sl(logger, "test.css", SourceLocation{}, CharReader::contextCallback, &reader); - Scope scope; - Registry registry(logger); - Manager manager; - ParserContext ctx{scope, registry, logger, manager}; + StandaloneParserContext ctx(sl); CSSParser instance; try { - instance.parse(reader, ctx).cast<SelectorNode>(); + instance.parse(reader, ctx.context).cast<SelectorNode>(); } catch (LoggableException ex) { logger.log(ex); diff --git a/test/plugins/xml/XmlParserTest.cpp b/test/plugins/xml/XmlParserTest.cpp index 2046940..6ac2fc1 100644 --- a/test/plugins/xml/XmlParserTest.cpp +++ b/test/plugins/xml/XmlParserTest.cpp @@ -38,7 +38,7 @@ TEST(XmlParser, mismatchedTagException) bool hadException = false; try { - p.parse("<document>\n</document2>", ctx); + p.parse("<document>\n</document2>", ctx.context); } catch (LoggableException ex) { ASSERT_EQ(2, ex.loc.line); @@ -81,7 +81,7 @@ TEST(XmlParser, namespaces) ScopedLogger sl(logger, "test.oxd", SourceLocation{}, CharReader::contextCallback, &reader); try { - p.parse(TEST_DATA, ctx); + p.parse(TEST_DATA, ctx.context); } catch (LoggableException ex) { logger.log(ex); |