diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-02-16 10:08:19 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-02-18 18:55:38 +0100 |
commit | 72e1fc7c0bfdf93088716a6d302b39cace6bf237 (patch) | |
tree | 1c1114878dc42ec4a2ebbda9b899bf723014f7b9 /tests/auto/corelib/kernel/qeventdispatcher | |
parent | 5f338040f4ecbf6404ea5610ec19adfd9ca71c35 (diff) |
Simplify failure detection logic in QEventDispatcher test
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 <qt_ci_bot@qt-project.org>
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qeventdispatcher')
-rw-r--r-- | tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp | 27 |
1 files changed, 10 insertions, 17 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 - - if (coreFails && !isGuiEventDispatcher) - QEXPECT_FAIL("", eventDispatcherName.constData(), Continue); - if (guiFails && isGuiEventDispatcher) + 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 (knownToFail) QEXPECT_FAIL("", eventDispatcherName.constData(), Continue); QVERIFY(!hadToQuit); |