summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp')
-rw-r--r--tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
index 6d58fdf6d0..ef7b020d89 100644
--- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
+++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
@@ -72,10 +72,16 @@ private slots:
void properties();
};
+QT_BEGIN_NAMESPACE
+// Avoid QHash randomization so that the order of the XML attributes is stable
+extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
+QT_END_NAMESPACE
+
void tst_QDBusXmlParser::initTestCase()
{
- // Avoid QHash randomization so that the order of the XML attributes is stable
- qputenv("QT_HASH_SEED", "123");
+ // If the seed not initialized yet (-1), set it to 0
+ // otherwise abort, so we don't get unexplained test failures later.
+ QVERIFY(qt_qhash_seed.testAndSetRelaxed(-1, 0));
}
void tst_QDBusXmlParser::parsing_data()