summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2012-04-13 19:41:47 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-14 13:51:49 +0200
commit5e24d22af075ce790b471fb9aca59a80037f34df (patch)
tree5b7d416f4786b7b0d3ed1c70139dc2233c653ade /tests/auto/corelib/tools
parenta8ceb73b93cdfdf7f0d07819c11d09f24deb6b4f (diff)
QHash: fix key() test
The key returned by QHash::key is an arbitrary one that maps to the given value. The test instead relied on it being a specific one. Change-Id: I090351797e8b52036d78160fd810518a11e8107d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 9d18c7a34e..5bd13b23a3 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -526,14 +526,14 @@ void tst_QHash::key()
hash2.insert(3, "two");
QCOMPARE(hash2.key("one"), 1);
QCOMPARE(hash2.key("one", def), 1);
- QCOMPARE(hash2.key("two"), 2);
- QCOMPARE(hash2.key("two", def), 2);
+ QVERIFY(hash2.key("two") == 2 || hash2.key("two") == 3);
+ QVERIFY(hash2.key("two", def) == 2 || hash2.key("two", def) == 3);
QCOMPARE(hash2.key("three"), 0);
QCOMPARE(hash2.key("three", def), def);
hash2.insert(-1, "two");
- QCOMPARE(hash2.key("two"), -1);
- QCOMPARE(hash2.key("two", def), -1);
+ QVERIFY(hash2.key("two") == 2 || hash2.key("two") == 3 || hash2.key("two") == -1);
+ QVERIFY(hash2.key("two", def) == 2 || hash2.key("two", def) == 3 || hash2.key("two", def) == -1);
hash2.insert(0, "zero");
QCOMPARE(hash2.key("zero"), 0);