From 5eda43de89d936a0261949519a0653a66e82b03b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 23 Nov 2021 07:26:40 -0800 Subject: [PATCH] tst_QHashSeed: reset the global seed in each iteration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QHashSeed is not a random number generator (though it uses one). It returns the same value over and over again unless you reset it to a new, random seed. Fixes: QTBUG-98480 Change-Id: I89446ea06b5742efb194fffd16ba36601f08d794 Reviewed-by: MÃ¥rten Nordheim --- tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp b/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp index 3d3b529f29f..f726a29d975 100644 --- a/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp +++ b/tests/auto/corelib/tools/qhashseed/tst_qhashseed.cpp @@ -152,6 +152,8 @@ void tst_QHashSeed::quality() ++oneThird; if (seed == BadSeed) ++badSeeds; + + QHashSeed::resetRandomGlobalSeed(); } // report out