summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-05 19:11:29 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-11-05 09:53:32 +0200
commite99b0016e8b639e40d5330e0c3eaa199b48e34f4 (patch)
tree7683f74b1974b7e674404abe20ebf8943acf253c /tests/auto/corelib
parent43c964b8ada63942b5d239f60fdbca6f5773f678 (diff)
Eradicate Q_FOREACHs over QVarLengthArray
There is no excuse for copying several KiBs of data just to iterate over it, yet that's exactly what Q_FOREACH does. Besides, this use of Q_FOREACH is being deprecated. In my tree, it's already a hard error. Change-Id: I07240c37626f7d284781e8c4be05eef3c7a54f39 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp6
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp2
2 files changed, 1 insertions, 7 deletions
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index 507b2e8d78..5ba8545b61 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -3484,9 +3484,6 @@ void tst_Collections::foreach_2()
QCOMPARE(varl1.count(), intlist.count());
QCOMPARE(varl2.count(), intlist.count());
QCOMPARE(varl3.count(), intlist.count());
- foreach_test_arrays(varl1);
- foreach_test_arrays(varl2);
- foreach_test_arrays(varl3);
QVarLengthArray<QString> varl4;
QVarLengthArray<QString, 3> varl5;
@@ -3499,9 +3496,6 @@ void tst_Collections::foreach_2()
QCOMPARE(varl4.count(), strlist.count());
QCOMPARE(varl5.count(), strlist.count());
QCOMPARE(varl6.count(), strlist.count());
- foreach_test_arrays(varl4);
- foreach_test_arrays(varl5);
- foreach_test_arrays(varl6);
}
struct IntOrString
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
index a1d0100f96..6220cc766a 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -827,7 +827,7 @@ void tst_QVarLengthArray::operators()
// +=: not provided, emulate
//myvla += myvlatwo;
- Q_FOREACH (const QString &s, myvlatwo)
+ for (const QString &s : qAsConst(myvlatwo))
myvla.push_back(s);
QCOMPARE(myvla, combined);