From 2b3782132f71945fcecf090669c9501aca7d727a Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Wed, 27 Apr 2022 14:12:03 +0200 Subject: [PATCH] QTestLog: simplify construction of a log message Change-Id: I055efa45ec468cae43a38a9746a47af0382ca8c1 Reviewed-by: Marc Mutz --- src/testlib/qtestlog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index e87527e57aa..bba1a06e041 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -75,6 +75,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static void saveCoverageTool(const char * appname, bool testfailed, bool installedTestCoverage) { #ifdef __COVERAGESCANNER__ @@ -328,10 +330,11 @@ void QTestLog::printUnhandledIgnoreMessages() QTest::IgnoreResultList *list = QTest::ignoreResultList; while (list) { if (list->pattern.userType() == QMetaType::QString) { - message = QStringLiteral("Did not receive message: \"") + list->pattern.toString() + u'"'; + message = "Did not receive message: \"%1\""_L1.arg(list->pattern.toString()); } else { #if QT_CONFIG(regularexpression) - message = QStringLiteral("Did not receive any message matching: \"") + list->pattern.toRegularExpression().pattern() + u'"'; + message = "Did not receive any message matching: \"%1\""_L1.arg( + list->pattern.toRegularExpression().pattern()); #endif } FOREACH_TEST_LOGGER