diff options
author | axis <qt-info@nokia.com> | 2010-09-23 13:21:31 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-09-23 13:21:31 (GMT) |
commit | fac1be47ea4ecc05c63e9ca6cae19ac67985c900 (patch) | |
tree | 0f7089a77ec1aa13b292faab39a242f7478b22ab /tests/auto | |
parent | 74f09c794d5fdcb8f4b547b1c55bcd512ef07b95 (diff) | |
parent | ecc7beca87bdfdad2e260f6b9621b77055cf313c (diff) | |
download | Qt-fac1be47ea4ecc05c63e9ca6cae19ac67985c900.zip Qt-fac1be47ea4ecc05c63e9ca6cae19ac67985c900.tar.gz Qt-fac1be47ea4ecc05c63e9ca6cae19ac67985c900.tar.bz2 |
Merge branch 'eventStarvationFixes' into 4.7-s60
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qapplication/test/test.pro | 2 | ||||
-rw-r--r-- | tests/auto/qtimer/tst_qtimer.cpp | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro index 30eb751..2c54c37 100644 --- a/tests/auto/qapplication/test/test.pro +++ b/tests/auto/qapplication/test/test.pro @@ -12,7 +12,7 @@ wince* { } symbian: { - additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe + additional.sources = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe additional.path = desktopsettingsaware someTest.sources = test.pro someTest.path = test diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index f23d065..102308e 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -89,6 +89,7 @@ private slots: void recurseOnTimeoutAndStopTimer(); void QTBUG13633_dontBlockEvents(); + void postedEventsShouldNotStarveTimers(); }; class TimerHelper : public QObject @@ -723,5 +724,31 @@ void tst_QTimer::QTBUG13633_dontBlockEvents() QVERIFY(t.total > 2); } +class SlotRepeater : public QObject { + Q_OBJECT +public: + SlotRepeater() {} + +public slots: + void repeatThisSlot() + { + QMetaObject::invokeMethod(this, "repeatThisSlot", Qt::QueuedConnection); + } +}; + +void tst_QTimer::postedEventsShouldNotStarveTimers() +{ + TimerHelper timerHelper; + QTimer timer; + connect(&timer, SIGNAL(timeout()), &timerHelper, SLOT(timeout())); + timer.setInterval(0); + timer.setSingleShot(false); + timer.start(); + SlotRepeater slotRepeater; + slotRepeater.repeatThisSlot(); + QTest::qWait(100); + QVERIFY(timerHelper.count > 5); +} + QTEST_MAIN(tst_QTimer) #include "tst_qtimer.moc" |