diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-01-11 09:25:47 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@qt.io> | 2023-01-14 22:09:58 +0100 |
commit | 1544f245bb22194a22c6eeb75d3b99b82cee15c1 (patch) | |
tree | 4ce6fbeaf1a2b0b28ee2f98956efdc0bff16e2c0 /tests | |
parent | 5685962e60273b80b3b47735d86d665b518b5066 (diff) | |
download | qtapplicationmanager-1544f245bb22194a22c6eeb75d3b99b82cee15c1.tar.gz |
Port from qAsConst to std::as_const
QT_NO_AS_CONST is now globally enabled in qtbase.
Pick-to: 6.5
Change-Id: Ifc2eab1c902e75f5dbfc38ef9a62b29b5c91bc61
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/configuration/tst_configuration.cpp | 2 | ||||
-rw-r--r-- | tests/auto/debugwrapper/tst_debugwrapper.cpp | 8 | ||||
-rw-r--r-- | tests/auto/packagecreator/tst_packagecreator.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/configuration/tst_configuration.cpp b/tests/auto/configuration/tst_configuration.cpp index 2c34c211..56eed174 100644 --- a/tests/auto/configuration/tst_configuration.cpp +++ b/tests/auto/configuration/tst_configuration.cpp @@ -423,7 +423,7 @@ void tst_Configuration::commandLineConfig() << "main-cl.qml"; QStringList strCommandLine; - for (const auto &c : qAsConst(commandLine)) + for (const auto &c : std::as_const(commandLine)) strCommandLine << QString::fromLatin1(c); c.parseWithArguments(strCommandLine); diff --git a/tests/auto/debugwrapper/tst_debugwrapper.cpp b/tests/auto/debugwrapper/tst_debugwrapper.cpp index 7798a748..769ebd3e 100644 --- a/tests/auto/debugwrapper/tst_debugwrapper.cpp +++ b/tests/auto/debugwrapper/tst_debugwrapper.cpp @@ -87,7 +87,7 @@ void tst_DebugWrapper::specification() for (auto it = env.cbegin(); it != env.cend(); ++it) strEnv.insert(QString::fromLatin1(it.key()), QString::fromLatin1(it.value())); - for (const auto &c : qAsConst(cmd)) + for (const auto &c : std::as_const(cmd)) strCmd << QString::fromLatin1(c); QCOMPARE(DebugWrapper::parseSpecification(spec, resultCmd, resultEnv), valid); @@ -127,11 +127,11 @@ void tst_DebugWrapper::substitute() QFETCH(QByteArrayList, result); QStringList strCmd, strArguments, strResult; - for (const auto &c : qAsConst(cmd)) + for (const auto &c : std::as_const(cmd)) strCmd << QString::fromLatin1(c); - for (const auto &a : qAsConst(arguments)) + for (const auto &a : std::as_const(arguments)) strArguments << QString::fromLatin1(a); - for (const auto &r : qAsConst(result)) + for (const auto &r : std::as_const(result)) strResult << QString::fromLatin1(r); QCOMPARE(DebugWrapper::substituteCommand(strCmd, program, strArguments), strResult); diff --git a/tests/auto/packagecreator/tst_packagecreator.cpp b/tests/auto/packagecreator/tst_packagecreator.cpp index 50eda7f5..304d883e 100644 --- a/tests/auto/packagecreator/tst_packagecreator.cpp +++ b/tests/auto/packagecreator/tst_packagecreator.cpp @@ -123,7 +123,7 @@ void tst_PackageCreator::createAndVerify() // check the contents of the files - for (const QString &file : qAsConst(files)) { + for (const QString &file : std::as_const(files)) { QFile src(m_baseDir.absoluteFilePath(file)); QVERIFY2(src.open(QFile::ReadOnly), qPrintable(src.errorString())); QByteArray data = src.readAll(); |