diff options
author | Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> | 2015-12-14 10:53:39 +0100 |
---|---|---|
committer | Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> | 2015-12-21 08:52:13 +0000 |
commit | bcc23e7942debca71f5aa13af3e512aeb5bb4fe7 (patch) | |
tree | 85066577cfc3ebf358f45a89e717d4ef68e6e16e | |
parent | 64857434e29c367191b653e24e0fe672c13eb2b1 (diff) |
Make tst_qtimeline::duration less fragile to timings
The test still can fail because 1s is quite a short time.
Change-Id: I6f42c182f2932d5a053f6a69667210529c9a7697
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
-rw-r--r-- | tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp index 507f7e3992..79118791d0 100644 --- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp +++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp @@ -174,11 +174,9 @@ void tst_QTimeLine::duration() QCOMPARE(timeLine.duration(), 1000); timeLine.start(); - QTest::qWait(999); - QCOMPARE(timeLine.state(), QTimeLine::Running); - QVERIFY(timeLine.currentTime() > 900); - QTest::qWait(100); - QCOMPARE(timeLine.state(), QTimeLine::NotRunning); + QTRY_COMPARE(timeLine.state(), QTimeLine::Running); + QTRY_VERIFY(timeLine.currentTime() > 0); + QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning); QCOMPARE(timeLine.currentTime(), 1000); // The duration shouldn't change QCOMPARE(timeLine.duration(), 1000); @@ -187,7 +185,7 @@ void tst_QTimeLine::duration() void tst_QTimeLine::frameRate() { QTimeLine timeLine; - timeLine.setFrameRange(10, 20); + timeLine.setFrameRange(100, 2000); QCOMPARE(timeLine.updateInterval(), 1000 / 25); timeLine.setUpdateInterval(1000 / 60); QCOMPARE(timeLine.updateInterval(), 1000 / 60); |