summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-03-26 17:28:46 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2018-04-03 10:20:36 +0000
commitc7dac6469c3bc804a70e1afcc0dc7865afc28e5a (patch)
tree1afcb61e6c7e0d22aa0b14bb7c64a6cd2df02e37 /tests
parent231ac1b878cf3246b0b4cf00bc63e956abd1c4fd (diff)
tst_QThread: Use QTRY_VERIFY instead of qWaits
These two places were sort of manually implementing QTRY_VERIFY except that they never time out. Change-Id: I136e6c7400194327c0475c6acfc019825ccec1b5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index 0405896ca7..aee243d880 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -988,9 +988,7 @@ void tst_QThread::exitAndStart()
connect(&sync2, SIGNAL(propChanged(int)), &sync1, SLOT(setProp(int)), Qt::QueuedConnection);
connect(&sync1, SIGNAL(propChanged(int)), &thread, SLOT(quit()), Qt::QueuedConnection);
QMetaObject::invokeMethod(&sync2, "setProp", Qt::QueuedConnection , Q_ARG(int, 89));
- QTest::qWait(50);
- while(!thread.wait(10))
- QTest::qWait(10);
+ QTRY_VERIFY(thread.wait(10));
QCOMPARE(sync2.m_prop, 89);
QCOMPARE(sync1.m_prop, 89);
}
@@ -1026,9 +1024,7 @@ void tst_QThread::exitAndExec()
connect(&sync2, SIGNAL(propChanged(int)), &sync1, SLOT(setProp(int)), Qt::QueuedConnection);
connect(&sync1, SIGNAL(propChanged(int)), &thread, SLOT(quit()), Qt::QueuedConnection);
QMetaObject::invokeMethod(&sync2, "setProp", Qt::QueuedConnection , Q_ARG(int, 89));
- QTest::qWait(50);
- while(!thread.wait(10))
- QTest::qWait(10);
+ QTRY_VERIFY(thread.wait(10));
QCOMPARE(sync2.m_prop, 89);
QCOMPARE(sync1.m_prop, 89);
}