summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-09-23 15:21:31 +0200
committeraxis <qt-info@nokia.com>2010-09-23 15:21:31 +0200
commitfac1be47ea4ecc05c63e9ca6cae19ac67985c900 (patch)
tree0f7089a77ec1aa13b292faab39a242f7478b22ab /tests
parent74f09c794d5fdcb8f4b547b1c55bcd512ef07b95 (diff)
parentecc7beca87bdfdad2e260f6b9621b77055cf313c (diff)
Merge branch 'eventStarvationFixes' into 4.7-s60
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qapplication/test/test.pro2
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp27
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro
index 30eb75177a..2c54c37d86 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 f23d0655d6..102308e768 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"