diff options
author | Marc Mutz <[email protected]> | 2024-01-10 10:32:33 +0100 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2024-01-25 11:35:52 +0100 |
commit | 557275301edfc23a6d2f97a44e6b142790d9059c (patch) | |
tree | 9d27d55a85ad39d16b92c8081812d97d888c1b82 /src/testlib/qtestcase.cpp | |
parent | 711def1290439d19e7ed9068704bb2160edab968 (diff) |
QTest: replace naked returns with QTEST_{FAIL,SKIP}_ACTION macros
... defaulting to "return".
This allows customizing these actions, incl. to eventually make them
throwing exceptions instead (but that won't work for
QVERIFY_THROWS_EXCEPTION, yet).
Change-Id: I078a4ce48135bda2cf98fce78318a12d757d7aa5
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Friedemann Kleint <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r-- | src/testlib/qtestcase.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index fd47db3f553..9a5c088a6e1 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2627,11 +2627,11 @@ void QTest::qCaught(const char *expected, const char *what, const char *file, in If the exception inherits std::exception, its what() message is logged and this function returns normally. The caller of this function must then - execute a \c{return} to exit from the test function. + execute a \c{QTEST_FAIL_ACTION} to exit from the test function. Otherwise, a message saying an unknown exception was caught is logged and - this function rethrows the exception, skipping the \c{return} that follows - this function call in the caller. + this function rethrows the exception, skipping the \c{QTEST_FAIL_ACTION} + that follows this function call in the caller. */ void QTest::qCaught(const char *expected, const char *file, int line) { @@ -2644,7 +2644,7 @@ void QTest::qCaught(const char *expected, const char *file, int line) qCaught(expected, nullptr, file, line); throw; } - // caller shall invoke `return` if control reached here + // caller shall invoke `QTEST_FAIL_ACTION` if control reached here } |