tst_QHash: replace QVERIFY(x == y) with QCOMPARE(x,y)

QCOMPARE produces more useful output on failure.

Change-Id: I584a5d33026ac2587758d72524f735937029e111
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2014-07-25 14:23:20 +02:00
parent 8b0cc9db9b
commit 443bc6ab18

View File

@ -1329,8 +1329,8 @@ void tst_QHash::initializerList()
#ifdef Q_COMPILER_INITIALIZER_LISTS
QHash<int, QString> hash = {{1, "bar"}, {1, "hello"}, {2, "initializer_list"}};
QCOMPARE(hash.count(), 2);
QVERIFY(hash[1] == "hello");
QVERIFY(hash[2] == "initializer_list");
QCOMPARE(hash[1], QString("hello"));
QCOMPARE(hash[2], QString("initializer_list"));
// note the difference to std::unordered_map:
// std::unordered_map<int, QString> stdh = {{1, "bar"}, {1, "hello"}, {2, "initializer_list"}};