From 0347b4ee5e5cabe6c3de6effa400494462dda10d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 23 Nov 2021 08:55:57 +0100 Subject: [PATCH] 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 Reviewed-by: Edward Welbourne --- src/testlib/qtestcase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 1541afc0846..03667a72a16 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,