diff options
Diffstat (limited to 'tests/auto/qtimer/tst_qtimer.cpp')
-rw-r--r-- | tests/auto/qtimer/tst_qtimer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index a55c1c6..0877500 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -88,6 +88,7 @@ private slots: void timerFiresOnlyOncePerProcessEvents_data(); void timerFiresOnlyOncePerProcessEvents(); void timerIdPersistsAfterThreadExit(); + void cancelLongTimer(); }; class TimerHelper : public QObject @@ -602,5 +603,16 @@ void tst_QTimer::timerIdPersistsAfterThreadExit() QVERIFY((timerId & 0xffffff) != (thread.timerId & 0xffffff)); } +void tst_QTimer::cancelLongTimer() +{ + QTimer timer; + timer.setSingleShot(true); + timer.start(1000 * 60 * 60); //set timer for 1 hour (which would overflow Symbian RTimer) + QCoreApplication::processEvents(); + QVERIFY(timer.isActive()); //if the timer completes immediately with an error, then this will fail + timer.stop(); + QVERIFY(!timer.isActive()); +} + QTEST_MAIN(tst_QTimer) #include "tst_qtimer.moc" |