Skip to content

Commit

Permalink
Fix warning from testing assignment
Browse files Browse the repository at this point in the history
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.

Pick-to: 6.4
Change-Id: I4a4b0161c4e16c0e1e27a68f33a41efdaa2c962c
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
vohi committed Sep 3, 2022
1 parent 54ea627 commit b05a276
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/testlib/qtestcase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))); \
} \
Expand Down

0 comments on commit b05a276

Please sign in to comment.