aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2022-10-06 11:30:50 +0200
committerMarc Mutz <[email protected]>2022-10-07 23:38:56 +0200
commitc2d490a2385ea6f389340a296acaac0fa198c8b9 (patch)
tree5bc4dc681c9a9501cb9b2f39b8a1ab6e3d76ccfd /tests/benchmarks
parent958cd3ee1094a068b6d0ff27c73a4b3caff088ad (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 <[email protected]>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/particles/affectors/tst_affectors.cpp4
-rw-r--r--tests/benchmarks/particles/emission/tst_emission.cpp2
-rw-r--r--tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/benchmarks/particles/affectors/tst_affectors.cpp b/tests/benchmarks/particles/affectors/tst_affectors.cpp
index abce304f9a..172d986186 100644
--- a/tests/benchmarks/particles/affectors/tst_affectors.cpp
+++ b/tests/benchmarks/particles/affectors/tst_affectors.cpp
@@ -66,7 +66,7 @@ void tst_affectors::test_basic()
int stillAlive = 0;
QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 1000, 10));//Small simulation variance is permissible.
- for (QQuickParticleData *d : qAsConst(system->groupData[0]->data)) {
+ for (QQuickParticleData *d : std::as_const(system->groupData[0]->data)) {
if (d->t == -1)
continue; //Particle data unused
@@ -106,7 +106,7 @@ void tst_affectors::test_filtered()
int stillAlive = 0;
QVERIFY(extremelyFuzzyCompare(system->groupData[1]->size(), 1000, 10));//Small simulation variance is permissible.
- for (QQuickParticleData *d : qAsConst(system->groupData[1]->data)) {
+ for (QQuickParticleData *d : std::as_const(system->groupData[1]->data)) {
if (d->t == -1)
continue; //Particle data unused
diff --git a/tests/benchmarks/particles/emission/tst_emission.cpp b/tests/benchmarks/particles/emission/tst_emission.cpp
index 155e2c6cff..875906ad45 100644
--- a/tests/benchmarks/particles/emission/tst_emission.cpp
+++ b/tests/benchmarks/particles/emission/tst_emission.cpp
@@ -54,7 +54,7 @@ void tst_emission::test_basic()
int stillAlive = 0;
QVERIFY(extremelyFuzzyCompare(system->groupData[0]->size(), 1000, 10));//Small simulation variance is permissible.
- for (QQuickParticleData *d : qAsConst(system->groupData[0]->data)) {
+ for (QQuickParticleData *d : std::as_const(system->groupData[0]->data)) {
if (d->t == -1)
continue; //Particle data unused
diff --git a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
index dbda2048b4..3bf1cb0802 100644
--- a/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/quickcontrols2/objectcount/tst_objectcount.cpp
@@ -89,7 +89,7 @@ static void doBenchmark(QQmlEngine *engine, const QUrl &url)
QVERIFY2(object.data(), qPrintable(component.errorString()));
QObjectList objects;
- for (QObject *object : qAsConst(*qt_qobjects())) {
+ for (QObject *object : std::as_const(*qt_qobjects())) {
if (qobject_cast<T *>(object))
objects += object;
}