summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp2
-rw-r--r--src/testlib/qtestlog.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 35fad9e708..57beed3c7c 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2133,7 +2133,7 @@ QSharedPointer<QTemporaryDir> QTest::qExtractTestData(const QString &dirName)
QFileInfo fileInfo = it.fileInfo();
if (!fileInfo.isDir()) {
- const QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().midRef(resourcePath.length());
+ const QString destination = dataPath + QLatin1Char('/') + QStringView{fileInfo.filePath()}.mid(resourcePath.length());
QFileInfo destinationFileInfo(destination);
QDir().mkpath(destinationFileInfo.path());
if (!QFile::copy(fileInfo.filePath(), destination)) {
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index be50176a08..f831b51a53 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -144,7 +144,7 @@ namespace QTest {
// (the space was added automatically by ~QDebug() until Qt 5.3,
// so autotests still might expect it)
if (expected.endsWith(QLatin1Char(' ')))
- return actual == expected.leftRef(expected.length() - 1);
+ return actual == QStringView{expected}.left(expected.length() - 1);
return false;
}