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,7 +31,6 @@ 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") \
@@ -43,5 +42,4 @@ constexpr unexpected<std::decay_t<E>> make_unexpected(E &&e)
action; \
} \
do { \
} while (0); \
}
} while (0)

View File

@@ -180,7 +180,7 @@ static bool copyScriptTemplates(const SuiteConf &suiteConf, const Utils::FilePat
const Utils::FilePath testFile = destination.pathAppended("test" + extension);
QTC_ASSERT(!testFile.exists(), return false);
const Utils::expected_str<void> result = test.copyFile(testFile);
QTC_ASSERT_EXPECTED(result, return false)
QTC_ASSERT_EXPECTED(result, return false);
if (scripted)
ok = suiteConf.ensureObjectMapExists();