##// END OF EJS Templates
Added basic tests around Amda plugin Python wrapper...
Added basic tests around Amda plugin Python wrapper - Basic Amda parser test - Basic Amda Download test, it makes few range updates on a single variable with myAMDA as server. Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r1213:2785fa3e9772
r1340:02cea38fdcb4
Show More
SignalWaiter.cpp
36 lines | 641 B | text/x-c | CppLexer
#include "Common/SignalWaiter.h"
#include <QTimer>
namespace {
const auto DEFAULT_TIMEOUT = 30000;
} // namespace
SignalWaiter::SignalWaiter(QObject &sender, const char *signal) : m_Timeout{false}
{
connect(&sender, signal, &m_EventLoop, SLOT(quit()));
}
bool SignalWaiter::wait(int timeout)
{
if (timeout == 0) {
timeout = DEFAULT_TIMEOUT;
}
QTimer timer{};
timer.setInterval(timeout);
timer.start();
connect(&timer, &QTimer::timeout, this, &SignalWaiter::timeout);
m_EventLoop.exec();
return !m_Timeout;
}
void SignalWaiter::timeout()
{
m_Timeout = true;
m_EventLoop.quit();
}