diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/tools/qhash/tst_qhash.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 014617f8d4..079b9c6ab7 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -80,6 +80,8 @@ private slots: void hashOfHash(); void stdHash(); + + void countInEmptyHash(); }; struct IdentityTracker { @@ -1976,5 +1978,18 @@ void tst_QHash::stdHash() QVERIFY(!strings.contains("z")); } +void tst_QHash::countInEmptyHash() +{ + { + QHash<int, int> hash; + QCOMPARE(hash.count(42), 0); + } + + { + QMultiHash<int, int> hash; + QCOMPARE(hash.count(42), 0); + } +} + QTEST_APPLESS_MAIN(tst_QHash) #include "tst_qhash.moc" |