Skip to content

Commit 90eadd0

Browse files
Marko KenttalaQt by Nokia
authored andcommitted
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 <[email protected]> Reviewed-by: Juha Kukkonen <[email protected]> Reviewed-by: Pasi Pentikäinen <[email protected]>
1 parent da65ccd commit 90eadd0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/auto/qeventloop/tst_qeventloop.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,15 +878,16 @@ namespace DeliverInDefinedOrder_QTBUG19637 {
878878
void moveToThread(QThread *t) {
879879
QObject::moveToThread(t);
880880
}
881+
void processEvents() {
882+
// Process all events for this thread
883+
QCoreApplication::processEvents(QEventLoop::AllEvents, 30000);
884+
}
881885
};
882886

883887
}
884888

885889
void tst_QEventLoop::deliverInDefinedOrder_QTBUG19637()
886890
{
887-
#ifdef Q_OS_SYMBIAN
888-
QSKIP("Causes test suite to crash - see QTBUG-23974", SkipAll);
889-
#endif
890891
using namespace DeliverInDefinedOrder_QTBUG19637;
891892
qMetaTypeId<QThread*>();
892893
QThread threads[NbThread];
@@ -907,8 +908,10 @@ void tst_QEventLoop::deliverInDefinedOrder_QTBUG19637()
907908
}
908909
}
909910

910-
QTest::qWait(30);
911911
for (int o = 0; o < NbObject; o++) {
912+
// Wait until all events processed
913+
QMetaObject::invokeMethod(&objects[o], "processEvents", Qt::BlockingQueuedConnection);
914+
// Test event count
912915
QTRY_COMPARE(objects[o].count, int(NbEvent));
913916
}
914917

0 commit comments

Comments
 (0)