QSharedPointer: hash autotest fix
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Mon, 9 Apr 2012 18:14:31 +0000 (19:14 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 13 Apr 2012 15:05:11 +0000 (17:05 +0200)
The hash autotest is wrong: it assumed that the iterator on the hash
would reach the end after iterating on two elements with identical key.
But three elements were added to that hash, and the third one
can appear after the other two.

That code path is left for the map test only.

Change-Id: I51de7987e2b132b6caff7bb4bac6a57fb7fcb530
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

index f8b9abb..bb9be1d 100644 (file)
@@ -1623,7 +1623,8 @@ void hashAndMapTest()
     QVERIFY(it != c.end());
     QCOMPARE(it.key(), k1);
     ++it;
-    QVERIFY(it == c.end());
+    if (Ordered)
+        QVERIFY(it == c.end());
 }
 
 void tst_QSharedPointer::map()