Stabilize tst_QSignalSpy::waitFunctionPointer_signalEmittedTooLate()

Replace qWait()/QCOMPARE() by QTRY_COMPARE().

Change-Id: Ic5233e2f26e6663a3fbcbb2edb09a517feef4564
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This commit is contained in:
Friedemann Kleint 2018-03-14 15:46:03 +01:00
parent 8b6838347d
commit ff1630ab0e

View File

@ -259,8 +259,7 @@ void tst_QSignalSpy::wait_signalEmittedTooLate()
QTimer::singleShot(500, this, SIGNAL(sigFoo()));
QSignalSpy spy(this, SIGNAL(sigFoo()));
QVERIFY(!spy.wait(200));
QTest::qWait(400);
QCOMPARE(spy.count(), 1);
QTRY_COMPARE(spy.count(), 1);
}
void tst_QSignalSpy::wait_signalEmittedMultipleTimes()