summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <[email protected]>2025-10-23 12:56:44 +0800
committerTim Blechmann <[email protected]>2025-10-24 01:44:07 +0800
commitc04f85e4e02e2fb99d7fe8c766a097c4d9cf8083 (patch)
treebfd82e93f5344f0dcb17031d6dc18eeeb9301a89
parentff4a289ff6adb874b68635568db5a0964f59ba55 (diff)
Tests: qhash - clear global variable use in stdHashImpl
`StdHashUsed` is set in the stdHashImpl, but the test does not ensure that it is initialized before the test. This causes test failures with -repeat. Clearing the flag at the beginning of the test function fixes this behaviour. Pick-to: 6.10 Change-Id: I383611ce9368c6826cb5436a74e12bd73748491c Reviewed-by: Tor Arne Vestbø <[email protected]>
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index b03750389bd..8ec9cb516d3 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -3153,6 +3153,8 @@ qHash(const StdHashKeyType<HasQHash> &s, size_t seed)
template <typename T>
void stdHashImpl()
{
+ T::StdHashUsed = false;
+
QHash<T, int> hash;
for (int i = 0; i < 1000; ++i)
hash.insert(T{i}, i);