From: Eduardo Ramos Testillano Date: Mon, 21 Sep 2015 00:55:49 +0000 (+0200) Subject: Avoid recursion on TestStepWait. Now is the TestManager after searching the condition... X-Git-Tag: REFACTORING_TESTING_LIBRARY~108 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=c7742e2134826a05ee9c6bf89eebaa726dae0d1b;p=anna.git Avoid recursion on TestStepWait. Now is the TestManager after searching the condition fulfilled, whom will process the test case. TODO for TestStepCmd and TestStepDelay --- diff --git a/example/diameter/launcher/testing/TestManager.cpp b/example/diameter/launcher/testing/TestManager.cpp index ea340b9..c01b89e 100644 --- a/example/diameter/launcher/testing/TestManager.cpp +++ b/example/diameter/launcher/testing/TestManager.cpp @@ -342,6 +342,7 @@ void TestManager::receiveMessage(const anna::DataBlock &message, const anna::dia } else { tsw->setClientSession(const_cast(clientSession)); + tc->process(); } } @@ -376,6 +377,7 @@ void TestManager::receiveMessage(const anna::DataBlock &message, const anna::dia } else { tsw->setServerSession(const_cast(serverSession)); + tc->process(); } } diff --git a/example/diameter/launcher/testing/TestStep.cpp b/example/diameter/launcher/testing/TestStep.cpp index c8aef4e..d08d482 100644 --- a/example/diameter/launcher/testing/TestStep.cpp +++ b/example/diameter/launcher/testing/TestStep.cpp @@ -523,13 +523,13 @@ bool TestStepWait::do_execute() throw() { } void TestStepWait::do_complete() throw() { - a_testCase->process(); // next() not invoked; we only want to reactivate the test case + //a_testCase->process(); // next() not invoked; we only want to reactivate the test case + // avoid stack overflow: we will process the test case externally when incoming message is fulfilled (TestCase.cpp), and TestManager is noticed } bool TestStepWait::fulfilled(const anna::DataBlock &db/*, bool matchSessionId*/) throw() { if (a_condition.comply(db/*, matchSessionId*/)) { - //a_message = db; // store matched - a_message.assign(db); + a_message = db; // store matched complete(); return true; }