Improve traces in testing system
[anna.git] / example / diameter / launcher / testing / TestCase.cpp
index 6bc033d..5678ff0 100644 (file)
@@ -223,8 +223,8 @@ bool TestCase::reset(bool hard) throw() {
 }
 
 void TestCase::assertInitialized() const throw(anna::RuntimeException) {
-  if (a_state != State::Initialized)
-    throw anna::RuntimeException(anna::functions::asString("Cannot program anymore. The test case %llu was started. You must reset it to append new steps.", a_id), ANNA_FILE_LOCATION);
+  if (isFinished())
+    throw anna::RuntimeException(anna::functions::asString("Cannot program anymore. The test case %llu has finished. You must reset it to append new steps (or do it during execution, which is also allowed).", a_id), ANNA_FILE_LOCATION);
 }
 
 void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(anna::RuntimeException) {
@@ -232,7 +232,7 @@ void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(ann
   bool isRequest = anna::diameter::codec::functions::isRequest(db);
   bool registerSessionId = ((isRequest && toEntity) || (!isRequest && !toEntity) /* (*) */);
   // (*) we register answers Session-Id assuming that we will know the Session-Id values created by the client (OCS)
-  // This is another solution for TODO(***) regarding diameter server testing. No tsure about the final implementation.
+  // This is another solution for TODO(***) regarding diameter server testing. No sure about the final implementation.
 
   // Check hop-by-hop:
   if (isRequest) {