tests/auto/qtimer/tst_qtimer.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
child 37 758a864f9613
--- a/tests/auto/qtimer/tst_qtimer.cpp	Wed Jun 23 19:07:03 2010 +0300
+++ b/tests/auto/qtimer/tst_qtimer.cpp	Tue Jul 06 15:10:48 2010 +0300
@@ -85,6 +85,7 @@
     void timerFiresOnlyOncePerProcessEvents();
     void timerIdPersistsAfterThreadExit();
     void cancelLongTimer();
+    void singleShotStaticFunctionZeroTimeout();
 };
 
 class TimerHelper : public QObject
@@ -611,5 +612,16 @@
     QVERIFY(!timer.isActive());
 }
 
+void tst_QTimer::singleShotStaticFunctionZeroTimeout()
+{
+    TimerHelper helper;
+
+    QTimer::singleShot(0, &helper, SLOT(timeout()));
+    QTest::qWait(500);
+    QCOMPARE(helper.count, 1);
+    QTest::qWait(500);
+    QCOMPARE(helper.count, 1);
+}
+
 QTEST_MAIN(tst_QTimer)
 #include "tst_qtimer.moc"