From 90eadd0c4b6de7d1ab4ba3472ffb9afe1539194c Mon Sep 17 00:00:00 2001 From: Marko Kenttala Date: Thu, 31 May 2012 11:25:06 +0300 Subject: Fix for QEventLoop autotest for Symbian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Juha Kukkonen Reviewed-by: Pasi Pentikäinen --- tests/auto/qeventloop/tst_qeventloop.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp index 53d0475..fe1e40c 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 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)); } -- cgit v0.12