summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qhash/tst_qhash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qhash/tst_qhash.cpp')
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp15
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 5389758b5f..0c3253784e 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -76,6 +76,8 @@ private slots:
void badHashFunction();
void hashOfHash();
+
+ void countInEmptyHash();
};
struct IdentityTracker {
@@ -1890,5 +1892,18 @@ void tst_QHash::hashOfHash()
(void)qHash(multiHash);
}
+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"