Allow to automatically reserve an FSM test id
[anna.git] / source / testing / TestManager.cpp
index 87278f1..e90d20d 100644 (file)
@@ -287,6 +287,10 @@ TestCase *TestManager::findTestCase(unsigned int id) const { // id = -1 provides
 
 TestCase *TestManager::getTestCase(unsigned int id, const std::string &description) {
 
+  if (id == 0) { // 0 is used to sequence automatically and get the value of 'tests() + 1'
+    id = tests() + 1;
+  }
+
   test_pool_nc_it it = a_testPool.find(id);
   if (it != a_testPool.end()) return it->second;