summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-18 10:45:40 +0100
committerAndreas Stöckel <andreas@somweyr.de>2015-02-18 10:45:40 +0100
commit493acd119d730207524cd69fa25868c978bdf0f9 (patch)
tree5d7435f35047da5ce2a5a7e75803b147baf15dea
parenta0719a9a3e1c0970c0207fa4beec150613f1a768 (diff)
Added test for bug with structs that do not posses a field
-rw-r--r--test/formats/osml/OsmlParserTest.cpp14
-rw-r--r--testdata/osmlparser/struct_with_no_field.osml12
2 files changed, 26 insertions, 0 deletions
diff --git a/test/formats/osml/OsmlParserTest.cpp b/test/formats/osml/OsmlParserTest.cpp
index 3472e5f..4cda20a 100644
--- a/test/formats/osml/OsmlParserTest.cpp
+++ b/test/formats/osml/OsmlParserTest.cpp
@@ -158,5 +158,19 @@ TEST(OsmlParser, structureInheritance)
ASSERT_TRUE(node != nullptr);
ASSERT_TRUE(node->isa(&RttiTypes::Domain));
}
+
+TEST(OsmlParser, structWithNoField)
+{
+ OsmlStandaloneEnvironment env(logger);
+ logger.reset();
+
+ Rooted<Node> node = env.parse("struct_with_no_field.osml", "", "",
+ RttiSet{&RttiTypes::Node});
+ ASSERT_FALSE(logger.hasError());
+
+ ASSERT_TRUE(node != nullptr);
+ ASSERT_TRUE(node->isa(&RttiTypes::Document));
+}
+
}
diff --git a/testdata/osmlparser/struct_with_no_field.osml b/testdata/osmlparser/struct_with_no_field.osml
new file mode 100644
index 0000000..8cf2d02
--- /dev/null
+++ b/testdata/osmlparser/struct_with_no_field.osml
@@ -0,0 +1,12 @@
+\document
+
+\domain#test
+ \struct#a[isRoot=true]
+ \field
+ \childRef[ref=b]
+ \struct#b
+
+\a
+ \b
+ \b
+