diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-03 20:20:59 +0100 |
---|---|---|
committer | Andreas Stöckel <andreas@somweyr.de> | 2015-03-03 20:20:59 +0100 |
commit | ec758436a01903ded6ec5951fa1fc5d2fe062239 (patch) | |
tree | 4dd95626d1efce4bf8cd8c0f6bb7fda8d6a6b968 /test/formats/osxml | |
parent | 42c0480b4fbf80afa0c5b13650a0af74311d7202 (diff) |
Added unit tests for annotation handling
Diffstat (limited to 'test/formats/osxml')
-rw-r--r-- | test/formats/osxml/OsxmlEventParserTest.cpp | 4 | ||||
-rw-r--r-- | test/formats/osxml/OsxmlParserTest.cpp | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/test/formats/osxml/OsxmlEventParserTest.cpp b/test/formats/osxml/OsxmlEventParserTest.cpp index d4e9443..6e1dddf 100644 --- a/test/formats/osxml/OsxmlEventParserTest.cpp +++ b/test/formats/osxml/OsxmlEventParserTest.cpp @@ -58,10 +58,10 @@ public: } void annotationEnd(const Variant &className, - const Variant &elementName) override + const Variant::mapType &args) override { events.emplace_back(OsxmlEvent::ANNOTATION_END, - Variant::arrayType{className, elementName}); + Variant::arrayType{className, args}); } void rangeEnd() override diff --git a/test/formats/osxml/OsxmlParserTest.cpp b/test/formats/osxml/OsxmlParserTest.cpp index 79dd58b..03f10d3 100644 --- a/test/formats/osxml/OsxmlParserTest.cpp +++ b/test/formats/osxml/OsxmlParserTest.cpp @@ -399,5 +399,20 @@ TEST(OsxmlParser, complexDocumentParsing) ASSERT_FALSE(logger.hasError()); } +TEST(OsxmlParser, simpleAnnotation) +{ + logger.reset(); + XmlStandaloneEnvironment env(logger); + Rooted<Node> book_document_node = + env.parse("simple_annotation.osxml", "", "", RttiSet{&RttiTypes::Document}); + ASSERT_FALSE(logger.hasError()); + ASSERT_FALSE(book_document_node == nullptr); + ASSERT_TRUE(book_document_node->isa(&RttiTypes::Document)); + Rooted<Document> doc = book_document_node.cast<Document>(); + ASSERT_TRUE(doc->validate(logger)); + ASSERT_FALSE(logger.hasError()); +} + + } |