diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-06 11:30:50 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-07 23:38:56 +0200 |
commit | c2d490a2385ea6f389340a296acaac0fa198c8b9 (patch) | |
tree | 5bc4dc681c9a9501cb9b2f39b8a1ab6e3d76ccfd /tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp | |
parent | 958cd3ee1094a068b6d0ff27c73a4b3caff088ad (diff) |
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp')
-rw-r--r-- | tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp index 79f27aee9c..f50b390fa9 100644 --- a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp +++ b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp @@ -181,17 +181,17 @@ bool Test262Runner::report() } if (!crashes.isEmpty()) { qDebug() << " Encountered" << crashes.size() << "crashes in the following files:"; - for (const QString &f : qAsConst(crashes)) + for (const QString &f : std::as_const(crashes)) qDebug() << " " << f; } if (!unexpectedFailures.isEmpty()) { qDebug() << " Encountered" << unexpectedFailures.size() << "unexpected failures in the following files:"; - for (const QString &f : qAsConst(unexpectedFailures)) + for (const QString &f : std::as_const(unexpectedFailures)) qDebug() << " " << f; } if (!unexpectedPasses.isEmpty()) { qDebug() << " Encountered" << unexpectedPasses.size() << "unexpected passes in the following files:"; - for (const QString &f : qAsConst(unexpectedPasses)) + for (const QString &f : std::as_const(unexpectedPasses)) qDebug() << " " << f; } return crashes.isEmpty() && unexpectedFailures.isEmpty() && unexpectedPasses.isEmpty(); @@ -464,7 +464,7 @@ void Test262Runner::writeTestExpectations() QTemporaryFile expectations; expectations.open(); - for (auto c : qAsConst(testCases)) { + for (auto c : std::as_const(testCases)) { TestExpectationLine line = TestExpectationLine::fromTestCase(c); expectations.write(line.toLine()); } @@ -709,7 +709,7 @@ TestData Test262Runner::getTestData(const TestCase &testCase) data.harness += harness("assert.js"); data.harness += harness("sta.js"); - for (QByteArray inc : qAsConst(data.includes)) { + for (QByteArray inc : std::as_const(data.includes)) { inc = inc.trimmed(); data.harness += harness(inc); } |