summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/moc/slots-with-void-template.h2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp28
-rw-r--r--tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro11
-rw-r--r--tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.qrc5
-rw-r--r--tests/auto/tools/qdbuscpp2xml/test1.h128
-rw-r--r--tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp181
-rw-r--r--tests/auto/tools/rcc/data/images/images.expected48
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp10
-rw-r--r--tests/auto/tools/tools.pro1
9 files changed, 377 insertions, 37 deletions
diff --git a/tests/auto/tools/moc/slots-with-void-template.h b/tests/auto/tools/moc/slots-with-void-template.h
index 081b03eb4a..73f07d1dc7 100644
--- a/tests/auto/tools/moc/slots-with-void-template.h
+++ b/tests/auto/tools/moc/slots-with-void-template.h
@@ -51,9 +51,11 @@ class SlotsWithVoidTemplateTest : public QObject
Q_OBJECT
public slots:
inline void dummySlot() {}
+ inline void dummySlot2(void) {}
inline void anotherSlot(const TestTemplate<void> &) {}
inline TestTemplate<void> mySlot() { return TestTemplate<void>(); }
signals:
void mySignal(const TestTemplate<void> &);
void myVoidSignal();
+ void myVoidSignal2(void);
};
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 49095048bf..f7ce54959e 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -748,7 +748,7 @@ void tst_Moc::classinfoWithEscapes()
QCOMPARE(mobj->methodCount() - mobj->methodOffset(), 1);
QMetaMethod mm = mobj->method(mobj->methodOffset());
- QCOMPARE(mm.signature(), "slotWithAReallyLongName(int)");
+ QCOMPARE(mm.methodSignature(), QByteArray("slotWithAReallyLongName(int)"));
}
void tst_Moc::trNoopInClassInfo()
@@ -874,6 +874,8 @@ void tst_Moc::slotsWithVoidTemplate()
&test, SLOT(dummySlot(void))));
QVERIFY(QObject::connect(&test, SIGNAL(mySignal(const TestTemplate<void> &)),
&test, SLOT(anotherSlot(const TestTemplate<void> &))));
+ QVERIFY(QObject::connect(&test, SIGNAL(myVoidSignal2()),
+ &test, SLOT(dummySlot2())));
}
void tst_Moc::structQObject()
@@ -1093,14 +1095,14 @@ void tst_Moc::invokable()
{
const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
}
{
const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("bar()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("bar()"));
}
}
@@ -1109,22 +1111,22 @@ void tst_Moc::singleFunctionKeywordSignalAndSlot()
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
}
}
@@ -1231,7 +1233,7 @@ void tst_Moc::constructors()
QMetaMethod mm = mo->constructor(0);
QCOMPARE(mm.access(), QMetaMethod::Public);
QCOMPARE(mm.methodType(), QMetaMethod::Constructor);
- QCOMPARE(mm.signature(), "CtorTestClass(QObject*)");
+ QCOMPARE(mm.methodSignature(), QByteArray("CtorTestClass(QObject*)"));
QCOMPARE(mm.typeName(), "");
QList<QByteArray> paramNames = mm.parameterNames();
QCOMPARE(paramNames.size(), 1);
@@ -1244,7 +1246,7 @@ void tst_Moc::constructors()
QMetaMethod mm = mo->constructor(1);
QCOMPARE(mm.access(), QMetaMethod::Public);
QCOMPARE(mm.methodType(), QMetaMethod::Constructor);
- QCOMPARE(mm.signature(), "CtorTestClass()");
+ QCOMPARE(mm.methodSignature(), QByteArray("CtorTestClass()"));
QCOMPARE(mm.typeName(), "");
QCOMPARE(mm.parameterNames().size(), 0);
QCOMPARE(mm.parameterTypes().size(), 0);
@@ -1253,7 +1255,7 @@ void tst_Moc::constructors()
QMetaMethod mm = mo->constructor(2);
QCOMPARE(mm.access(), QMetaMethod::Public);
QCOMPARE(mm.methodType(), QMetaMethod::Constructor);
- QCOMPARE(mm.signature(), "CtorTestClass(QString)");
+ QCOMPARE(mm.methodSignature(), QByteArray("CtorTestClass(QString)"));
QCOMPARE(mm.typeName(), "");
QList<QByteArray> paramNames = mm.parameterNames();
QCOMPARE(paramNames.size(), 1);
diff --git a/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro b/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro
new file mode 100644
index 0000000000..4217d5e73c
--- /dev/null
+++ b/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.pro
@@ -0,0 +1,11 @@
+CONFIG += testcase
+QT = core testlib dbus
+TARGET = tst_qdbuscpp2xml
+
+QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS
+
+SOURCES += tst_qdbuscpp2xml.cpp \
+
+RESOURCES += qdbuscpp2xml.qrc
+
+HEADERS += test1.h \ No newline at end of file
diff --git a/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.qrc b/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.qrc
new file mode 100644
index 0000000000..b4cffb842e
--- /dev/null
+++ b/tests/auto/tools/qdbuscpp2xml/qdbuscpp2xml.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/tst_qdbuscpp2xml/">
+ <file>test1.h</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/tools/qdbuscpp2xml/test1.h b/tests/auto/tools/qdbuscpp2xml/test1.h
new file mode 100644
index 0000000000..35dee2cc38
--- /dev/null
+++ b/tests/auto/tools/qdbuscpp2xml/test1.h
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDBUSCPP2XML_TEST1_H
+#define QDBUSCPP2XML_TEST1_H
+
+#include <QObject>
+
+class QDBusObjectPath;
+class QDBusUnixFileDescriptor;
+class QDBusSignature;
+
+class Test1 : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.qtProject.qdbuscpp2xmlTests.Test1")
+ Q_PROPERTY(int numProperty1 READ numProperty1 CONSTANT)
+ Q_PROPERTY(int numProperty2 READ numProperty2 WRITE setNumProperty2)
+public:
+ Test1(QObject *parent = 0) : QObject(parent) {}
+
+ int numProperty1() { return 42; }
+
+ int numProperty2() { return 42; }
+ void setNumProperty2(int) {}
+
+signals:
+ void signalVoidType();
+ int signalIntType();
+ void signal_primitive_args(int a1, bool a2, short a3, ushort a4, uint a5, qlonglong a6, double a7, qlonglong a8 = 0);
+ void signal_string_args(const QByteArray &ba, const QString &a2);
+ void signal_Qt_args1(const QDate &a1, const QTime &a2, const QDateTime &a3,
+ const QRect &a4, const QRectF &a5, const QSize &a6, const QSizeF &a7);
+ void signal_Qt_args2(const QPoint &a1, const QPointF &a2, const QLine &a3, const QLineF &a4,
+ const QVariantList &a5, const QVariantMap &a6, const QVariantHash &a7);
+
+ void signal_QDBus_args(const QDBusObjectPath &a1, const QDBusSignature &a2, const QDBusUnixFileDescriptor &a3);
+
+ void signal_container_args1(const QList<bool> &a1, const QList<short> &a2, const QList<ushort> &a3, const QList<int> &a4, const QList<uint> &a5);
+ void signal_container_args2(const QList<qlonglong> &a1, const QList<qulonglong> &a2, const QList<double> &a3, const QList<QDBusObjectPath> &a4, const QList<QDBusSignature> &a5, const QList<QDBusUnixFileDescriptor> &a6);
+
+ Q_SCRIPTABLE void signalVoidType_scriptable();
+ Q_SCRIPTABLE int signalIntType_scriptable();
+ Q_SCRIPTABLE void signal_primitive_args_scriptable(int a1, bool a2, short a3, ushort a4, uint a5, qlonglong a6, double a7, qlonglong a8 = 0);
+ Q_SCRIPTABLE void signal_string_args_scriptable(const QByteArray &ba, const QString &a2);
+ Q_SCRIPTABLE void signal_Qt_args1_scriptable(const QDate &a1, const QTime &a2, const QDateTime &a3,
+ const QRect &a4, const QRectF &a5, const QSize &a6, const QSizeF &a7);
+ Q_SCRIPTABLE void signal_Qt_args2_scriptable(const QPoint &a1, const QPointF &a2, const QLine &a3, const QLineF &a4,
+ const QVariantList &a5, const QVariantMap &a6, const QVariantHash &a7);
+
+ Q_SCRIPTABLE void signal_QDBus_args_scriptable(const QDBusObjectPath &a1, const QDBusSignature &a2, const QDBusUnixFileDescriptor &a3);
+
+ Q_SCRIPTABLE void signal_container_args1_scriptable(const QList<bool> &a1, const QList<short> &a2, const QList<ushort> &a3, const QList<int> &a4, const QList<uint> &a5);
+ Q_SCRIPTABLE void signal_container_args2_scriptable(const QList<qlonglong> &a1, const QList<qulonglong> &a2, const QList<double> &a3, const QList<QDBusObjectPath> &a4, const QList<QDBusSignature> &a5, const QList<QDBusUnixFileDescriptor> &a6);
+
+public slots:
+ void slotVoidType() {}
+ int slotIntType() { return 42; }
+
+ Q_SCRIPTABLE void slotVoidType_scriptable() {}
+ Q_SCRIPTABLE int slotIntType_scriptable() { return 42; }
+
+protected slots:
+ void neverExported1() {}
+ int neverExported2() { return 42; }
+
+ Q_SCRIPTABLE void neverExported3() {}
+ Q_SCRIPTABLE int neverExported4() { return 42; }
+
+private slots:
+ void neverExported5() {}
+ int neverExported6() { return 42; }
+
+ Q_SCRIPTABLE void neverExported7() {}
+ Q_SCRIPTABLE int neverExported8() { return 42; }
+
+public:
+ Q_SCRIPTABLE void methodVoidType() {}
+ Q_SCRIPTABLE int methodIntType() { return 42; }
+
+protected:
+ Q_SCRIPTABLE void neverExported9() {}
+ Q_SCRIPTABLE int neverExported10() { return 42; }
+
+private:
+ Q_SCRIPTABLE void neverExported11() {}
+ Q_SCRIPTABLE int neverExported12() { return 42; }
+};
+
+#endif
diff --git a/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp b/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp
new file mode 100644
index 0000000000..5510c656e1
--- /dev/null
+++ b/tests/auto/tools/qdbuscpp2xml/tst_qdbuscpp2xml.cpp
@@ -0,0 +1,181 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include "test1.h"
+
+#include <QtDBus/QDBusConnection>
+
+// in qdbusxmlgenerator.cpp
+QT_BEGIN_NAMESPACE
+extern Q_DBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface,
+ const QMetaObject *mo,
+ const QMetaObject *base,
+ int flags);
+QT_END_NAMESPACE
+
+static QString addXmlHeader(const QString &input)
+{
+ return
+ "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n<node>"
+ + (input.isEmpty() ? QString() : QString("\n " + input.trimmed()))
+ + "\n</node>\n";
+}
+
+class tst_qdbuscpp2xml : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void qdbuscpp2xml_data();
+ void qdbuscpp2xml();
+
+ void initTestCase();
+ void cleanupTestCase();
+
+private:
+ QHash<QString, QObject*> m_tests;
+};
+
+void tst_qdbuscpp2xml::initTestCase()
+{
+ m_tests.insert("test1", new Test1);
+}
+
+void tst_qdbuscpp2xml::cleanupTestCase()
+{
+ qDeleteAll(m_tests);
+}
+
+void tst_qdbuscpp2xml::qdbuscpp2xml_data()
+{
+ QTest::addColumn<QString>("inputfile");
+ QTest::addColumn<int>("flags");
+
+ QBitArray doneFlags(QDBusConnection::ExportAllContents + 1);
+ for (int flag = 0x10; flag < QDBusConnection::ExportScriptableContents; flag += 0x10) {
+ QTest::newRow("xmlgenerator-" + QByteArray::number(flag)) << "test1" << flag;
+ doneFlags.setBit(flag);
+ for (int mask = QDBusConnection::ExportAllSlots; mask <= QDBusConnection::ExportAllContents; mask += 0x110) {
+ int flags = flag | mask;
+ if (doneFlags.testBit(flags))
+ continue;
+ QTest::newRow("xmlgenerator-" + QByteArray::number(flags)) << "test1" << flags;
+ doneFlags.setBit(flags);
+ }
+ }
+}
+
+void tst_qdbuscpp2xml::qdbuscpp2xml()
+{
+ QFETCH(QString, inputfile);
+ QFETCH(int, flags);
+
+ // qdbuscpp2xml considers these equivalent
+ if (flags & QDBusConnection::ExportScriptableSlots)
+ flags |= QDBusConnection::ExportScriptableInvokables;
+ if (flags & QDBusConnection::ExportNonScriptableSlots)
+ flags |= QDBusConnection::ExportNonScriptableInvokables;
+
+ if (flags & QDBusConnection::ExportScriptableInvokables)
+ flags |= QDBusConnection::ExportScriptableSlots;
+ if (flags & QDBusConnection::ExportNonScriptableInvokables)
+ flags |= QDBusConnection::ExportNonScriptableSlots;
+
+ QStringList options;
+ if (flags & QDBusConnection::ExportScriptableProperties) {
+ if (flags & QDBusConnection::ExportNonScriptableProperties)
+ options << "-P";
+ else
+ options << "-p";
+ }
+ if (flags & QDBusConnection::ExportScriptableSignals) {
+ if (flags & QDBusConnection::ExportNonScriptableSignals)
+ options << "-S";
+ else
+ options << "-s";
+ }
+ if (flags & QDBusConnection::ExportScriptableSlots) {
+ if (flags & QDBusConnection::ExportNonScriptableSlots)
+ options << "-M";
+ else
+ options << "-m";
+ }
+
+ // Launch
+ const QString command = QLatin1String("qdbuscpp2xml");
+ QProcess process;
+ process.start(command, QStringList() << options << (QFINDTESTDATA(inputfile + QStringLiteral(".h"))));
+ if (!process.waitForFinished()) {
+ const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
+ QString message = QString::fromLatin1("'%1' could not be found when run from '%2'. Path: '%3' ").
+ arg(command, QDir::currentPath(), path);
+ QFAIL(qPrintable(message));
+ }
+ const QChar cr = QLatin1Char('\r');
+ const QString err = QString::fromLocal8Bit(process.readAllStandardError()).remove(cr);
+ const QString out = QString::fromAscii(process.readAllStandardOutput()).remove(cr);
+
+ if (!err.isEmpty()) {
+ qDebug() << "UNEXPECTED STDERR CONTENTS: " << err;
+ QFAIL("UNEXPECTED STDERR CONTENTS");
+ }
+
+ const QChar nl = QLatin1Char('\n');
+ const QStringList actualLines = out.split(nl);
+
+ QObject *testObject = m_tests.value(inputfile);
+
+ if (flags == 0)
+ flags = QDBusConnection::ExportScriptableContents
+ | QDBusConnection::ExportNonScriptableContents;
+
+ QString expected = qDBusGenerateMetaObjectXml(QString(), testObject->metaObject(), &QObject::staticMetaObject, flags);
+
+ expected = addXmlHeader(expected);
+
+ QCOMPARE(out, expected);
+}
+
+QTEST_APPLESS_MAIN(tst_qdbuscpp2xml)
+
+#include "tst_qdbuscpp2xml.moc"
diff --git a/tests/auto/tools/rcc/data/images/images.expected b/tests/auto/tools/rcc/data/images/images.expected
index 71be819310..4ebf066568 100644
--- a/tests/auto/tools/rcc/data/images/images.expected
+++ b/tests/auto/tools/rcc/data/images/images.expected
@@ -1,8 +1,8 @@
/****************************************************************************
** Resource object code
**
-IGNORE: ** Created: Tue Jul 15 11:17:15 2008
-IGNORE: ** by: The Resource Compiler for Qt version 4.4.2
+IGNORE: ** Created: Sun Apr 1 21:20:28 2012
+IGNORE: ** by: The Resource Compiler for Qt version 5.0.0
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
@@ -10,16 +10,7 @@ IGNORE: ** by: The Resource Compiler for Qt version 4.4.2
#include <QtCore/qglobal.h>
static const unsigned char qt_resource_data[] = {
-IGNORE: // /data5/dev/qt/tests/auto/rcc/data/images/square.png
- 0x0,0x0,0x0,0x5e,
- 0x89,
- 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
- 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x1,0x3,0x0,0x0,0x0,0x49,0xb4,0xe8,0xb7,
- 0x0,0x0,0x0,0x6,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x58,0xa8,0xff,0x8c,0x14,
- 0x1f,0xab,0x0,0x0,0x0,0x13,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x0,0x81,
- 0xfa,0xff,0xff,0xff,0xd,0x3e,0x2,0x4,0x0,0x8d,0x4d,0x68,0x6b,0xcf,0xb8,0x8e,
- 0x86,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
-IGNORE: // /data5/dev/qt/tests/auto/rcc/data/images/circle.png
+IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/circle.png
0x0,0x0,0x0,0xa5,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -33,7 +24,16 @@ IGNORE: // /data5/dev/qt/tests/auto/rcc/data/images/circle.png
0x4c,0x48,0x31,0x15,0x53,0xec,0x5,0x14,0x9b,0x11,0xc5,0x6e,0x8,0xdd,0x8e,0x1b,
0x14,0x54,0x19,0xf3,0xa1,0x23,0xdb,0xd5,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
0xae,0x42,0x60,0x82,
-IGNORE: // /data5/dev/qt/tests/auto/rcc/data/images/subdir/triangle.png
+IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/square.png
+ 0x0,0x0,0x0,0x5e,
+ 0x89,
+ 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
+ 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x1,0x3,0x0,0x0,0x0,0x49,0xb4,0xe8,0xb7,
+ 0x0,0x0,0x0,0x6,0x50,0x4c,0x54,0x45,0x0,0x0,0x0,0x58,0xa8,0xff,0x8c,0x14,
+ 0x1f,0xab,0x0,0x0,0x0,0x13,0x49,0x44,0x41,0x54,0x8,0xd7,0x63,0x60,0x0,0x81,
+ 0xfa,0xff,0xff,0xff,0xd,0x3e,0x2,0x4,0x0,0x8d,0x4d,0x68,0x6b,0xcf,0xb8,0x8e,
+ 0x86,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
+IGNORE: // /dev/qt5/qtbase/tests/auto/tools/rcc/data/images/images/subdir/triangle.png
0x0,0x0,0x0,0xaa,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
@@ -56,21 +56,21 @@ static const unsigned char qt_resource_name[] = {
0x7,0x3,0x7d,0xc3,
0x0,0x69,
0x0,0x6d,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x73,
- // square.png
- 0x0,0xa,
- 0x8,0x8b,0x6,0x27,
+ // subdir
+ 0x0,0x6,
+ 0x7,0xab,0x8b,0x2,
0x0,0x73,
- 0x0,0x71,0x0,0x75,0x0,0x61,0x0,0x72,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
+ 0x0,0x75,0x0,0x62,0x0,0x64,0x0,0x69,0x0,0x72,
// circle.png
0x0,0xa,
0xa,0x2d,0x16,0x47,
0x0,0x63,
0x0,0x69,0x0,0x72,0x0,0x63,0x0,0x6c,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
- // subdir
- 0x0,0x6,
- 0x7,0xab,0x8b,0x2,
+ // square.png
+ 0x0,0xa,
+ 0x8,0x8b,0x6,0x27,
0x0,0x73,
- 0x0,0x75,0x0,0x62,0x0,0x64,0x0,0x69,0x0,0x72,
+ 0x0,0x71,0x0,0x75,0x0,0x61,0x0,0x72,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
// triangle.png
0x0,0xc,
0x5,0x59,0xa7,0xc7,
@@ -85,11 +85,11 @@ static const unsigned char qt_resource_struct[] = {
// :/images
0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x3,0x0,0x0,0x0,0x2,
// :/images/subdir
- 0x0,0x0,0x0,0x46,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
+ 0x0,0x0,0x0,0x12,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x5,
// :/images/square.png
- 0x0,0x0,0x0,0x12,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ 0x0,0x0,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xa9,
// :/images/circle.png
- 0x0,0x0,0x0,0x2c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x62,
+ 0x0,0x0,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
// :/images/subdir/triangle.png
0x0,0x0,0x0,0x58,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0xb,
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;
diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro
index 6bf6ddf64f..0a2821773f 100644
--- a/tests/auto/tools/tools.pro
+++ b/tests/auto/tools/tools.pro
@@ -5,3 +5,4 @@ SUBDIRS=\
moc \
rcc \
+contains(QT_CONFIG, dbus):SUBDIRS += qdbuscpp2xml