summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-09-06 18:43:36 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-09-08 11:32:44 +0200
commit9c63667d01eb13f43d3b51a8a3502bfc233d6b0b (patch)
tree00cc6bd496543ef08e6f100a8804eb9fc1661931 /tests/auto/corelib/tools
parent8ca319a172b84207be404ed3bb619c3548a802da (diff)
tst_QHashFunctions: fix std::pair test to use QFETCH_GLOBAL seeds
Because the local `seed` variable shadowed the member one, this test was run for each QFETCH_GLOBAL with the same data and seed. That doesn't make sense, so make the test use the member variable `seed`, as all other tests already do. Since zero is one of the seeds coming from QFETCH_GLOBAL, drop the seedless calls to qHash(), too. Amends 64bfc927b09b46bb7fc0dc6caf1bf1a4d4133ab4. Pick-to: 6.6 6.5 6.2 Change-Id: I1e22ec0b38341264bcf2d5c26146cbbcab6e0749 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
index 63fcfb99d0..69e401ae66 100644
--- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
+++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
@@ -415,13 +415,9 @@ void tst_QHashFunctions::stdPair_template(const T1 &t1, const T2 &t2)
std::pair<T1, T2> dpair{};
std::pair<T1, T2> vpair{t1, t2};
- size_t seed = QHashSeed::globalSeed();
-
// confirm proper working of the pair and of the underlying types
QVERIFY(t1 == t1);
QVERIFY(t2 == t2);
- QCOMPARE(qHash(t1), qHash(t1));
- QCOMPARE(qHash(t2), qHash(t2));
QCOMPARE(qHash(t1, seed), qHash(t1, seed));
QCOMPARE(qHash(t2, seed), qHash(t2, seed));
@@ -429,9 +425,7 @@ void tst_QHashFunctions::stdPair_template(const T1 &t1, const T2 &t2)
QVERIFY(vpair == vpair);
// therefore their hashes should be equal
- QCOMPARE(qHash(dpair), qHash(dpair));
QCOMPARE(qHash(dpair, seed), qHash(dpair, seed));
- QCOMPARE(qHash(vpair), qHash(vpair));
QCOMPARE(qHash(vpair, seed), qHash(vpair, seed));
}