summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-02-16 10:08:19 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-18 19:04:55 +0000
commit7c41abfe76635a8f887cbb006611bbd8c581680b (patch)
tree326e38663ce3bdeeecdda70d8c4453505c766595 /tests
parent7e9c39b0249691637a38aeee31243508c71219d9 (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). 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> (cherry picked from commit 72e1fc7c0bfdf93088716a6d302b39cace6bf237) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp27
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);