diff options
author | Marc Mutz <marc.mutz@qt.io> | 2021-11-23 08:55:57 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2021-11-23 21:23:41 +0100 |
commit | 0347b4ee5e5cabe6c3de6effa400494462dda10d (patch) | |
tree | 4d3aa82136db9005b8ec988a8e9860a1eb01b67e /src/testlib/qtestcase.h | |
parent | 5eda43de89d936a0261949519a0653a66e82b03b (diff) |
QTest: mark qFail() as cold
Unit tests should not fail, so a call to qFail() is by definition
exceptional. Therefore, mark the function as cold. It probably doesn't
matter in the grand scheme of things, but it also doesn't cost much.
Change-Id: I0cafcfa65ff285812155d0687deded8d26cf4efd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib/qtestcase.h')
-rw-r--r-- | src/testlib/qtestcase.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 1541afc084..03667a72a1 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -307,6 +307,7 @@ namespace QTest Q_TESTLIB_EXPORT bool qVerify(bool statement, const char *statementStr, const char *description, const char *file, int line); + Q_DECL_COLD_FUNCTION Q_TESTLIB_EXPORT void qFail(const char *message, const char *file, int line); Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line); Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode, |