summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorStefan Radomski <sradomski@mintwerk.de>2016-04-22 14:48:35 (GMT)
committerStefan Radomski <sradomski@mintwerk.de>2016-04-22 14:48:35 (GMT)
commitdfaff1e3e310cb0201a05915de23a893956b0609 (patch)
tree38357c398b301e518debaa8025cdf52ef9a43f86 /test/src
parentf8ef62805dff7df0742958626a85afc1d4fd03da (diff)
downloaduscxml-dfaff1e3e310cb0201a05915de23a893956b0609.zip
uscxml-dfaff1e3e310cb0201a05915de23a893956b0609.tar.gz
uscxml-dfaff1e3e310cb0201a05915de23a893956b0609.tar.bz2
new test-issue63
Diffstat (limited to 'test/src')
-rw-r--r--test/src/issues/test-issue63.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/src/issues/test-issue63.cpp b/test/src/issues/test-issue63.cpp
new file mode 100644
index 0000000..12a471c
--- /dev/null
+++ b/test/src/issues/test-issue63.cpp
@@ -0,0 +1,48 @@
+#include "uscxml/Interpreter.h"
+
+#include "glog/logging.h"
+
+using namespace uscxml;
+
+int main(int argc, char** argv) {
+ google::LogToStderr();
+ google::InitGoogleLogging(argv[0]);
+
+ const char* scxmlContent =
+ "<scxml datamodel=\"lua\" initial=\"init\" name=\"scxml_root\" version=\"1.0\" xmlns=\"http://www.w3.org/2005/07/scxml\">"
+ " <state id=\"init\"> "
+ " <onentry> <script> print('Hello, World!') </script> </onentry> "
+ " <onentry> <script> print(\"Hello, World!\") </script> </onentry> "
+ " <onentry> <script> print('Hello, &quot;World&quot;') </script> </onentry> "
+ " <onentry> <script><![CDATA[ print('Hello, \"World\"') ]]></script> </onentry> "
+ " <onentry> <script> print(&quot;Hello, world!&quot;) </script> </onentry> "
+ " <transition target=\"FinalShape1\"/> "
+ " <transition cond=\"_event.data==&quot;string value&quot;\" event=\"test\" target=\"FinalShape1\"/> "
+ " </state> "
+ " <final id=\"FinalShape1\"/> "
+ "</scxml> ";
+
+ std::string msg;
+
+ uscxml::Interpreter scxml = uscxml::Interpreter(uscxml::Interpreter::fromXML(scxmlContent, ""));
+
+ std::list<InterpreterIssue> issues = scxml.validate();
+ for (std::list<InterpreterIssue>::iterator issueIter = issues.begin(); issueIter != issues.end(); issueIter++) {
+ std::cout << *issueIter << std::endl;
+ }
+
+ scxml.addMonitor(new StateTransitionMonitor());
+
+ uscxml::InterpreterState state;
+
+ do {
+
+ state = scxml.step();
+ } while(state != uscxml::USCXML_FINISHED && state != uscxml::USCXML_DESTROYED);
+
+ std::cout << "************************************" << std::endl;
+ std::cout << "Successfully finished state machine!" << std::endl;
+
+ return EXIT_SUCCESS;
+
+} \ No newline at end of file