From e41d243789560278b2ced383730df7e1a20e6fc7 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 20 Jan 2020 15:36:48 +0100 Subject: [PATCH] Adjust autotest to coming QHash changes QHash and QMultiHash are separate classes in the future, and the iterator is not random access. Change-Id: I7e1a4162ca964001c8da81a2fd7c41ccae27bdb3 Reviewed-by: Simon Hausmann --- .../tools/collections/tst_collections.cpp | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp index 7da49e09170..f319244bd37 100644 --- a/tests/auto/corelib/tools/collections/tst_collections.cpp +++ b/tests/auto/corelib/tools/collections/tst_collections.cpp @@ -2701,8 +2701,10 @@ void testMapLikeStlIterators() QString t; fake.insert(k, t); - typename Container::iterator i1 = fake.begin(), i2 = i1 + 1; - typename Container::const_iterator c1 = i1, c2 = c1 + 1; + typename Container::iterator i1 = fake.begin(), i2 = i1; + ++i2; + typename Container::const_iterator c1 = i1, c2 = c1; + ++c2; QVERIFY(i1 == i1); QVERIFY(i1 == c1); @@ -2712,8 +2714,6 @@ void testMapLikeStlIterators() QVERIFY(i2 == c2); QVERIFY(c2 == i2); QVERIFY(c2 == c2); - QVERIFY(1 + i1 == i1 + 1); - QVERIFY(1 + c1 == c1 + 1); QVERIFY(i1 != i2); QVERIFY(i1 != c2); @@ -2924,10 +2924,6 @@ void instantiateMutableIterationContainer() it = container.begin(); it = container.end(); Q_UNUSED(it) - - // QSet lacks count(T). - const ValueType value = ValueType(); - container.count(value); } template @@ -2935,10 +2931,9 @@ void instantiateSequence() { instantiateMutableIterationContainer(); -// QVector lacks removeAll(T) -// ValueType value = ValueType(); -// ContainerType container; -// container.removeAll(value); + ValueType value = ValueType(); + ContainerType container; + container.removeAll(value); } template @@ -3011,11 +3006,10 @@ void instantiatePairAssociative() constContainer.keys(); container.remove(key); container.take(key); - container.unite(constContainer); + container.insert(constContainer); container.value(key); container.value(key, value); container.values(); - container.values(key); container[key]; const int foo = constContainer[key]; Q_UNUSED(foo);