summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-03 11:48:39 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-04 07:17:30 +0000
commit6806192e87bed03d7c9d96168509ae2cd3a10629 (patch)
tree9bfd0b8966a4eb573cef83a9adc147de0fd59617
parent5b2924b4b0ff0df70f3937bbfe310e90e6788242 (diff)
Fix warning from testing assignment
Tests that do QTRY_VERIFY(a = b); generate a compiler warning: using the result of an assignment as a condition without parentheses [-Wparentheses]: place parentheses around the assignment to silence this warning Do that centrally in the QTRY_TIMEOUT_DEBUG_IMPL macro definition. Change-Id: I4a4b0161c4e16c0e1e27a68f33a41efdaa2c962c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b05a2768c2fb166bdca8f05a6833409fe5a40ee6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/testlib/qtestcase.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index a0df8dd305..dd0599e196 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -168,7 +168,7 @@ inline void useVerifyThrowsException() {}
#define QTRY_TIMEOUT_DEBUG_IMPL(expr, timeoutValue, step) \
if (!QTest::currentTestFailed() && !(expr)) { \
QTRY_LOOP_IMPL(expr, 2 * (timeoutValue), step) \
- if (expr) { \
+ if ((expr)) { \
QFAIL(qPrintable(QTest::Internal::formatTryTimeoutDebugMessage(\
u8"" #expr, timeoutValue, timeoutValue + qt_test_i))); \
} \