From 5192b06ccb3a015a224c8a5efb23d5c8029b1156 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 16 Apr 2012 23:11:41 +1000 Subject: [PATCH] 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 --- tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp | 5 +++-- 1 file 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 f05497d..4ac0e91 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); } -- 2.7.4