diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2018-04-03 10:21:24 +0300 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2018-04-06 07:19:19 +0000 |
commit | fd87c8da82b4bf52d395a5f9a2687e4eb7a22221 (patch) | |
tree | 91dc20aaad65e0f56548a23bb445a2861cb2a509 /tests/auto/other/qobjectrace | |
parent | a1b1dd3b84bc53eab7e93245f89e25d7c2f3330e (diff) |
tests/auto/other: Avoid unconditional qWait()s
There is no need to qWait() before a QTRY_VERIFY. qWait() will also
intermittently handle events while waiting, so calling it in a loop isn't
necessary.
Change-Id: Ica7fbf18c03e673213dd9b72f31f71937cdcb145
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/other/qobjectrace')
-rw-r--r-- | tests/auto/other/qobjectrace/tst_qobjectrace.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp index aa78d70716..e6eb51500b 100644 --- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp @@ -420,11 +420,7 @@ void tst_QObjectRace::disconnectRace() threads[i]->start(); } - QTime timeLimiter; - timeLimiter.start(); - - while (timeLimiter.elapsed() < TimeLimit) - QTest::qWait(10); + QTest::qWait(TimeLimit); for (int i = 0; i < ThreadCount; ++i) { threads[i]->requestInterruption(); @@ -450,11 +446,7 @@ void tst_QObjectRace::disconnectRace() threads[i]->start(); } - QTime timeLimiter; - timeLimiter.start(); - - while (timeLimiter.elapsed() < TimeLimit) - QTest::qWait(10); + QTest::qWait(TimeLimit); senderThread->requestInterruption(); QVERIFY(senderThread->wait(300)); |