X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestStep.cpp;h=9bb5230d809e8fd98d561cf2e1d512fb800718c4;hp=d02d9b6aa98ebcb8568b8aad149c0775aae0eec0;hb=56fdf785afe43dc636ca4334c4ca47cf8241334d;hpb=786b2fe6e2363dc5af619526208583c61f18f70b diff --git a/example/diameter/launcher/testing/TestStep.cpp b/example/diameter/launcher/testing/TestStep.cpp index d02d9b6..9bb5230 100644 --- a/example/diameter/launcher/testing/TestStep.cpp +++ b/example/diameter/launcher/testing/TestStep.cpp @@ -177,10 +177,11 @@ void TestStep::initialize(TestCase *testCase) { a_number = testCase->steps() + 1; // testCase is not NULL } -bool TestStep::decodeMessage() throw() { +bool TestStep::decodeMessage(bool trust) throw() { if (a_messageCodec) return true; a_messageCodec = new anna::diameter::codec::Message; if (::decodeMessage(a_message, *a_messageCodec)) return true; + if (trust) return true; delete a_messageCodec; a_messageCodec = NULL; @@ -413,12 +414,10 @@ bool TestStepSendxml::do_execute() throw() { // Detailed log: if(a_originHost->logEnabled()) { - //if (decodeMessage()) { - // here we decode what we encoded on programming, then we could have a validation problem but not a decoding one: - decodeMessage(); + if (decodeMessage(true /* trust */)) { std::string detail = usedClientSession ? usedClientSession->asString() : ""; // shouldn't happen a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2e" : "send2eError"), detail); - //} + } } } else if (getType() == Type::Sendxml2c) { @@ -449,12 +448,10 @@ bool TestStepSendxml::do_execute() throw() { // Detailed log: if(a_originHost->logEnabled()) { - //if (decodeMessage()) { - // here we decode what we encoded on programming, then we could have a validation problem but not a decoding one: - decodeMessage(); + if (decodeMessage(true /* trust */)) { std::string detail = usedServerSession ? usedServerSession->asString() : ""; // shouldn't happen a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2c" : "send2cError"), detail); - //} + } } }