summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2021-11-11 11:37:22 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2021-11-11 22:44:10 +0100
commit838edd9c48284b97dfc22cf3644bb082035a9a93 (patch)
tree9b202f6d0a6b590463500b818fd6e0de09eb88b5 /tests/auto/corelib/tools
parent090c7e3262dce93df83c73a4a822761e5d9b4650 (diff)
Fix QMultiHash::operator== crash
QMultiHash::operator== crashes when comparing two unequal objects. This patch fixes it. Pick-to: 6.2 Fixes: QTBUG-98265 Change-Id: Ibf9fef3372a2b4581843be5f25e65cc9a55ef64d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 576a1c6107..7e297c0119 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -95,6 +95,8 @@ private slots:
void fineTuningInEmptyHash();
void reserveShared();
+
+ void QTBUG98265();
};
struct IdentityTracker {
@@ -1742,6 +1744,7 @@ void tst_QHash::qmultihash_specific()
map2.insert(48, 3);
QCOMPARE(map1.count(), map2.count());
QVERIFY(map1.remove(42,5));
+ QVERIFY(map1 != map2);
QVERIFY(map2.remove(42,5));
QVERIFY(map1 == map2);
@@ -2615,5 +2618,14 @@ void tst_QHash::reserveShared()
QCOMPARE(hash.capacity(), oldCap);
}
+void tst_QHash::QTBUG98265()
+{
+ QMultiHash<QUuid, QByteArray> a;
+ QMultiHash<QUuid, QByteArray> b;
+ a.insert(QUuid("3e0dfb4d-90eb-43a4-bd54-88f5b69832c1"), QByteArray());
+ b.insert(QUuid("1b710ada-3dd7-432e-b7c8-e852e59f46a0"), QByteArray());
+
+ QVERIFY(a != b);
+}
QTEST_APPLESS_MAIN(tst_QHash)
#include "tst_qhash.moc"