Improve traces in testing system
[anna.git] / example / diameter / launcher / testing / TestStep.cpp
index 810565b..07ed685 100644 (file)
@@ -177,10 +177,14 @@ 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) {
+    LOGDEBUG(anna::Logger::debug("Error DECODING, but trusting it ...", ANNA_FILE_LOCATION));
+    return true;
+  }
 
   delete a_messageCodec;
   a_messageCodec = NULL;
@@ -413,7 +417,7 @@ bool TestStepSendxml::do_execute() throw() {
 
       // Detailed log:
       if(a_originHost->logEnabled()) {
-        if (decodeMessage()) {
+        if (decodeMessage(true /* trust */)) {
           std::string detail = usedClientSession ? usedClientSession->asString() : "<null client session>"; // shouldn't happen
           a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2e" : "send2eError"), detail);
         }
@@ -447,7 +451,7 @@ bool TestStepSendxml::do_execute() throw() {
 
       // Detailed log:
       if(a_originHost->logEnabled()) {
-        if (decodeMessage()) {
+        if (decodeMessage(true /* trust */)) {
           std::string detail = usedServerSession ? usedServerSession->asString() : "<null server session>"; // shouldn't happen
           a_originHost->writeLogFile(*a_messageCodec, (success ? "sent2c" : "send2cError"), detail);
         }