From b404ad58949ffd3d7ad4d2b25a2c818d175b85a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 21 Sep 2022 10:32:54 +0200 Subject: [PATCH] tst_QHash: Fix outdated rehash test Inserting the same key repeatedly with QMultiHash will not test rehashing behavior because in Qt6 those entries all end up in a linked list. Change-Id: I78c45eed0f35a13af6d6da75d7189a6933750f13 Reviewed-by: Thiago Macieira (cherry picked from commit c633f4644c0065964345402535d54f3749431d82) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/corelib/tools/qhash/tst_qhash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp index 5b51d6888db..1b544944d84 100644 --- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp +++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp @@ -1629,9 +1629,9 @@ void tst_QHash::rehash_isnt_quadratic() { // this test should be incredibly slow if rehash() is quadratic for (int j = 0; j < 5; ++j) { - QMultiHash testHash; + QHash testHash; for (int i = 0; i < 500000; ++i) - testHash.insert(1, 1); + testHash.insert(i, 1); } }