From dfaff1e3e310cb0201a05915de23a893956b0609 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Fri, 22 Apr 2016 16:48:35 +0200 Subject: new test-issue63 --- test/CMakeLists.txt | 3 ++- test/src/issues/test-issue63.cpp | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 test/src/issues/test-issue63.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fed5265..965fa9d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -50,7 +50,8 @@ endif() USCXML_TEST_COMPILE(BUILD_ONLY NAME test-sockets LABEL general/test-sockets FILES src/test-sockets.cpp) -USCXML_TEST_COMPILE(NAME test-issue62 LABEL general/test-issue64 FILES src/issues/test-issue62.cpp) +USCXML_TEST_COMPILE(NAME test-issue62 LABEL general/test-issue62 FILES src/issues/test-issue62.cpp) +USCXML_TEST_COMPILE(NAME test-issue63 LABEL general/test-issue63 FILES src/issues/test-issue63.cpp) USCXML_TEST_COMPILE(NAME test-url LABEL general/test-url FILES src/test-url.cpp) USCXML_TEST_COMPILE(NAME test-doneevent LABEL general/test-doneevent FILES src/test-doneevent.cpp) 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 = + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "; + + std::string msg; + + uscxml::Interpreter scxml = uscxml::Interpreter(uscxml::Interpreter::fromXML(scxmlContent, "")); + + std::list issues = scxml.validate(); + for (std::list::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 -- cgit v0.12