diff options
author | Stefan Radomski <sradomski@mintwerk.de> | 2016-04-22 10:49:41 (GMT) |
---|---|---|
committer | Stefan Radomski <sradomski@mintwerk.de> | 2016-04-22 10:49:41 (GMT) |
commit | f8ef62805dff7df0742958626a85afc1d4fd03da (patch) | |
tree | fe19f98c3e317e7c2db65b67258cd2efa32a7230 | |
parent | b3e5a85374523c614d09ceeebe7565a0a6ab6838 (diff) | |
download | uscxml-f8ef62805dff7df0742958626a85afc1d4fd03da.zip uscxml-f8ef62805dff7df0742958626a85afc1d4fd03da.tar.gz uscxml-f8ef62805dff7df0742958626a85afc1d4fd03da.tar.bz2 |
Issue62
-rw-r--r-- | src/uscxml/Interpreter.cpp | 4 | ||||
-rw-r--r-- | test/src/issues/test-issue62.cpp | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index 3e4171e..12f1c32 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -924,6 +924,10 @@ InterpreterState InterpreterImpl::step(int waitForMS) { return _state; } + if (_state == USCXML_FINISHED || _state == USCXML_DESTROYED) { + return _state; + } + setInterpreterState(USCXML_MACROSTEPPED); } diff --git a/test/src/issues/test-issue62.cpp b/test/src/issues/test-issue62.cpp index b75693c..4074177 100644 --- a/test/src/issues/test-issue62.cpp +++ b/test/src/issues/test-issue62.cpp @@ -41,6 +41,11 @@ int main(int argc, char** argv) { 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; + } + scxml.addMonitor(new StateTransitionMonitor()); uscxml::InterpreterState state; @@ -54,11 +59,9 @@ int main(int argc, char** argv) { scxml.receive(Event("inside_invoke")); while(state != uscxml::USCXML_FINISHED) { - do { - state = scxml.step(); + state = scxml.step(true); } while(state > 0); - } std::cout << "************************************" << std::endl; |