summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/RegistryTest.cpp4
-rw-r--r--test/core/StandaloneEnvironment.hpp2
-rw-r--r--test/core/resource/ResourceRequestTest.cpp8
-rw-r--r--test/plugins/css/CSSParserTest.cpp15
4 files changed, 17 insertions, 12 deletions
diff --git a/test/core/RegistryTest.cpp b/test/core/RegistryTest.cpp
index 1a23139..4e8fc6a 100644
--- a/test/core/RegistryTest.cpp
+++ b/test/core/RegistryTest.cpp
@@ -31,9 +31,9 @@ namespace ousia {
namespace {
class TestParser : public Parser {
protected:
- Rooted<Node> doParse(CharReader &reader, ParserContext &ctx) override
+ void doParse(CharReader &reader, ParserContext &ctx) override
{
- return new Node{ctx.getManager()};
+ // Stub
}
};
}
diff --git a/test/core/StandaloneEnvironment.hpp b/test/core/StandaloneEnvironment.hpp
index eaaa9bf..ef07379 100644
--- a/test/core/StandaloneEnvironment.hpp
+++ b/test/core/StandaloneEnvironment.hpp
@@ -54,7 +54,7 @@ struct StandaloneEnvironment {
logger.setSourceContextCallback(NullSourceContextCallback);
}
- Rooted<Node> parse(const std::string &path,
+ NodeVector<Node> parse(const std::string &path,
const std::string mimetype, const std::string rel,
const RttiSet &supportedTypes)
{
diff --git a/test/core/resource/ResourceRequestTest.cpp b/test/core/resource/ResourceRequestTest.cpp
index 0bb34be..dac7a28 100644
--- a/test/core/resource/ResourceRequestTest.cpp
+++ b/test/core/resource/ResourceRequestTest.cpp
@@ -41,17 +41,17 @@ static TerminalLogger logger(std::cerr, true);
namespace {
class ModuleParser : public Parser {
protected:
- Rooted<Node> doParse(CharReader &reader, ParserContext &ctx) override
+ void doParse(CharReader &reader, ParserContext &ctx) override
{
- return nullptr; // Stub
+ // Stub
}
};
class DocumentParser : public Parser {
protected:
- Rooted<Node> doParse(CharReader &reader, ParserContext &ctx) override
+ void doParse(CharReader &reader, ParserContext &ctx) override
{
- return nullptr; // Stub
+ // Stub
}
};
diff --git a/test/plugins/css/CSSParserTest.cpp b/test/plugins/css/CSSParserTest.cpp
index 815efa2..2855e81 100644
--- a/test/plugins/css/CSSParserTest.cpp
+++ b/test/plugins/css/CSSParserTest.cpp
@@ -46,8 +46,10 @@ TEST(CSSParser, testParseSelectors)
// parse the data.
CSSParser instance;
- Rooted<model::SelectorNode> root =
- instance.parse(data, env.context).cast<model::SelectorNode>();
+ instance.parse(data, env.context);
+ auto nodes = env.context.getScope().getTopLevelNodes();
+ ASSERT_EQ(1U, nodes.size());
+ Rooted<model::SelectorNode> root = nodes[0].cast<model::SelectorNode>();
// we expect three children of the root node overall.
ASSERT_EQ(3U, root->getEdges().size());
@@ -158,8 +160,10 @@ TEST(CSSParser, testParseCSS)
// parse the input.
CSSParser instance;
CharReader reader{input};
- Rooted<model::SelectorNode> root =
- instance.parse(reader, env.context).cast<model::SelectorNode>();
+ instance.parse(reader, env.context);
+ auto nodes = env.context.getScope().getTopLevelNodes();
+ ASSERT_EQ(1U, nodes.size());
+ Rooted<model::SelectorNode> root = nodes[0].cast<model::SelectorNode>();
// we expect three children of the root node overall.
ASSERT_EQ(3U, root->getEdges().size());
@@ -274,7 +278,8 @@ void assertException(std::string css)
logger.reset();
try {
- instance.parse(reader, env.context).cast<model::SelectorNode>();
+ instance.parse(reader, env.context);
+ ASSERT_EQ(1U, env.context.getScope().getTopLevelNodes().size());
}
catch (LoggableException ex) {
logger.log(ex);