Utils: Enforce use of semicolon after QTC_ASSERT_EXPECTED

Change-Id: I2fe6b60434f251e4abf7a13a535844a10f99c6a3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-01-10 08:01:50 +01:00
parent bf9e2110e6
commit ad2013eee5
2 changed files with 13 additions and 15 deletions

View File

@@ -31,17 +31,15 @@ constexpr unexpected<std::decay_t<E>> make_unexpected(E &&e)
//! If 'expected' has an error the error will be printed and the 'action' will be executed.
#define QTC_ASSERT_EXPECTED(expected, action) \
{ \
if (Q_LIKELY(expected)) { \
} else { \
::Utils::writeAssertLocation(QString("%1:%2: %3") \
.arg(__FILE__) \
.arg(__LINE__) \
.arg(expected.error()) \
.toUtf8() \
.data()); \
action; \
} \
do { \
} while (0); \
}
if (Q_LIKELY(expected)) { \
} else { \
::Utils::writeAssertLocation(QString("%1:%2: %3") \
.arg(__FILE__) \
.arg(__LINE__) \
.arg(expected.error()) \
.toUtf8() \
.data()); \
action; \
} \
do { \
} while (0)