qt5base-lts/tests/auto/corelib
Jarek Kobus db3d5a3097 Fix flaky QTimer::remainingTime() test
Before, we used not so accurate QTest::qWait(50)
to measure the accuracy of more precise timer's interval.
In addition, the checked range for remainingTime (50, 200)
was probably wrong, since by definition it couldn't be more than 150,
as we started the timer with interval of 200 and waited at least 50.

In this fix we have additional "tester" timer to measure remainingTime
of "tested" timer. The "tester" is a singleShot timer with interval of
50, and is started together with "tested" timer. Whenever the "tested"
timer timeouts, it restarts the "tester" timer - this is done desired
number of times (2 by default, like in the original test).

The test itself lies now inside tester's lambda. We fix the tested
range (at least 1, no more than 150). The minimum value could in
theory be greater, but it's enough to test that it's not overdue.

Finally, we wait for expected number of test runs. We give it twice
as much time as is in theory needed.

Task-number: QTBUG-83419
Task-number: QTBUG-58519
Change-Id: I43836d787d804f22bb66515ebb215d040189c4f3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-09-10 02:49:59 +02:00
..
animation Remove timeStep parameter from QAnimationDrive::advanceAnimation 2020-09-03 18:43:22 +02:00
global Round float->qfloat16 to even 2020-09-06 12:35:12 +02:00
io QProcess/Unix: introduce setChildProcessModifier() 2020-09-08 21:00:29 -07:00
itemmodels Long live QAIM::multiData! 2020-09-02 22:51:42 +02:00
kernel Fix flaky QTimer::remainingTime() test 2020-09-10 02:49:59 +02:00
mimetypes Fix warnings about unused expression results in tests 2020-07-29 14:33:29 +02:00
plugin Make QUUid constructors from string like types explicit 2020-08-27 18:58:21 +02:00
serialization Change QByteArray to handle large arrays 2020-08-27 18:58:20 +02:00
text Clean up QTextBoundaryFinder and qunicodetools 2020-09-07 09:09:55 +02:00
thread Get rid of hasPendingEvents() and flush() 2020-09-06 00:17:12 +02:00
time Fix failures in tst_qdatetime under non-english locales 2020-09-09 06:00:28 +02:00
tools QProcess/Unix: introduce setChildProcessModifier() 2020-09-08 21:00:29 -07:00
.prev_CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
corelib.pro Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00