summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qdatastream.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-09-04 10:47:40 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-09-10 02:49:59 +0200
commitdb3d5a30973eef3d3abc767e625923c13f8cf327 (patch)
treee38408fd4f081cfe9593bf9690f5d3bccffca10f /src/corelib/serialization/qdatastream.cpp
parenta1cbca44ef40d89f1ff9182e4014f9b8594330d5 (diff)
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>
Diffstat (limited to 'src/corelib/serialization/qdatastream.cpp')
0 files changed, 0 insertions, 0 deletions