From d2ed1074d051c870e7191d0a31f48fae9759e9d7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 19 May 2019 23:10:38 +0200 Subject: tests: remove the last uses of Java-style iterators ... except where they are actually the component under test. Java-style iterators are scheduled for deprecation. Change-Id: If4399f7f74c5ffc0f7e65205e422edfa1d908ee8 Reviewed-by: Lars Knoll --- tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp index d7a7f383ac..12e85d4842 100644 --- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp +++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp @@ -167,9 +167,7 @@ void tst_QTransform::func##_data() \ { \ QTest::addColumn("transform"); \ QMap x = generateTransforms(); \ - QMapIterator it(x); \ - while (it.hasNext()) { \ - it.next(); \ + for (auto it = x.begin(), end = x.end(); it != end; ++it) { \ QTest::newRow(it.key()) << it.value(); \ } \ } @@ -180,14 +178,10 @@ void tst_QTransform::func##_data() \ QTest::addColumn("x1"); \ QTest::addColumn("x2"); \ QMap x = generateTransforms(); \ - QMapIterator it(x); \ - while (it.hasNext()) { \ - it.next(); \ + for (auto it = x.cbegin(), end = x.cend(); it != end; ++it) { \ const char *key1 = it.key(); \ QTransform x1 = it.value(); \ - QMapIterator it2(x); \ - while (it2.hasNext()) { \ - it2.next(); \ + for (auto it2 = x.cbegin(), end = x.cend(); it2 != end; ++it2) { \ QTest::newRow(QString("%1 + %2").arg(key1).arg(it2.key()).toLatin1().constData()) \ << x1 << it2.value(); \ } \ -- cgit v1.2.3