#include "testutils.h" #include #include #include TestUtils::TestUtils() { } bool TestUtils::wait(const bool &forWait, int msec) { auto curmsec = QDateTime::currentMSecsSinceEpoch() + msec; while (curmsec > QDateTime::currentMSecsSinceEpoch() && !forWait) { QCoreApplication::processEvents(); } QCoreApplication::processEvents(); return forWait; } bool TestUtils::wait(std::function forWait, int msec) { auto curmsec = QDateTime::currentMSecsSinceEpoch() + msec; while (curmsec > QDateTime::currentMSecsSinceEpoch() && !forWait()) { QCoreApplication::processEvents(); } QCoreApplication::processEvents(); return forWait(); }