diff --git a/tests/auto/core5/tools/qlinkedlist/tst_qlinkedlist.cpp b/tests/auto/core5/tools/qlinkedlist/tst_qlinkedlist.cpp index 6ba0571..5baf00d 100644 --- a/tests/auto/core5/tools/qlinkedlist/tst_qlinkedlist.cpp +++ b/tests/auto/core5/tools/qlinkedlist/tst_qlinkedlist.cpp @@ -1095,6 +1095,7 @@ void tst_QLinkedList::iterators() const list << 4 << 5 << 6; QVERIFY(!list.isEmpty()); QVERIFY(list.size() == 6); +#ifndef QT_NO_JAVA_STYLE_ITERATORS { int sum = 0; QLinkedListIterator i = list; @@ -1103,6 +1104,7 @@ void tst_QLinkedList::iterators() const } QVERIFY(sum == 21); } +#endif { int sum = 0; QLinkedList::const_iterator i = list.begin(); @@ -1111,10 +1113,16 @@ void tst_QLinkedList::iterators() const QVERIFY(sum == 21); } { +#ifndef QT_NO_JAVA_STYLE_ITERATORS QMutableLinkedListIterator i = list; while (i.hasNext()) i.setValue(2 * i.next()); +#else + for (auto &e : list) + e *= 2; +#endif } +#ifndef QT_NO_JAVA_STYLE_ITERATORS { int sum = 0; QLinkedListIterator i = list; @@ -1123,12 +1131,19 @@ void tst_QLinkedList::iterators() const sum += i.previous(); QVERIFY(sum == 2 * 21); } +#endif { +#ifndef QT_NO_JAVA_STYLE_ITERATORS QMutableLinkedListIterator i = list; i.toBack(); while (i.hasPrevious()) i.setValue(2 * i.previous()); +#else + for (auto &e : list) + e *= 2; +#endif } +#ifndef QT_NO_JAVA_STYLE_ITERATORS { int sum = 0; QLinkedListIterator i = list; @@ -1205,6 +1220,7 @@ void tst_QLinkedList::iterators() const while (i.findNext(42)) i.remove(); } +#endif } QT_END_NAMESPACE