summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtimer
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@sosco.com>2009-09-16 13:48:59 (GMT)
committerShane Kearns <shane.kearns@sosco.com>2009-09-16 13:48:59 (GMT)
commit504dd08854a8f6519a0529014df2233938b82728 (patch)
treec96594b5b69bcd10d61b97fd9838505208eb7610 /tests/auto/qtimer
parent314e5680c8276d539b596927874036a873966d8f (diff)
downloadQt-504dd08854a8f6519a0529014df2233938b82728.zip
Qt-504dd08854a8f6519a0529014df2233938b82728.tar.gz
Qt-504dd08854a8f6519a0529014df2233938b82728.tar.bz2
Fix QTimer overflow with interval > 35 minutes on symbian
For long intervals, restart the system timer every 2000 seconds New autotest to verify long timers don't crash or complete immediately Task-number: QT-651 Reviewed-by: axis
Diffstat (limited to 'tests/auto/qtimer')
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp12
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"