Command execution for system test cases
[anna.git] / example / diameter / launcher / Launcher.cpp
index 4452ee4..ffc814b 100644 (file)
@@ -1673,9 +1673,9 @@ void Launcher::eventOperation(const std::string &operation, std::string &respons
     else if(param1 == "repeats") {
       if (numParams > 2 || numParams < 2)
         throw anna::RuntimeException("Wrong body content format on HTTP Request. Use 'help' management command to see more information.", ANNA_FILE_LOCATION);
-
-      testManager.setPoolRepeats(atoi(param2.c_str()));
-      int repeats = testManager.getPoolRepeats();
+      int repeats = atoi(param2.c_str());
+      if (repeats < 0) repeats = -1;
+      testManager.setPoolRepeats(repeats);
       std::string nolimit = (repeats != -1) ? "":" [no limit]";
       opt_response_content += anna::functions::asString("Pool repeats: %d%s (current cycle: %d)", repeats, nolimit.c_str(), testManager.getPoolCycle());
     }