summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qtimeline
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2012-04-16 23:11:41 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-17 08:06:47 +0200
commit5192b06ccb3a015a224c8a5efb23d5c8029b1156 (patch)
tree4a4ee196df2f0c67c3e2b8a6e2da56ff3fc68b75 /tests/auto/corelib/tools/qtimeline
parent4e282e3ea23972e8a28915cd57ede214d89d840d (diff)
Fix bug in tst_QTimeLine::duration().
QTimeLine::currentTime() is an integer in the range [0..duration], not a float in the range [0.0..1.0]. The aim of the test appears to be to verify that currentTime() is at least 90% of the way to duration() when the timeline is almost due to finish, so verify that and give the corresponding 10% tolerance on reaching the end state. Change-Id: I38646947c3b9189a4e8e91a450c6071430ddc66a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/tools/qtimeline')
-rw-r--r--tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
index f05497d7a2..4ac0e91755 100644
--- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
@@ -184,9 +184,10 @@ void tst_QTimeLine::duration()
timeLine.start();
QTest::qWait(999);
QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > 0.9);
- QTest::qWait(50);
+ QVERIFY(timeLine.currentTime() > 900);
+ QTest::qWait(100);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QCOMPARE(timeLine.currentTime(), 1000);
// The duration shouldn't change
QCOMPARE(timeLine.duration(), 1000);
}