X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Ftesting%2FTestTimer.cpp;fp=source%2Ftesting%2FTestTimer.cpp;h=47c4ccc967ff20ed84fbf0f8f379a8e7117e2754;hb=d723d5bf571eb48c641b092058eaa38bb6c4fcc8;hp=0000000000000000000000000000000000000000;hpb=61f1340da3cae5159d2e3bc14fc47c6d4bf9453e;p=anna.git diff --git a/source/testing/TestTimer.cpp b/source/testing/TestTimer.cpp new file mode 100644 index 0000000..47c4ccc --- /dev/null +++ b/source/testing/TestTimer.cpp @@ -0,0 +1,73 @@ +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // + + +// Project +#include +#include + +// Standard +#include + +// Project +#include + + +using namespace std; +using namespace anna; +using namespace anna::testing; + +void TestTimer::expire(anna::timex::Engine*) +throw(anna::RuntimeException) { + + TestStep *step = getTestCaseStep(); + + // action: + step->complete(); + + LOGDEBUG( + string msg("TestTimer::expire | Completed TestStep:\n\n"); + msg += step->asXMLString(); + anna::Logger::debug(msg, ANNA_FILE_LOCATION); + ); +} + +const char* TestTimer::asText(const Type::_v type) +throw() { + static const char* text [] = { "TimeLeft", "Delay" }; + return text [type]; +} + + +string TestTimer::asString() const +throw() { + string result("TestTimer { "); + result += anna::timex::Transaction::asString(); + result += " Type: "; + result += asText(a_type); + +// const TestStep *step = getTestCaseStep(); +// +// if(step != NULL) { +// result += " | "; +// result += step->asXMLString(); +// } else +// result += " | step: "; +// } + +// switch(getType()) { +// case Type::TimeLeft: +// //result += " | xxxxx: "; +// break; +// case Type::Delay: +// //result += " | xxxxx: "; +// break; +// } + + return result += " }"; +} +