diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-21 15:14:55 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-21 15:14:55 (GMT) |
commit | f7ad82f972bf46571bb5229205f877f8ab31069d (patch) | |
tree | e83110054a551053a68fb93d7061709808a19a0d /test | |
parent | a3fb1daf5b4e58471cc714853636025b6cac9aed (diff) | |
download | uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.zip uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.tar.gz uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.tar.bz2 |
New Interpreter::validate() to identify issues with a document before running it
Diffstat (limited to 'test')
-rw-r--r-- | test/src/test-lifecycle.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/src/test-lifecycle.cpp b/test/src/test-lifecycle.cpp index 22c724a..9b1ac5a 100644 --- a/test/src/test-lifecycle.cpp +++ b/test/src/test-lifecycle.cpp @@ -212,6 +212,30 @@ int main(int argc, char** argv) { int iterations = 1; while(iterations--) { + + if (1) { + // syntactic xml parse error + try { + const char* xml = + "<scxml datamodel=\"ecmascript\">" + " <state id=\"start\">" + " <transition target=\"done\" cond=\"%sf\" />" + " </state>" + " <final id=\"done\" />" + "</scxml>"; + Interpreter interpreter = Interpreter::fromXML(xml); + std::list<InterpreterIssue> issues = interpreter.validate(); + + for (std::list<InterpreterIssue>::iterator issueIter = issues.begin(); issueIter != issues.end(); issueIter++) { + std::cout << *issueIter << std::endl; + } + + } catch (Event& e) { + std::cout << e; + } + } + + if (1) { // syntactic xml parse error try { |