diff --git a/tests/auto/qtpromise/qpromise/delay/tst_delay.cpp b/tests/auto/qtpromise/qpromise/delay/tst_delay.cpp index 5a35aec..4b018db 100644 --- a/tests/auto/qtpromise/qpromise/delay/tst_delay.cpp +++ b/tests/auto/qtpromise/qpromise/delay/tst_delay.cpp @@ -34,8 +34,12 @@ void tst_qpromise_delay::fulfilled() QCOMPARE(waitForValue(p, -1), 42); QCOMPARE(p.isFulfilled(), true); - QVERIFY(elapsed >= 1000 * 0.95); // Qt::CoarseTimer (default) Coarse timers try to - QVERIFY(elapsed <= 1000 * 1.05); // keep accuracy within 5% of the desired interval. + + // Qt::CoarseTimer (default) Coarse timers try to + // keep accuracy within 5% of the desired interval. + // Require accuracy within 6% for passing the test. + QVERIFY(elapsed >= 1000 * 0.94); + QVERIFY(elapsed <= 1000 * 1.06); } void tst_qpromise_delay::rejected() @@ -51,5 +55,5 @@ void tst_qpromise_delay::rejected() QCOMPARE(waitForError(p, QString()), QString("foo")); QCOMPARE(p.isRejected(), true); - QVERIFY(elapsed < 5); + QVERIFY(elapsed <= 10); } diff --git a/tests/auto/qtpromise/qpromise/timeout/tst_timeout.cpp b/tests/auto/qtpromise/qpromise/timeout/tst_timeout.cpp index bf43c61..fd40348 100644 --- a/tests/auto/qtpromise/qpromise/timeout/tst_timeout.cpp +++ b/tests/auto/qtpromise/qpromise/timeout/tst_timeout.cpp @@ -87,6 +87,10 @@ void tst_qpromise_timeout::timeout() QCOMPARE(waitForValue(p, -1), -1); QCOMPARE(p.isRejected(), true); QCOMPARE(failed, true); - QVERIFY(elapsed >= 2000 * 0.95); // Qt::CoarseTimer (default) Coarse timers try to - QVERIFY(elapsed <= 2000 * 1.05); // keep accuracy within 5% of the desired interval. + + // Qt::CoarseTimer (default) Coarse timers try to + // keep accuracy within 5% of the desired interval. + // Require accuracy within 6% for passing the test. + QVERIFY(elapsed >= 2000 * 0.94); + QVERIFY(elapsed <= 2000 * 1.06); }