X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Ftesting%2FTestManager.cpp;h=a74ab6d16ec4b948d631f5084bda610773677b3e;hp=20a29a2f5a2f4336b832124458247a73953def92;hb=1f560cfaaea555f037a99a6790eade56434eb119;hpb=51d5997996ea8be2f545f13c3258b56e19a4e291 diff --git a/source/testing/TestManager.cpp b/source/testing/TestManager.cpp index 20a29a2..a74ab6d 100644 --- a/source/testing/TestManager.cpp +++ b/source/testing/TestManager.cpp @@ -194,7 +194,7 @@ throw() { bool TestManager::configureTTPS(int testTicksPerSecond) throw() { - if (testTicksPerSecond == 0) { + if (testTicksPerSecond == 0) { if (a_clock) { a_timeController->cancel(a_clock); LOGDEBUG(anna::Logger::debug("Testing timer clock stopped !", ANNA_FILE_LOCATION)); @@ -260,6 +260,23 @@ bool TestManager::gotoTestCase(unsigned int id) throw() { return false; } +bool TestManager::runTestCase(unsigned int id) throw() { + test_pool_it it = a_testPool.find(id); + if (it != a_testPool.end()) { + a_currentTestIt = it; + + // execTestCases will get the next one, we must return 1 position: + if (a_currentTestIt == a_testPool.begin()) + a_currentTestIt = a_testPool.end(); + else + a_currentTestIt--; + + return execTestCases(1); + } + + return false; +} + TestCase *TestManager::findTestCase(unsigned int id) const throw() { // id = -1 provides current test case triggered if (!tests()) return NULL;