diff options
author | axis <qt-info@nokia.com> | 2009-08-11 12:28:37 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-08-11 12:38:46 (GMT) |
commit | b81b46407299c0b03fffab60d6d87cc71b57cd34 (patch) | |
tree | 6d2e68327c556939948c4d1b256766fd0309dc8a /tests | |
parent | 0d3a88ae2f4f4c9b356ee093ba6d166b92256a56 (diff) | |
download | Qt-b81b46407299c0b03fffab60d6d87cc71b57cd34.zip Qt-b81b46407299c0b03fffab60d6d87cc71b57cd34.tar.gz Qt-b81b46407299c0b03fffab60d6d87cc71b57cd34.tar.bz2 |
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')
-rw-r--r-- | tests/auto/qtimer/tst_qtimer.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index 43b7553..8c8f1e3 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" -\ |