summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtimer
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-08-11 14:28:37 +0200
committeraxis <qt-info@nokia.com>2009-08-11 14:38:46 +0200
commitb81b46407299c0b03fffab60d6d87cc71b57cd34 (patch)
tree6d2e68327c556939948c4d1b256766fd0309dc8a /tests/auto/qtimer
parent0d3a88ae2f4f4c9b356ee093ba6d166b92256a56 (diff)
Wrote an autotest to expose a bug in the GLib event dispatcher.
Zero timers don't fire on the first pass in the GLib event dispatcher. Ideally I should fix the bug of course, but time doesn't permit at the moment. Submitting this test instead as a "reminder". The UNIX event dispatcher passes the test, and it also passes if moved to the end of the slots. Task: 259505
Diffstat (limited to 'tests/auto/qtimer')
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index 43b755347c..8c8f1e3d33 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -73,6 +73,7 @@ public slots:
void init();
void cleanup();
private slots:
+ void zeroTimer();
void singleShotTimeout();
void timeout();
void livelock_data();
@@ -129,6 +130,20 @@ void tst_QTimer::cleanup()
{
}
+void tst_QTimer::zeroTimer()
+{
+ TimerHelper helper;
+ QTimer timer;
+ timer.setInterval(0);
+ timer.start();
+
+ connect(&timer, SIGNAL(timeout()), &helper, SLOT(timeout()));
+
+ QCoreApplication::processEvents();
+
+ QCOMPARE(helper.count, 1);
+}
+
void tst_QTimer::singleShotTimeout()
{
TimerHelper helper;
@@ -482,4 +497,3 @@ void tst_QTimer::restartedTimerFiresTooSoon()
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
-\