diff options
author | Giuseppe D'Angelo <dangelog@gmail.com> | 2012-04-01 18:53:55 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-03 23:56:10 +0200 |
commit | fb20f9c2da369b07fc50857a90b596ae63f943da (patch) | |
tree | da28a81ab925777e4f82346a1ce6c6684f41c326 /tests/auto/tools | |
parent | 72eb9d49a9849ba4a27b27e82b60f4bdd887a70e (diff) |
Stop relying on QHash ordering
tst_rcc and tst_qdom rely on specific QHash orderings inside
rcc and QDom respectively (see QTBUG-25078 and QTBUG-25071).
A workaround is added to make them succeed: QDom checks for
all possible orderings, and rcc initializes the hash seed to 0
if the QT_RCC_TEST environment variable is set.
Change-Id: I5ed6b50602fceba731c797aec8dffc9cc1d6a1ce
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'tests/auto/tools')
-rw-r--r-- | tests/auto/tools/rcc/tst_rcc.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp index dbf5cebd9d..8af85a6d09 100644 --- a/tests/auto/tools/rcc/tst_rcc.cpp +++ b/tests/auto/tools/rcc/tst_rcc.cpp @@ -52,6 +52,7 @@ #include <QtCore/QList> #include <QtCore/QResource> #include <QtCore/QLocale> +#include <QtCore/QtGlobal> typedef QMap<QString, QString> QStringMap; Q_DECLARE_METATYPE(QStringMap) @@ -61,6 +62,8 @@ class tst_rcc : public QObject Q_OBJECT private slots: + void initTestCase(); + void rcc_data(); void rcc(); void binary_data(); @@ -69,6 +72,13 @@ private slots: void cleanupTestCase(); }; +void tst_rcc::initTestCase() +{ + // rcc uses a QHash to store files in the resource system. + // we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078 + QVERIFY(qputenv("QT_RCC_TEST", "1")); +} + QString findExpectedFile(const QString &base) { QString expectedrccfile = base; |