diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-09-06 18:43:36 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-09-12 17:26:24 +0000 |
commit | 76b192811421d034a582a303a34dbb11dc2b9a0b (patch) | |
tree | 592b29ec60701c27e8c1808272cccc2e62cba166 | |
parent | fa1e04a543f16841b3333a5862741f4e28ec73a6 (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.
Change-Id: I1e22ec0b38341264bcf2d5c26146cbbcab6e0749
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9c63667d01eb13f43d3b51a8a3502bfc233d6b0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp | 6 |
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)); } |