From c7742e2134826a05ee9c6bf89eebaa726dae0d1b Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Mon, 21 Sep 2015 02:55:49 +0200 Subject: [PATCH] Avoid recursion on TestStepWait. Now is the TestManager after searching the condition fulfilled, whom will process the test case. TODO for TestStepCmd and TestStepDelay --- example/diameter/launcher/testing/TestManager.cpp | 2 ++ example/diameter/launcher/testing/TestStep.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.20.1