diff options
author | Stefan Radomski <sradomski@mintwerk.de> | 2016-04-28 11:00:10 (GMT) |
---|---|---|
committer | Stefan Radomski <sradomski@mintwerk.de> | 2016-04-28 11:00:10 (GMT) |
commit | 4750623a631e72c7a8be8d4172b33c83f20113a6 (patch) | |
tree | 64d626708595d3fe5438d75af1616870db724800 /test/src/issues/test-issue63.cpp | |
parent | 454fa66e503e41465cba75a6bea00463a93a20ef (diff) | |
download | uscxml-4750623a631e72c7a8be8d4172b33c83f20113a6.zip uscxml-4750623a631e72c7a8be8d4172b33c83f20113a6.tar.gz uscxml-4750623a631e72c7a8be8d4172b33c83f20113a6.tar.bz2 |
Fixed issue 64 and beautified code again
Diffstat (limited to 'test/src/issues/test-issue63.cpp')
-rw-r--r-- | test/src/issues/test-issue63.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/test/src/issues/test-issue63.cpp b/test/src/issues/test-issue63.cpp index 12a471c..5cedcad 100644 --- a/test/src/issues/test-issue63.cpp +++ b/test/src/issues/test-issue63.cpp @@ -5,44 +5,44 @@ 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, "World"') </script> </onentry> " - " <onentry> <script><![CDATA[ print('Hello, \"World\"') ]]></script> </onentry> " - " <onentry> <script> print("Hello, world!") </script> </onentry> " - " <transition target=\"FinalShape1\"/> " - " <transition cond=\"_event.data=="string value"\" 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; - + 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, "World"') </script> </onentry> " + " <onentry> <script><![CDATA[ print('Hello, \"World\"') ]]></script> </onentry> " + " <onentry> <script> print("Hello, world!") </script> </onentry> " + " <transition target=\"FinalShape1\"/> " + " <transition cond=\"_event.data=="string value"\" 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 |