summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-04-03 15:45:48 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2018-04-12 05:49:07 +0000
commit350a64196f03e740092edf35587b75bec3869c8b (patch)
tree358d886119214a531b2172ae619579b9ae9d8bf9 /tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
parent375dd7ad3457e335bd454ff91a66412941ae8f99 (diff)
tests/auto/dbus: Avoid unconditional qWait()s
Use QTRY_COMPARE instead of a wait followed by QCOMPARE. Unless the condition doesn't change and the wait provides the opportunity for things to go wrong. Task-number: QTBUG-63992 Change-Id: I13474a45f1f4df9d77a418729a5748235ae0dd1a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp')
-rw-r--r--tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp b/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
index 8bda5f5641..018b7c2a35 100644
--- a/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
+++ b/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
@@ -414,8 +414,7 @@ void tst_QDBusThreading::registerObjectInOtherThread()
QCOMPARE(functionSpy, Object_method);
QCOMPARE(threadSpy, th);
- QTest::qWait(100);
- QCOMPARE(signalSpy, 1);
+ QTRY_COMPARE(signalSpy, 1);
sem2.acquire(); // the object is gone
functionSpy = NoMethod;
@@ -462,8 +461,7 @@ void tst_QDBusThreading::registerAdaptorInOtherThread()
QCOMPARE(functionSpy, Adaptor_method);
QCOMPARE(threadSpy, th);
- QTest::qWait(100);
- QCOMPARE(signalSpy, 1);
+ QTRY_COMPARE(signalSpy, 1);
functionSpy = NoMethod;
threadSpy = 0;