From 90d340a0712a7cbd7d45350c37481e7eb9772a1c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 21 Dec 2022 13:56:17 -0300 Subject: [PATCH] tst_qlogging: fix preprocessor directives Reorganize them and fix the comment. Change-Id: I69ecc04064514f939896fffd1732dd57203cb21f Reviewed-by: Volker Hilsheimer (cherry picked from commit 5aa66034c2c81e62bdd159e32a3226f8971089a7) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 1b80287250c..efe8d8b3087 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -716,17 +716,17 @@ void tst_qmessagehandler::qMessagePattern_data() #define BACKTRACE_HELPER_NAME "qlogging_helper" -#ifdef __GLIBC__ #ifdef QT_NAMESPACE #define QT_NAMESPACE_STR QT_STRINGIFY(QT_NAMESPACE::) #else #define QT_NAMESPACE_STR "" #endif -#if QT_CONFIG(static) +#ifdef __GLIBC__ +# if QT_CONFIG(static) QSKIP("These test cases don't work with static Qt builds"); -#else -#ifndef QT_NO_DEBUG +# else +# ifndef QT_NO_DEBUG QList expectedBacktrace = { // MyClass::qt_static_metacall is explicitly marked as hidden in the // Q_OBJECT macro hence the ?helper? frame @@ -740,14 +740,13 @@ void tst_qmessagehandler::qMessagePattern_data() "|" QT_NAMESPACE_STR "QMetaObject::invokeMethodImpl] from_a_function 34" }; QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << expectedBacktrace; -#endif +# endif QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList() << "[MyClass::myFunction\nMyClass::mySlot1] from_a_function 34" << "[T::T\n"); -#endif // #if !QT_CONFIG(process) +# endif // #if !QT_CONFIG(static) #endif // #ifdef __GLIBC__ - }