Improved wait for regexp operations
[anna.git] / source / testing / TestCase.cpp
index efaba5c..f8d7a98 100644 (file)
@@ -366,11 +366,25 @@ void TestCase::addWait(bool fromEntity,
   addStep(step);
 }
 
-void TestCase::addWaitRegexp(bool fromEntity, const std::string &regexp) throw(anna::RuntimeException) {
+void TestCase::addWaitRegexpHex(bool fromEntity, const std::string &regexp) throw(anna::RuntimeException) {
   assertInitialized();
 
   TestStepWait *step = new TestStepWait(this);
-  step->setCondition(fromEntity, regexp);
+  step->setConditionRegexpHex(fromEntity, regexp);
+
+  LOGINFORMATION(
+    if (hasSameCondition(step->getCondition()))
+      anna::Logger::information(anna::functions::asString("The same wait condition has already been programmed in this test case (%llu). Are you sure ?", a_id), ANNA_FILE_LOCATION);
+  );
+
+  addStep(step);
+}
+
+void TestCase::addWaitRegexpXml(bool fromEntity, const std::string &regexp) throw(anna::RuntimeException) {
+  assertInitialized();
+
+  TestStepWait *step = new TestStepWait(this);
+  step->setConditionRegexpXml(fromEntity, regexp);
 
   LOGINFORMATION(
     if (hasSameCondition(step->getCondition()))