From 9c3ab9a17e44135f0c90340e28516491e3b42e59 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 1 Aug 2024 09:51:00 +0200 Subject: [PATCH] QPROPERTY_TEST_COMPARISON_HELPER: fix extra leading \n in failure output Once we ported the formatting to use formatFailMessage() in aa8a4be9e9eae82b6c6b8875371114dbfb3ec06a, it became apparent that the output contained an extra leading newline compared QCOMPARE use of formatFailMessage(). We kept the newline in the patch that was picked to older branches. Since this is a stylistic discrepancy, though, standardize on no leading newline going forward. Change-Id: I4badf700900a106d835f3f72e92441d8a8912ff7 Reviewed-by: Ivan Solovev (cherry picked from commit 4bc81fe5d1d1e4587075a82a45be9b34825b5233) Reviewed-by: Qt Cherry-pick Bot --- src/testlib/qtestresult.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index b4e50499267..0e1c9d7ad95 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -372,7 +372,7 @@ QTest::Internal::formatPropertyTestHelperFailure(char *msg, size_t maxMsgLen, const char *actual, const char *expected, const char *actualExpr, const char *expectedExpr) { - formatFailMessage(msg, maxMsgLen, "\nComparison failed!", // ### why leading \n? + formatFailMessage(msg, maxMsgLen, "Comparison failed!", actual, expected, actualExpr, expectedExpr, QTest::ComparisonOperation::CustomCompare); return msg;