summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>2015-12-14 11:13:10 +0100
committerJędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>2015-12-21 08:52:27 +0000
commit229c03cd88ab9ed6453eb39df907825193a87af4 (patch)
treeb15ea1bb6c9a4b6dda7761ad4ee00521d2e8d913 /tests/auto
parentbcc23e7942debca71f5aa13af3e512aeb5bb4fe7 (diff)
Make tst_qtimeline::range less prune to timing errors
Change-Id: I5fd84c58250a9dfa237fcb7fca4da50c35a9f57e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
index 79118791d0..8d42fc9d44 100644
--- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
@@ -93,29 +93,20 @@ void tst_QTimeLine::range()
QCOMPARE(timeLine.endFrame(), 16);
// Verify that you can change the range in the timeLine
- timeLine.setFrameRange(10, 20);
+ timeLine.setFrameRange(1000, 2000);
QSignalSpy spy(&timeLine, &QTimeLine::frameChanged);
QVERIFY(spy.isValid());
- timeLine.start();
-#ifdef Q_OS_WINCE
- QTest::qWait(1000);
-#else
- QTest::qWait(100);
-#endif
- QCOMPARE(timeLine.state(), QTimeLine::Running);
+ timeLine.start(); // make sure that the logic works for a running timeline
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ timeLine.setCurrentTime(timeLine.duration()/2);
int oldValue = timeLine.currentFrame();
- timeLine.setFrameRange(0, 5);
+ timeLine.setFrameRange(0, 500);
QVERIFY(timeLine.currentFrame() < oldValue);
- timeLine.setEndFrame(100);
- timeLine.setStartFrame(50);
+ timeLine.setEndFrame(10000);
+ timeLine.setStartFrame(5000);
QVERIFY(timeLine.currentFrame() > oldValue);
- timeLine.setFrameRange(0, 5);
-#ifdef Q_OS_WINCE
- QTest::qWait(500);
-#else
- QTest::qWait(50);
-#endif
- QVERIFY(spy.count() > 1);
+ timeLine.setFrameRange(0, 500);
+ QTRY_VERIFY(spy.count() > 1);
QVERIFY(timeLine.currentFrame() < oldValue);
}