summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-03-15 13:06:25 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:19:27 +0200
commit2f394e84881ba663f1747a66891f994a54e5fdd4 (patch)
treec6cf04c6616581f474236c2756785c5f9808a02f /test
parent45a0c86e35fd693cdfb40d8d3bcb251fe4b786b0 (diff)
Fix crash when an undefined annotation is met in the input
Diffstat (limited to 'test')
-rw-r--r--test/formats/osml/OsmlParserTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/formats/osml/OsmlParserTest.cpp b/test/formats/osml/OsmlParserTest.cpp
index 78ddf17..8dc0035 100644
--- a/test/formats/osml/OsmlParserTest.cpp
+++ b/test/formats/osml/OsmlParserTest.cpp
@@ -212,6 +212,19 @@ TEST(OsmlParser, simpleAnnotation)
ASSERT_TRUE(node->isa(&RttiTypes::Document));
}
+TEST(OsmlParser, undefinedAnnotation)
+{
+ OsmlStandaloneEnvironment env(logger);
+ logger.reset();
+
+ Rooted<Node> node =
+ env.parse("undefined_annotation.osml", "", "", RttiSet{&RttiTypes::Node});
+ ASSERT_TRUE(logger.hasError());
+
+ ASSERT_TRUE(node != nullptr);
+ ASSERT_TRUE(node->isa(&RttiTypes::Document));
+}
+
TEST(OsmlParser, overlappingAnnotations)
{
OsmlStandaloneEnvironment env(logger);