X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestStep.cpp;h=524e0bdf3841df386200d6a433a1380736a4c7a8;hb=983eaadca6cfae987be3453853d75bb9bce04487;hp=018dfcd72d14bf5006b30f6383b9339aabe7c938;hpb=a06169181968130467d2e54ac91676aecd14bcea;p=anna.git diff --git a/example/diameter/launcher/testing/TestStep.cpp b/example/diameter/launcher/testing/TestStep.cpp index 018dfcd..524e0bd 100644 --- a/example/diameter/launcher/testing/TestStep.cpp +++ b/example/diameter/launcher/testing/TestStep.cpp @@ -152,7 +152,7 @@ namespace { bool result = true; try { - messageCodec.setEngine(NULL); // perhaps we will need another codec engine ... + messageCodec.clear(); messageCodec.decode(message); } catch (anna::RuntimeException &ex) { @@ -483,12 +483,13 @@ throw() { anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepDelay"); - result->createAttribute("Delay", a_delay.asString()); + result->createAttribute("Delay", ((a_delay == 0) ? "dummy step, no delay" : a_delay.asString())); return result; } bool TestStepDelay::do_execute() throw() { + if (a_delay == 0) { complete(); return true; } // special case try { a_timer = TestManager::instantiate().createTimer((TestCaseStep*)this, a_delay, TestTimer::Type::Delay); } @@ -502,12 +503,14 @@ bool TestStepDelay::do_execute() throw() { } void TestStepDelay::do_complete() throw() { + if (a_delay == 0) return; // special case a_timer = NULL; next(); // next() invoked here because execute() is always false for delay and never advance the iterator // TODO, avoid this recursion } void TestStepDelay::do_reset() throw() { + if (a_delay == 0) return; // special case try { TestManager::instantiate().cancelTimer(a_timer); }