summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-22 16:21:18 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-22 16:21:18 (GMT)
commit9509b795c7493d7b351dc25855a6a82cd392deb1 (patch)
tree11f1950bab743ecbe2ac8d75177702a3620ef15c /test/src
parentd6fa07c2b4b3eb0c8db4f79927f88de72892dcc2 (diff)
downloaduscxml-9509b795c7493d7b351dc25855a6a82cd392deb1.zip
uscxml-9509b795c7493d7b351dc25855a6a82cd392deb1.tar.gz
uscxml-9509b795c7493d7b351dc25855a6a82cd392deb1.tar.bz2
Moved InterpreterIssues to own source file
Diffstat (limited to 'test/src')
-rw-r--r--test/src/test-issue-reporting.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/src/test-issue-reporting.cpp b/test/src/test-issue-reporting.cpp
index 5de3366..3cdb141 100644
--- a/test/src/test-issue-reporting.cpp
+++ b/test/src/test-issue-reporting.cpp
@@ -27,6 +27,41 @@ int main(int argc, char** argv) {
while(iterations--) {
if (1) {
+ // Unreachable states
+
+ const char* xml =
+ "<scxml datamodel=\"ecmascript\">"
+ " <state id=\"foo\">"
+ " <parallel id=\"foz\">"
+ " <state id=\"s0\" />"
+ " <state id=\"s1\" />"
+ " <state id=\"s2\" />"
+ " </parallel>"
+ " </state>"
+ " <state id=\"bar\" />"
+ "</scxml>";
+
+ std::set<std::string> issueLocations = issueLocationsForXML(xml);
+ assert(issueLocations.find("//state[@id=\"bar\"]") != issueLocations.end());
+ assert(issueLocations.size() == 1);
+ }
+
+ if (1) {
+ // Invalid parents
+
+ const char* xml =
+ "<scxml datamodel=\"ecmascript\">"
+ " <onentry>"
+ " <cancel sendidexpr=\"foo\" />"
+ " </onentry>"
+ "</scxml>";
+
+ std::set<std::string> issueLocations = issueLocationsForXML(xml);
+ assert(issueLocations.find("/scxml[1]/onentry[1]") != issueLocations.end());
+ assert(issueLocations.size() == 1);
+ }
+
+ if (1) {
// State has no 'id' attribute
const char* xml =
"<scxml datamodel=\"ecmascript\">"
@@ -310,6 +345,7 @@ int main(int argc, char** argv) {
assert(issueLocations.size() == 1);
}
+
}
return EXIT_SUCCESS;