#include <string>
#include <vector>
#include <thread>
+#include <atomic>
// Project
#include <anna/core/DataBlock.hpp>
public:
TestStepTimeout(TestCase *testCase) : TestStep(testCase), a_timeout(0), a_timer(NULL) { a_type = Type::Timeout; }
+ ~TestStepTimeout() { do_reset(); }
// setter & getters
void setTimeout(const anna::Millisecond &t) throw() { a_timeout = t; }
a_expired(false),
a_originHost(NULL),
a_waitForRequestStepNumber(-1) {;}
- ~TestStepSendDiameterXml() {;}
+ ~TestStepSendDiameterXml() { do_reset(); }
// setter & getters
void setOriginHost(anna::diameter::comm::OriginHost *host) throw() { a_originHost = host; }
public:
TestStepDelay(TestCase *testCase) : TestStep(testCase), a_delay(0), a_timer(NULL) { a_type = Type::Delay; }
+ ~TestStepDelay() { do_reset(); }
// setter & getters
void setDelay(const anna::Millisecond &d) throw() { a_delay = d; }
a_clientSession = NULL;
a_serverSession = NULL;
}
- ~TestStepWaitDiameter() {;}
+ ~TestStepWaitDiameter() { do_reset(); }
// setter & getters
void setCondition(bool fromEntity,
std::string a_script;
std::thread a_thread;
- bool a_threadRunning;
+ std::atomic<bool> a_threadRunning;
bool a_threadDeprecated;
int a_resultCode;
std::string a_errorMsg;
public:
TestStepCmd(TestCase *testCase) : TestStep(testCase), a_threadRunning(false), a_threadDeprecated(false), a_resultCode(-2)/*, a_output("")*/, a_errorMsg(""), a_childPid(-1) { a_type = Type::Cmd; }
+ ~TestStepCmd() { do_reset(); }
// setter & getters
- void setThreadRunning(bool running) throw() { a_threadRunning = running; }
+ void setThreadRunning() throw() { a_threadRunning = true; }
+ void setThreadNotRunning() throw() { a_threadRunning = false; }
+ bool threadRunning() const throw() { return a_threadRunning; }
+ bool threadNotRunning() const throw() { return !a_threadRunning; }
void setResultCode(int rc) throw() { a_resultCode = rc; }
int getResultCode() const throw() { return a_resultCode; }
public:
TestStepIpLimit(TestCase *testCase) : TestStep(testCase), a_ipLimit(1) { a_type = Type::IpLimit; }
+ ~TestStepIpLimit() { do_reset(); }
// setter & getters
void setIpLimit(unsigned int limit) throw() { a_ipLimit = limit; }