diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2014-08-28 12:53:43 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2014-08-28 13:59:37 +0200 |
commit | 9b599c6cea0a7f265caf6db09dccd31f0c805ff9 (patch) | |
tree | ac59e79f2bf3160ab59e890f6112623b963e2bba /tests/auto/widgets | |
parent | 6f52256dc2580cbe6b273e5d58f1934b9dbc51c5 (diff) |
tst_qstatusbar: Allow a little more leeway in timer checking.
Timer granularity means that sometimes this won't wait the full timeout before
vanishing the message. Add some extra tolerance so we don't unnecessarily fail
integrations.
Change-Id: I203ac16cda7bd1f0437dd3febc0509c17e86c25a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp b/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp index 7c3ef3613b..38eae1d19d 100644 --- a/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp +++ b/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp @@ -294,7 +294,12 @@ void tst_QStatusBar::QTBUG25492_msgtimeout() // Message disappears after 2 seconds QTRY_VERIFY(testWidget->currentMessage().isNull()); - QVERIFY2(t.elapsed() >= 2000, qPrintable("Timer was " + QString::number(t.elapsed()))); + qint64 ts = t.elapsed(); + + // XXX: ideally ts should be 2000, but sometimes it appears to go away early, probably due to timer granularity. + QVERIFY2(ts >= 1800, qPrintable("Timer was " + QString::number(ts))); + if (ts < 2000) + qWarning("QTBUG25492_msgtimeout: message vanished early, should be >= 2000, was %lld", ts); QVERIFY(currentMessage.isNull()); // Set display message for 2 seconds first |