From 72e1fc7c0bfdf93088716a6d302b39cace6bf237 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 16 Feb 2022 10:08:19 +0100 Subject: [PATCH] Simplify failure detection logic in QEventDispatcher test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test always fails when either the Xcb or UNIX, one of the Windows event dispatchers is used. So only test for the event dispatcher name, which then covers all platforms, including QNX and INTEGRITY (which use the UNIX event dispatcher). Pick-to: 6.3 6.2 Change-Id: I2e315831b53f823c5496ad0319319df78f064cc1 Reviewed-by: Qt CI Bot Reviewed-by: Pasi Petäjäjärvi --- .../qeventdispatcher/tst_qeventdispatcher.cpp | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp index 75b5fe91b7..deb8726f2c 100644 --- a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp +++ b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp @@ -443,24 +443,17 @@ void tst_QEventDispatcher::postEventFromEventHandler() QAbstractEventDispatcher::instance()->processEvents(QEventLoop::WaitForMoreEvents); done = true; - bool coreFails = false; - bool guiFails = false; const QByteArrayView eventDispatcherName(QAbstractEventDispatcher::instance()->metaObject()->className()); -#if defined(Q_OS_DARWIN) - coreFails = true; -#elif defined(Q_OS_WINDOWS) - coreFails = true; - guiFails = true; -#elif defined(Q_OS_LINUX) || defined(Q_OS_INTEGRITY) - // QXcbUnixEventDispatcher and QEventDispatcherUNIX do not do this correctly - // QXcbGlibEventDispatcher and QEventDispatcherGlib do - coreFails = !eventDispatcherName.contains("Glib"); - guiFails = !eventDispatcherName.contains("Glib"); -#endif + qDebug() << eventDispatcherName; + // QXcbUnixEventDispatcher and QEventDispatcherUNIX do not do this correctly on any platform; + // both Windows event dispatchers fail as well. + const bool knownToFail = eventDispatcherName.contains("UNIX") + || eventDispatcherName.contains("XcbUnix") + || eventDispatcherName.contains("Win32") + || eventDispatcherName.contains("WindowsGui") + || eventDispatcherName.contains("Android"); - if (coreFails && !isGuiEventDispatcher) - QEXPECT_FAIL("", eventDispatcherName.constData(), Continue); - if (guiFails && isGuiEventDispatcher) + if (knownToFail) QEXPECT_FAIL("", eventDispatcherName.constData(), Continue); QVERIFY(!hadToQuit);