summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarko Kenttala <ext-marko.r.kenttala@nokia.com>2012-05-31 11:25:06 +0300
committerPasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>2012-06-13 10:14:01 +0200
commit88fecab6846bf4f3d57fe576c2b2e1a9093a713f (patch)
tree8d95e5dc85484b86bbe003082287a2b4bf381efc
parent4ebc429af10e4255af35e976cce63d55b3908351 (diff)
Fix for QEventLoop autotest for Symbian
Test deliverInDefinedOrder_QTBUG19637 was skipped in Symbian to avoid crashing. Test crashed because object events could not be processed in time in slower Symbian devices. Added waiting for all events to be processed before checking actual event count. Task-Number: QTBUG-23974 Change-Id: Idd79d4ec9fe21a4f03f2d9ba2e365abbbc45c9d8 Reviewed-by: Murray Read <ext-murray.2.read@nokia.com> Reviewed-by: Juha Kukkonen <ext-juha.kukkonen@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com> (cherry picked from commit 90eadd0c4b6de7d1ab4ba3472ffb9afe1539194c)
-rw-r--r--tests/auto/qeventloop/tst_qeventloop.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp
index 53d04751a1..fe1e40c291 100644
--- a/tests/auto/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/qeventloop/tst_qeventloop.cpp
@@ -878,15 +878,16 @@ namespace DeliverInDefinedOrder_QTBUG19637 {
void moveToThread(QThread *t) {
QObject::moveToThread(t);
}
+ void processEvents() {
+ // Process all events for this thread
+ QCoreApplication::processEvents(QEventLoop::AllEvents, 30000);
+ }
};
}
void tst_QEventLoop::deliverInDefinedOrder_QTBUG19637()
{
-#ifdef Q_OS_SYMBIAN
- QSKIP("Causes test suite to crash - see QTBUG-23974", SkipAll);
-#endif
using namespace DeliverInDefinedOrder_QTBUG19637;
qMetaTypeId<QThread*>();
QThread threads[NbThread];
@@ -907,8 +908,10 @@ void tst_QEventLoop::deliverInDefinedOrder_QTBUG19637()
}
}
- QTest::qWait(30);
for (int o = 0; o < NbObject; o++) {
+ // Wait until all events processed
+ QMetaObject::invokeMethod(&objects[o], "processEvents", Qt::BlockingQueuedConnection);
+ // Test event count
QTRY_COMPARE(objects[o].count, int(NbEvent));
}