From aa434bc90861f1599209edd6bc614802c50704dc Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 14 Dec 2012 10:42:08 +0100 Subject: tst_QDBusXmlParser: make XML attribute order deterministic Avoid QHash randomization so that the order of the XML attributes is stable This was causing intermittent failures. Change-Id: I4cc0dba4b0c2ec36601f3b06fb17ff80005cc9fb Reviewed-by: Sean Harmer --- tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp index 35cf989753..6d58fdf6d0 100644 --- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp +++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp @@ -58,6 +58,7 @@ private: QString clean_xml(const QString&); private slots: + void initTestCase(); void parsing_data(); void parsing(); void parsingWithDoctype_data(); @@ -71,6 +72,12 @@ private slots: void properties(); }; +void tst_QDBusXmlParser::initTestCase() +{ + // Avoid QHash randomization so that the order of the XML attributes is stable + qputenv("QT_HASH_SEED", "123"); +} + void tst_QDBusXmlParser::parsing_data() { QTest::addColumn("xmlData"); -- cgit v1.2.3