From b81b46407299c0b03fffab60d6d87cc71b57cd34 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 11 Aug 2009 14:28:37 +0200 Subject: 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 --- tests/auto/qtimer/tst_qtimer.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/auto/qtimer') 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" -\ -- cgit v1.2.3