From 5e24d22af075ce790b471fb9aca59a80037f34df Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 13 Apr 2012 19:41:47 +0100 Subject: 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 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qhash/tst_qhash.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/corelib/tools') 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); -- cgit v1.2.3