QtTestLib: replace QLatin1String uses with _L1/_s/QStringLiteral

Task-number: QTBUG-98434
Change-Id: Ie327fd4af1880002e5a1e09b43384f2b709625e7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Sona Kurazyan 2022-04-26 17:07:00 +02:00 committed by Marc Mutz
parent 34242f843e
commit 7baa06fe0c
7 changed files with 88 additions and 82 deletions

View File

@ -53,6 +53,8 @@
#include <initializer_list> #include <initializer_list>
using namespace Qt::StringLiterals;
// dummy // dummy
class TestBenchmark : public QObject class TestBenchmark : public QObject
{ {
@ -225,8 +227,8 @@ QTest::qSleep(250);
//! [27] //! [27]
void TestBenchmark::simple() void TestBenchmark::simple()
{ {
QString str1 = QLatin1String("This is a test string"); QString str1 = u"This is a test string"_s;
QString str2 = QLatin1String("This is a test string"); QString str2 = u"This is a test string"_s;
QCOMPARE(str1.localeAwareCompare(str2), 0); QCOMPARE(str1.localeAwareCompare(str2), 0);
QBENCHMARK { QBENCHMARK {
str1.localeAwareCompare(str2); str1.localeAwareCompare(str2);

View File

@ -50,6 +50,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
// Returns \c true if valgrind is available. // Returns \c true if valgrind is available.
bool QBenchmarkValgrindUtils::haveValgrind() bool QBenchmarkValgrindUtils::haveValgrind()
{ {
@ -57,7 +59,7 @@ bool QBenchmarkValgrindUtils::haveValgrind()
return false; return false;
#else #else
QProcess process; QProcess process;
process.start(QLatin1String("valgrind"), QStringList(QLatin1String("--version"))); process.start(u"valgrind"_s, QStringList(u"--version"_s));
return process.waitForStarted() && process.waitForFinished(-1); return process.waitForStarted() && process.waitForFinished(-1);
#endif #endif
} }
@ -89,7 +91,7 @@ qint64 QBenchmarkValgrindUtils::extractResult(const QString &fileName)
qint64 val = -1; qint64 val = -1;
bool valSeen = false; bool valSeen = false;
QRegularExpression rxValue(QLatin1String("^summary: (\\d+)")); QRegularExpression rxValue(u"^summary: (\\d+)"_s);
while (!file.atEnd()) { while (!file.atEnd()) {
const QString line(QLatin1String(file.readLine())); const QString line(QLatin1String(file.readLine()));
QRegularExpressionMatch match = rxValue.match(line); QRegularExpressionMatch match = rxValue.match(line);
@ -169,22 +171,20 @@ QString QBenchmarkValgrindUtils::outFileBase(qint64 pid)
bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppArgs, int &exitCode) bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppArgs, int &exitCode)
{ {
const QString &execFile = origAppArgs.at(0); const QString &execFile = origAppArgs.at(0);
QStringList args; QStringList args{ u"--tool=callgrind"_s, u"--instr-atstart=yes"_s,
args << QLatin1String("--tool=callgrind") << QLatin1String("--instr-atstart=yes") u"--quiet"_s, execFile, u"-callgrindchild"_s };
<< QLatin1String("--quiet")
<< execFile << QLatin1String("-callgrindchild");
// pass on original arguments that make sense (e.g. avoid wasting time producing output // pass on original arguments that make sense (e.g. avoid wasting time producing output
// that will be ignored anyway) ... // that will be ignored anyway) ...
for (int i = 1; i < origAppArgs.size(); ++i) { for (int i = 1; i < origAppArgs.size(); ++i) {
const QString &arg = origAppArgs.at(i); const QString &arg = origAppArgs.at(i);
if (arg == QLatin1String("-callgrind")) if (arg == "-callgrind"_L1)
continue; continue;
args << arg; // ok to pass on args << arg; // ok to pass on
} }
QProcess process; QProcess process;
process.start(QLatin1String("valgrind"), args); process.start(u"valgrind"_s, args);
process.waitForStarted(-1); process.waitForStarted(-1);
QBenchmarkGlobalData::current->callgrindOutFileBase = QBenchmarkGlobalData::current->callgrindOutFileBase =
QBenchmarkValgrindUtils::outFileBase(process.processId()); QBenchmarkValgrindUtils::outFileBase(process.processId());

View File

@ -72,6 +72,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
namespace QTest { namespace QTest {
static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type) static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type)
@ -148,9 +150,9 @@ namespace QTest {
template <typename T> QString formatResult(T number, int significantDigits) template <typename T> QString formatResult(T number, int significantDigits)
{ {
if (number < T(0)) if (number < T(0))
return QLatin1String("NAN"); return u"NAN"_s;
if (number == T(0)) if (number == T(0))
return QLatin1String("0"); return u"0"_s;
QString beforeDecimalPoint = QString::number(qint64(number), 'f', 0); QString beforeDecimalPoint = QString::number(qint64(number), 'f', 0);
QString afterDecimalPoint = QString::number(number, 'f', 20); QString afterDecimalPoint = QString::number(number, 'f', 20);
@ -168,7 +170,7 @@ namespace QTest {
int afterUse = significantDigits - beforeUse; int afterUse = significantDigits - beforeUse;
// leading zeroes after the decimal point does not count towards the digit use. // leading zeroes after the decimal point does not count towards the digit use.
if (beforeDecimalPoint == QLatin1String("0") && afterDecimalPoint.isEmpty() == false) { if (beforeDecimalPoint == u'0' && !afterDecimalPoint.isEmpty()) {
++afterUse; ++afterUse;
int i = 0; int i = 0;

View File

@ -48,6 +48,9 @@
#endif #endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
/*! \internal /*! \internal
\class QTapTestLogger \class QTapTestLogger
\inmodule QtTest \inmodule QtTest
@ -316,15 +319,14 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
#if QT_CONFIG(regularexpression) #if QT_CONFIG(regularexpression)
// This is fragile, but unfortunately testlib doesn't plumb // This is fragile, but unfortunately testlib doesn't plumb
// the expected and actual values to the loggers (yet). // the expected and actual values to the loggers (yet).
static QRegularExpression verifyRegex( static QRegularExpression verifyRegex(u"^'(?<actualexpression>.*)' returned "
QLatin1String("^'(?<actualexpression>.*)' returned " "(?<actual>\\w+).+\\((?<message>.*)\\)$"_s);
"(?<actual>\\w+).+\\((?<message>.*)\\)$"));
static QRegularExpression compareRegex( static QRegularExpression compareRegex(
QLatin1String("^(?<message>.*)\n" u"^(?<message>.*)\n"
"\\s*Actual\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n" "\\s*Actual\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n"
"\\s*Expected\\s+\\((?<expectedexpresssion>.*)\\)\\s*: " "\\s*Expected\\s+\\((?<expectedexpresssion>.*)\\)\\s*: "
"(?<expected>.*)$")); "(?<expected>.*)$"_s);
QString descriptionString = QString::fromUtf8(description); QString descriptionString = QString::fromUtf8(description);
QRegularExpressionMatch match = verifyRegex.match(descriptionString); QRegularExpressionMatch match = verifyRegex.match(descriptionString);
@ -333,26 +335,24 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
match = compareRegex.match(descriptionString); match = compareRegex.match(descriptionString);
if (match.hasMatch()) { if (match.hasMatch()) {
QString message = match.captured(QLatin1String("message")); QString message = match.captured(u"message");
QString expected; QString expected;
QString actual; QString actual;
const auto parenthesize = [&match](QLatin1String key) -> QString { const auto parenthesize = [&match](QLatin1String key) -> QString {
return QLatin1String(" (") % match.captured(key) % u')'; return " ("_L1 % match.captured(key) % u')';
}; };
const QString actualExpression const QString actualExpression = parenthesize("actualexpression"_L1);
= parenthesize(QLatin1String("actualexpression"));
if (isVerify) { if (isVerify) {
actual = match.captured(QLatin1String("actual")).toLower() actual = match.captured(u"actual").toLower() % actualExpression;
% actualExpression; expected = (actual.startsWith("true "_L1) ? "false"_L1 : "true"_L1)
expected = QLatin1String(actual.startsWith(QLatin1String("true ")) % actualExpression;
? "false" : "true") % actualExpression;
if (message.isEmpty()) if (message.isEmpty())
message = QLatin1String("Verification failed"); message = u"Verification failed"_s;
} else { } else {
expected = match.captured(QLatin1String("expected")) expected = match.captured(u"expected")
% parenthesize(QLatin1String("expectedexpresssion")); % parenthesize("expectedexpresssion"_L1);
actual = match.captured(QLatin1String("actual")) % actualExpression; actual = match.captured(u"actual") % actualExpression;
} }
QTestCharBuffer diagnosticsYamlish; QTestCharBuffer diagnosticsYamlish;

View File

@ -50,6 +50,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
namespace QTest { namespace QTest {
static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type) static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type)
@ -119,13 +121,13 @@ void QTeamCityLogger::startLogging()
flowID = tcEscapedString(QString::fromUtf8(QTestResult::currentTestObjectName())); flowID = tcEscapedString(QString::fromUtf8(QTestResult::currentTestObjectName()));
QString str = QLatin1String("##teamcity[testSuiteStarted name='%1' flowId='%1']\n").arg(flowID); QString str = "##teamcity[testSuiteStarted name='%1' flowId='%1']\n"_L1.arg(flowID);
outputString(qPrintable(str)); outputString(qPrintable(str));
} }
void QTeamCityLogger::stopLogging() void QTeamCityLogger::stopLogging()
{ {
QString str = QLatin1String("##teamcity[testSuiteFinished name='%1' flowId='%1']\n").arg(flowID); QString str = "##teamcity[testSuiteFinished name='%1' flowId='%1']\n"_L1.arg(flowID);
outputString(qPrintable(str)); outputString(qPrintable(str));
QAbstractTestLogger::stopLogging(); QAbstractTestLogger::stopLogging();
@ -153,7 +155,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
QString tmpFuncName = escapedTestFuncName(); QString tmpFuncName = escapedTestFuncName();
if (tmpFuncName != currTestFuncName) { if (tmpFuncName != currTestFuncName) {
buf = QLatin1String("##teamcity[testStarted name='%1' flowId='%2']\n").arg(tmpFuncName, flowID); buf = "##teamcity[testStarted name='%1' flowId='%2']\n"_L1.arg(tmpFuncName, flowID);
outputString(qPrintable(buf)); outputString(qPrintable(buf));
} }
@ -168,27 +170,27 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
// Test failed // Test failed
if (type == Fail || type == XPass) { if (type == Fail || type == XPass) {
QString messageText(QLatin1String("Failure!")); QString messageText(u"Failure!"_s);
if (file) if (file)
messageText += QLatin1String(" |[Loc: %1(%2)|]").arg(QString::fromUtf8(file)).arg(line); messageText += " |[Loc: %1(%2)|]"_L1.arg(QString::fromUtf8(file)).arg(line);
buf = QLatin1String("##teamcity[testFailed name='%1' message='%2' details='%3' flowId='%4']\n") buf = "##teamcity[testFailed name='%1' message='%2' details='%3' flowId='%4']\n"_L1
.arg(tmpFuncName, messageText, detailedText, flowID); .arg(tmpFuncName, messageText, detailedText, flowID);
outputString(qPrintable(buf)); outputString(qPrintable(buf));
} else if (type == Skip) { } else if (type == Skip) {
if (file) if (file)
detailedText.append(QLatin1String(" |[Loc: %1(%2)|]").arg(QString::fromUtf8(file)).arg(line)); detailedText.append(" |[Loc: %1(%2)|]"_L1.arg(QString::fromUtf8(file)).arg(line));
buf = QLatin1String("##teamcity[testIgnored name='%1' message='%2' flowId='%3']\n") buf = "##teamcity[testIgnored name='%1' message='%2' flowId='%3']\n"_L1
.arg(escapedTestFuncName(), detailedText, flowID); .arg(escapedTestFuncName(), detailedText, flowID);
outputString(qPrintable(buf)); outputString(qPrintable(buf));
} }
if (!pendingMessages.isEmpty()) { if (!pendingMessages.isEmpty()) {
buf = QLatin1String("##teamcity[testStdOut name='%1' out='%2' flowId='%3']\n") buf = "##teamcity[testStdOut name='%1' out='%2' flowId='%3']\n"_L1
.arg(tmpFuncName, pendingMessages, flowID); .arg(tmpFuncName, pendingMessages, flowID);
outputString(qPrintable(buf)); outputString(qPrintable(buf));
@ -196,7 +198,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
pendingMessages.clear(); pendingMessages.clear();
} }
buf = QLatin1String("##teamcity[testFinished name='%1' flowId='%2']\n").arg(tmpFuncName, flowID); buf = "##teamcity[testFinished name='%1' flowId='%2']\n"_L1.arg(tmpFuncName, flowID);
outputString(qPrintable(buf)); outputString(qPrintable(buf));
} }
@ -223,22 +225,22 @@ QString QTeamCityLogger::tcEscapedString(const QString &str) const
for (QChar ch : str) { for (QChar ch : str) {
switch (ch.toLatin1()) { switch (ch.toLatin1()) {
case '\n': case '\n':
formattedString.append(QLatin1String("|n")); formattedString.append("|n"_L1);
break; break;
case '\r': case '\r':
formattedString.append(QLatin1String("|r")); formattedString.append("|r"_L1);
break; break;
case '|': case '|':
formattedString.append(QLatin1String("||")); formattedString.append("||"_L1);
break; break;
case '[': case '[':
formattedString.append(QLatin1String("|[")); formattedString.append("|["_L1);
break; break;
case ']': case ']':
formattedString.append(QLatin1String("|]")); formattedString.append("|]"_L1);
break; break;
case '\'': case '\'':
formattedString.append(QLatin1String("|'")); formattedString.append("|'"_L1);
break; break;
default: default:
formattedString.append(ch); formattedString.append(ch);
@ -262,16 +264,16 @@ void QTeamCityLogger::addPendingMessage(const char *type, const QString &msg, co
QString pendMessage; QString pendMessage;
if (!pendingMessages.isEmpty()) if (!pendingMessages.isEmpty())
pendMessage += QLatin1String("|n"); pendMessage += "|n"_L1;
if (file) { if (file) {
pendMessage += QLatin1String("%1 |[Loc: %2(%3)|]: %4") pendMessage += "%1 |[Loc: %2(%3)|]: %4"_L1
.arg(QString::fromUtf8(type), QString::fromUtf8(file)) .arg(QString::fromUtf8(type), QString::fromUtf8(file))
.arg(line) .arg(line)
.arg(msg); .arg(msg);
} else { } else {
pendMessage += QLatin1String("%1: %2").arg(QString::fromUtf8(type), msg); pendMessage += "%1: %2"_L1.arg(QString::fromUtf8(type), msg);
} }
pendingMessages.append(pendMessage); pendingMessages.append(pendMessage);

View File

@ -404,7 +404,7 @@ inline char *toString(const std::tuple<Types...> &tuple)
inline char *toString(std::nullptr_t) inline char *toString(std::nullptr_t)
{ {
return toString(QLatin1String("nullptr")); return toString(QStringLiteral("nullptr"));
} }
template<> template<>

View File

@ -125,6 +125,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
using QtMiscUtils::toHexUpper; using QtMiscUtils::toHexUpper;
using QtMiscUtils::fromHex; using QtMiscUtils::fromHex;
@ -298,7 +300,8 @@ namespace QTest
QString Internal::formatTryTimeoutDebugMessage(q_no_char8_t::QUtf8StringView expr, int timeout, int actual) QString Internal::formatTryTimeoutDebugMessage(q_no_char8_t::QUtf8StringView expr, int timeout, int actual)
{ {
return QLatin1String("QTestLib: This test case check (\"%1\") failed because the requested timeout (%2 ms) was too short, %3 ms would have been sufficient this time.") return "QTestLib: This test case check (\"%1\") failed because the requested timeout (%2 ms) "
"was too short, %3 ms would have been sufficient this time."_L1
// ### Qt 7: remove the toString() (or earlier, when arg() can handle QUtf8StringView), passing the view directly // ### Qt 7: remove the toString() (or earlier, when arg() can handle QUtf8StringView), passing the view directly
.arg(expr.toString(), QString::number(timeout), QString::number(actual)); .arg(expr.toString(), QString::number(timeout), QString::number(actual));
} }
@ -1066,7 +1069,7 @@ class WatchDog : public QThread
public: public:
WatchDog() WatchDog()
{ {
setObjectName(QLatin1String("QtTest Watchdog")); setObjectName("QtTest Watchdog"_L1);
auto locker = qt_unique_lock(mutex); auto locker = qt_unique_lock(mutex);
expecting.store(ThreadStart, std::memory_order_relaxed); expecting.store(ThreadStart, std::memory_order_relaxed);
start(); start();
@ -1154,7 +1157,7 @@ bool TestMethods::invokeTest(int index, QLatin1String tag, WatchDog *watchDog) c
QBenchmarkTestMethodData::current = &benchmarkData; QBenchmarkTestMethodData::current = &benchmarkData;
const QByteArray &name = m_methods[index].name(); const QByteArray &name = m_methods[index].name();
QBenchmarkGlobalData::current->context.slotName = QLatin1String(name) + QLatin1String("()"); QBenchmarkGlobalData::current->context.slotName = QLatin1String(name) + "()"_L1;
char member[512]; char member[512];
QTestTable table; QTestTable table;
@ -2300,8 +2303,8 @@ void QTest::failOnWarning(const QRegularExpression &messagePattern)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
static inline bool isWindowsBuildDirectory(const QString &dirName) static inline bool isWindowsBuildDirectory(const QString &dirName)
{ {
return dirName.compare(QLatin1String("Debug"), Qt::CaseInsensitive) == 0 return dirName.compare("Debug"_L1, Qt::CaseInsensitive) == 0
|| dirName.compare(QLatin1String("Release"), Qt::CaseInsensitive) == 0; || dirName.compare("Release"_L1, Qt::CaseInsensitive) == 0;
} }
#endif #endif
@ -2392,10 +2395,9 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
#endif // Q_OS_WIN #endif // Q_OS_WIN
else if (QTestLog::verboseLevel() >= 2) { else if (QTestLog::verboseLevel() >= 2) {
const QString candidate = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + u'/' + base); const QString candidate = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + u'/' + base);
QTestLog::info(qPrintable( QTestLog::info(qPrintable("testdata %1 not found relative to test binary [%2]; "
QLatin1String("testdata %1 not found relative to test binary [%2]; " "checking next location"_L1.arg(base, candidate)),
"checking next location").arg(base, candidate)), file, line);
file, line);
} }
} }
@ -2404,16 +2406,15 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
const char *testObjectName = QTestResult::currentTestObjectName(); const char *testObjectName = QTestResult::currentTestObjectName();
if (testObjectName) { if (testObjectName) {
const QString testsPath = QLibraryInfo::path(QLibraryInfo::TestsPath); const QString testsPath = QLibraryInfo::path(QLibraryInfo::TestsPath);
const QString candidate = QLatin1String("%1/%2/%3") const QString candidate = "%1/%2/%3"_L1
.arg(testsPath, QFile::decodeName(testObjectName).toLower(), base); .arg(testsPath, QFile::decodeName(testObjectName).toLower(), base);
if (QFileInfo::exists(candidate)) { if (QFileInfo::exists(candidate)) {
found = candidate; found = candidate;
} else if (QTestLog::verboseLevel() >= 2) { } else if (QTestLog::verboseLevel() >= 2) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable("testdata %1 not found in tests install path [%2]; "
QLatin1String("testdata %1 not found in tests install path [%2]; " "checking next location"_L1
"checking next location") .arg(base, QDir::toNativeSeparators(candidate))),
.arg(base, QDir::toNativeSeparators(candidate))), file, line);
file, line);
} }
} }
} }
@ -2425,17 +2426,16 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
// If the srcdir is relative, that means it is relative to the current working // If the srcdir is relative, that means it is relative to the current working
// directory of the compiler at compile time, which should be passed in as `builddir'. // directory of the compiler at compile time, which should be passed in as `builddir'.
if (!srcdir.isAbsolute() && builddir) { if (!srcdir.isAbsolute() && builddir)
srcdir.setFile(QFile::decodeName(builddir) + QLatin1String("/") + srcdir.filePath()); srcdir.setFile(QFile::decodeName(builddir) + u'/' + srcdir.filePath());
}
const QString canonicalPath = srcdir.canonicalFilePath(); const QString canonicalPath = srcdir.canonicalFilePath();
const QString candidate = QLatin1String("%1/%2").arg(canonicalPath, base); const QString candidate = "%1/%2"_L1.arg(canonicalPath, base);
if (!canonicalPath.isEmpty() && QFileInfo::exists(candidate)) { if (!canonicalPath.isEmpty() && QFileInfo::exists(candidate)) {
found = candidate; found = candidate;
} else if (QTestLog::verboseLevel() >= 2) { } else if (QTestLog::verboseLevel() >= 2) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable(
QLatin1String("testdata %1 not found relative to source path [%2]") "testdata %1 not found relative to source path [%2]"_L1
.arg(base, QDir::toNativeSeparators(candidate))), .arg(base, QDir::toNativeSeparators(candidate))),
file, line); file, line);
} }
@ -2443,12 +2443,12 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
// 4. Try resources // 4. Try resources
if (found.isEmpty()) { if (found.isEmpty()) {
const QString candidate = QLatin1String(":/%1").arg(base); const QString candidate = ":/%1"_L1.arg(base);
if (QFileInfo::exists(candidate)) { if (QFileInfo::exists(candidate)) {
found = candidate; found = candidate;
} else if (QTestLog::verboseLevel() >= 2) { } else if (QTestLog::verboseLevel() >= 2) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable(
QLatin1String("testdata %1 not found in resources [%2]") "testdata %1 not found in resources [%2]"_L1
.arg(base, QDir::toNativeSeparators(candidate))), .arg(base, QDir::toNativeSeparators(candidate))),
file, line); file, line);
} }
@ -2461,7 +2461,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
found = candidate; found = candidate;
} else if (QTestLog::verboseLevel() >= 2) { } else if (QTestLog::verboseLevel() >= 2) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable(
QLatin1String("testdata %1 not found in current directory [%2]") "testdata %1 not found in current directory [%2]"_L1
.arg(base, QDir::toNativeSeparators(candidate))), .arg(base, QDir::toNativeSeparators(candidate))),
file, line); file, line);
} }
@ -2474,7 +2474,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
found = candidate; found = candidate;
} else if (QTestLog::verboseLevel() >= 2) { } else if (QTestLog::verboseLevel() >= 2) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable(
QLatin1String("testdata %1 not found in main source directory [%2]") "testdata %1 not found in main source directory [%2]"_L1
.arg(base, QDir::toNativeSeparators(candidate))), .arg(base, QDir::toNativeSeparators(candidate))),
file, line); file, line);
} }
@ -2487,7 +2487,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
found = candidate; found = candidate;
} else if (QTestLog::verboseLevel() >= 2) { } else if (QTestLog::verboseLevel() >= 2) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable(
QLatin1String("testdata %1 not found in supplied source directory [%2]") "testdata %1 not found in supplied source directory [%2]"_L1
.arg(base, QDir::toNativeSeparators(candidate))), .arg(base, QDir::toNativeSeparators(candidate))),
file, line); file, line);
} }
@ -2496,11 +2496,11 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
if (found.isEmpty()) { if (found.isEmpty()) {
QTestLog::warn(qPrintable( QTestLog::warn(qPrintable(
QLatin1String("testdata %1 could not be located!").arg(base)), "testdata %1 could not be located!"_L1.arg(base)),
file, line); file, line);
} else if (QTestLog::verboseLevel() >= 1) { } else if (QTestLog::verboseLevel() >= 1) {
QTestLog::info(qPrintable( QTestLog::info(qPrintable(
QLatin1String("testdata %1 was located at %2").arg(base, QDir::toNativeSeparators(found))), "testdata %1 was located at %2"_L1.arg(base, QDir::toNativeSeparators(found))),
file, line); file, line);
} }