From f8ef62805dff7df0742958626a85afc1d4fd03da Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Fri, 22 Apr 2016 12:49:41 +0200 Subject: Issue62 --- src/uscxml/Interpreter.cpp | 4 ++++ 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 issues = scxml.validate(); + for (std::list::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; -- cgit v0.12