summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2022-02-14 17:12:48 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2022-02-15 09:10:59 +0100
commit21ce257b6c62465ac5b4056b0c9f593e3485c0c3 (patch)
tree5798be18ed1c172ebf2582b8506a363c75c8c105 /tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
parentda27a95aab15b949e7498d92b1ab4424856a3c4e (diff)
Repair tst_qcoreapplication to not segfault on Android
tst_qcoreapplication.cpp is used both in tst_qcoreapplication and tst_qguiapplication. To distinguish these two compilations, the define QT_GUI_LIB was used. This led to an error on Android, where Qt::Gui is always linked, because the Qt Android Platform Plugin needs it. This patch introduces the preprocessor define QT_QGUIAPPLICATIONTEST which is to be used only in the compilation of tst_qguiapplication. This is then used instead of QT_GUI_LIB. Change-Id: Ifa5bfacb197d68365288c1da85573106515fc6c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp')
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index fcfd3030d5..6d83371eac 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -123,7 +123,7 @@ void tst_QCoreApplication::getSetCheck()
void tst_QCoreApplication::qAppName()
{
-#ifdef QT_GUI_LIB
+#ifdef QT_QGUIAPPLICATIONTEST
const char* appName = "tst_qguiapplication";
#else
const char* appName = "tst_qcoreapplication";
@@ -1078,7 +1078,7 @@ static void createQObjectOnDestruction()
}
Q_DESTRUCTOR_FUNCTION(createQObjectOnDestruction)
-#ifndef QT_GUI_LIB
+#ifndef QT_QGUIAPPLICATIONTEST
QTEST_APPLESS_MAIN(tst_QCoreApplication)
#endif