summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>2015-12-14 10:42:51 +0100
committerJędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>2016-05-04 09:26:57 +0000
commit67509693bdac23af4e062140a1b1058dee3f060b (patch)
treebed9b7b163c7269271f7c2b1a533d30852befefa /tests/auto
parent63ec10353db7aaaf227f769398056b6fd42f9b7d (diff)
Improve tst_qtimeline::setPaused resilience
The test should not depend on qWait explicitly Change-Id: I13c01c47c9f7bae8b0c30afa2ac8550dc0fbf028 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
index b588e1fe82..dd41b5632d 100644
--- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
@@ -649,22 +649,21 @@ void tst_QTimeLine::restart()
void tst_QTimeLine::setPaused()
{
- QTimeLine timeLine(1000);
+ const int EndTime = 10000;
+ QTimeLine timeLine(EndTime);
{
QCOMPARE(timeLine.currentTime(), 0);
timeLine.start();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() != 0); // wait for start
timeLine.setPaused(true);
int oldCurrentTime = timeLine.currentTime();
QVERIFY(oldCurrentTime > 0);
- QVERIFY(oldCurrentTime < 1000);
+ QVERIFY(oldCurrentTime < EndTime);
QTest::qWait(1000);
timeLine.setPaused(false);
- QTest::qWait(250);
- int currentTime = timeLine.currentTime();
- QVERIFY(currentTime > 0);
- QVERIFY(currentTime > oldCurrentTime);
- QVERIFY(currentTime < 1000);
+ QTRY_VERIFY(timeLine.currentTime() > oldCurrentTime);
+ QVERIFY(timeLine.currentTime() > 0);
+ QVERIFY(timeLine.currentTime() < EndTime);
timeLine.stop();
}
}