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>
This commit is contained in:
Marc Mutz 2021-11-23 08:55:57 +01:00
parent 5eda43de89
commit 0347b4ee5e

View File

@ -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,