diff options
Diffstat (limited to 'tests')
404 files changed, 9086 insertions, 5362 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 1796fa2db9..63c4ca6a48 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -18,8 +18,8 @@ cross_compile: SUBDIRS -= tools !contains(QT_CONFIG, opengl): SUBDIRS -= opengl !unix|embedded|!contains(QT_CONFIG, dbus): SUBDIRS -= dbus -# disable 'make check' on Mac OS X for the following subdirs for the time being -mac { +# disable 'make check' on Mac OS X and Windows for the following subdirs for the time being +mac|win32 { network.CONFIG += no_check_target } diff --git a/tests/auto/concurrent/qfuture/qfuture.pro b/tests/auto/concurrent/qfuture/qfuture.pro index a4c706129d..c0fe7ec5a3 100644 --- a/tests/auto/concurrent/qfuture/qfuture.pro +++ b/tests/auto/concurrent/qfuture/qfuture.pro @@ -1,5 +1,5 @@ CONFIG += testcase parallel_test TARGET = tst_qfuture -QT = concurrent-private testlib concurrent +QT = core concurrent-private testlib concurrent SOURCES = tst_qfuture.cpp DEFINES += QT_STRICT_ITERATORS diff --git a/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro b/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro index 3b8ebda4a4..e9caf5494a 100644 --- a/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro +++ b/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro @@ -1,4 +1,4 @@ CONFIG += testcase parallel_test TARGET = tst_qfuturewatcher -QT = concurrent-private testlib concurrent +QT = core concurrent-private testlib concurrent SOURCES = tst_qfuturewatcher.cpp diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index 7daed397d5..4144e82a29 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -172,75 +172,72 @@ void tst_QTextCodec::fromUnicode_data() QTest::addColumn<QString>("codecName"); QTest::addColumn<bool>("eightBit"); - QTest::newRow("data1") << "ISO-8859-1" << true; - QTest::newRow("data2") << "ISO-8859-2" << true; - QTest::newRow("data3") << "ISO-8859-3" << true; - QTest::newRow("data4") << "ISO-8859-4" << true; - QTest::newRow("data5") << "ISO-8859-5" << true; - QTest::newRow("data6") << "ISO-8859-6" << true; - QTest::newRow("data7") << "ISO-8859-7" << true; - QTest::newRow("data8") << "ISO-8859-8" << true; - QTest::newRow("data9") << "ISO-8859-9" << true; - QTest::newRow("data10") << "ISO-8859-10" << true; - QTest::newRow("data13") << "ISO-8859-13" << true; - QTest::newRow("data14") << "ISO-8859-14" << true; - QTest::newRow("data15") << "ISO-8859-15" << true; - QTest::newRow("data16") << "ISO-8859-16" << true; - - QTest::newRow("data18") << "IBM850" << true; - QTest::newRow("data19") << "IBM874" << true; - QTest::newRow("data20") << "IBM866" << true; - - QTest::newRow("data21") << "windows-1250" << true; - QTest::newRow("data22") << "windows-1251" << true; - QTest::newRow("data23") << "windows-1252" << true; - QTest::newRow("data24") << "windows-1253" << true; - QTest::newRow("data25") << "windows-1254" << true; - QTest::newRow("data26") << "windows-1255" << true; - QTest::newRow("data27") << "windows-1256" << true; - QTest::newRow("data28") << "windows-1257" << true; - QTest::newRow("data28") << "windows-1258" << true; - - QTest::newRow("data29") << "Apple Roman" << true; - QTest::newRow("data29") << "WINSAMI2" << true; - QTest::newRow("data30") << "TIS-620" << true; - QTest::newRow("data31") << "roman8" << true; - - QTest::newRow("data32") << "SJIS" << false; - QTest::newRow("data33") << "EUC-KR" << false; + QTest::newRow("ISO-8859-1") << "ISO-8859-1" << true; + QTest::newRow("ISO-8859-2") << "ISO-8859-2" << true; + QTest::newRow("ISO-8859-3") << "ISO-8859-3" << true; + QTest::newRow("ISO-8859-4") << "ISO-8859-4" << true; + QTest::newRow("ISO-8859-5") << "ISO-8859-5" << true; + QTest::newRow("ISO-8859-6") << "ISO-8859-6" << true; + QTest::newRow("ISO-8859-7") << "ISO-8859-7" << true; + QTest::newRow("ISO-8859-8") << "ISO-8859-8" << true; + QTest::newRow("ISO-8859-9") << "ISO-8859-9" << true; + QTest::newRow("ISO-8859-10") << "ISO-8859-10" << true; + QTest::newRow("ISO-8859-13") << "ISO-8859-13" << true; + QTest::newRow("ISO-8859-14") << "ISO-8859-14" << true; + QTest::newRow("ISO-8859-15") << "ISO-8859-15" << true; + QTest::newRow("ISO-8859-16") << "ISO-8859-16" << true; + + QTest::newRow("IBM850") << "IBM850" << true; + QTest::newRow("IBM874") << "IBM874" << true; + QTest::newRow("IBM866") << "IBM866" << true; + + QTest::newRow("windows-1250") << "windows-1250" << true; + QTest::newRow("windows-1251") << "windows-1251" << true; + QTest::newRow("windows-1252") << "windows-1252" << true; + QTest::newRow("windows-1253") << "windows-1253" << true; + QTest::newRow("windows-1254") << "windows-1254" << true; + QTest::newRow("windows-1255") << "windows-1255" << true; + QTest::newRow("windows-1256") << "windows-1256" << true; + QTest::newRow("windows-1257") << "windows-1257" << true; + QTest::newRow("windows-1258") << "windows-1258" << true; + + QTest::newRow("Apple Roman") << "Apple Roman" << true; + QTest::newRow("WINSAMI2") << "WINSAMI2" << true; + QTest::newRow("TIS-620") << "TIS-620" << true; + QTest::newRow("roman8") << "roman8" << true; + QTest::newRow("SJIS") << "SJIS" << false; // all codecs from documentation - QTest::newRow("doc2") << "Big5" << false; - QTest::newRow("doc3") << "Big5-HKSCS" << false; - QTest::newRow("doc4") << "CP949" << false; - QTest::newRow("doc5") << "EUC-JP" << false; - QTest::newRow("doc6") << "EUC-KR" << false; - //QTest::newRow("doc7") << "GB18030-0" << false; // only GB18030 works - QTest::newRow("doc7-bis") << "GB18030" << false; - QTest::newRow("doc8") << "IBM 850" << false; - QTest::newRow("doc9") << "IBM 866" << false; - QTest::newRow("doc10") << "IBM 874" << false; - QTest::newRow("doc11") << "ISO 2022-JP" << false; + QTest::newRow("Big5") << "Big5" << false; + QTest::newRow("Big5-HKSCS") << "Big5-HKSCS" << false; + QTest::newRow("CP949") << "CP949" << false; + QTest::newRow("EUC-JP") << "EUC-JP" << false; + QTest::newRow("EUC-KR") << "EUC-KR" << false; + //QTest::newRow("GB18030-0") << "GB18030-0" << false; // only GB18030 works + QTest::newRow("GB18030") << "GB18030" << false; + QTest::newRow("IBM 850") << "IBM 850" << false; + QTest::newRow("IBM 866") << "IBM 866" << false; + QTest::newRow("IBM 874") << "IBM 874" << false; + QTest::newRow("ISO 2022-JP") << "ISO 2022-JP" << false; //ISO 8859-1 to 10 and ISO 8859-13 to 16 tested previously // Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml tested in Iscii test - //QTest::newRow("doc12") << "JIS X 0201" << false; //actually not there - //QTest::newRow("doc13") << "JIS X 0208" << false; // actually not there - QTest::newRow("doc14") << "KOI8-R" << false; - QTest::newRow("doc15") << "KOI8-U" << false; - //QTest::newRow("doc16") << "MuleLao-1" << false; //only on x11 - QTest::newRow("doc17") << "ROMAN8" << false; - QTest::newRow("doc18") << "Shift-JIS" << false; - QTest::newRow("doc19") << "TIS-620" << false; - QTest::newRow("doc20") << "TSCII" << false; - QTest::newRow("doc21") << "UTF-8" << false; - QTest::newRow("doc22") << "UTF-16" << false; - QTest::newRow("doc23") << "UTF-16BE" << false; - QTest::newRow("doc24") << "UTF-16LE" << false; - QTest::newRow("doc25") << "UTF-32" << false; - QTest::newRow("doc26") << "UTF-32BE" << false; - QTest::newRow("doc27") << "UTF-32LE" << false; + //QTest::newRow("JIS X 0201") << "JIS X 0201" << false; // actually not there + //QTest::newRow("JIS X 0208") << "JIS X 0208" << false; // actually not there + QTest::newRow("KOI8-R") << "KOI8-R" << false; + QTest::newRow("KOI8-U") << "KOI8-U" << false; + //QTest::newRow("MuleLao-1") << "MuleLao-1" << false; //only on x11 + QTest::newRow("ROMAN8") << "ROMAN8" << false; + QTest::newRow("Shift-JIS") << "Shift-JIS" << false; + QTest::newRow("TIS-620") << "TIS-620" << false; + QTest::newRow("TSCII") << "TSCII" << false; + QTest::newRow("UTF-8") << "UTF-8" << false; + QTest::newRow("UTF-16") << "UTF-16" << false; + QTest::newRow("UTF-16BE") << "UTF-16BE" << false; + QTest::newRow("UTF-16LE") << "UTF-16LE" << false; + QTest::newRow("UTF-32") << "UTF-32" << false; + QTest::newRow("UTF-32BE") << "UTF-32BE" << false; + QTest::newRow("UTF-32LE") << "UTF-32LE" << false; //Windows-1250 to 1258 tested previously - QTest::newRow("doc3") << "WINSAMI2" << false; } void tst_QTextCodec::fromUnicode() @@ -1222,7 +1219,7 @@ void tst_QTextCodec::utf8Codec_data() utf8.clear(); utf8 += char(0xff); str = fromInvalidUtf8Sequence(utf8); - QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.1") << utf8 << str << -1; + QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.2") << utf8 << str << -1; // 3.5.2 utf8.clear(); @@ -1230,7 +1227,7 @@ void tst_QTextCodec::utf8Codec_data() utf8 += char(0xfe); utf8 += char(0xff); str = fromInvalidUtf8Sequence(utf8); - QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.1") << utf8 << str << -1; + QTest::newRow("http://www.w3.org/2001/06/utf-8-wrong/UTF-8-test.html 3.5.2-1") << utf8 << str << -1; // 4.1.1 utf8.clear(); diff --git a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp index 69b91683d4..e07b7cb239 100644 --- a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp +++ b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp @@ -239,7 +239,7 @@ void tst_Utf8::invalidUtf8_data() QTest::newRow("non-unicode-3") << QByteArray("\xFC\x84\x80\x80\x80\x80"); // 0x7fffffff: 1 11 1111 11 1111 11 1111 11 1111 11 1111 // encoding: xxxx:xxz0 xz00:0100 xz00:0000 xz00:0000 xz00:0001 xz00:0001 - QTest::newRow("non-unicode-3") << QByteArray("\xFD\xBF\xBF\xBF\xBF\xBF"); + QTest::newRow("non-unicode-4") << QByteArray("\xFD\xBF\xBF\xBF\xBF\xBF"); // As seen above, 0xFE and 0xFF never appear: QTest::newRow("fe") << QByteArray("\xFE"); @@ -269,9 +269,9 @@ void tst_Utf8::invalidUtf8_data() // overlong 4: xxxx:z000 xz00:0000 xz00:0010 xz00:0000 QTest::newRow("overlong-2-4") << QByteArray("\xF0\x80\x82\x80"); // overlong 5: xxxx:xz00 xz00:0000 xz00:0000 xz00:0010 xz00:0000 - QTest::newRow("overlong-2-4") << QByteArray("\xF8\x80\x80\x82\x80"); + QTest::newRow("overlong-2-5") << QByteArray("\xF8\x80\x80\x82\x80"); // overlong 6: xxxx:xxz0 xz00:0000 xz00:0000 xz00:0000 xz00:0010 xz00:0000 - QTest::newRow("overlong-2-4") << QByteArray("\xFC\x80\x80\x80\x82\x80"); + QTest::newRow("overlong-2-6") << QByteArray("\xFC\x80\x80\x80\x82\x80"); // U+0800: 10 0000 00 0000 // proper encoding: xxxz:0000 xz10:0000 xz00:0000 diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro index 4f284ac21e..a85a385f80 100644 --- a/tests/auto/corelib/corelib.pro +++ b/tests/auto/corelib/corelib.pro @@ -7,6 +7,7 @@ SUBDIRS=\ itemmodels \ json \ kernel \ + mimetypes \ plugin \ statemachine \ thread \ diff --git a/tests/auto/corelib/global/global.pro b/tests/auto/corelib/global/global.pro index a6c638f530..d4293a896c 100644 --- a/tests/auto/corelib/global/global.pro +++ b/tests/auto/corelib/global/global.pro @@ -6,4 +6,4 @@ SUBDIRS=\ qglobal \ qnumeric \ qrand \ - qmessagehandler + qlogging diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro new file mode 100644 index 0000000000..1088d08a58 --- /dev/null +++ b/tests/auto/corelib/global/qlogging/app/app.pro @@ -0,0 +1,11 @@ +TEMPLATE = app + +TARGET = app +QT = core + +DESTDIR = ./ + +CONFIG -= app_bundle +CONFIG += console + +SOURCES += main.cpp diff --git a/tests/auto/corelib/global/qlogging/app/main.cpp b/tests/auto/corelib/global/qlogging/app/main.cpp new file mode 100644 index 0000000000..dfa52315c7 --- /dev/null +++ b/tests/auto/corelib/global/qlogging/app/main.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <QCoreApplication> + +struct T { + T() { qDebug("static constructor"); } + ~T() { qDebug("static destructor"); } +} t; + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + app.setApplicationName("tst_qlogging"); + + qDebug("qDebug"); + qWarning("qWarning"); + qCritical("qCritical"); + return 0; +} diff --git a/tests/auto/corelib/global/qlogging/qlogging.pro b/tests/auto/corelib/global/qlogging/qlogging.pro new file mode 100644 index 0000000000..1d5e7681df --- /dev/null +++ b/tests/auto/corelib/global/qlogging/qlogging.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs +CONFIG += ordered + +SUBDIRS += \ + app \ + tst_qlogging.pro diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp new file mode 100644 index 0000000000..aaec46fe64 --- /dev/null +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -0,0 +1,674 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <qdebug.h> +#include <qglobal.h> +#include <QtCore/QProcess> +#include <QtTest/QtTest> + +class tst_qmessagehandler : public QObject +{ + Q_OBJECT +public slots: + void initTestCase(); + +private slots: + void cleanup(); + + void defaultHandler(); + void installMessageHandler(); + void installMsgHandler(); + void installBothHandler(); + + void cleanupFuncinfo_data(); + void cleanupFuncinfo(); + + void qMessagePattern(); + +private: + QString m_appDir; +}; + +static QtMsgType s_type; +const char *s_file; +int s_line; +const char *s_function; +static QString s_message; + +void customMessageHandler(QtMsgType type, const QMessageLogContext &context, const char *msg) +{ + s_type = type; + s_file = context.file; + s_line = context.line; + s_function = context.function; + s_message = QString::fromLocal8Bit(msg); +} + +void customMsgHandler(QtMsgType type, const char *msg) +{ + s_type = type; + s_file = 0; + s_line = 0; + s_function = 0; + s_message = QString::fromLocal8Bit(msg); +} + +void tst_qmessagehandler::initTestCase() +{ + m_appDir = QFINDTESTDATA("app"); + QVERIFY2(!m_appDir.isEmpty(), qPrintable( + QString::fromLatin1("Couldn't find helper app dir starting from %1.").arg(QDir::currentPath()))); +} + +void tst_qmessagehandler::cleanup() +{ + qInstallMsgHandler(0); + qInstallMessageHandler(0); + s_type = QtFatalMsg; + s_file = 0; + s_line = 0; + s_function = 0; +} + +void tst_qmessagehandler::defaultHandler() +{ + // check that the default works + QTest::ignoreMessage(QtDebugMsg, "defaultHandler"); + qDebug("defaultHandler"); +} + +void tst_qmessagehandler::installMessageHandler() +{ + QMessageHandler oldHandler = qInstallMessageHandler(customMessageHandler); + + qDebug("installMessageHandler"); int line = __LINE__; + + QCOMPARE(s_type, QtDebugMsg); + QCOMPARE(s_message, QString::fromLocal8Bit("installMessageHandler")); + QCOMPARE(s_file, __FILE__); + QCOMPARE(s_function, Q_FUNC_INFO); + QCOMPARE(s_line, line); + + QMessageHandler myHandler = qInstallMessageHandler(oldHandler); + QCOMPARE((void*)myHandler, (void*)customMessageHandler); +} + +void tst_qmessagehandler::installMsgHandler() +{ + QtMsgHandler oldHandler = qInstallMsgHandler(customMsgHandler); + + qDebug("installMsgHandler"); + + QCOMPARE(s_type, QtDebugMsg); + QCOMPARE(s_message, QString::fromLocal8Bit("installMsgHandler")); + QCOMPARE(s_file, (const char*)0); + QCOMPARE(s_function, (const char*)0); + QCOMPARE(s_line, 0); + + QtMsgHandler myHandler = qInstallMsgHandler(oldHandler); + QCOMPARE((void*)myHandler, (void*)customMsgHandler); +} + +void tst_qmessagehandler::installBothHandler() +{ + qInstallMessageHandler(customMessageHandler); + qInstallMsgHandler(customMsgHandler); + + qDebug("installBothHandler"); int line = __LINE__; + + QCOMPARE(s_type, QtDebugMsg); + QCOMPARE(s_message, QString::fromLocal8Bit("installBothHandler")); + QCOMPARE(s_file, __FILE__); + QCOMPARE(s_function, Q_FUNC_INFO); + QCOMPARE(s_line, line); +} + +# define ADD(x) QTest::newRow(x) << Q_FUNC_INFO << x; + +class TestClass1 +{ +public: + enum Something { foo }; + char c; + + void func_void() { ADD("TestClass1::func_void"); } + int func_int() { ADD("TestClass1::func_int"); return 0; } + unsigned func_unsigned() { ADD("TestClass1::func_unsigned"); return 0; } + long func_long() { ADD("TestClass1::func_long"); return 0; } + long long func_ll() { ADD("TestClass1::func_ll"); return 0; } + unsigned long long func_ull() { ADD("TestClass1::func_ull"); return 0; } + char func_char() { ADD("TestClass1::func_char"); return 0; } + signed char func_schar() { ADD("TestClass1::func_schar"); return 0; } + unsigned char func_uchar() { ADD("TestClass1::func_uchar"); return 0; } + char &func_Rchar() { ADD("TestClass1::func_Rchar"); return c; } + char *func_Pchar() { ADD("TestClass1::func_Pchar"); return 0; } + const char *func_KPchar() { ADD("TestClass1::func_KPchar"); return 0; } + const volatile char *func_VKPchar() { ADD("TestClass1::func_VKPchar"); return 0; } + const volatile unsigned long long * const volatile func_KVPKVull() { ADD("TestClass1::func_KVPKVull"); return 0; } + const void * const volatile *func_KPKVvoid() { ADD("TestClass1::func_KPKVvoid"); return 0; } + + QList<int> func_ai() { ADD("TestClass1::func_ai"); return QList<int>(); } + QList<unsigned long long const volatile*> func_aptr() { ADD("TestClass1::func_aptr"); return QList<unsigned long long const volatile*>(); } + + QList<Something> func_aenum() { ADD("TestClass1::func_aenum"); return QList<Something>(); } + QList<QList<const void *> > func_aaptr() { ADD("TestClass1::func_aaptr"); return QList<QList<const void *> >(); } + + QMap<int, Something> func_ienummap() { ADD("TestClass1::func_ienummap"); return QMap<int, Something>(); } + + template<typename T> + T* func_template1() { ADD("TestClass1::func_template1"); return 0; } + template<Something val> + long func_template2() { ADD("TestClass1::func_template2"); return long(val); } + + typedef unsigned long long * ( *fptr)(); + typedef unsigned long long * (TestClass1::* pmf)(); + typedef fptr (TestClass1::* uglypmf)(); + fptr func_fptr() { ADD("TestClass1::func_fptr"); return 0; } + pmf func_pmf() { ADD("TestClass1::func_pmf"); return 0; } + uglypmf func_uglypmf(uglypmf = 0) { ADD("TestClass1::func_uglypmf"); return 0; } + QMap<QString, uglypmf> func_uglypmf2() { ADD("TestClass1::func_uglypmf2"); return QMap<QString, uglypmf>(); } + + void operator()() { ADD("TestClass1::operator()"); } + int operator<(int) { ADD("TestClass1::operator<"); return 0; } + int operator>(int) { ADD("TestClass1::operator>"); return 0; } + int operator<=(int) { ADD("TestClass1::operator<="); return 0; } + int operator>=(int) { ADD("TestClass1::operator>="); return 0; } + int operator=(int) { ADD("TestClass1::operator="); return 0; } + int operator+(int) { ADD("TestClass1::operator+"); return 0; } + int operator-(int) { ADD("TestClass1::operator-"); return 0; } + int operator*(int) { ADD("TestClass1::operator*"); return 0; } + int operator/(int) { ADD("TestClass1::operator/"); return 0; } + int operator%(int) { ADD("TestClass1::operator%"); return 0; } + int x; + int &operator++() { ADD("TestClass1::operator++"); return x; } + int operator++(int) { ADD("TestClass1::operator++"); return 0; } + int &operator--() { ADD("TestClass1::operator--"); return x; } + int operator--(int) { ADD("TestClass1::operator--"); return 0; } + +public: + TestClass1() + { + // instantiate + func_void(); + func_int(); + func_unsigned(); + func_long(); + func_ll(); + func_ull(); + func_char(); + func_schar(); + func_uchar(); + func_Rchar(); + func_Pchar(); + func_KPchar(); + func_VKPchar(); + func_KVPKVull(); + func_KPKVvoid(); + func_ai(); + func_aptr(); + func_aenum(); + func_aaptr(); + func_ienummap(); + func_template1<TestClass1>(); + func_template2<foo>(); + func_fptr(); + func_pmf(); + func_uglypmf(); + func_uglypmf2(); + operator()(); + operator<(0); + operator>(0); + operator<=(0); + operator>=(0); + operator=(0); + operator+(0); + operator-(0); + operator*(0); + operator/(0); + operator%(0); + operator++(); + operator++(0); + operator--(); + operator--(0); + } +}; + +template<typename T> class TestClass2 +{ + long func_long() { ADD("TestClass2::func_long"); return 0; } + template<typename S> + T* func_template1() { ADD("TestClass2::func_template1"); return 0; } + template<TestClass1::Something val> + long func_template2() { ADD("TestClass2::func_template2"); return long(val); } +public: + TestClass2() + { + func_long(); + func_template1<TestClass2>(); + func_template2<TestClass1::foo>(); + } +}; + +template<typename T, TestClass1::Something v> class TestClass3 +{ + long func_long() { ADD("TestClass3::func_long"); return 0; } + template<typename S> + S* func_template1() { ADD("TestClass3::func_template1"); return 0; } + template<TestClass1::Something val> + long func_template2() { ADD("TestClass3::func_template2"); return long(val); } +public: + struct Foo { TestClass3 foo; }; + TestClass3() + { + func_long(); + func_template1<TestClass2<T> >(); + func_template2<TestClass1::foo>(); + } +}; + +class TestClass4 +{ + TestClass1 c1; + + TestClass2<std::map<long, const void *> > func2() + { ADD("TestClass4::func2"); return TestClass2<std::map<long, const void *> >(); } + TestClass3<std::map<std::list<int>, const void *>, TestClass1::foo>::Foo func3() + { ADD("TestClass4::func3"); return TestClass3<std::map<std::list<int>, const void *>, TestClass1::foo>::Foo(); } +public: + TestClass4() + { + func2(); + func3(); + ADD("TestClass4::TestClass4"); + } + ~TestClass4() + { + ADD("TestClass4::~TestClass4"); + } +}; + + +void tst_qmessagehandler::cleanupFuncinfo_data() +{ +#ifndef QT_BUILD_INTERNAL + QSKIP("Requires -developer-build"); +#endif + QTest::addColumn<QString>("funcinfo"); + QTest::addColumn<QString>("expected"); + + TestClass4 c4; + + QTest::newRow("msvc_01") + << "void __thiscall TestClass1::func_void(void)" + << "TestClass1::func_void"; + QTest::newRow("gcc_01") + << "void TestClass1::func_void()" + << "TestClass1::func_void"; + + QTest::newRow("msvc_02") + << "int __thiscall TestClass1::func_int(void)" + << "TestClass1::func_int"; + QTest::newRow("gcc_02") + << "int TestClass1::func_int()" + << "TestClass1::func_int"; + + QTest::newRow("msvc_03") + << "unsigned int __thiscall TestClass1::func_unsigned(void)" + << "TestClass1::func_unsigned"; + QTest::newRow("gcc_03") + << "unsigned int TestClass1::func_unsigned()" + << "TestClass1::func_unsigned"; + + QTest::newRow("msvc_04") + << "long __thiscall TestClass1::func_long(void)" + << "TestClass1::func_long"; + QTest::newRow("gcc_04") + << "long int TestClass1::func_long()" + << "TestClass1::func_long"; + + QTest::newRow("msvc_05") + << "__int64 __thiscall TestClass1::func_ll(void)" + << "TestClass1::func_ll"; + QTest::newRow("gcc_05") + << "long long int TestClass1::func_ll()" + << "TestClass1::func_ll"; + + QTest::newRow("msvc_06") + << "unsigned __int64 __thiscall TestClass1::func_ull(void)" + << "TestClass1::func_ull"; + QTest::newRow("gcc_06") + << "long long unsigned int TestClass1::func_ull()" + << "TestClass1::func_ull"; + + QTest::newRow("msvc_07") + << "char __thiscall TestClass1::func_char(void)" + << "TestClass1::func_char"; + QTest::newRow("gcc_07") + << "char TestClass1::func_char()" + << "TestClass1::func_char"; + + QTest::newRow("msvc_08") + << "signed char __thiscall TestClass1::func_schar(void)" + << "TestClass1::func_schar"; + QTest::newRow("gcc_08") + << "signed char TestClass1::func_schar()" + << "TestClass1::func_schar"; + + QTest::newRow("msvc_09") + << "unsigned char __thiscall TestClass1::func_uchar(void)" + << "TestClass1::func_uchar"; + QTest::newRow("gcc_09") + << "unsigned char TestClass1::func_uchar()" + << "TestClass1::func_uchar"; + + QTest::newRow("msvc_09a") + << "char &__thiscall TestClass1::func_Rchar(void)" + << "TestClass1::func_Rchar"; + QTest::newRow("gcc_09a") + << "char& TestClass1::func_Rchar()" + << "TestClass1::func_Rchar"; + QTest::newRow("clang_09a") + << "char &TestClass1::func_Rchar()" + << "TestClass1::func_Rchar"; + + QTest::newRow("msvc_10") + << "char *__thiscall TestClass1::func_Pchar(void)" + << "TestClass1::func_Pchar"; + QTest::newRow("gcc_10") + << "char* TestClass1::func_Pchar()" + << "TestClass1::func_Pchar"; + QTest::newRow("clang_10") + << "char *TestClass1::func_Pchar()" + << "TestClass1::func_Pchar"; + + QTest::newRow("msvc_11") + << "const char *__thiscall TestClass1::func_KPchar(void)" + << "TestClass1::func_KPchar"; + QTest::newRow("gcc_11") + << "const char* TestClass1::func_KPchar()" + << "TestClass1::func_KPchar"; + + QTest::newRow("msvc_12") + << "volatile const char *__thiscall TestClass1::func_VKPchar(void)" + << "TestClass1::func_VKPchar"; + QTest::newRow("gcc_12") + << "const volatile char* TestClass1::func_VKPchar()" + << "TestClass1::func_VKPchar"; + + QTest::newRow("msvc_13") + << "volatile const unsigned __int64 *volatile const __thiscall TestClass1::func_KVPKVull(void)" + << "TestClass1::func_KVPKVull"; + QTest::newRow("gcc_13") + << "const volatile long long unsigned int* const volatile TestClass1::func_KVPKVull()" + << "TestClass1::func_KVPKVull"; + + QTest::newRow("msvc_14") + << "const void *volatile const *__thiscall TestClass1::func_KPKVvoid(void)" + << "TestClass1::func_KPKVvoid"; + QTest::newRow("gcc_14") + << "const void* const volatile* TestClass1::func_KPKVvoid()" + << "TestClass1::func_KPKVvoid"; + + QTest::newRow("msvc_15") + << "class QList<int> __thiscall TestClass1::func_ai(void)" + << "TestClass1::func_ai"; + QTest::newRow("gcc_15") + << "QList<int> TestClass1::func_ai()" + << "TestClass1::func_ai"; + + QTest::newRow("msvc_16") + << "class QList<unsigned __int64 const volatile *> __thiscall TestClass1::func_aptr(void)" + << "TestClass1::func_aptr"; + QTest::newRow("gcc_16") + << "QList<const volatile long long unsigned int*> TestClass1::func_aptr()" + << "TestClass1::func_aptr"; + + QTest::newRow("msvc_17") + << "class QList<enum TestClass1::Something> __thiscall TestClass1::func_aenum(void)" + << "TestClass1::func_aenum"; + QTest::newRow("gcc_17") + << "QList<TestClass1::Something> TestClass1::func_aenum()" + << "TestClass1::func_aenum"; + + QTest::newRow("msvc_18") + << "class QList<class QList<void const *> > __thiscall TestClass1::func_aaptr(void)" + << "TestClass1::func_aaptr"; + QTest::newRow("gcc_18") + << "QList<QList<const void*> > TestClass1::func_aaptr()" + << "TestClass1::func_aaptr"; + + QTest::newRow("msvc_19") + << "class QMap<int,enum TestClass1::Something> __thiscall TestClass1::func_ienummap(void)" + << "TestClass1::func_ienummap"; + QTest::newRow("gcc_19") + << "QMap<int, TestClass1::Something> TestClass1::func_ienummap()" + << "TestClass1::func_ienummap"; + + QTest::newRow("msvc_20") + << "class TestClass1 *__thiscall TestClass1::func_template1<class TestClass1>(void)" + << "TestClass1::func_template1"; + QTest::newRow("gcc_20") + << "T* TestClass1::func_template1() [with T = TestClass1]" + << "TestClass1::func_template1"; + + QTest::newRow("msvc_21") + << "long __thiscall TestClass1::func_template2<foo>(void)" + << "TestClass1::func_template2"; + QTest::newRow("gcc_21") + << "long int TestClass1::func_template2() [with TestClass1::Something val = foo]" + << "TestClass1::func_template2"; + + QTest::newRow("msvc_22") + << "unsigned __int64 *(__cdecl *__thiscall TestClass1::func_fptr(void))(void)" + << "TestClass1::func_fptr"; + QTest::newRow("gcc_22") + << "long long unsigned int* (* TestClass1::func_fptr())()" + << "TestClass1::func_fptr"; + + QTest::newRow("msvc_23") + << "unsigned __int64 *(__thiscall TestClass1::* __thiscall TestClass1::func_pmf(void))(void)" + << "TestClass1::func_pmf"; + QTest::newRow("gcc_23") + << "long long unsigned int* (TestClass1::* TestClass1::func_pmf())()" + << "TestClass1::func_pmf"; + + QTest::newRow("msvc_24") + << "unsigned __int64 *(__cdecl *(__thiscall TestClass1::* __thiscall TestClass1::func_uglypmf(unsigned __int64 *(__cdecl *(__thiscall TestClass1::* )(void))(void)))(void))(void)" + << "TestClass1::func_uglypmf"; + QTest::newRow("gcc_24") + << "long long unsigned int* (* (TestClass1::* TestClass1::func_uglypmf(long long unsigned int* (* (TestClass1::*)())()))())()" + << "TestClass1::func_uglypmf"; + + QTest::newRow("msvc_25") + << "class QMap<class QString,unsigned __int64 * (__cdecl*(__thiscall TestClass1::*)(void))(void)> __thiscall TestClass1::func_uglypmf2(void)" + << "TestClass1::func_uglypmf2"; + QTest::newRow("gcc_25") + << "QMap<QString, long long unsigned int* (* (TestClass1::*)())()> TestClass1::func_uglypmf2()" + << "TestClass1::func_uglypmf2"; + + QTest::newRow("msvc_26") + << "class TestClass2<class std::map<long,void const *,struct std::less<long>,class std::allocator<struct std::pair<long const ,void const *> > > > __thiscall TestClass4::func2(void)" + << "TestClass4::func2"; + QTest::newRow("gcc_26") + << "TestClass2<std::map<long int, const void*, std::less<long int>, std::allocator<std::pair<const long int, const void*> > > > TestClass4::func2()" + << "TestClass4::func2"; + + QTest::newRow("msvc_27") + << "long __thiscall TestClass2<class std::map<long,void const *,struct std::less<long>,class std::allocator<struct std::pair<long const ,void const *> > > >::func_long(void)" + << "TestClass2::func_long"; + QTest::newRow("gcc_27") + << "long int TestClass2<T>::func_long() [with T = std::map<long int, const void*, std::less<long int>, std::allocator<std::pair<const long int, const void*> > >]" + << "TestClass2::func_long"; + + QTest::newRow("msvc_28") + << "class std::map<long,void const *,struct std::less<long>,class std::allocator<struct std::pair<long const ,void const *> > > *__thiscall TestClass2<class std::map<long,void const *,struct std::less<long>,class std::allocator<struct std::pair<long const ,void const *> > > >::func_template1<class TestClass2<class std::map<long,void const *,struct std::less<long>,class std::allocator<struct std::pair<long const ,void const *> > > >>(void)" + << "TestClass2::func_template1"; + QTest::newRow("gcc_21") + << "T* TestClass2<T>::func_template1() [with S = TestClass2<std::map<long int, const void*, std::less<long int>, std::allocator<std::pair<const long int, const void*> > > >, T = std::map<long int, const void*, std::less<long int>, std::allocator<std::pair<const long int, const void*> > >]" + << "TestClass2::func_template1"; + + QTest::newRow("msvc_29") + << "long __thiscall TestClass2<class std::map<long,void const *,struct std::less<long>,class std::allocator<struct std::pair<long const ,void const *> > > >::func_template2<foo>(void)" + << "TestClass2::func_template2"; + QTest::newRow("gcc_29") + << "long int TestClass2<T>::func_template2() [with TestClass1::Something val = foo, T = std::map<long int, const void*, std::less<long int>, std::allocator<std::pair<const long int, const void*> > >]" + << "TestClass2::func_template2"; + + QTest::newRow("msvc_30") + << "struct TestClass3<class std::map<class std::list<int,class std::allocator<int> >,void const *,struct std::less<class std::list<int,class std::allocator<int> > >,class std::allocator<struct std::pair<class std::list<int,class std::allocator<int> > const ,void const *> > >,0>::Foo __thiscall TestClass4::func3(void)" + << "TestClass4::func3"; + QTest::newRow("gcc_30") + << "TestClass3<std::map<std::list<int, std::allocator<int> >, const void*, std::less<std::list<int, std::allocator<int> > >, std::allocator<std::pair<const std::list<int, std::allocator<int> >, const void*> > >, foo>::Foo TestClass4::func3()" + << "TestClass4::func3"; + + QTest::newRow("msvc_31") + << "long __thiscall TestClass3<class std::map<class std::list<int,class std::allocator<int> >,void const *,struct std::less<class std::list<int,class std::allocator<int> > >,class std::allocator<struct std::pair<class std::list<int,class std::allocator<int> > const ,void const *> > >,0>::func_long(void)" + << "TestClass3::func_long"; + QTest::newRow("gcc_31") + << "long int TestClass3<T, v>::func_long() [with T = std::map<std::list<int, std::allocator<int> >, const void*, std::less<std::list<int, std::allocator<int> > >, std::allocator<std::pair<const std::list<int, std::allocator<int> >, const void*> > >, TestClass1::Something v = foo]" + << "TestClass3::func_long"; + + QTest::newRow("msvc_32") + << "class TestClass2<class std::map<class std::list<int,class std::allocator<int> >,void const *,struct std::less<class std::list<int,class std::allocator<int> > >,class std::allocator<struct std::pair<class std::list<int,class std::allocator<int> > const ,void const *> > > > *__thiscall TestClass3<class std::map<class std::list<int,class std::allocator<int> >,void const *,struct std::less<class std::list<int,class std::allocator<int> > >,class std::allocator<struct std::pair<class std::list<int,class std::allocator<int> > const ,void const *> > >,0>::func_template1<class TestClass2<class std::map<class std::list<int,class std::allocator<int> >,void const *,struct std::less<class std::list<int,class std::allocator<int> > >,class std::allocator<struct std::pair<class std::list<int,class std::allocator<int> > const ,void const *> > > >>(void)" + << "TestClass3::func_template1"; + QTest::newRow("gcc_32") + << "S* TestClass3<T, v>::func_template1() [with S = TestClass2<std::map<std::list<int, std::allocator<int> >, const void*, std::less<std::list<int, std::allocator<int> > >, std::allocator<std::pair<const std::list<int, std::allocator<int> >, const void*> > > >, T = std::map<std::list<int, std::allocator<int> >, const void*, std::less<std::list<int, std::allocator<int> > >, std::allocator<std::pair<const std::list<int, std::allocator<int> >, const void*> > >, TestClass1::Something v = foo]" + << "TestClass3::func_template1"; + + QTest::newRow("msvc_33") + << "long __thiscall TestClass3<class std::map<class std::list<int,class std::allocator<int> >,void const *,struct std::less<class std::list<int,class std::allocator<int> > >,class std::allocator<struct std::pair<class std::list<int,class std::allocator<int> > const ,void const *> > >,0>::func_template2<foo>(void)" + << "TestClass3::func_template2"; + QTest::newRow("gcc_33") + << "long int TestClass3<T, v>::func_template2() [with TestClass1::Something val = foo, T = std::map<std::list<int, std::allocator<int> >, const void*, std::less<std::list<int, std::allocator<int> > >, std::allocator<std::pair<const std::list<int, std::allocator<int> >, const void*> > >, TestClass1::Something v = foo]" + << "TestClass3::func_template2"; + + QTest::newRow("msvc_34") + << "__thiscall TestClass4::TestClass4(void)" + << "TestClass4::TestClass4"; + QTest::newRow("gcc_34") + << "TestClass4::TestClass4()" + << "TestClass4::TestClass4"; + + QTest::newRow("msvc_35") + << "__thiscall TestClass4::~TestClass4(void)" + << "TestClass4::~TestClass4"; + QTest::newRow("gcc_35") + << "TestClass4::~TestClass4()" + << "TestClass4::~TestClass4"; + + QTest::newRow("gcc_36") + << "void TestClass1::operator()()" + << "TestClass1::operator()"; + + QTest::newRow("gcc_37") + << "long int TestClass1::func_template2() [with TestClass1::Something val = (TestClass1::Something)0u]" + << "TestClass1::func_template2"; + + QTest::newRow("gcc_38") + << "int TestClass1::operator<(int)" + << "TestClass1::operator<"; + + QTest::newRow("gcc_39") + << "int TestClass1::operator>(int)" + << "TestClass1::operator>";} + +#ifdef QT_BUILD_INTERNAL +QT_BEGIN_NAMESPACE +extern QByteArray qCleanupFuncinfo(QByteArray); +QT_END_NAMESPACE +#endif + +void tst_qmessagehandler::cleanupFuncinfo() +{ +#ifdef QT_BUILD_INTERNAL + QFETCH(QString, funcinfo); + +// qDebug() << funcinfo.toLatin1(); + QByteArray result = qCleanupFuncinfo(funcinfo.toLatin1()); + QTEST(QString::fromLatin1(result), "expected"); +#endif +} + +void tst_qmessagehandler::qMessagePattern() +{ + QProcess process; + + QStringList environment = QProcess::systemEnvironment(); + // %{file} is tricky because of shadow builds + environment.prepend("QT_MESSAGE_PATTERN=\"%{type} %{appname} %{line} %{function} %{message}\""); + process.setEnvironment(environment); + + QString appExe = m_appDir + "/app"; + process.start(appExe); + QVERIFY2(process.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(appExe, process.errorString()))); + process.waitForFinished(); + + QByteArray output = process.readAllStandardError(); +// qDebug() << output; + QVERIFY(!output.isEmpty()); + + QVERIFY(output.contains("debug 45 T::T static constructor")); + // we can't be sure whether the QT_MESSAGE_PATTERN is already destructed + QVERIFY(output.contains("static destructor")); + QVERIFY(output.contains("debug tst_qlogging 54 main qDebug")); + QVERIFY(output.contains("warning tst_qlogging 55 main qWarning")); + QVERIFY(output.contains("critical tst_qlogging 56 main qCritical")); + + environment = QProcess::systemEnvironment(); + environment.prepend("QT_MESSAGE_PATTERN=\"PREFIX: %{unknown} %{message}\""); + process.setEnvironment(environment); + + process.start(appExe); + QVERIFY2(process.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(appExe, process.errorString()))); + process.waitForFinished(); + + output = process.readAllStandardError(); +// qDebug() << output; + QVERIFY(!output.isEmpty()); + + QVERIFY(output.contains("QT_MESSAGE_PATTERN: Unknown placeholder %{unknown}")); + QVERIFY(output.contains("PREFIX: qDebug")); +} + +QTEST_MAIN(tst_qmessagehandler) +#include "tst_qlogging.moc" diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.pro b/tests/auto/corelib/global/qlogging/tst_qlogging.pro new file mode 100644 index 0000000000..60377e0fdc --- /dev/null +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.pro @@ -0,0 +1,4 @@ +CONFIG += testcase parallel_test +TARGET = tst_qlogging +QT = core testlib +SOURCES = tst_qlogging.cpp diff --git a/tests/auto/corelib/global/qmessagehandler/qmessagehandler.pro b/tests/auto/corelib/global/qmessagehandler/qmessagehandler.pro deleted file mode 100644 index 8bdba4bfc4..0000000000 --- a/tests/auto/corelib/global/qmessagehandler/qmessagehandler.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase parallel_test -TARGET = tst_qmessagehandler -QT = core testlib -SOURCES = tst_qmessagehandler.cpp diff --git a/tests/auto/corelib/global/qmessagehandler/tst_qmessagehandler.cpp b/tests/auto/corelib/global/qmessagehandler/tst_qmessagehandler.cpp deleted file mode 100644 index 39bd0986a5..0000000000 --- a/tests/auto/corelib/global/qmessagehandler/tst_qmessagehandler.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** 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 <qdebug.h> -#include <QtTest/QtTest> - -#include <qglobal.h> - -class tst_qmessagehandler : public QObject -{ - Q_OBJECT -private slots: - void cleanup(); - - void defaultHandler(); - void installMessageHandler(); - void installMsgHandler(); - void installBothHandler(); -}; - -static QtMsgType s_type; -const char *s_file; -int s_line; -const char *s_function; -static QString s_message; - -void customMessageHandler(QtMsgType type, const QMessageLogContext &context, const char *msg) -{ - s_type = type; - s_file = context.file; - s_line = context.line; - s_function = context.function; - s_message = QString::fromLocal8Bit(msg); -} - -void customMsgHandler(QtMsgType type, const char *msg) -{ - s_type = type; - s_file = 0; - s_line = 0; - s_function = 0; - s_message = QString::fromLocal8Bit(msg); -} - -void tst_qmessagehandler::cleanup() -{ - qInstallMsgHandler(0); - qInstallMessageHandler(0); - s_type = QtFatalMsg; - s_file = 0; - s_line = 0; - s_function = 0; -} - -void tst_qmessagehandler::defaultHandler() -{ - // check that the default works - QTest::ignoreMessage(QtDebugMsg, "defaultHandler"); - qDebug("defaultHandler"); -} - -void tst_qmessagehandler::installMessageHandler() -{ - QMessageHandler oldHandler = qInstallMessageHandler(customMessageHandler); - - qDebug("installMessageHandler"); int line = __LINE__; - - QCOMPARE(s_type, QtDebugMsg); - QCOMPARE(s_message, QString::fromLocal8Bit("installMessageHandler")); - QCOMPARE(s_file, __FILE__); - QCOMPARE(s_function, Q_FUNC_INFO); - QCOMPARE(s_line, line); - - QMessageHandler myHandler = qInstallMessageHandler(oldHandler); - QCOMPARE((void*)myHandler, (void*)customMessageHandler); -} - -void tst_qmessagehandler::installMsgHandler() -{ - QtMsgHandler oldHandler = qInstallMsgHandler(customMsgHandler); - - qDebug("installMsgHandler"); - - QCOMPARE(s_type, QtDebugMsg); - QCOMPARE(s_message, QString::fromLocal8Bit("installMsgHandler")); - QCOMPARE(s_file, (const char*)0); - QCOMPARE(s_function, (const char*)0); - QCOMPARE(s_line, 0); - - QtMsgHandler myHandler = qInstallMsgHandler(oldHandler); - QCOMPARE((void*)myHandler, (void*)customMsgHandler); -} - -void tst_qmessagehandler::installBothHandler() -{ - qInstallMessageHandler(customMessageHandler); - qInstallMsgHandler(customMsgHandler); - - qDebug("installBothHandler"); int line = __LINE__; - - QCOMPARE(s_type, QtDebugMsg); - QCOMPARE(s_message, QString::fromLocal8Bit("installBothHandler")); - QCOMPARE(s_file, __FILE__); - QCOMPARE(s_function, Q_FUNC_INFO); - QCOMPARE(s_line, line); -} - -QTEST_MAIN(tst_qmessagehandler) -#include "tst_qmessagehandler.moc" diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp index 064724e888..899efc11d9 100644 --- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp +++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp @@ -72,7 +72,7 @@ void tst_QNumeric::fuzzyCompare_data() QTest::newRow("mis2") << 0.0 << 10000000.0 << false; QTest::newRow("mis3") << 0.0 << 0.000000001 << false; QTest::newRow("mis4") << 100000000.0 << 0.000000001 << false; - QTest::newRow("mis4") << 0.0000000001 << 0.000000001 << false; + QTest::newRow("mis5") << 0.0000000001 << 0.000000001 << false; } void tst_QNumeric::fuzzyCompare() diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index eb227625a7..79c96fbdc9 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -2680,8 +2680,8 @@ void tst_QDataStream::status_QBitArray_data() // past end QTest::newRow("empty") << QByteArray() << (int) QDataStream::ReadPastEnd << QBitArray(); QTest::newRow("badsize 0a") << QByteArray("\x00", 1) << (int) QDataStream::ReadPastEnd << QBitArray(); - QTest::newRow("badsize 0a") << QByteArray("\x00\x00", 2) << (int) QDataStream::ReadPastEnd << QBitArray(); - QTest::newRow("badsize 0a") << QByteArray("\x00\x00\x00", 3) << (int) QDataStream::ReadPastEnd << QBitArray(); + QTest::newRow("badsize 0b") << QByteArray("\x00\x00", 2) << (int) QDataStream::ReadPastEnd << QBitArray(); + QTest::newRow("badsize 0c") << QByteArray("\x00\x00\x00", 3) << (int) QDataStream::ReadPastEnd << QBitArray(); QTest::newRow("badsize 1") << QByteArray("\x00\x00\x00\x01", 4) << (int) QDataStream::ReadPastEnd << QBitArray(); QTest::newRow("badsize 2") << QByteArray("\x00\x00\x00\x02", 4) << (int) QDataStream::ReadPastEnd << QBitArray(); QTest::newRow("badsize 3") << QByteArray("\x00\x00\x00\x03", 4) << (int) QDataStream::ReadPastEnd << QBitArray(); diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index f1c9015092..6a48d7e60f 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -190,6 +190,8 @@ private slots: void isReadable(); + void cdBelowRoot(); + private: QString m_dataPath; }; @@ -383,6 +385,10 @@ void tst_QDir::removeRecursively() void tst_QDir::removeRecursivelyFailure() { +#ifdef Q_OS_UNIX + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); +#endif const QString tmpdir = QDir::currentPath() + "/tmpdir/"; const QString path = tmpdir + "undeletable"; QDir().mkpath(path); @@ -1930,6 +1936,10 @@ void tst_QDir::isRelative() void tst_QDir::isReadable() { +#ifdef Q_OS_UNIX + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); +#endif QDir dir; QVERIFY(dir.isReadable()); @@ -1942,6 +1952,36 @@ void tst_QDir::isReadable() #endif } +void tst_QDir::cdBelowRoot() +{ +#if defined (Q_OS_UNIX) +#define ROOT QString("/") +#define DIR QString("/tmp") +#define CD_INTO "tmp" +#else +#define ROOT QString::fromLocal8Bit(qgetenv("SystemDrive"))+"/" +#define DIR QString::fromLocal8Bit(qgetenv("SystemRoot")).replace('\\', '/') +#define CD_INTO QString::fromLocal8Bit(qgetenv("SystemRoot")).mid(3) +#endif + + QDir root(ROOT); + QVERIFY(!root.cd("..")); + QCOMPARE(root.path(), ROOT); + QVERIFY(root.cd(CD_INTO)); + QCOMPARE(root.path(), DIR); +#ifdef Q_OS_UNIX + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); +#endif + QDir dir(DIR); + QVERIFY(!dir.cd("../..")); + QCOMPARE(dir.path(), DIR); + QVERIFY(!dir.cd("../abs/../..")); + QCOMPARE(dir.path(), DIR); + QVERIFY(dir.cd("..")); + QCOMPARE(dir.path(), ROOT); +} + QTEST_MAIN(tst_QDir) #include "tst_qdir.moc" diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp index ad61db51d6..d5d490dc29 100644 --- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp @@ -403,8 +403,11 @@ void tst_QDirIterator::iterateResource() QDirIterator it(dirName, nameFilters, filters, flags); QStringList list; - while (it.hasNext()) - list << it.next(); + while (it.hasNext()) { + const QString dir = it.next(); + if (!dir.startsWith(":/qt-project.org")) + list << dir; + } list.sort(); QStringList sortedEntries = entries; diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 00e45354ba..d1a0debf4d 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -53,7 +53,9 @@ #include <QHostInfo> #endif #include <QProcess> -#ifndef Q_OS_WIN +#ifdef Q_OS_WIN +# include <qt_windows.h> +#else # include <sys/types.h> # include <unistd.h> #endif @@ -476,8 +478,16 @@ void tst_QFile::open_data() QTest::newRow("noreadfile") << QString("noreadfile") << int(QIODevice::ReadOnly) << false << QFile::OpenError; #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly) - << true << QFile::NoError; + //opening devices requires administrative privileges (and elevation). + HANDLE hTest = CreateFile(_T("\\\\.\\PhysicalDrive0"), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + if (hTest != INVALID_HANDLE_VALUE) { + CloseHandle(hTest); + QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly) + << true << QFile::NoError; + } else { + QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly) + << false << QFile::OpenError; + } QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QIODevice::ReadOnly) << true << QFile::NoError; #endif @@ -2339,6 +2349,13 @@ void tst_QFile::rename() QFETCH(QString, destination); QFETCH(bool, result); +#if defined(Q_OS_UNIX) + if (strcmp(QTest::currentDataTag(), "renamefile -> /etc/renamefile") == 0) { + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); + } +#endif + QFile::remove("renamedfile"); QFile f("renamefile"); f.open(QFile::WriteOnly); @@ -3011,25 +3028,28 @@ void tst_QFile::openStandardStreamsBufferedStreams() { QFile in; in.open(stdin, QIODevice::ReadOnly); + if (!in.isSequential()) + QSKIP("Standard input redirected."); QCOMPARE( in.pos(), (qint64)0 ); QCOMPARE( in.size(), (qint64)0 ); - QVERIFY( in.isSequential() ); } { QFile out; out.open(stdout, QIODevice::WriteOnly); + if (!out.isSequential()) + QSKIP("Standard output redirected."); QCOMPARE( out.pos(), (qint64)0 ); QCOMPARE( out.size(), (qint64)0 ); - QVERIFY( out.isSequential() ); } { QFile err; err.open(stderr, QIODevice::WriteOnly); + if (!err.isSequential()) + QSKIP("Standard error redirected."); QCOMPARE( err.pos(), (qint64)0 ); QCOMPARE( err.size(), (qint64)0 ); - QVERIFY( err.isSequential() ); } } diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 7b80152b62..797d5ff5e3 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -159,8 +159,8 @@ private slots: void isBundle_data(); void isBundle(); - void isLocalFs_data(); - void isLocalFs(); + void isNativePath_data(); + void isNativePath(); void refresh(); @@ -1222,10 +1222,13 @@ void tst_QFileInfo::isBundle() QCOMPARE(fi.isBundle(), isBundle); } -void tst_QFileInfo::isLocalFs_data() +void tst_QFileInfo::isNativePath_data() { QTest::addColumn<QString>("path"); - QTest::addColumn<bool>("isLocalFs"); + QTest::addColumn<bool>("isNativePath"); + + QTest::newRow("default-constructed") << QString() << false; + QTest::newRow("empty") << QString("") << true; QTest::newRow("local root") << QString::fromLatin1("/") << true; QTest::newRow("local non-existent file") << QString::fromLatin1("/abrakadabra.boo") << true; @@ -1233,17 +1236,15 @@ void tst_QFileInfo::isLocalFs_data() QTest::newRow("qresource root") << QString::fromLatin1(":/") << false; } -void tst_QFileInfo::isLocalFs() +void tst_QFileInfo::isNativePath() { QFETCH(QString, path); - QFETCH(bool, isLocalFs); + QFETCH(bool, isNativePath); QFileInfo info(path); - QFileInfoPrivate *privateInfo = getPrivate(info); - QCOMPARE((privateInfo->fileEngine == 0), isLocalFs); - if (privateInfo->fileEngine) - QCOMPARE(bool(privateInfo->fileEngine->fileFlags(QAbstractFileEngine::LocalDiskFlag) - & QAbstractFileEngine::LocalDiskFlag), isLocalFs); + if (path.isNull()) + info = QFileInfo(); + QCOMPARE(info.isNativePath(), isNativePath); } void tst_QFileInfo::refresh() @@ -1722,7 +1723,13 @@ void tst_QFileInfo::group() #if defined(Q_OS_UNIX) struct group *gr; gid_t gid = getegid(); + + errno = 0; gr = getgrgid(gid); + + QVERIFY2(gr, qPrintable( + QString("getgrgid returned 0: %1, cannot determine my own group") + .arg(QString::fromLocal8Bit(strerror(errno))))); expected = QString::fromLocal8Bit(gr->gr_name); #endif diff --git a/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp b/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp index fe2e30a95c..b083d3b1c3 100644 --- a/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp +++ b/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp @@ -241,15 +241,15 @@ void tst_QFileSystemEntry::suffix_data() QTest::newRow("data1") << "file.tar.gz" << "gz"; QTest::newRow("data2") << "/path/file/file.tar.gz" << "gz"; QTest::newRow("data3") << "/path/file.tar" << "tar"; - QTest::newRow("hidden1") << ".ext1" << "ext1"; - QTest::newRow("hidden1") << ".ext" << "ext"; - QTest::newRow("hidden1") << ".ex" << "ex"; - QTest::newRow("hidden1") << ".e" << "e"; - QTest::newRow("hidden2") << ".ext1.ext2" << "ext2"; - QTest::newRow("hidden2") << ".ext.ext2" << "ext2"; - QTest::newRow("hidden2") << ".ex.ext2" << "ext2"; - QTest::newRow("hidden2") << ".e.ext2" << "ext2"; - QTest::newRow("hidden2") << "..ext2" << "ext2"; + QTest::newRow("hidden1-1") << ".ext1" << "ext1"; + QTest::newRow("hidden1-2") << ".ext" << "ext"; + QTest::newRow("hidden1-3") << ".ex" << "ex"; + QTest::newRow("hidden1-4") << ".e" << "e"; + QTest::newRow("hidden2-1") << ".ext1.ext2" << "ext2"; + QTest::newRow("hidden2-2") << ".ext.ext2" << "ext2"; + QTest::newRow("hidden2-3") << ".ex.ext2" << "ext2"; + QTest::newRow("hidden2-4") << ".e.ext2" << "ext2"; + QTest::newRow("hidden2-5") << "..ext2" << "ext2"; QTest::newRow("dots") << "/path/file.with.dots/file..ext2" << "ext2"; QTest::newRow("dots2") << "/path/file.with.dots/.file..ext2" << "ext2"; } diff --git a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro index e712a6ad5f..8ada44fdf7 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro +++ b/tests/auto/corelib/io/qfilesystemwatcher/qfilesystemwatcher.pro @@ -2,5 +2,3 @@ CONFIG += testcase parallel_test TARGET = tst_qfilesystemwatcher QT = core testlib SOURCES = tst_qfilesystemwatcher.cpp - -mac: CONFIG += insignificant_test # QTBUG-22744 diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 5e5a99f937..8caccb6da9 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -42,6 +42,7 @@ #include <QCoreApplication> +#include <QTemporaryDir> #include <QFileSystemWatcher> #ifdef Q_OS_LINUX @@ -52,9 +53,15 @@ # endif #endif +/* All tests need to run in temporary directories not used + * by the application to avoid non-deterministic failures on Windows + * due to locked directories and left-overs from previous tests. */ + class tst_QFileSystemWatcher : public QObject { Q_OBJECT +public: + tst_QFileSystemWatcher(); private slots: void basicTest_data(); @@ -75,11 +82,20 @@ private slots: void removeFileAndUnWatch(); - void cleanup(); - void destroyAfterQCoreApplication(); + +private: + QString m_tempDirPattern; }; +tst_QFileSystemWatcher::tst_QFileSystemWatcher() +{ + m_tempDirPattern = QDir::tempPath(); + if (!m_tempDirPattern.endsWith(QLatin1Char('/'))) + m_tempDirPattern += QLatin1Char('/'); + m_tempDirPattern += QStringLiteral("tst_qfilesystemwatcherXXXXXX"); +} + void tst_QFileSystemWatcher::basicTest_data() { QTest::addColumn<QString>("backend"); @@ -92,7 +108,9 @@ void tst_QFileSystemWatcher::basicTest() QFETCH(QString, backend); // create test file - QFile testFile("testfile.txt"); + QTemporaryDir temporaryDirectory(m_tempDirPattern); + QVERIFY(temporaryDirectory.isValid()); + QFile testFile(temporaryDirectory.path() + QStringLiteral("/testfile.txt")); testFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner); testFile.remove(); QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Truncate)); @@ -151,14 +169,16 @@ void tst_QFileSystemWatcher::basicTest() QCOMPARE(changedSpy.count(), 0); // readd the file watch with a relative path - QVERIFY(watcher.addPath(testFile.fileName().prepend("./"))); + const QString relativeTestFileName = QDir::current().relativeFilePath(testFile.fileName()); + QVERIFY(!relativeTestFileName.isEmpty()); + QVERIFY(watcher.addPath(relativeTestFileName)); testFile.open(QIODevice::WriteOnly | QIODevice::Truncate); testFile.write(QByteArray("hello multiverse!")); testFile.close(); QTRY_VERIFY(changedSpy.count() > 0); - QVERIFY(watcher.removePath(testFile.fileName().prepend("./"))); + QVERIFY(watcher.removePath(relativeTestFileName)); changedSpy.clear(); @@ -222,15 +242,21 @@ void tst_QFileSystemWatcher::watchDirectory() { QFETCH(QString, backend); - QDir().mkdir("testDir"); - QDir testDir("testDir"); + QTemporaryDir temporaryDirectory(m_tempDirPattern); + QVERIFY(temporaryDirectory.isValid()); + + QDir temporaryDir(temporaryDirectory.path()); + const QString testDirName = QStringLiteral("testDir"); + QVERIFY(temporaryDir.mkdir(testDirName)); + QDir testDir = temporaryDir; + QVERIFY(testDir.cd(testDirName)); QString testFileName = testDir.filePath("testFile.txt"); QFile::remove(testFileName); QFileSystemWatcher watcher; watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend); - QVERIFY(watcher.addPath(testDir.dirName())); + QVERIFY(watcher.addPath(testDir.absolutePath())); QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(const QString &))); QVERIFY(changedSpy.isValid()); @@ -246,7 +272,7 @@ void tst_QFileSystemWatcher::watchDirectory() QString fileName; // remove the watch, should not get notification of a new file - QVERIFY(watcher.removePath(testDir.dirName())); + QVERIFY(watcher.removePath(testDir.absolutePath())); QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Truncate)); testFile.close(); @@ -256,7 +282,7 @@ void tst_QFileSystemWatcher::watchDirectory() QCOMPARE(changedSpy.count(), 0); - QVERIFY(watcher.addPath(testDir.dirName())); + QVERIFY(watcher.addPath(testDir.absolutePath())); // remove the file again, should get a signal from the watcher QVERIFY(testFile.remove()); @@ -265,7 +291,7 @@ void tst_QFileSystemWatcher::watchDirectory() eventLoop.exec(); // remove the directory, should get a signal from the watcher - QVERIFY(QDir().rmdir("testDir")); + QVERIFY(temporaryDir.rmdir(testDirName)); // waiting max 5 seconds for notification for directory removal to trigger #ifdef Q_OS_WINCE @@ -276,15 +302,16 @@ void tst_QFileSystemWatcher::watchDirectory() QCOMPARE(changedSpy.at(1).count(), 1); fileName = changedSpy.at(0).at(0).toString(); - QCOMPARE(fileName, testDir.dirName()); + QCOMPARE(fileName, testDir.absolutePath()); fileName = changedSpy.at(1).at(0).toString(); - QCOMPARE(fileName, testDir.dirName()); + QCOMPARE(fileName, testDir.absolutePath()); changedSpy.clear(); // recreate the file, we should not get any notification - if (!QDir().mkdir("testDir")) - QSKIP("Failed to recreate directory, skipping final test."); + if (!temporaryDir.mkdir(testDirName)) + QSKIP(qPrintable(QString::fromLatin1("Failed to recreate directory '%1' under '%2', skipping final test."). + arg(testDirName, temporaryDir.absolutePath()))); // waiting max 5 seconds for notification for dir recreation to trigger timer.start(5000); @@ -292,7 +319,7 @@ void tst_QFileSystemWatcher::watchDirectory() QCOMPARE(changedSpy.count(), 0); - QVERIFY(QDir().rmdir("testDir")); + QVERIFY(temporaryDir.rmdir(testDirName)); } void tst_QFileSystemWatcher::addPath() @@ -360,8 +387,15 @@ void tst_QFileSystemWatcher::removePaths() void tst_QFileSystemWatcher::watchFileAndItsDirectory() { QFETCH(QString, backend); - QDir().mkdir("testDir"); - QDir testDir("testDir"); + + QTemporaryDir temporaryDirectory(m_tempDirPattern); + QVERIFY(temporaryDirectory.isValid()); + + QDir temporaryDir(temporaryDirectory.path()); + const QString testDirName = QStringLiteral("testDir"); + QVERIFY(temporaryDir.mkdir(testDirName)); + QDir testDir = temporaryDir; + QVERIFY(testDir.cd(testDirName)); QString testFileName = testDir.filePath("testFile.txt"); QString secondFileName = testDir.filePath("testFile2.txt"); @@ -378,7 +412,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QFileSystemWatcher watcher; watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend); - QVERIFY(watcher.addPath(testDir.dirName())); + QVERIFY(watcher.addPath(testDir.absolutePath())); QVERIFY(watcher.addPath(testFileName)); QSignalSpy fileChangedSpy(&watcher, SIGNAL(fileChanged(const QString &))); @@ -398,6 +432,11 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() testFile.write(QByteArray("hello again")); testFile.close(); +#ifdef Q_OS_MAC + // wait again for the file's atime to be updated + QTest::qWait(2000); +#endif + QTRY_VERIFY(fileChangedSpy.count() > 0); //according to Qt 4 documentation: @@ -443,17 +482,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QCOMPARE(fileChangedSpy.count(), 0); QCOMPARE(dirChangedSpy.count(), 1); - QVERIFY(QDir().rmdir("testDir")); -} - -void tst_QFileSystemWatcher::cleanup() -{ - QDir testDir("testDir"); - QString testFileName = testDir.filePath("testFile.txt"); - QString secondFileName = testDir.filePath("testFile2.txt"); - QFile::remove(testFileName); - QFile::remove(secondFileName); - QDir().rmdir("testDir"); + QVERIFY(temporaryDir.rmdir(testDirName)); } void tst_QFileSystemWatcher::nonExistingFile() @@ -475,22 +504,33 @@ void tst_QFileSystemWatcher::nonExistingFile() void tst_QFileSystemWatcher::removeFileAndUnWatch() { - static const char * const filename = "foo.txt"; + QTemporaryDir temporaryDirectory(m_tempDirPattern); + QVERIFY(temporaryDirectory.isValid()); + + const QString filename = temporaryDirectory.path() + QStringLiteral("/foo.txt"); + QFileSystemWatcher watcher; { QFile testFile(filename); - testFile.open(QIODevice::WriteOnly); + QVERIFY2(testFile.open(QIODevice::WriteOnly), + qPrintable(QString::fromLatin1("Cannot open %1 for writing: %2").arg(filename, testFile.errorString()))); testFile.close(); } QVERIFY(watcher.addPath(filename)); QFile::remove(filename); - QVERIFY(watcher.removePath(filename)); + /* There are potential race conditions here; the watcher thread might remove the file from its list + * before the call to watcher.removePath(), which then fails. When that happens, the auto-signal + * notification to remove the file from the watcher's main list will not be delivered before the next + * event loop such that the call to watcher.addPath() fails since the file is still in the main list. */ + if (!watcher.removePath(filename)) + QSKIP("Skipping remaining test due to race condition."); { QFile testFile(filename); - testFile.open(QIODevice::WriteOnly); + QVERIFY2(testFile.open(QIODevice::WriteOnly), + qPrintable(QString::fromLatin1("Cannot open %1 for writing: %2").arg(filename, testFile.errorString()))); testFile.close(); } QVERIFY(watcher.addPath(filename)); diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp index fa72083dcc..796282d6d8 100644 --- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp +++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp @@ -92,6 +92,7 @@ void tst_QResourceEngine::checkStructure_data() << QString() << (QStringList() << "search_file.txt") << (QStringList() << QLatin1String("aliasdir") << QLatin1String("otherdir") + << QLatin1String("qt-project.org") << QLatin1String("runtime_resource") << QLatin1String("searchpath1") << QLatin1String("searchpath2") << QLatin1String("secondary_root") diff --git a/tests/auto/corelib/io/qsettings/qsettings.pro b/tests/auto/corelib/io/qsettings/qsettings.pro index ed3be0f23f..9de476fe13 100644 --- a/tests/auto/corelib/io/qsettings/qsettings.pro +++ b/tests/auto/corelib/io/qsettings/qsettings.pro @@ -6,4 +6,4 @@ RESOURCES += qsettings.qrc win32-msvc*:LIBS += advapi32.lib -mac: CONFIG += insignificant_test # QTBUG-22745 +win32: CONFIG += insignificant_test # QTBUG-24145 diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 0d6443c5ac..df8e97ab9c 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -580,6 +580,9 @@ void tst_QSettings::ctor() QCoreApplication::instance()->setOrganizationName(""); QCoreApplication::instance()->setApplicationName(""); QSettings settings; +#ifdef Q_OS_MAC + QEXPECT_FAIL("native", "Default settings on Mac are valid, despite organization domain, name, and app name being null", Continue); +#endif QCOMPARE(settings.status(), QSettings::AccessError); QCoreApplication::instance()->setOrganizationName("software.org"); QCoreApplication::instance()->setApplicationName("KillerAPP"); @@ -592,6 +595,9 @@ void tst_QSettings::ctor() } QSettings settings(format, QSettings::UserScope, "", ""); +#ifdef Q_OS_MAC + QEXPECT_FAIL("native", "Default settings on Mac are valid, despite organization domain, name, and app name being null", Continue); +#endif QCOMPARE(settings.status(), QSettings::AccessError); QSettings settings2(format, QSettings::UserScope, "software.org", "KillerAPP"); QCOMPARE(settings2.status(), QSettings::NoError); diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 1e288e2418..ebfd640dfb 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -229,6 +229,11 @@ void tst_qstandardpaths::testRuntimeDirectory() void tst_qstandardpaths::testCustomRuntimeDirectory() { +#if defined(Q_OS_UNIX) + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); +#endif + #ifdef Q_XDG_PLATFORM qputenv("XDG_RUNTIME_DIR", QFile::encodeName("/tmp")); // It's very unlikely that /tmp is 0600 or that we can chmod it diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 46d2fa2bde..0b2e1e1902 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -50,6 +50,10 @@ #ifdef Q_OS_WIN # include <windows.h> #endif +#ifdef Q_OS_UNIX // for geteuid() +# include <sys/types.h> +# include <unistd.h> +#endif class tst_QTemporaryDir : public QObject { diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 01aecc2a21..37a1556cf9 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -2755,7 +2755,7 @@ void tst_QTextStream::double_write_with_flags_data() QTest::newRow("inf uppercase") << qInf() << QString("INF") << (int)QTextStream::UppercaseDigits << 0; QTest::newRow("-inf uppercase") << -qInf() << QString("-INF") << (int)QTextStream::UppercaseDigits << 0; QTest::newRow("nan") << qQNaN() << QString("nan") << 0 << 0; - QTest::newRow("nan") << qQNaN() << QString("NAN") << (int)QTextStream::UppercaseDigits << 0; + QTest::newRow("NAN") << qQNaN() << QString("NAN") << (int)QTextStream::UppercaseDigits << 0; QTest::newRow("scientific") << 1.234567e+02 << QString("1.234567e+02") << 0 << (int)QTextStream::ScientificNotation; QTest::newRow("scientific2") << 1.234567e+02 << QString("1.234567e+02") << (int)QTextStream::UppercaseBase << (int)QTextStream::ScientificNotation; QTest::newRow("scientific uppercase") << 1.234567e+02 << QString("1.234567E+02") << (int)QTextStream::UppercaseDigits << (int)QTextStream::ScientificNotation; diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 611847852f..a74d817b8a 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -350,6 +350,8 @@ void tst_QUrl::setUrl() QVERIFY(url.authority().isEmpty()); QVERIFY(url.fragment().isEmpty()); QCOMPARE(url.port(), -1); + QCOMPARE(url.toString(), QString::fromLatin1("file:///")); + QCOMPARE(url.toDisplayString(), QString::fromLatin1("file:///")); } { @@ -363,6 +365,8 @@ void tst_QUrl::setUrl() QCOMPARE(url.host(), QString::fromLatin1("www.foo.bar")); QCOMPARE(url.authority(), QString::fromLatin1("www.foo.bar:80")); QCOMPARE(url.port(), 80); + QCOMPARE(url.toString(), QString::fromLatin1("http://www.foo.bar:80")); + QCOMPARE(url.toDisplayString(), QString::fromLatin1("http://www.foo.bar:80")); QUrl url2("//www1.foo.bar"); QCOMPARE(url.resolved(url2).toString(), QString::fromLatin1("http://www1.foo.bar")); @@ -379,6 +383,8 @@ void tst_QUrl::setUrl() QCOMPARE(url.host(), QString::fromLatin1("56::56:56:56:127.0.0.1")); QCOMPARE(url.authority(), QString::fromLatin1("user:pass@[56::56:56:56:127.0.0.1]:99")); QCOMPARE(url.port(), 99); + QCOMPARE(url.url(), QString::fromLatin1("http://user:pass@[56::56:56:56:127.0.0.1]:99")); + QCOMPARE(url.toDisplayString(), QString::fromLatin1("http://user@[56::56:56:56:127.0.0.1]:99")); } { @@ -3114,8 +3120,8 @@ void tst_QUrl::fromUserInput_data() QTest::newRow("port-0") << "example.org:80" << portUrl; QTest::newRow("port-1") << "http://example.org:80" << portUrl; portUrl.setPath("path"); - QTest::newRow("port-1") << "example.org:80/path" << portUrl; - QTest::newRow("port-1") << "http://example.org:80/path" << portUrl; + QTest::newRow("port-2") << "example.org:80/path" << portUrl; + QTest::newRow("port-3") << "http://example.org:80/path" << portUrl; // mailto doesn't have a ://, but is valid QUrl mailto("ben@example.net"); diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp index 2ca5df477b..8d451dbff9 100644 --- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -1257,13 +1257,13 @@ void tst_QAbstractItemModel::testMoveToGrandParent_data() QTest::newRow("move09") << 8 << 8 << 8; // Moving to the row of my parent and its neighbours doesn't confuse things - QTest::newRow("move09") << 8 << 8 << 4; - QTest::newRow("move10") << 8 << 8 << 5; - QTest::newRow("move11") << 8 << 8 << 6; + QTest::newRow("move10") << 8 << 8 << 4; + QTest::newRow("move11") << 8 << 8 << 5; + QTest::newRow("move12") << 8 << 8 << 6; // Moving everything from one parent to another - QTest::newRow("move12") << 0 << 9 << 10; - QTest::newRow("move13") << 0 << 9 << 0; + QTest::newRow("move13") << 0 << 9 << 10; + QTest::newRow("move14") << 0 << 9 << 0; } void tst_QAbstractItemModel::testMoveToGrandParent() @@ -1397,14 +1397,14 @@ void tst_QAbstractItemModel::testMoveToSibling_data() QTest::newRow("move09") << 8 << 8 << 8; // Moving to the row of my target and its neighbours doesn't confuse things - QTest::newRow("move09") << 8 << 8 << 4; - QTest::newRow("move10") << 8 << 8 << 5; - QTest::newRow("move11") << 8 << 8 << 6; + QTest::newRow("move10") << 8 << 8 << 4; + QTest::newRow("move11") << 8 << 8 << 5; + QTest::newRow("move12") << 8 << 8 << 6; // Move such that the destination parent no longer valid after the move. // The destination parent is always QMI(5, 0), but after this move the // row count is 5, so (5, 0) (used internally in QAIM) no longer refers to a valid index. - QTest::newRow("move12") << 0 << 4 << 0; + QTest::newRow("move13") << 0 << 4 << 0; } void tst_QAbstractItemModel::testMoveToSibling() @@ -1541,12 +1541,12 @@ void tst_QAbstractItemModel::testMoveToUncle_data() QTest::newRow("move09") << 8 << 8 << 8; // Moving to the row of my parent and its neighbours doesn't confuse things - QTest::newRow("move09") << 8 << 8 << 4; - QTest::newRow("move10") << 8 << 8 << 5; - QTest::newRow("move11") << 8 << 8 << 6; + QTest::newRow("move10") << 8 << 8 << 4; + QTest::newRow("move11") << 8 << 8 << 5; + QTest::newRow("move12") << 8 << 8 << 6; // Moving everything from one parent to another - QTest::newRow("move12") << 0 << 9 << 10; + QTest::newRow("move13") << 0 << 9 << 10; } void tst_QAbstractItemModel::testMoveToUncle() @@ -1734,22 +1734,22 @@ void tst_QAbstractItemModel::testMoveWithinOwnRange_data() QTest::newRow("move07") << 0 << 5 << 4; QTest::newRow("move08") << 0 << 5 << 5; QTest::newRow("move09") << 0 << 5 << 6; - QTest::newRow("move08") << 3 << 5 << 5; - QTest::newRow("move08") << 3 << 5 << 6; - QTest::newRow("move09") << 4 << 5 << 5; - QTest::newRow("move10") << 4 << 5 << 6; - QTest::newRow("move11") << 5 << 5 << 5; - QTest::newRow("move12") << 5 << 5 << 6; - QTest::newRow("move13") << 5 << 9 << 9; - QTest::newRow("move14") << 5 << 9 << 10; - QTest::newRow("move15") << 6 << 9 << 9; - QTest::newRow("move16") << 6 << 9 << 10; - QTest::newRow("move17") << 7 << 9 << 9; - QTest::newRow("move18") << 7 << 9 << 10; - QTest::newRow("move19") << 8 << 9 << 9; - QTest::newRow("move20") << 8 << 9 << 10; - QTest::newRow("move21") << 9 << 9 << 9; - QTest::newRow("move22") << 0 << 9 << 10; + QTest::newRow("move10") << 3 << 5 << 5; + QTest::newRow("move11") << 3 << 5 << 6; + QTest::newRow("move12") << 4 << 5 << 5; + QTest::newRow("move13") << 4 << 5 << 6; + QTest::newRow("move14") << 5 << 5 << 5; + QTest::newRow("move15") << 5 << 5 << 6; + QTest::newRow("move16") << 5 << 9 << 9; + QTest::newRow("move17") << 5 << 9 << 10; + QTest::newRow("move18") << 6 << 9 << 9; + QTest::newRow("move19") << 6 << 9 << 10; + QTest::newRow("move20") << 7 << 9 << 9; + QTest::newRow("move21") << 7 << 9 << 10; + QTest::newRow("move22") << 8 << 9 << 9; + QTest::newRow("move23") << 8 << 9 << 10; + QTest::newRow("move24") << 9 << 9 << 9; + QTest::newRow("move25") << 0 << 9 << 10; } void tst_QAbstractItemModel::testMoveWithinOwnRange() diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp index cbe7da11ad..d27d685f37 100644 --- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp @@ -779,19 +779,19 @@ void tst_QItemModel::remove_data() makeTestRow(":none at the middle", MIDDLE, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); makeTestRow(":none at the end", END, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", -99, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", 9999, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", -99, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", 9999, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", -99, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", 9999, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - - makeTestRow(":valid start, invalid count", START, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", MIDDLE, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", END, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", START, 9999, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", MIDDLE, 9999, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", END, 9999, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 1", -99, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 2", 9999, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 3", -99, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 4", 9999, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 5", -99, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 6", 9999, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + + makeTestRow(":valid start, invalid count 1", START, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 2", MIDDLE, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 3", END, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 4", START, 9999, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 5", MIDDLE, 9999, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 6", END, 9999, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); // Recursive remove's might assert, haven't decided yet... //makeTestRow(":one at the start recursivly", START, DEFAULTCOUNT, 2, DNS, 2, DNS, RECURSIVE, START, DEFAULTCOUNT, FAIL); @@ -1126,16 +1126,16 @@ void tst_QItemModel::insert_data() makeTestRow(":none at the middle", MIDDLE, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); makeTestRow(":none at the end", END, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", -99, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", 9999, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", -99, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", 9999, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", -99, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":invalid start, valid count", 9999, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 1", -99, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 2", 9999, 0, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 3", -99, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 4", 9999, 1, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 5", -99, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":invalid start, valid count 6", 9999, MANY, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", START, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", MIDDLE, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); - makeTestRow(":valid start, invalid count", END, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 1", START, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 2", MIDDLE, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); + makeTestRow(":valid start, invalid count 3", END, -2, NOSIGNALS, NOSIGNALS, NOSIGNALS, NOSIGNALS, !RECURSIVE, 0, 0, FAIL); // Recursive insert's might assert, haven't decided yet... //makeTestRow(":one at the start recursivly", START, DEFAULTCOUNT, 2, DNS, 2, DNS, RECURSIVE, START, DEFAULTCOUNT, FAIL); diff --git a/tests/auto/corelib/json/json.pro b/tests/auto/corelib/json/json.pro index 5158b7337a..7978a74278 100644 --- a/tests/auto/corelib/json/json.pro +++ b/tests/auto/corelib/json/json.pro @@ -3,6 +3,6 @@ QT = core testlib CONFIG -= app_bundle CONFIG += testcase -DEFINES += SRCDIR=\\\"$$PWD/\\\" +TESTDATA += test.json test.bjson test3.json test2.json SOURCES += tst_qtjson.cpp diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index e35f645ef6..2ac0574ec5 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -92,6 +92,7 @@ private Q_SLOTS: void toJson(); void fromJson(); + void fromJsonErrors(); void fromBinary(); void toAndFromBinary_data(); void toAndFromBinary(); @@ -111,6 +112,8 @@ private Q_SLOTS: void testCompaction(); void testDebugStream(); void testCompactionError(); +private: + QString testDataDir; }; TestQtJson::TestQtJson(QObject *parent) : QObject(parent) @@ -119,6 +122,9 @@ TestQtJson::TestQtJson(QObject *parent) : QObject(parent) void TestQtJson::initTestCase() { + testDataDir = QFileInfo(QFINDTESTDATA("test.json")).absolutePath(); + if (testDataDir.isEmpty()) + testDataDir = QCoreApplication::applicationDirPath(); } void TestQtJson::cleanupTestCase() @@ -1075,9 +1081,173 @@ void TestQtJson::fromJson() } } +void TestQtJson::fromJsonErrors() +{ + { + QJsonParseError error; + QByteArray json = "{\n \n\n"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::UnterminatedObject); + QCOMPARE(error.offset, 8); + } + { + QJsonParseError error; + QByteArray json = "{\n \"key\" 10\n"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::MissingNameSeparator); + QCOMPARE(error.offset, 13); + } + { + QJsonParseError error; + QByteArray json = "[\n \n\n"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::UnterminatedArray); + QCOMPARE(error.offset, 8); + } + { + QJsonParseError error; + QByteArray json = "[\n 1, true\n\n"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::UnterminatedArray); + QCOMPARE(error.offset, 14); + } + { + QJsonParseError error; + QByteArray json = "[\n 1 true\n\n"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::MissingValueSeparator); + QCOMPARE(error.offset, 7); + } + { + QJsonParseError error; + QByteArray json = "[\n nul"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalValue); + QCOMPARE(error.offset, 7); + } + { + QJsonParseError error; + QByteArray json = "[\n nulzz"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalValue); + QCOMPARE(error.offset, 10); + } + { + QJsonParseError error; + QByteArray json = "[\n tru"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalValue); + QCOMPARE(error.offset, 7); + } + { + QJsonParseError error; + QByteArray json = "[\n trud]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalValue); + QCOMPARE(error.offset, 10); + } + { + QJsonParseError error; + QByteArray json = "[\n fal"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalValue); + QCOMPARE(error.offset, 7); + } + { + QJsonParseError error; + QByteArray json = "[\n falsd]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalValue); + QCOMPARE(error.offset, 11); + } + { + QJsonParseError error; + QByteArray json = "[\n 11111"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::EndOfNumber); + QCOMPARE(error.offset, 11); + } + { + QJsonParseError error; + QByteArray json = "[\n -1E10000]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalNumber); + QCOMPARE(error.offset, 14); + } + { + QJsonParseError error; + QByteArray json = "[\n -1e-10000]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::IllegalNumber); + QCOMPARE(error.offset, 15); + } + { + QJsonParseError error; + QByteArray json = "[\n \"\\u12\"]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::StringEscapeSequence); + QCOMPARE(error.offset, 11); + } + { + QJsonParseError error; + QByteArray json = "[\n \"foo\uffffbar\"]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::StringUTF8Scan); + QCOMPARE(error.offset, 13); + } + { + QJsonParseError error; + QByteArray json = "[\n \""; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::EndOfString); + QCOMPARE(error.offset, 8); + } + { + QJsonParseError error; + QByteArray json = "[\n \"cЂa\\u12\"]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::StringEscapeSequence); + QCOMPARE(error.offset, 15); + } + { + QJsonParseError error; + QByteArray json = "[\n \"cЂa\uffffbar\"]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::StringUTF8Scan); + QCOMPARE(error.offset, 14); + } + { + QJsonParseError error; + QByteArray json = "[\n \"cЂa ]"; + QJsonDocument doc = QJsonDocument::fromJson(json, &error); + QVERIFY(doc.isEmpty()); + QCOMPARE(error.error, QJsonParseError::EndOfString); + QCOMPARE(error.offset, 14); + } +} + void TestQtJson::fromBinary() { - QFile file(QLatin1String(SRCDIR "test.json")); + QFile file(testDataDir + "/test.json"); file.open(QFile::ReadOnly); QByteArray testJson = file.readAll(); @@ -1086,7 +1256,7 @@ void TestQtJson::fromBinary() QVERIFY(!outdoc.isNull()); QVERIFY(doc == outdoc); - QFile bfile(QLatin1String(SRCDIR "test.bjson")); + QFile bfile(testDataDir + "/test.bjson"); bfile.open(QFile::ReadOnly); QByteArray binary = bfile.readAll(); @@ -1099,8 +1269,8 @@ void TestQtJson::fromBinary() void TestQtJson::toAndFromBinary_data() { QTest::addColumn<QString>("filename"); - QTest::newRow("test.json") << QString::fromLatin1(SRCDIR "test.json"); - QTest::newRow("test2.json") << QString::fromLatin1(SRCDIR "test2.json"); + QTest::newRow("test.json") << (testDataDir + "/test.json"); + QTest::newRow("test2.json") << (testDataDir + "/test2.json"); } void TestQtJson::toAndFromBinary() @@ -1279,7 +1449,7 @@ void TestQtJson::parseDuplicateKeys() void TestQtJson::testParser() { - QFile file(QLatin1String(SRCDIR "test.json")); + QFile file(testDataDir + "/test.json"); file.open(QFile::ReadOnly); QByteArray testJson = file.readAll(); @@ -1364,7 +1534,7 @@ void TestQtJson::compactObject() void TestQtJson::validation() { // this basically tests that we don't crash on corrupt data - QFile file(QLatin1String(SRCDIR "test.json")); + QFile file(testDataDir + "/test.json"); QVERIFY(file.open(QFile::ReadOnly)); QByteArray testJson = file.readAll(); QVERIFY(!testJson.isEmpty()); @@ -1385,7 +1555,7 @@ void TestQtJson::validation() } - QFile file2(QLatin1String(SRCDIR "test3.json")); + QFile file2(testDataDir + "/test3.json"); file2.open(QFile::ReadOnly); testJson = file2.readAll(); QVERIFY(!testJson.isEmpty()); diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro index 3c697f4149..7ec01d4a36 100644 --- a/tests/auto/corelib/kernel/kernel.pro +++ b/tests/auto/corelib/kernel/kernel.pro @@ -1,10 +1,12 @@ TEMPLATE=subdirs SUBDIRS=\ qcoreapplication \ + qeventdispatcher \ qeventloop \ qmath \ qmetaobject \ qmetaobjectbuilder \ + qmetamethod \ qmetaproperty \ qmetatype \ qmimedata \ diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 97c9757107..572c2fdfd1 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -126,6 +126,9 @@ void tst_QCoreApplication::qAppName() void tst_QCoreApplication::argc() { +#ifdef Q_OS_WIN + QSKIP("QCoreApplication::arguments() always parses arguments from actual command line in Windows, making this test invalid."); +#endif { int argc = 1; char *argv[] = { "tst_qcoreapplication" }; diff --git a/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro b/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro new file mode 100644 index 0000000000..ff048d0429 --- /dev/null +++ b/tests/auto/corelib/kernel/qeventdispatcher/qeventdispatcher.pro @@ -0,0 +1,4 @@ +CONFIG += testcase +TARGET = tst_qeventdispatcher +QT = core testlib +SOURCES += tst_qeventdispatcher.cpp diff --git a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp new file mode 100644 index 0000000000..bc6d6bfadd --- /dev/null +++ b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp @@ -0,0 +1,213 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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$ +** +****************************************************************************/ + +#ifdef QT_GUI_LIB +# include <QtGui/QGuiApplication> +#else +# include <QtCore/QCoreApplication> +#endif +#include <QtTest/QtTest> + +enum { + PreciseTimerInterval = 10, + CoarseTimerInterval = 200, + VeryCoarseTimerInterval = 1000 +}; + +class tst_QEventDispatcher : public QObject +{ + Q_OBJECT + + QAbstractEventDispatcher *eventDispatcher; + int receivedEventType; + int timerIdFromEvent; + +protected: + bool event(QEvent *e); + +public: + inline tst_QEventDispatcher() + : QObject(), + eventDispatcher(QAbstractEventDispatcher::instance(thread())), + receivedEventType(-1), + timerIdFromEvent(-1) + { } + +private slots: + void initTestCase(); + void registerTimer(); + /* void registerSocketNotifier(); */ // Not implemented here, see tst_QSocketNotifier instead + /* void registerEventNotifiier(); */ // Not implemented here, see tst_QWinEventNotifier instead + void sendPostedEvents_data(); + void sendPostedEvents(); +}; + +bool tst_QEventDispatcher::event(QEvent *e) +{ + switch (receivedEventType = e->type()) { + case QEvent::Timer: + { + timerIdFromEvent = static_cast<QTimerEvent *>(e)->timerId(); + return true; + } + default: + break; + } + return QObject::event(e); +} + +// drain the system event queue after the test starts to avoid destabilizing the test functions +void tst_QEventDispatcher::initTestCase() +{ + QElapsedTimer elapsedTimer; + elapsedTimer.start(); + while (!elapsedTimer.hasExpired(CoarseTimerInterval) && eventDispatcher->processEvents(QEventLoop::AllEvents)) { + ; + } +} + +// test that the eventDispatcher's timer implementation is complete and working +void tst_QEventDispatcher::registerTimer() +{ +#define FIND_TIMERS() \ + do { \ + foundPrecise = false; \ + foundCoarse = false; \ + foundVeryCoarse = false; \ + for (int i = 0; i < registeredTimers.count(); ++i) { \ + const QAbstractEventDispatcher::TimerInfo &timerInfo = registeredTimers.at(i); \ + if (timerInfo.timerId == preciseTimerId) { \ + QCOMPARE(timerInfo.interval, int(PreciseTimerInterval)); \ + QCOMPARE(timerInfo.timerType, Qt::PreciseTimer); \ + foundPrecise = true; \ + } else if (timerInfo.timerId == coarseTimerId) { \ + QCOMPARE(timerInfo.interval, int(CoarseTimerInterval)); \ + QCOMPARE(timerInfo.timerType, Qt::CoarseTimer); \ + foundCoarse = true; \ + } else if (timerInfo.timerId == veryCoarseTimerId) { \ + QCOMPARE(timerInfo.interval, int(VeryCoarseTimerInterval)); \ + QCOMPARE(timerInfo.timerType, Qt::VeryCoarseTimer); \ + foundVeryCoarse = true; \ + } \ + } \ + } while (0) + + // start 3 timers, each with the different timer types and different intervals + int preciseTimerId = eventDispatcher->registerTimer(PreciseTimerInterval, Qt::PreciseTimer, this); + int coarseTimerId = eventDispatcher->registerTimer(CoarseTimerInterval, Qt::CoarseTimer, this); + int veryCoarseTimerId = eventDispatcher->registerTimer(VeryCoarseTimerInterval, Qt::VeryCoarseTimer, this); + QVERIFY(preciseTimerId > 0); + QVERIFY(coarseTimerId > 0); + QVERIFY(veryCoarseTimerId > 0); + + // check that all 3 are present in the eventDispatcher's registeredTimer() list + QList<QAbstractEventDispatcher::TimerInfo> registeredTimers = eventDispatcher->registeredTimers(this); + QCOMPARE(registeredTimers.count(), 3); + bool foundPrecise, foundCoarse, foundVeryCoarse; + FIND_TIMERS(); + QVERIFY(foundPrecise && foundCoarse && foundVeryCoarse); + + // process events, waiting for the next event... this should only fire the precise timer + receivedEventType = -1; + timerIdFromEvent = -1; + QVERIFY(eventDispatcher->processEvents(QEventLoop::WaitForMoreEvents)); + QCOMPARE(receivedEventType, int(QEvent::Timer)); + QCOMPARE(timerIdFromEvent, preciseTimerId); + // now unregister it and make sure it's gone + eventDispatcher->unregisterTimer(preciseTimerId); + registeredTimers = eventDispatcher->registeredTimers(this); + QCOMPARE(registeredTimers.count(), 2); + FIND_TIMERS(); + QVERIFY(!foundPrecise && foundCoarse && foundVeryCoarse); + + // do the same again for the coarse timer + receivedEventType = -1; + timerIdFromEvent = -1; + QVERIFY(eventDispatcher->processEvents(QEventLoop::WaitForMoreEvents)); + QCOMPARE(receivedEventType, int(QEvent::Timer)); + QCOMPARE(timerIdFromEvent, coarseTimerId); + // now unregister it and make sure it's gone + eventDispatcher->unregisterTimer(coarseTimerId); + registeredTimers = eventDispatcher->registeredTimers(this); + QCOMPARE(registeredTimers.count(), 1); + FIND_TIMERS(); + QVERIFY(!foundPrecise && !foundCoarse && foundVeryCoarse); + + // not going to wait for the VeryCoarseTimer, would take too long, just unregister it + eventDispatcher->unregisterTimers(this); + registeredTimers = eventDispatcher->registeredTimers(this); + QVERIFY(registeredTimers.isEmpty()); + +#undef FIND_TIMERS +} + +void tst_QEventDispatcher::sendPostedEvents_data() +{ + QTest::addColumn<int>("processEventsFlagsInt"); + + QTest::newRow("WaitForMoreEvents") << int(QEventLoop::WaitForMoreEvents); + QTest::newRow("AllEvents") << int(QEventLoop::AllEvents); +} + +// test that the eventDispatcher sends posted events correctly +void tst_QEventDispatcher::sendPostedEvents() +{ + QFETCH(int, processEventsFlagsInt); + QEventLoop::ProcessEventsFlags processEventsFlags = QEventLoop::ProcessEventsFlags(processEventsFlagsInt); + + QElapsedTimer elapsedTimer; + elapsedTimer.start(); + while (!elapsedTimer.hasExpired(200)) { + receivedEventType = -1; + QCoreApplication::postEvent(this, new QEvent(QEvent::User)); + + // event shouldn't be delivered as a result of posting + QCOMPARE(receivedEventType, -1); + + // since there is a pending posted event, this should not actually block, it should send the posted event and return + QVERIFY(eventDispatcher->processEvents(processEventsFlags)); + // event shouldn't be delivered as a result of posting + QCOMPARE(receivedEventType, int(QEvent::User)); + } +} + +QTEST_MAIN(tst_QEventDispatcher) +#include "tst_qeventdispatcher.moc" diff --git a/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro b/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro new file mode 100644 index 0000000000..f909742748 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetamethod/qmetamethod.pro @@ -0,0 +1,5 @@ +CONFIG += testcase +TARGET = tst_qmetamethod +QT = core testlib +SOURCES = tst_qmetamethod.cpp +macx:CONFIG -= app_bundle diff --git a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp new file mode 100644 index 0000000000..1651d00738 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp @@ -0,0 +1,630 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <qobject.h> +#include <qmetaobject.h> + +class tst_QMetaMethod : public QObject +{ + Q_OBJECT + +private slots: + void method_data(); + void method(); + + void invalidMethod(); +}; + +struct CustomType { }; +Q_DECLARE_METATYPE(CustomType) + +struct CustomUnregisteredType { }; + +Q_DECLARE_METATYPE(QMetaMethod::Access) +Q_DECLARE_METATYPE(QMetaMethod::MethodType) + +class MethodTestObject : public QObject +{ + Q_OBJECT +public: + Q_INVOKABLE MethodTestObject(); + Q_INVOKABLE MethodTestObject(int constructorIntArg); + Q_INVOKABLE MethodTestObject(qreal constructorQRealArg); + Q_INVOKABLE MethodTestObject(const QString &constructorQStringArg); + Q_INVOKABLE MethodTestObject(CustomType constructorCustomTypeArg); + Q_INVOKABLE MethodTestObject(CustomUnregisteredType constructorCustomUnregisteredTypeArg); + Q_INVOKABLE MethodTestObject(bool boolArg, int intArg, uint uintArg, + qlonglong longlongArg, qulonglong ulonglongArg, + double doubleArg, long longArg, short shortArg, + char charArg, ulong ulongArg, ushort ushortArg, + uchar ucharArg, float floatArg); + Q_INVOKABLE MethodTestObject(bool, int); + + Q_INVOKABLE void voidInvokable(); + Q_INVOKABLE void voidInvokableInt(int voidInvokableIntArg); + Q_INVOKABLE void voidInvokableQReal(qreal voidInvokableQRealArg); + Q_INVOKABLE void voidInvokableQString(const QString &voidInvokableQStringArg); + Q_INVOKABLE void voidInvokableCustomType(CustomType voidInvokableCustomTypeArg); + Q_INVOKABLE void voidInvokableCustomUnregisteredType(CustomUnregisteredType voidInvokableCustomUnregisteredTypeArg); + Q_INVOKABLE bool boolInvokable(); + Q_INVOKABLE qreal qrealInvokable(); + Q_INVOKABLE QString qstringInvokable(); + Q_INVOKABLE CustomType customTypeInvokable(); + Q_INVOKABLE CustomUnregisteredType customUnregisteredTypeInvokable(); + Q_INVOKABLE QVariant qvariantInvokableBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat( + bool boolArg, int intArg, uint uintArg, qlonglong longlongArg, qulonglong ulonglongArg, double doubleArg, + long longArg, short shortArg, char charArg, ulong ulongArg, ushort ushortArg, uchar ucharArg, float floatArg); + Q_INVOKABLE void voidInvokableNoParameterNames(bool, int); +public slots: + void voidSlot(); + void voidSlotInt(int voidSlotIntArg); + void voidSlotQReal(qreal voidSlotQRealArg); + void voidSlotQString(const QString &voidSlotQStringArg); + void voidSlotCustomType(CustomType voidSlotCustomTypeArg); + void voidSlotCustomUnregisteredType(CustomUnregisteredType voidSlotCustomUnregisteredTypeArg); + bool boolSlot(); + qreal qrealSlot(); + QString qstringSlot(); + CustomType customTypeSlot(); + CustomUnregisteredType customUnregisteredTypeSlot(); + QVariant qvariantSlotBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat( + bool boolArg, int intArg, uint uintArg, qlonglong longlongArg, qulonglong ulonglongArg, double doubleArg, + long longArg, short shortArg, char charArg, ulong ulongArg, ushort ushortArg, uchar ucharArg, float floatArg); + void voidSlotNoParameterNames(bool, int); +signals: + void voidSignal(); + void voidSignalInt(int voidSignalIntArg); + void voidSignalQReal(qreal voidSignalQRealArg); + void voidSignalQString(const QString &voidSignalQStringArg); + void voidSignalCustomType(CustomType voidSignalCustomTypeArg); + void voidSignalCustomUnregisteredType(CustomUnregisteredType voidSignalCustomUnregisteredTypeArg); + bool boolSignal(); + qreal qrealSignal(); + QString qstringSignal(); + CustomType customTypeSignal(); + CustomUnregisteredType customUnregisteredTypeSignal(); + QVariant qvariantSignalBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat( + bool boolArg, int intArg, uint uintArg, qlonglong longlongArg, qulonglong ulonglongArg, double doubleArg, + long longArg, short shortArg, char charArg, ulong ulongArg, ushort ushortArg, uchar ucharArg, float floatArg); + void voidSignalNoParameterNames(bool, int); +}; + +MethodTestObject::MethodTestObject() {} +MethodTestObject::MethodTestObject(int) {} +MethodTestObject::MethodTestObject(qreal) {} +MethodTestObject::MethodTestObject(const QString &) {} +MethodTestObject::MethodTestObject(CustomType) {} +MethodTestObject::MethodTestObject(CustomUnregisteredType) {} +MethodTestObject::MethodTestObject(bool, int, uint, qlonglong, qulonglong, + double, long, short, char, ulong, ushort, + uchar, float) {} +MethodTestObject::MethodTestObject(bool, int) {} + +void MethodTestObject::voidInvokable() {} +void MethodTestObject::voidInvokableInt(int) {} +void MethodTestObject::voidInvokableQReal(qreal) {} +void MethodTestObject::voidInvokableQString(const QString &) {} +void MethodTestObject::voidInvokableCustomType(CustomType) {} +void MethodTestObject::voidInvokableCustomUnregisteredType(CustomUnregisteredType) {} +bool MethodTestObject::boolInvokable() { return true; } +qreal MethodTestObject::qrealInvokable() { return 1.0; } +QString MethodTestObject::qstringInvokable() { return QString(); } +CustomType MethodTestObject::customTypeInvokable() { return CustomType(); } +CustomUnregisteredType MethodTestObject::customUnregisteredTypeInvokable() +{ + return CustomUnregisteredType(); +} +QVariant MethodTestObject::qvariantInvokableBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat( + bool, int, uint, qlonglong, qulonglong, double, long, short, char, ulong, ushort, uchar, float) +{ + return QVariant(); +} +void MethodTestObject::voidInvokableNoParameterNames(bool, int) {} + +void MethodTestObject::voidSlot() {} +void MethodTestObject::voidSlotInt(int) {} +void MethodTestObject::voidSlotQReal(qreal) {} +void MethodTestObject::voidSlotQString(const QString &) {} +void MethodTestObject::voidSlotCustomType(CustomType) {} +void MethodTestObject::voidSlotCustomUnregisteredType(CustomUnregisteredType) {} +bool MethodTestObject::boolSlot() { return true; } +qreal MethodTestObject::qrealSlot() { return 1.0; } +QString MethodTestObject::qstringSlot() { return QString(); } +CustomType MethodTestObject::customTypeSlot() { return CustomType(); } +CustomUnregisteredType MethodTestObject::customUnregisteredTypeSlot() +{ + return CustomUnregisteredType(); +} +QVariant MethodTestObject::qvariantSlotBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat( + bool, int, uint, qlonglong, qulonglong, double, long, short, char, ulong, ushort, uchar, float) +{ + return QVariant(); +} +void MethodTestObject::voidSlotNoParameterNames(bool, int) {} + +void tst_QMetaMethod::method_data() +{ + QTest::addColumn<QByteArray>("signature"); + QTest::addColumn<int>("returnType"); + QTest::addColumn<QByteArray>("returnTypeName"); + QTest::addColumn<QList<int> >("parameterTypes"); + QTest::addColumn<QList<QByteArray> >("parameterTypeNames"); + QTest::addColumn<QList<QByteArray> >("parameterNames"); + QTest::addColumn<QMetaMethod::Access>("access"); + QTest::addColumn<QMetaMethod::MethodType>("methodType"); + + QTest::newRow("voidSignal") + << QByteArray("voidSignal()") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokable") + << QByteArray("voidInvokable()") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlot") + << QByteArray("voidSlot()") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject()") + << QByteArray("MethodTestObject()") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Constructor; + + QTest::newRow("voidSignalInt") + << QByteArray("voidSignalInt(int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("voidSignalIntArg")) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokableInt") + << QByteArray("voidInvokableInt(int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("voidInvokableIntArg")) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlotInt") + << QByteArray("voidSlotInt(int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("voidSlotIntArg")) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(int)") + << QByteArray("MethodTestObject(int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("constructorIntArg")) + << QMetaMethod::Public + << QMetaMethod::Constructor; + + QTest::newRow("voidSignalQReal") + << QByteArray("voidSignalQReal(qreal)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<qreal>()) + << (QList<QByteArray>() << QByteArray("qreal")) + << (QList<QByteArray>() << QByteArray("voidSignalQRealArg")) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokableQReal") + << QByteArray("voidInvokableQReal(qreal)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<qreal>()) + << (QList<QByteArray>() << QByteArray("qreal")) + << (QList<QByteArray>() << QByteArray("voidInvokableQRealArg")) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlotQReal") + << QByteArray("voidSlotQReal(qreal)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<qreal>()) + << (QList<QByteArray>() << QByteArray("qreal")) + << (QList<QByteArray>() << QByteArray("voidSlotQRealArg")) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(qreal)") + << QByteArray("MethodTestObject(qreal)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<qreal>()) + << (QList<QByteArray>() << QByteArray("qreal")) + << (QList<QByteArray>() << QByteArray("constructorQRealArg")) + << QMetaMethod::Public + << QMetaMethod::Constructor; + + QTest::newRow("voidSignalQString") + << QByteArray("voidSignalQString(QString)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::QString)) + << (QList<QByteArray>() << QByteArray("QString")) + << (QList<QByteArray>() << QByteArray("voidSignalQStringArg")) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokableQString") + << QByteArray("voidInvokableQString(QString)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::QString)) + << (QList<QByteArray>() << QByteArray("QString")) + << (QList<QByteArray>() << QByteArray("voidInvokableQStringArg")) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlotQString") + << QByteArray("voidSlotQString(QString)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::QString)) + << (QList<QByteArray>() << QByteArray("QString")) + << (QList<QByteArray>() << QByteArray("voidSlotQStringArg")) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(QString)") + << QByteArray("MethodTestObject(QString)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::QString)) + << (QList<QByteArray>() << QByteArray("QString")) + << (QList<QByteArray>() << QByteArray("constructorQStringArg")) + << QMetaMethod::Public + << QMetaMethod::Constructor; + + QTest::newRow("voidSignalCustomType") + << QByteArray("voidSignalCustomType(CustomType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<CustomType>()) + << (QList<QByteArray>() << QByteArray("CustomType")) + << (QList<QByteArray>() << QByteArray("voidSignalCustomTypeArg")) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokableCustomType") + << QByteArray("voidInvokableCustomType(CustomType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<CustomType>()) + << (QList<QByteArray>() << QByteArray("CustomType")) + << (QList<QByteArray>() << QByteArray("voidInvokableCustomTypeArg")) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlotCustomType") + << QByteArray("voidSlotCustomType(CustomType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<CustomType>()) + << (QList<QByteArray>() << QByteArray("CustomType")) + << (QList<QByteArray>() << QByteArray("voidSlotCustomTypeArg")) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(CustomType)") + << QByteArray("MethodTestObject(CustomType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << qMetaTypeId<CustomType>()) + << (QList<QByteArray>() << QByteArray("CustomType")) + << (QList<QByteArray>() << QByteArray("constructorCustomTypeArg")) + << QMetaMethod::Public + << QMetaMethod::Constructor; + + QTest::newRow("voidSignalCustomUnregisteredType") + << QByteArray("voidSignalCustomUnregisteredType(CustomUnregisteredType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << 0) + << (QList<QByteArray>() << QByteArray("CustomUnregisteredType")) + << (QList<QByteArray>() << QByteArray("voidSignalCustomUnregisteredTypeArg")) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokableCustomUnregisteredType") + << QByteArray("voidInvokableCustomUnregisteredType(CustomUnregisteredType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << 0) + << (QList<QByteArray>() << QByteArray("CustomUnregisteredType")) + << (QList<QByteArray>() << QByteArray("voidInvokableCustomUnregisteredTypeArg")) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlotCustomUnregisteredType") + << QByteArray("voidSlotCustomUnregisteredType(CustomUnregisteredType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << 0) + << (QList<QByteArray>() << QByteArray("CustomUnregisteredType")) + << (QList<QByteArray>() << QByteArray("voidSlotCustomUnregisteredTypeArg")) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(CustomUnregisteredType)") + << QByteArray("MethodTestObject(CustomUnregisteredType)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << 0) + << (QList<QByteArray>() << QByteArray("CustomUnregisteredType")) + << (QList<QByteArray>() << QByteArray("constructorCustomUnregisteredTypeArg")) + << QMetaMethod::Public + << QMetaMethod::Constructor; + + QTest::newRow("boolSignal") + << QByteArray("boolSignal()") + << int(QMetaType::Bool) << QByteArray("bool") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("boolInvokable") + << QByteArray("boolInvokable()") + << int(QMetaType::Bool) << QByteArray("bool") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("boolSlot") + << QByteArray("boolSlot()") + << int(QMetaType::Bool) << QByteArray("bool") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("qrealSignal") + << QByteArray("qrealSignal()") + << int(QMetaType::QReal) << QByteArray("qreal") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("qrealInvokable") + << QByteArray("qrealInvokable()") + << int(QMetaType::QReal) << QByteArray("qreal") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("qrealSlot") + << QByteArray("qrealSlot()") + << int(QMetaType::QReal) << QByteArray("qreal") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("qstringSignal") + << QByteArray("qstringSignal()") + << int(QMetaType::QString) << QByteArray("QString") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("qstringInvokable") + << QByteArray("qstringInvokable()") + << int(QMetaType::QString) << QByteArray("QString") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("qstringSlot") + << QByteArray("qstringSlot()") + << int(QMetaType::QString) << QByteArray("QString") + << (QList<int>()) + << (QList<QByteArray>()) + << (QList<QByteArray>()) + << QMetaMethod::Public + << QMetaMethod::Slot; + + { + QList<int> parameterTypes = QList<int>() + << int(QMetaType::Bool) << int(QMetaType::Int) << int(QMetaType::UInt) + << int(QMetaType::LongLong) << int(QMetaType::ULongLong) << int(QMetaType::Double) + << int(QMetaType::Long) << int(QMetaType::Short) << int(QMetaType::Char) + << int(QMetaType::ULong) << int(QMetaType::UShort) << int(QMetaType::UChar) + << int(QMetaType::Float); + QList<QByteArray> parameterTypeNames = QList<QByteArray>() + << QByteArray("bool") << QByteArray("int") << QByteArray("uint") + << QByteArray("qlonglong") << QByteArray("qulonglong") << QByteArray("double") + << QByteArray("long") << QByteArray("short") << QByteArray("char") << QByteArray("ulong") + << QByteArray("ushort") << QByteArray("uchar") << QByteArray("float"); + QList<QByteArray> parameterNames = QList<QByteArray>() + << QByteArray("boolArg") << QByteArray("intArg") << QByteArray("uintArg") + << QByteArray("longlongArg") << QByteArray("ulonglongArg") << QByteArray("doubleArg") + << QByteArray("longArg") << QByteArray("shortArg") << QByteArray("charArg") + << QByteArray("ulongArg") << QByteArray("ushortArg") << QByteArray("ucharArg") + << QByteArray("floatArg"); + + QTest::newRow("qvariantSignalBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat") + << QByteArray("qvariantSignalBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat(" + "bool,int,uint,qlonglong,qulonglong,double,long,short,char,ulong,ushort,uchar,float)") + << int(QMetaType::QVariant) << QByteArray("QVariant") + << parameterTypes << parameterTypeNames << parameterNames + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("qvariantInvokableBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat") + << QByteArray("qvariantInvokableBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat(" + "bool,int,uint,qlonglong,qulonglong,double,long,short,char,ulong,ushort,uchar,float)") + << int(QMetaType::QVariant) << QByteArray("QVariant") + << parameterTypes << parameterTypeNames << parameterNames + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("qvariantSlotBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat") + << QByteArray("qvariantSlotBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat(" + "bool,int,uint,qlonglong,qulonglong,double,long,short,char,ulong,ushort,uchar,float)") + << int(QMetaType::QVariant) << QByteArray("QVariant") + << parameterTypes << parameterTypeNames << parameterNames + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(bool,int,uint,qlonglong,qulonglong,double,long,short,char,ulong,ushort,uchar,float)") + << QByteArray("MethodTestObject(bool,int,uint,qlonglong,qulonglong,double,long,short,char,ulong,ushort,uchar,float)") + << int(QMetaType::Void) << QByteArray("") + << parameterTypes << parameterTypeNames << parameterNames + << QMetaMethod::Public + << QMetaMethod::Constructor; + } + + QTest::newRow("voidSignalNoParameterNames") + << QByteArray("voidSignalNoParameterNames(bool,int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Bool) << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("bool") << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("") << QByteArray("")) + << QMetaMethod::Protected + << QMetaMethod::Signal; + + QTest::newRow("voidInvokableNoParameterNames") + << QByteArray("voidInvokableNoParameterNames(bool,int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Bool) << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("bool") << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("") << QByteArray("")) + << QMetaMethod::Public + << QMetaMethod::Method; + + QTest::newRow("voidSlotNoParameterNames") + << QByteArray("voidSlotNoParameterNames(bool,int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Bool) << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("bool") << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("") << QByteArray("")) + << QMetaMethod::Public + << QMetaMethod::Slot; + + QTest::newRow("MethodTestObject(bool,int)") + << QByteArray("MethodTestObject(bool,int)") + << int(QMetaType::Void) << QByteArray("") + << (QList<int>() << int(QMetaType::Bool) << int(QMetaType::Int)) + << (QList<QByteArray>() << QByteArray("bool") << QByteArray("int")) + << (QList<QByteArray>() << QByteArray("") << QByteArray("")) + << QMetaMethod::Public + << QMetaMethod::Constructor; +} + +void tst_QMetaMethod::method() +{ + QFETCH(QByteArray, signature); + QFETCH(int, returnType); + QFETCH(QByteArray, returnTypeName); + QFETCH(QList<int>, parameterTypes); + QFETCH(QList<QByteArray>, parameterTypeNames); + QFETCH(QList<QByteArray>, parameterNames); + QFETCH(QMetaMethod::MethodType, methodType); + QFETCH(QMetaMethod::Access, access); + + QVERIFY(parameterTypes.size() == parameterTypeNames.size()); + QVERIFY(parameterTypes.size() == parameterNames.size()); + + const QMetaObject *mo = &MethodTestObject::staticMetaObject; + int index = (methodType == QMetaMethod::Constructor) + ? mo->indexOfConstructor(signature) : mo->indexOfMethod(signature); + QVERIFY(index != -1); + QMetaMethod method = (methodType == QMetaMethod::Constructor) + ? mo->constructor(index) : mo->method(index); + QVERIFY(method.isValid()); + QCOMPARE(method.methodType(), methodType); + QCOMPARE(method.access(), access); + + QCOMPARE(method.signature(), signature.constData()); + + QCOMPARE(method.tag(), ""); + + QCOMPARE(method.typeName(), returnTypeName.constData()); + QCOMPARE(QMetaType::type(method.typeName()), returnType); + + QCOMPARE(method.parameterTypes(), parameterTypeNames); + QCOMPARE(method.parameterNames(), parameterNames); +} + +void tst_QMetaMethod::invalidMethod() +{ + QMetaMethod method; + QVERIFY(!method.isValid()); + + QMetaMethod method2 = staticMetaObject.method(staticMetaObject.methodCount()); + QVERIFY(!method2.isValid()); + + QMetaMethod method3 = staticMetaObject.method(-1); + QVERIFY(!method3.isValid()); +} + +QTEST_MAIN(tst_QMetaMethod) +#include "tst_qmetamethod.moc" diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index def1b74ea4..97b14a374e 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -64,6 +64,7 @@ private slots: void staticMetacall(); void copyMetaObject(); void serialize(); + void relocatableData(); void removeNotifySignal(); void usage_signal(); @@ -90,6 +91,7 @@ class SomethingOfEverything : public QObject Q_CLASSINFO("ci_bar", "DEF") Q_PROPERTY(QString prop READ prop WRITE setProp NOTIFY propChanged) Q_PROPERTY(QString prop2 READ prop WRITE setProp) + Q_PROPERTY(QString revisionProp READ prop WRITE setProp REVISION 42) Q_PROPERTY(SomethingEnum eprop READ eprop) Q_PROPERTY(SomethingFlagEnum fprop READ fprop) Q_PROPERTY(QLocale::Language language READ language) @@ -123,6 +125,7 @@ public: public slots: void slot1(const QString&) {} void slot2(int, const QString&) {} + Q_REVISION(24) void revisionSlot() {} private slots: void slot3() {} @@ -218,6 +221,7 @@ void tst_QMetaObjectBuilder::method() QVERIFY(nullMethod.tag().isEmpty()); QVERIFY(nullMethod.access() == QMetaMethod::Public); QCOMPARE(nullMethod.attributes(), 0); + QCOMPARE(nullMethod.revision(), 0); QCOMPARE(nullMethod.index(), 0); // Add a method and check its attributes. @@ -229,6 +233,7 @@ void tst_QMetaObjectBuilder::method() QVERIFY(method1.tag().isEmpty()); QVERIFY(method1.access() == QMetaMethod::Public); QCOMPARE(method1.attributes(), 0); + QCOMPARE(method1.revision(), 0); QCOMPARE(method1.index(), 0); QCOMPARE(builder.methodCount(), 1); @@ -241,6 +246,7 @@ void tst_QMetaObjectBuilder::method() QVERIFY(method2.tag().isEmpty()); QVERIFY(method2.access() == QMetaMethod::Public); QCOMPARE(method2.attributes(), 0); + QCOMPARE(method2.revision(), 0); QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); @@ -255,6 +261,7 @@ void tst_QMetaObjectBuilder::method() method1.setTag("tag"); method1.setAccess(QMetaMethod::Private); method1.setAttributes(42); + method1.setRevision(123); // Check that method1 is changed, but method2 is not. QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); @@ -264,6 +271,7 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(method1.tag(), QByteArray("tag")); QVERIFY(method1.access() == QMetaMethod::Private); QCOMPARE(method1.attributes(), 42); + QCOMPARE(method1.revision(), 123); QCOMPARE(method1.index(), 0); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); QVERIFY(method2.methodType() == QMetaMethod::Method); @@ -272,6 +280,7 @@ void tst_QMetaObjectBuilder::method() QVERIFY(method2.tag().isEmpty()); QVERIFY(method2.access() == QMetaMethod::Public); QCOMPARE(method2.attributes(), 0); + QCOMPARE(method2.revision(), 0); QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); @@ -281,6 +290,7 @@ void tst_QMetaObjectBuilder::method() method2.setTag("Q_FOO"); method2.setAccess(QMetaMethod::Protected); method2.setAttributes(24); + method2.setRevision(321); // This time check that only method2 changed. QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); @@ -290,6 +300,7 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(method1.tag(), QByteArray("tag")); QVERIFY(method1.access() == QMetaMethod::Private); QCOMPARE(method1.attributes(), 42); + QCOMPARE(method1.revision(), 123); QCOMPARE(method1.index(), 0); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); QVERIFY(method2.methodType() == QMetaMethod::Method); @@ -298,6 +309,7 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(method2.tag(), QByteArray("Q_FOO")); QVERIFY(method2.access() == QMetaMethod::Protected); QCOMPARE(method2.attributes(), 24); + QCOMPARE(method2.revision(), 321); QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); @@ -312,6 +324,7 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(method2.tag(), QByteArray("Q_FOO")); QVERIFY(method2.access() == QMetaMethod::Protected); QCOMPARE(method2.attributes(), 24); + QCOMPARE(method2.revision(), 321); QCOMPARE(method2.index(), 0); // Perform index-based lookup again. @@ -541,6 +554,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!nullProp.isConstant()); QVERIFY(!nullProp.isFinal()); QCOMPARE(nullProp.index(), 0); + QCOMPARE(nullProp.revision(), 0); // Add a property and check its attributes. QMetaPropertyBuilder prop1 = builder.addProperty("foo", "const QString &"); @@ -559,6 +573,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop1.isEnumOrFlag()); QVERIFY(!prop1.isConstant()); QVERIFY(!prop1.isFinal()); + QCOMPARE(prop1.revision(), 0); QCOMPARE(prop1.index(), 0); QCOMPARE(builder.propertyCount(), 1); @@ -579,6 +594,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isEnumOrFlag()); QVERIFY(!prop2.isConstant()); QVERIFY(!prop2.isFinal()); + QCOMPARE(prop2.revision(), 0); QCOMPARE(prop2.index(), 1); QCOMPARE(builder.propertyCount(), 2); @@ -602,6 +618,7 @@ void tst_QMetaObjectBuilder::property() prop1.setEnumOrFlag(true); prop1.setConstant(true); prop1.setFinal(true); + prop1.setRevision(123); // Check that prop1 is changed, but prop2 is not. QCOMPARE(prop1.name(), QByteArray("foo")); @@ -618,6 +635,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(prop1.isEnumOrFlag()); QVERIFY(prop1.isConstant()); QVERIFY(prop1.isFinal()); + QCOMPARE(prop1.revision(), 123); QVERIFY(prop2.isReadable()); QVERIFY(prop2.isWritable()); QCOMPARE(prop2.name(), QByteArray("bar")); @@ -632,6 +650,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isEnumOrFlag()); QVERIFY(!prop2.isConstant()); QVERIFY(!prop2.isFinal()); + QCOMPARE(prop2.revision(), 0); // Remove prop1 and check that prop2 becomes index 0. builder.removeProperty(0); @@ -649,6 +668,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isEnumOrFlag()); QVERIFY(!prop2.isConstant()); QVERIFY(!prop2.isFinal()); + QCOMPARE(prop2.revision(), 0); QCOMPARE(prop2.index(), 0); // Perform index-based lookup again. @@ -1028,6 +1048,39 @@ void tst_QMetaObjectBuilder::serialize() } } +void tst_QMetaObjectBuilder::relocatableData() +{ + QMetaObjectBuilder builder; + builder.setClassName("TestObject"); + + QMetaMethodBuilder intPropChanged = builder.addSignal("intPropChanged(int)"); + intPropChanged.setParameterNames(QList<QByteArray>() << "newIntPropValue"); + + QMetaPropertyBuilder prop = builder.addProperty("intProp", "int"); + prop.setNotifySignal(intPropChanged); + + QMetaMethodBuilder voidSlotInt = builder.addSlot("voidSlotInt(int)"); + voidSlotInt.setParameterNames(QList<QByteArray>() << "slotIntArg"); + + QMetaMethodBuilder listInvokableQRealQString = builder.addMethod("listInvokableQRealQString(qreal,QString)"); + listInvokableQRealQString.setReturnType("QVariantList"); + listInvokableQRealQString.setParameterNames(QList<QByteArray>() << "qrealArg" << "qstringArg"); + + bool ok = false; + QByteArray data = builder.toRelocatableData(&ok); + QVERIFY(ok); + + QMetaObjectBuilder builder2; + QMetaObject meta2; + builder2.fromRelocatableData(&meta2, &QObject::staticMetaObject, data); + + QMetaObject *meta = builder.toMetaObject(); + + QVERIFY(sameMetaObject(meta, &meta2)); + free(meta); +} + + // Check that removing a method updates notify signals appropriately void tst_QMetaObjectBuilder::removeNotifySignal() { @@ -1129,6 +1182,9 @@ static bool sameMethod(const QMetaMethod& method1, const QMetaMethod& method2) if (method1.attributes() != method2.attributes()) return false; + if (method1.revision() != method2.revision()) + return false; + return true; } @@ -1159,6 +1215,9 @@ static bool sameProperty(const QMetaProperty& prop1, const QMetaProperty& prop2) return false; } + if (prop1.revision() != prop2.revision()) + return false; + return true; } @@ -1282,11 +1341,11 @@ class TestObject : public QObject // Manually expanded from Q_OBJECT macro public: Q_OBJECT_CHECK + static QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); private: - Q_DECL_HIDDEN static const QMetaObjectExtraData staticMetaObjectExtraData; Q_DECL_HIDDEN static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); //Q_PROPERTY(int intProp READ intProp WRITE setIntProp NOTIFY intPropChanged) @@ -1319,14 +1378,15 @@ private: int m_voidSlotIntArg; }; -const QMetaObjectExtraData TestObject::staticMetaObjectExtraData = { - 0, qt_static_metacall +QMetaObject TestObject::staticMetaObject = { + { 0, 0, 0, 0 } }; TestObject::TestObject(QObject *parent) : QObject(parent), m_metaObject(buildMetaObject()), m_intProp(-1), m_voidSlotIntArg(-1) { + staticMetaObject = *m_metaObject; } TestObject::~TestObject() @@ -1422,9 +1482,6 @@ void TestObject::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, } } } else if (_c == QMetaObject::IndexOfMethod) { - // This code is currently unreachable because it's only used by the - // template-based versions of connect() and disconnect(), which don't - // work with dynamically generated meta-objects (see test). int *result = reinterpret_cast<int *>(_a[0]); void **func = reinterpret_cast<void **>(_a[1]); { @@ -1445,7 +1502,6 @@ void TestObject::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, *result = 2; } } - qFatal("You forgot to add one or more IndexOfMethod cases"); } } @@ -1609,11 +1665,22 @@ void tst_QMetaObjectBuilder::usage_templateConnect() { QScopedPointer<TestObject> testObject(new TestObject); - QTest::ignoreMessage(QtWarningMsg, "QObject::connect: signal not found in QObject"); QMetaObject::Connection con = QObject::connect(testObject.data(), &TestObject::intPropChanged, testObject.data(), &TestObject::voidSlotInt); - QEXPECT_FAIL("", "template-based connect() fails because meta-object is deduced at compile-time", Abort); QVERIFY(con); + + QVERIFY(testObject->voidSlotIntArgument() == -1); + testObject->setProperty("intProp", 123); + QCOMPARE(testObject->voidSlotIntArgument(), 123); + + QVERIFY(QObject::disconnect(testObject.data(), &TestObject::intPropChanged, + testObject.data(), &TestObject::voidSlotInt)); + + // Something that isn't a signal + QTest::ignoreMessage(QtWarningMsg, "QObject::connect: signal not found in TestObject"); + con = QObject::connect(testObject.data(), &TestObject::setIntProp, + testObject.data(), &TestObject::intPropChanged); + QVERIFY(!con); } QTEST_MAIN(tst_QMetaObjectBuilder) diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index be13b39e7e..72913d10f2 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -78,16 +78,22 @@ private slots: void createCopy(); void sizeOf_data(); void sizeOf(); + void sizeOfStaticLess_data(); + void sizeOfStaticLess(); void flags_data(); void flags(); + void flagsStaticLess_data(); + void flagsStaticLess(); void construct_data(); void construct(); void constructCopy_data(); void constructCopy(); void typedefs(); + void registerType(); void isRegistered_data(); void isRegistered(); - void unregisterType(); + void isRegisteredStaticLess_data(); + void isRegisteredStaticLess(); void registerStreamBuiltin(); void automaticTemplateRegistration(); }; @@ -125,6 +131,9 @@ class MetaTypeTorturer: public QThread protected: void run() { + Bar space[1]; + space[0].~Bar(); + for (int i = 0; i < 1000; ++i) { const QByteArray name = QString("Bar%1_%2").arg(i).arg((size_t)QThread::currentThreadId()).toLatin1(); const char *nm = name.constData(); @@ -132,6 +141,15 @@ protected: #ifdef Q_OS_LINUX pthread_yield(); #endif + QMetaType info(tp); + if (!info.isValid()) { + ++failureCount; + qWarning() << "Wrong typeInfo returned for" << tp; + } + if (!info.isRegistered()) { + ++failureCount; + qWarning() << name << "is not a registered metatype"; + } if (QMetaType::typeFlags(tp) != (QMetaType::NeedsConstruction | QMetaType::NeedsDestruction)) { ++failureCount; qWarning() << "Wrong typeInfo returned for" << tp; @@ -148,9 +166,22 @@ protected: ++failureCount; qWarning() << "Wrong typeName returned for" << tp; } - void *buf = QMetaType::create(tp, 0); - void *buf2 = QMetaType::create(tp, buf); - if (!buf) { + void *buf1 = QMetaType::create(tp, 0); + void *buf2 = QMetaType::create(tp, buf1); + void *buf3 = info.create(tp, 0); + void *buf4 = info.create(tp, buf1); + + QMetaType::construct(tp, space, 0); + QMetaType::destruct(tp, space); + QMetaType::construct(tp, space, buf1); + QMetaType::destruct(tp, space); + + info.construct(space, 0); + info.destruct(space); + info.construct(space, buf1); + info.destruct(space); + + if (!buf1) { ++failureCount; qWarning() << "Null buffer returned by QMetaType::create(tp, 0)"; } @@ -158,9 +189,20 @@ protected: ++failureCount; qWarning() << "Null buffer returned by QMetaType::create(tp, buf)"; } - QMetaType::destroy(tp, buf); + if (!buf3) { + ++failureCount; + qWarning() << "Null buffer returned by info.create(tp, 0)"; + } + if (!buf4) { + ++failureCount; + qWarning() << "Null buffer returned by infocreate(tp, buf)"; + } + QMetaType::destroy(tp, buf1); QMetaType::destroy(tp, buf2); + info.destroy(buf3); + info.destroy(buf4); } + new (space) Bar; } public: MetaTypeTorturer() : failureCount(0) { } @@ -480,13 +522,17 @@ template<int ID> static void testCreateHelper() { typedef typename MetaEnumToType<ID>::Type Type; - void *actual = QMetaType::create(ID); + QMetaType info(ID); + void *actual1 = QMetaType::create(ID); + void *actual2 = info.create(); if (DefaultValueTraits<ID>::IsInitialized) { Type *expected = DefaultValueFactory<ID>::create(); - QCOMPARE(*static_cast<Type *>(actual), *expected); + QCOMPARE(*static_cast<Type *>(actual1), *expected); + QCOMPARE(*static_cast<Type *>(actual2), *expected); delete expected; } - QMetaType::destroy(ID, actual); + QMetaType::destroy(ID, actual1); + info.destroy(actual2); } template<> @@ -529,9 +575,13 @@ static void testCreateCopyHelper() { typedef typename MetaEnumToType<ID>::Type Type; Type *expected = TestValueFactory<ID>::create(); - void *actual = QMetaType::create(ID, expected); - QCOMPARE(*static_cast<Type *>(actual), *expected); - QMetaType::destroy(ID, actual); + QMetaType info(ID); + void *actual1 = QMetaType::create(ID, expected); + void *actual2 = info.create(expected); + QCOMPARE(*static_cast<Type *>(actual1), *expected); + QCOMPARE(*static_cast<Type *>(actual2), *expected); + QMetaType::destroy(ID, actual1); + info.destroy(actual2); delete expected; } @@ -588,6 +638,18 @@ void tst_QMetaType::sizeOf() QCOMPARE(QMetaType::sizeOf(type), size); } +void tst_QMetaType::sizeOfStaticLess_data() +{ + sizeOf_data(); +} + +void tst_QMetaType::sizeOfStaticLess() +{ + QFETCH(QMetaType::Type, type); + QFETCH(int, size); + QCOMPARE(QMetaType(type).sizeOf(), size); +} + struct CustomMovable {}; QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(CustomMovable, Q_MOVABLE_TYPE); @@ -653,6 +715,23 @@ void tst_QMetaType::flags() QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::PointerToQObject), isPointerToQObject); } +void tst_QMetaType::flagsStaticLess_data() +{ + flags_data(); +} + +void tst_QMetaType::flagsStaticLess() +{ + QFETCH(int, type); + QFETCH(bool, isMovable); + QFETCH(bool, isComplex); + + int flags = QMetaType(type).flags(); + QCOMPARE(bool(flags & QMetaType::NeedsConstruction), isComplex); + QCOMPARE(bool(flags & QMetaType::NeedsDestruction), isComplex); + QCOMPARE(bool(flags & QMetaType::MovableType), isMovable); +} + void tst_QMetaType::construct_data() { create_data(); @@ -688,20 +767,30 @@ template<int ID> static void testConstructHelper() { typedef typename MetaEnumToType<ID>::Type Type; - int size = QMetaType::sizeOf(ID); - void *storage = qMallocAligned(size, TypeAlignment<Type>::Value); - void *actual = QMetaType::construct(ID, storage, /*copy=*/0); - QCOMPARE(actual, storage); + QMetaType info(ID); + int size = info.sizeOf(); + void *storage1 = qMallocAligned(size, TypeAlignment<Type>::Value); + void *actual1 = QMetaType::construct(ID, storage1, /*copy=*/0); + void *storage2 = qMallocAligned(size, TypeAlignment<Type>::Value); + void *actual2 = info.construct(storage2, /*copy=*/0); + QCOMPARE(actual1, storage1); + QCOMPARE(actual2, storage2); if (DefaultValueTraits<ID>::IsInitialized) { Type *expected = DefaultValueFactory<ID>::create(); - QCOMPARE(*static_cast<Type *>(actual), *expected); + QCOMPARE(*static_cast<Type *>(actual1), *expected); + QCOMPARE(*static_cast<Type *>(actual2), *expected); delete expected; } - QMetaType::destruct(ID, actual); - qFreeAligned(storage); + QMetaType::destruct(ID, actual1); + qFreeAligned(storage1); + info.destruct(actual2); + qFreeAligned(storage2); QVERIFY(QMetaType::construct(ID, 0, /*copy=*/0) == 0); QMetaType::destruct(ID, 0); + + QVERIFY(info.construct(0, /*copy=*/0) == 0); + info.destruct(0); } template<> @@ -748,15 +837,24 @@ static void testConstructCopyHelper() { typedef typename MetaEnumToType<ID>::Type Type; Type *expected = TestValueFactory<ID>::create(); + QMetaType info(ID); int size = QMetaType::sizeOf(ID); - void *storage = qMallocAligned(size, TypeAlignment<Type>::Value); - void *actual = QMetaType::construct(ID, storage, expected); - QCOMPARE(actual, storage); - QCOMPARE(*static_cast<Type *>(actual), *expected); - QMetaType::destruct(ID, actual); - qFreeAligned(storage); + QCOMPARE(info.sizeOf(), size); + void *storage1 = qMallocAligned(size, TypeAlignment<Type>::Value); + void *actual1 = QMetaType::construct(ID, storage1, expected); + void *storage2 = qMallocAligned(size, TypeAlignment<Type>::Value); + void *actual2 = info.construct(storage2, expected); + QCOMPARE(actual1, storage1); + QCOMPARE(actual2, storage2); + QCOMPARE(*static_cast<Type *>(actual1), *expected); + QCOMPARE(*static_cast<Type *>(actual2), *expected); + QMetaType::destruct(ID, actual1); + qFreeAligned(storage1); + info.destruct(actual2); + qFreeAligned(storage2); QVERIFY(QMetaType::construct(ID, 0, expected) == 0); + QVERIFY(info.construct(0, expected) == 0); delete expected; } @@ -829,6 +927,44 @@ void tst_QMetaType::typedefs() QCOMPARE(QMetaType::type("WhityDouble"), ::qMetaTypeId<WhityDouble>()); } +void tst_QMetaType::registerType() +{ + // Built-in + QCOMPARE(qRegisterMetaType<QString>("QString"), int(QMetaType::QString)); + QCOMPARE(qRegisterMetaType<QString>("QString"), int(QMetaType::QString)); + + // Custom + int fooId = qRegisterMetaType<TestSpace::Foo>("TestSpace::Foo"); + QVERIFY(fooId >= int(QMetaType::User)); + QCOMPARE(qRegisterMetaType<TestSpace::Foo>("TestSpace::Foo"), fooId); + + int movableId = qRegisterMetaType<CustomMovable>("CustomMovable"); + QVERIFY(movableId >= int(QMetaType::User)); + QCOMPARE(qRegisterMetaType<CustomMovable>("CustomMovable"), movableId); + + // Alias to built-in + typedef QString MyString; + + QCOMPARE(qRegisterMetaType<MyString>("MyString"), int(QMetaType::QString)); + QCOMPARE(qRegisterMetaType<MyString>("MyString"), int(QMetaType::QString)); + + QCOMPARE(QMetaType::type("MyString"), int(QMetaType::QString)); + + // Alias to custom type + typedef CustomMovable MyMovable; + typedef TestSpace::Foo MyFoo; + + QCOMPARE(qRegisterMetaType<MyMovable>("MyMovable"), movableId); + QCOMPARE(qRegisterMetaType<MyMovable>("MyMovable"), movableId); + + QCOMPARE(QMetaType::type("MyMovable"), movableId); + + QCOMPARE(qRegisterMetaType<MyFoo>("MyFoo"), fooId); + QCOMPARE(qRegisterMetaType<MyFoo>("MyFoo"), fooId); + + QCOMPARE(QMetaType::type("MyFoo"), fooId); +} + class IsRegisteredDummyType { }; void tst_QMetaType::isRegistered_data() @@ -857,26 +993,16 @@ void tst_QMetaType::isRegistered() QCOMPARE(QMetaType::isRegistered(typeId), registered); } -class RegUnreg +void tst_QMetaType::isRegisteredStaticLess_data() { -public: - RegUnreg() {}; - RegUnreg(const RegUnreg &) {}; - ~RegUnreg() {}; -}; - -void tst_QMetaType::unregisterType() -{ - // cannot unregister standard types - int typeId = qRegisterMetaType<QList<QVariant> >("QList<QVariant>"); - QCOMPARE(QMetaType::isRegistered(typeId), true); - QMetaType::unregisterType("QList<QVariant>"); - QCOMPARE(QMetaType::isRegistered(typeId), true); - // allow unregister user types - typeId = qRegisterMetaType<RegUnreg>("RegUnreg"); - QCOMPARE(QMetaType::isRegistered(typeId), true); - QMetaType::unregisterType("RegUnreg"); - QCOMPARE(QMetaType::isRegistered(typeId), false); + isRegistered_data(); +} + +void tst_QMetaType::isRegisteredStaticLess() +{ + QFETCH(int, typeId); + QFETCH(bool, registered); + QCOMPARE(QMetaType(typeId).isRegistered(), registered); } void tst_QMetaType::registerStreamBuiltin() diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp index 09f17602b3..f9a6bae087 100644 --- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp +++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp @@ -317,19 +317,22 @@ void tst_QMimeData::setUrls() const longUrlList += QUrl("http://www.google.com"); // verify initial state - QVERIFY(mimeData.hasUrls() == false); + QCOMPARE(mimeData.hasUrls(), false); // set a few, verify mimeData.setUrls(shortUrlList); QCOMPARE(mimeData.urls(), shortUrlList); + QCOMPARE(mimeData.text(), QString("http://qt.nokia.com")); // change them, verify mimeData.setUrls(longUrlList); QCOMPARE(mimeData.urls(), longUrlList); + QCOMPARE(mimeData.text(), QString("http://qt.nokia.com\nhttp://www.google.com\n")); // clear, verify mimeData.clear(); - QVERIFY(mimeData.hasUrls() == false); + QCOMPARE(mimeData.hasUrls(), false); + QCOMPARE(mimeData.hasText(), false); } QTEST_MAIN(tst_QMimeData) diff --git a/tests/auto/corelib/kernel/qobject/qobject.pro b/tests/auto/corelib/kernel/qobject/qobject.pro index ee48f56b1d..0f86408fc9 100644 --- a/tests/auto/corelib/kernel/qobject/qobject.pro +++ b/tests/auto/corelib/kernel/qobject/qobject.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = signalbug tst_qobject.pro -CONFIG += parallel_test +SUBDIRS = signalbug +tst_qobject.pro.depends = $$SUBDIRS +SUBDIRS += tst_qobject.pro diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 7f95f68075..a6ad1d53bc 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -1703,7 +1703,9 @@ void tst_QObject::property() QVERIFY(property.isWritable()); QVERIFY(!property.isEnumType()); QCOMPARE(property.typeName(), "CustomType*"); + qRegisterMetaType<CustomType*>(); QCOMPARE(property.type(), QVariant::UserType); + QCOMPARE(property.userType(), qMetaTypeId<CustomType*>()); CustomType *customPointer = 0; QVariant customVariant = object.property("custom"); @@ -1718,6 +1720,7 @@ void tst_QObject::property() QVERIFY(property.isWritable()); QCOMPARE(property.typeName(), "CustomType*"); QCOMPARE(property.type(), QVariant::UserType); + QCOMPARE(property.userType(), qMetaTypeId<CustomType*>()); QVERIFY(object.setProperty("custom", customVariant)); QCOMPARE(object.custom(), customPointer); @@ -3183,6 +3186,14 @@ void tst_QObject::dumpObjectInfo() QObject a, b; QObject::connect(&a, SIGNAL(destroyed(QObject *)), &b, SLOT(deleteLater())); a.disconnect(&b); +#ifdef QT_DEBUG + QTest::ignoreMessage(QtDebugMsg, "OBJECT QObject::unnamed"); + QTest::ignoreMessage(QtDebugMsg, " SIGNALS OUT"); + QTest::ignoreMessage(QtDebugMsg, " signal: destroyed(QObject*)"); + QTest::ignoreMessage(QtDebugMsg, " <Disconnected receiver>"); + QTest::ignoreMessage(QtDebugMsg, " SIGNALS IN"); + QTest::ignoreMessage(QtDebugMsg, " <None>"); +#endif a.dumpObjectInfo(); // should not crash } @@ -3810,12 +3821,18 @@ void tst_QObject::sameName() c2.emitSignal1(); QCOMPARE(c1.s, 2); +#ifndef QT_NO_DEBUG + QTest::ignoreMessage(QtWarningMsg, "QMetaObject::indexOfSignal: signal aPublicSlot() from SenderObject redefined in ConfusingObject"); +#endif QVERIFY(connect(&c2, SIGNAL(aPublicSlot()), &c1, SLOT(signal1()))); c2.aPublicSlot(); QCOMPARE(c2.aPublicSlotCalled, 0); QCOMPARE(c1.aPublicSlotCalled, 0); QCOMPARE(c1.s, 3); +#ifndef QT_NO_DEBUG + QTest::ignoreMessage(QtWarningMsg, "QMetaObject::indexOfSignal: signal aPublicSlot() from SenderObject redefined in ConfusingObject"); +#endif QVERIFY(connect(&c2, SIGNAL(aPublicSlot()), &c1, SLOT(aPublicSlot()))); c2.aPublicSlot(); QCOMPARE(c2.aPublicSlotCalled, 0); @@ -4149,9 +4166,6 @@ void tst_QObject::pointerConnect() QVERIFY( connect( s, &SenderObject::signal1 , r2, &ReceiverObject::slot1 ) ); QVERIFY( connect( s, &SenderObject::signal1 , r1, &ReceiverObject::slot3 ) ); QVERIFY( connect( s, &SenderObject::signal3 , r1, &ReceiverObject::slot3 ) ); -#if defined(Q_CC_GNU) && defined(Q_OS_UNIX) - QEXPECT_FAIL("", "Test may fail due to failing comparison of pointers to member functions caused by problems with -reduce-relocations on this platform.", Continue); -#endif QVERIFY2( connect( &timer, &QTimer::timeout, r1, &ReceiverObject::deleteLater ), "Signal connection failed most likely due to failing comparison of pointers to member functions caused by problems with -reduce-relocations on this platform."); diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.pro b/tests/auto/corelib/kernel/qobject/tst_qobject.pro index d74f2bcb0f..30fd810a2e 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.pro +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.pro @@ -6,3 +6,6 @@ SOURCES = tst_qobject.cpp # this is here for a reason, moc_oldnormalizedobject.cpp is not auto-generated, it was generated by # moc from Qt 4.6, and should *not* be generated by the current moc SOURCES += moc_oldnormalizeobject.cpp + +load(testcase) # for target.path and installTestHelperApp() +installTestHelperApp("signalbug/signalbug",signalbug,signalbug) diff --git a/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro b/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro index 55f6934fc9..58e4b98af7 100644 --- a/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro +++ b/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro @@ -6,5 +6,3 @@ SOURCES = tst_qsocketnotifier.cpp requires(contains(QT_CONFIG,private_tests)) include(../../../network/socket/platformsocketengine/platformsocketengine.pri) - -mac: CONFIG += insignificant_test # QTBUG-22746 diff --git a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp index e3bfe3bc6d..5442303e7e 100644 --- a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp +++ b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp @@ -237,7 +237,7 @@ void tst_QSocketNotifier::mixingWithTimers() QCoreApplication::processEvents(); QCOMPARE(helper.timerActivated, true); - QCOMPARE(helper.socketActivated, true); + QTRY_COMPARE(helper.socketActivated, true); } void tst_QSocketNotifier::posixSockets() @@ -264,10 +264,7 @@ void tst_QSocketNotifier::posixSockets() connect(&rn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop())); QSignalSpy readSpy(&rn, SIGNAL(activated(int))); QVERIFY(readSpy.isValid()); - QSocketNotifier wn(posixSocket, QSocketNotifier::Write); - connect(&wn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop())); - QSignalSpy writeSpy(&wn, SIGNAL(activated(int))); - QVERIFY(writeSpy.isValid()); + // No write notifier, some systems trigger write notification on socket creation, but not all QSocketNotifier en(posixSocket, QSocketNotifier::Exception); connect(&en, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop())); QSignalSpy errorSpy(&en, SIGNAL(activated(int))); @@ -278,19 +275,27 @@ void tst_QSocketNotifier::posixSockets() QTestEventLoop::instance().enterLoop(3); QCOMPARE(readSpy.count(), 1); - writeSpy.clear(); //depending on OS, write notifier triggers on creation or not. QCOMPARE(errorSpy.count(), 0); char buffer[100]; - qt_safe_read(posixSocket, buffer, 100); + int r = qt_safe_read(posixSocket, buffer, 100); + QCOMPARE(r, 6); QCOMPARE(buffer, "hello"); + QSocketNotifier wn(posixSocket, QSocketNotifier::Write); + connect(&wn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QSignalSpy writeSpy(&wn, SIGNAL(activated(int))); + QVERIFY(writeSpy.isValid()); qt_safe_write(posixSocket, "goodbye", 8); QTestEventLoop::instance().enterLoop(3); QCOMPARE(readSpy.count(), 1); QCOMPARE(writeSpy.count(), 1); QCOMPARE(errorSpy.count(), 0); + + // Write notifier may have fired before the read notifier inside + // QTcpSocket, give QTcpSocket a chance to see the incoming data + passive->waitForReadyRead(100); QCOMPARE(passive->readAll(), QByteArray("goodbye",8)); } qt_safe_close(posixSocket); diff --git a/tests/auto/corelib/kernel/qvariant/qvariant.pro b/tests/auto/corelib/kernel/qvariant/qvariant.pro index 48229ee140..9b4b346d35 100644 --- a/tests/auto/corelib/kernel/qvariant/qvariant.pro +++ b/tests/auto/corelib/kernel/qvariant/qvariant.pro @@ -3,5 +3,3 @@ TARGET = tst_qvariant QT += widgets network testlib SOURCES = tst_qvariant.cpp RESOURCES += qvariant.qrc - -mac: CONFIG += insignificant_test # QTBUG-QTBUG-22747 diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 2bf554dd78..ccdab17668 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -83,11 +83,22 @@ Q_DECLARE_METATYPE(QFont) Q_DECLARE_METATYPE(QColor) Q_DECLARE_METATYPE(QKeySequence) +class CustomNonQObject; + class tst_QVariant : public QObject { Q_OBJECT +public: + tst_QVariant(QObject *parent = 0) + : QObject(parent), customNonQObjectPointer(0) + { + + } + private slots: + void cleanupTestCase(); + void constructor(); void copy_constructor(); void isNull(); @@ -176,6 +187,7 @@ private slots: void qvariant_cast_QObject_data(); void qvariant_cast_QObject(); + void qvariant_cast_QObject_derived(); void toLocale(); @@ -275,6 +287,9 @@ private: void dataStream_data(QDataStream::Version version); void loadQVariantFromDataStream(QDataStream::Version version); void saveQVariantFromDataStream(QDataStream::Version version); + + CustomNonQObject *customNonQObjectPointer; + QVector<QObject*> objectPointerTestData; }; Q_DECLARE_METATYPE(QDate) @@ -1842,10 +1857,6 @@ void tst_QVariant::operator_eq_eq_data() QTest::newRow("HashSecondLarger") << QVariant(hash1) << QVariant(hash2) << false; } - - QTest::newRow( "UserType" ) << QVariant(QVariant::UserType) << QVariant(QVariant::UserType) << true; - QVariant mUserType(QVariant::UserType); - QTest::newRow( "Shared UserType" ) << mUserType << mUserType << true; } void tst_QVariant::operator_eq_eq() @@ -1919,7 +1930,6 @@ void tst_QVariant::typeName_data() QTest::newRow("39") << int(QVariant::RectF) << QByteArray("QRectF"); QTest::newRow("40") << int(QVariant::PointF) << QByteArray("QPointF"); QTest::newRow("41") << int(QVariant::RegExp) << QByteArray("QRegExp"); - QTest::newRow("42") << int(QVariant::UserType) << QByteArray(); QTest::newRow("43") << int(QVariant::Matrix) << QByteArray("QMatrix"); QTest::newRow("44") << int(QVariant::Transform) << QByteArray("QTransform"); QTest::newRow("45") << int(QVariant::Hash) << QByteArray("QVariantHash"); @@ -2031,10 +2041,10 @@ void tst_QVariant::userType() qVariantSetValue(userVar, data); QCOMPARE(userVar.type(), QVariant::UserType); + QCOMPARE(userVar.userType(), qMetaTypeId<MyType>()); QCOMPARE(userVar.typeName(), "MyType"); QVERIFY(!userVar.isNull()); QVERIFY(!userVar.canConvert(QVariant::String)); - QVERIFY(!userVar.canConvert(QVariant::UserType)); QVariant userVar2(userVar); QVERIFY(userVar == userVar2); @@ -2060,10 +2070,10 @@ void tst_QVariant::userType() qVariantSetValue(userVar, &data); QCOMPARE(userVar.type(), QVariant::UserType); + QCOMPARE(userVar.userType(), qMetaTypeId<MyType*>()); QCOMPARE(userVar.typeName(), "MyType*"); QVERIFY(!userVar.isNull()); QVERIFY(!userVar.canConvert(QVariant::String)); - QVERIFY(!userVar.canConvert(QVariant::UserType)); QVariant userVar2(userVar); QVERIFY(userVar == userVar2); @@ -2457,20 +2467,63 @@ void tst_QVariant::invalidQColor() const QVERIFY(!qvariant_cast<QColor>(va).isValid()); } -void tst_QVariant::qvariant_cast_QObject_data() { +class CustomQObject : public QObject { + Q_OBJECT +public: + CustomQObject(QObject *parent = 0) : QObject(parent) {} +}; +class CustomQWidget : public QWidget { + Q_OBJECT +public: + CustomQWidget(QWidget *parent = 0) : QWidget(parent) {} +}; +Q_DECLARE_METATYPE(CustomQObject*) +Q_DECLARE_METATYPE(CustomQWidget*) + +class CustomNonQObject { }; +Q_DECLARE_METATYPE(CustomNonQObject) +Q_DECLARE_METATYPE(CustomNonQObject*) +void tst_QVariant::cleanupTestCase() +{ + delete customNonQObjectPointer; + qDeleteAll(objectPointerTestData); +} + +void tst_QVariant::qvariant_cast_QObject_data() +{ QTest::addColumn<QVariant>("data"); QTest::addColumn<bool>("success"); - QObject *obj = new QObject(this); + QObject *obj = new QObject; obj->setObjectName(QString::fromLatin1("Hello")); QTest::newRow("from QObject") << QVariant(QMetaType::QObjectStar, &obj) << true; QTest::newRow("from QObject2") << QVariant::fromValue(obj) << true; QTest::newRow("from String") << QVariant(QLatin1String("1, 2, 3")) << false; QTest::newRow("from int") << QVariant((int) 123) << false; -} - - -void tst_QVariant::qvariant_cast_QObject() { + QWidget *widget = new QWidget; + widget->setObjectName(QString::fromLatin1("Hello")); + QTest::newRow("from QWidget") << QVariant::fromValue(widget) << true; + CustomQObject *customObject = new CustomQObject(this); + customObject->setObjectName(QString::fromLatin1("Hello")); + QTest::newRow("from Derived QObject") << QVariant::fromValue(customObject) << true; + CustomQWidget *customWidget = new CustomQWidget; + customWidget->setObjectName(QString::fromLatin1("Hello")); + QTest::newRow("from Derived QWidget") << QVariant::fromValue(customWidget) << true; + QTest::newRow("from custom Object") << QVariant::fromValue(CustomNonQObject()) << false; + + // Deleted in cleanupTestCase. + customNonQObjectPointer = new CustomNonQObject; + QTest::newRow("from custom ObjectStar") << QVariant::fromValue(customNonQObjectPointer) << false; + + // Deleted in cleanupTestCase. + objectPointerTestData.push_back(obj); + objectPointerTestData.push_back(widget); + objectPointerTestData.push_back(customObject); + objectPointerTestData.push_back(customWidget); +} + +void tst_QVariant::qvariant_cast_QObject() +{ QFETCH(QVariant, data); QFETCH(bool, success); @@ -2481,6 +2534,38 @@ void tst_QVariant::qvariant_cast_QObject() { } } +class CustomQObjectDerived : public CustomQObject { + Q_OBJECT +public: + CustomQObjectDerived(QObject *parent = 0) : CustomQObject(parent) {} +}; +Q_DECLARE_METATYPE(CustomQObjectDerived*) + +void tst_QVariant::qvariant_cast_QObject_derived() +{ + { + CustomQObjectDerived *object = new CustomQObjectDerived(this); + QVariant data = QVariant::fromValue(object); + + QVERIFY(data.userType() == qMetaTypeId<CustomQObjectDerived*>()); + + QCOMPARE(data.value<QObject *>(), object); + QCOMPARE(data.value<CustomQObjectDerived *>(), object); + QCOMPARE(data.value<CustomQObject *>(), object); + QVERIFY(data.value<CustomQWidget*>() == 0); + } + { + CustomQWidget customWidget; + QWidget *widget = &customWidget; + QVariant data = QVariant::fromValue(widget); + QVERIFY(data.userType() == QMetaType::QWidgetStar); + + QCOMPARE(data.value<QObject*>(), widget); + QCOMPARE(data.value<QWidget*>(), widget); + QCOMPARE(data.value<CustomQWidget*>(), widget); + } +} + Q_DECLARE_METATYPE(qint8); void tst_QVariant::convertToQUint8() const @@ -2696,7 +2781,7 @@ Q_DECLARE_METATYPE( MyClass ) void tst_QVariant::loadUnknownUserType() { qRegisterMetaType<MyClass>("MyClass"); - char data[] = {0, 0, 0, 127, 0, 0, 0, 0, 8, 77, 121, 67, 108, 97, 115, 115, 0}; + char data[] = {0, 0, 1, 0, 0, 0, 0, 0, 8, 77, 121, 67, 108, 97, 115, 115, 0}; QByteArray ba(data, sizeof(data)); QDataStream ds(&ba, QIODevice::ReadOnly); @@ -3306,6 +3391,7 @@ void tst_QVariant::movabilityTest() memcpy(buffer, &variant, sizeof(QVariant)); QCOMPARE(buffer[0].type(), QVariant::UserType); + QCOMPARE(buffer[0].userType(), qMetaTypeId<MyNotMovable>()); MyNotMovable tmp(buffer[0].value<MyNotMovable>()); new (&variant) QVariant(); @@ -3365,12 +3451,8 @@ void tst_QVariant::colorInteger() } class Forward; -QT_BEGIN_NAMESPACE namespace QtPrivate { -template <> struct IsPointerToTypeDerivedFromQObject<Forward*> { - enum { Value = false }; -}; -} QT_END_NAMESPACE -Q_DECLARE_METATYPE(Forward*); +Q_DECLARE_OPAQUE_POINTER(Forward*) +Q_DECLARE_METATYPE(Forward*) void tst_QVariant::forwardDeclare() { @@ -3460,6 +3542,7 @@ void tst_QVariant::loadQVariantFromDataStream(QDataStream::Version version) stream >> typeName >> loadedVariant; const int id = QMetaType::type(typeName.toLatin1()); + QVariant constructedVariant(static_cast<QVariant::Type>(id)); QCOMPARE(constructedVariant.userType(), id); QCOMPARE(QMetaType::typeName(loadedVariant.userType()), typeName.toLatin1().constData()); @@ -3534,7 +3617,7 @@ void tst_QVariant::debugStream_data() { QTest::addColumn<QVariant>("variant"); QTest::addColumn<int>("typeId"); - for (int id = QMetaType::Void; id < QMetaType::User; ++id) { + for (int id = 0; id < QMetaType::User; ++id) { const char *tagName = QMetaType::typeName(id); if (!tagName) continue; diff --git a/tests/auto/corelib/mimetypes/mimetypes.pro b/tests/auto/corelib/mimetypes/mimetypes.pro new file mode 100644 index 0000000000..9063d677e7 --- /dev/null +++ b/tests/auto/corelib/mimetypes/mimetypes.pro @@ -0,0 +1,8 @@ +TEMPLATE=subdirs + +SUBDIRS = \ + qmimetype \ + qmimedatabase + +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qmimetype diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro new file mode 100644 index 0000000000..815401ce1e --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro @@ -0,0 +1,12 @@ +CONFIG += testcase parallel_test + +TARGET = tst_qmimedatabase-cache + +QT = core testlib concurrent + +SOURCES = tst_qmimedatabase-cache.cpp +HEADERS = ../tst_qmimedatabase.h + +DEFINES += SRCDIR='"\\"$$PWD/../\\""' + +*-g++*:QMAKE_CXXFLAGS += -W -Wall -Wextra -Werror -Wshadow -Wno-long-long -Wnon-virtual-dtor diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp new file mode 100644 index 0000000000..205331d4dd --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 "../tst_qmimedatabase.h" +#include <QDir> +#include <QFile> +#include <QtTest/QtTest> +#include <qstandardpaths.h> + +#include "../tst_qmimedatabase.cpp" + +tst_QMimeDatabase::tst_QMimeDatabase() +{ + QDir here = QDir::currentPath(); + const QString tempMime = here.absolutePath() + QString::fromLatin1("/mime"); + runUpdateMimeDatabase(tempMime); + QVERIFY(QFile::exists(tempMime + QString::fromLatin1("/mime.cache"))); +} diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro new file mode 100644 index 0000000000..ac7515f781 --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/qmimedatabase-xml.pro @@ -0,0 +1,14 @@ +CONFIG += testcase parallel_test + +TARGET = tst_qmimedatabase-xml + +QT = core testlib concurrent + +CONFIG += depend_includepath + +SOURCES += tst_qmimedatabase-xml.cpp +HEADERS += ../tst_qmimedatabase.h + +DEFINES += SRCDIR='"\\"$$PWD/../\\""' + +*-g++*:QMAKE_CXXFLAGS += -W -Wall -Wextra -Werror -Wshadow -Wno-long-long -Wnon-virtual-dtor diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/tst_qmimedatabase-xml.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/tst_qmimedatabase-xml.cpp new file mode 100644 index 0000000000..13ca372290 --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/tst_qmimedatabase-xml.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 "../tst_qmimedatabase.h" +#include <QDebug> +#include <QDir> + +tst_QMimeDatabase::tst_QMimeDatabase() +{ + qputenv("QT_NO_MIME_CACHE", "1"); +} + +#include "../tst_qmimedatabase.cpp" diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro new file mode 100644 index 0000000000..876b4377dd --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS = qmimedatabase-xml +unix: SUBDIRS += qmimedatabase-cache diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp new file mode 100644 index 0000000000..fc86fa5431 --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -0,0 +1,834 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <qmimedatabase.h> + +#include "qstandardpaths.h" + +#include <QtCore/QFile> +#include <QtConcurrent/QtConcurrentRun> +#include <QtConcurrent/QFuture> + +#include <QtTest/QtTest> + +void initializeLang() +{ + qputenv("LANG", "en_US"); +} + +// Set LANG before QCoreApplication is created +Q_CONSTRUCTOR_FUNCTION(initializeLang) + +void tst_QMimeDatabase::initTestCase() +{ + // Create a "global" and a "local" XDG data dir, right here. + // The local dir will be empty initially, while the global dir will contain a copy of freedesktop.org.xml + + QDir here = QDir::currentPath(); + + qputenv("XDG_DATA_DIRS", QFile::encodeName(here.absolutePath())); + QDir(here.absolutePath() + "/mime").removeRecursively(); + here.mkpath(QString::fromLatin1("mime/packages")); + + QFile xml(QFile::decodeName(SRCDIR "../../../src/mimetypes/mime/packages/freedesktop.org.xml")); + const QString mimeDir = here.absolutePath() + QLatin1String("/mime"); + xml.copy(mimeDir + QLatin1String("/packages/freedesktop.org.xml")); + + m_dataHome = here.absolutePath() + QLatin1String("/../datahome"); + qputenv("XDG_DATA_HOME", QFile::encodeName(m_dataHome)); + //qDebug() << "XDG_DATA_HOME=" << m_dataHome; + + // Make sure we start clean + cleanupTestCase(); +} + +void tst_QMimeDatabase::cleanupTestCase() +{ + QDir here = QDir::currentPath(); + here.remove(QString::fromLatin1("mime/packages/yast2-metapackage-handler-mimetypes.xml")); + + QDir(m_dataHome).removeRecursively(); +} + +void tst_QMimeDatabase::mimeTypeForName() +{ + QMimeDatabase db; + QMimeType s0 = db.mimeTypeForName(QString::fromLatin1("application/x-zerosize")); + QVERIFY(s0.isValid()); + QCOMPARE(s0.name(), QString::fromLatin1("application/x-zerosize")); + QCOMPARE(s0.comment(), QString::fromLatin1("empty document")); + + QMimeType s0Again = db.mimeTypeForName(QString::fromLatin1("application/x-zerosize")); + QCOMPARE(s0Again.name(), s0.name()); + + QMimeType s1 = db.mimeTypeForName(QString::fromLatin1("text/plain")); + QVERIFY(s1.isValid()); + QCOMPARE(s1.name(), QString::fromLatin1("text/plain")); + //qDebug("Comment is %s", qPrintable(s1.comment())); + + QMimeType krita = db.mimeTypeForName(QString::fromLatin1("application/x-krita")); + QVERIFY(krita.isValid()); + + // Test <comment> parsing with application/rdf+xml which has the english comment after the other ones + QMimeType rdf = db.mimeTypeForName(QString::fromLatin1("application/rdf+xml")); + QVERIFY(rdf.isValid()); + QCOMPARE(rdf.comment(), QString::fromLatin1("RDF file")); + + QMimeType bzip2 = db.mimeTypeForName(QString::fromLatin1("application/x-bzip2")); + QVERIFY(bzip2.isValid()); + QCOMPARE(bzip2.comment(), QString::fromLatin1("Bzip archive")); + + QMimeType defaultMime = db.mimeTypeForName(QString::fromLatin1("application/octet-stream")); + QVERIFY(defaultMime.isValid()); + QVERIFY(defaultMime.isDefault()); + + QMimeType doesNotExist = db.mimeTypeForName(QString::fromLatin1("foobar/x-doesnot-exist")); + QVERIFY(!doesNotExist.isValid()); + + // TODO move to findByFile +#ifdef Q_OS_LINUX + QString exePath = QStandardPaths::findExecutable(QLatin1String("ls")); + if (exePath.isEmpty()) + qWarning() << "ls not found"; + else { + const QString executableType = QString::fromLatin1("application/x-executable"); + //QTest::newRow("executable") << exePath << executableType; + QCOMPARE(db.mimeTypeForFile(exePath).name(), executableType); + } +#endif + +} + +void tst_QMimeDatabase::mimeTypeForFileName_data() +{ + QTest::addColumn<QString>("fileName"); + QTest::addColumn<QString>("expectedMimeType"); + + QTest::newRow("text") << "textfile.txt" << "text/plain"; + QTest::newRow("case-insensitive search") << "textfile.TxT" << "text/plain"; + + // Needs shared-mime-info > 0.91. Earlier versions wrote .Z to the mime.cache file... + //QTest::newRow("case-insensitive match on a non-lowercase glob") << "foo.z" << "application/x-compress"; + + QTest::newRow("case-sensitive uppercase match") << "textfile.C" << "text/x-c++src"; + QTest::newRow("case-sensitive lowercase match") << "textfile.c" << "text/x-csrc"; + QTest::newRow("case-sensitive long-extension match") << "foo.PS.gz" << "application/x-gzpostscript"; + QTest::newRow("case-sensitive-only match") << "core" << "application/x-core"; + QTest::newRow("case-sensitive-only match") << "Core" << "application/octet-stream"; // #198477 + + QTest::newRow("desktop file") << "foo.desktop" << "application/x-desktop"; + QTest::newRow("old kdelnk file is x-desktop too") << "foo.kdelnk" << "application/x-desktop"; + QTest::newRow("double-extension file") << "foo.tar.bz2" << "application/x-bzip-compressed-tar"; + QTest::newRow("single-extension file") << "foo.bz2" << "application/x-bzip"; + QTest::newRow(".doc should assume msword") << "somefile.doc" << "application/msword"; // #204139 + QTest::newRow("glob that uses [] syntax, 1") << "Makefile" << "text/x-makefile"; + QTest::newRow("glob that uses [] syntax, 2") << "makefile" << "text/x-makefile"; + QTest::newRow("glob that ends with *, no extension") << "README" << "text/x-readme"; + QTest::newRow("glob that ends with *, extension") << "README.foo" << "text/x-readme"; + QTest::newRow("glob that ends with *, also matches *.txt. Higher weight wins.") << "README.txt" << "text/plain"; + QTest::newRow("glob that ends with *, also matches *.nfo. Higher weight wins.") << "README.nfo" << "text/x-nfo"; + // fdo bug 15436, needs shared-mime-info >= 0.40 (and this tests the globs2-parsing code). + QTest::newRow("glob that ends with *, also matches *.pdf. *.pdf has higher weight") << "README.pdf" << "application/pdf"; + QTest::newRow("directory") << "/" << "inode/directory"; + QTest::newRow("doesn't exist, no extension") << "IDontExist" << "application/octet-stream"; + QTest::newRow("doesn't exist but has known extension") << "IDontExist.txt" << "text/plain"; +} + +void tst_QMimeDatabase::mimeTypeForFileName() +{ + QFETCH(QString, fileName); + QFETCH(QString, expectedMimeType); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForFile(fileName, QMimeDatabase::MatchExtension); + QVERIFY(mime.isValid()); + QCOMPARE(mime.name(), expectedMimeType); + + QList<QMimeType> mimes = db.mimeTypesForFileName(fileName); + if (expectedMimeType == "application/octet-stream") { + QVERIFY(mimes.isEmpty()); + } else { + QVERIFY(!mimes.isEmpty()); + QCOMPARE(mimes.count(), 1); + QCOMPARE(mimes.first().name(), expectedMimeType); + } +} + +void tst_QMimeDatabase::mimeTypesForFileName_data() +{ + QTest::addColumn<QString>("fileName"); + QTest::addColumn<QStringList>("expectedMimeTypes"); + + QTest::newRow("txt, 1 hit") << "foo.txt" << (QStringList() << "text/plain"); + QTest::newRow("txtfoobar, 0 hit") << "foo.foobar" << QStringList(); + QTest::newRow("m, 2 hits") << "foo.m" << (QStringList() << "text/x-matlab" << "text/x-objcsrc"); + QTest::newRow("sub, 3 hits") << "foo.sub" << (QStringList() << "text/x-microdvd" << "text/x-mpsub" << "text/x-subviewer"); +} + +void tst_QMimeDatabase::mimeTypesForFileName() +{ + QFETCH(QString, fileName); + QFETCH(QStringList, expectedMimeTypes); + QMimeDatabase db; + QList<QMimeType> mimes = db.mimeTypesForFileName(fileName); + QStringList mimeNames; + foreach (const QMimeType &mime, mimes) + mimeNames.append(mime.name()); + QCOMPARE(mimeNames, expectedMimeTypes); +} + +void tst_QMimeDatabase::inheritance() +{ + QMimeDatabase db; + + // All file-like mimetypes inherit from octet-stream + const QMimeType wordperfect = db.mimeTypeForName(QString::fromLatin1("application/vnd.wordperfect")); + QVERIFY(wordperfect.isValid()); + QCOMPARE(wordperfect.parentMimeTypes().join(QString::fromLatin1(",")), QString::fromLatin1("application/octet-stream")); + QVERIFY(wordperfect.inherits(QLatin1String("application/octet-stream"))); + + QVERIFY(db.mimeTypeForName(QString::fromLatin1("image/svg+xml-compressed")).inherits(QLatin1String("application/x-gzip"))); + + // Check that msword derives from ole-storage + const QMimeType msword = db.mimeTypeForName(QString::fromLatin1("application/msword")); + QVERIFY(msword.isValid()); + const QMimeType olestorage = db.mimeTypeForName(QString::fromLatin1("application/x-ole-storage")); + QVERIFY(olestorage.isValid()); + QVERIFY(msword.inherits(olestorage.name())); + QVERIFY(msword.inherits(QLatin1String("application/octet-stream"))); + + const QMimeType directory = db.mimeTypeForName(QString::fromLatin1("inode/directory")); + QVERIFY(directory.isValid()); + QCOMPARE(directory.parentMimeTypes().count(), 0); + QVERIFY(!directory.inherits(QLatin1String("application/octet-stream"))); + + // Check that text/x-patch knows that it inherits from text/plain (it says so explicitly) + const QMimeType plain = db.mimeTypeForName(QString::fromLatin1("text/plain")); + const QMimeType derived = db.mimeTypeForName(QString::fromLatin1("text/x-patch")); + QVERIFY(derived.isValid()); + QCOMPARE(derived.parentMimeTypes().join(QString::fromLatin1(",")), plain.name()); + QVERIFY(derived.inherits(QLatin1String("text/plain"))); + QVERIFY(derived.inherits(QLatin1String("application/octet-stream"))); + + // Check that application/x-shellscript inherits from application/x-executable + // (Otherwise KRun cannot start shellscripts...) + // This is a test for multiple inheritance... + const QMimeType shellscript = db.mimeTypeForName(QString::fromLatin1("application/x-shellscript")); + QVERIFY(shellscript.isValid()); + QVERIFY(shellscript.inherits(QLatin1String("text/plain"))); + QVERIFY(shellscript.inherits(QLatin1String("application/x-executable"))); + const QStringList shellParents = shellscript.parentMimeTypes(); + QVERIFY(shellParents.contains(QLatin1String("text/plain"))); + QVERIFY(shellParents.contains(QLatin1String("application/x-executable"))); + QCOMPARE(shellParents.count(), 2); // only the above two + const QStringList allShellAncestors = shellscript.allAncestors(); + QVERIFY(allShellAncestors.contains(QLatin1String("text/plain"))); + QVERIFY(allShellAncestors.contains(QLatin1String("application/x-executable"))); + QVERIFY(allShellAncestors.contains(QLatin1String("application/octet-stream"))); + // Must be least-specific last, i.e. breadth first. + QCOMPARE(allShellAncestors.last(), QString::fromLatin1("application/octet-stream")); + + const QStringList allSvgAncestors = db.mimeTypeForName(QString::fromLatin1("image/svg+xml")).allAncestors(); + QCOMPARE(allSvgAncestors, QStringList() << QLatin1String("application/xml") << QLatin1String("text/plain") << QLatin1String("application/octet-stream")); + + // Check that text/x-mrml knows that it inherits from text/plain (implicitly) + const QMimeType mrml = db.mimeTypeForName(QString::fromLatin1("text/x-mrml")); + QVERIFY(mrml.isValid()); + QVERIFY(mrml.inherits(QLatin1String("text/plain"))); + QVERIFY(mrml.inherits(QLatin1String("application/octet-stream"))); + + // Check that msword-template inherits msword + const QMimeType mswordTemplate = db.mimeTypeForName(QString::fromLatin1("application/msword-template")); + QVERIFY(mswordTemplate.isValid()); + QVERIFY(mswordTemplate.inherits(QLatin1String("application/msword"))); +} + +void tst_QMimeDatabase::aliases() +{ + QMimeDatabase db; + + const QMimeType canonical = db.mimeTypeForName(QString::fromLatin1("application/xml")); + QVERIFY(canonical.isValid()); + + QMimeType resolvedAlias = db.mimeTypeForName(QString::fromLatin1("text/xml")); + QVERIFY(resolvedAlias.isValid()); + QCOMPARE(resolvedAlias.name(), QString::fromLatin1("application/xml")); + + QVERIFY(resolvedAlias.inherits(QLatin1String("application/xml"))); + QVERIFY(canonical.inherits(QLatin1String("text/xml"))); + + // Test for kde bug 197346: does nspluginscan see that audio/mp3 already exists? + bool mustWriteMimeType = !db.mimeTypeForName(QString::fromLatin1("audio/mp3")).isValid(); + QVERIFY(!mustWriteMimeType); +} + +void tst_QMimeDatabase::icons() +{ + QMimeDatabase db; + QMimeType directory = db.mimeTypeForFile(QString::fromLatin1("/")); + QCOMPARE(directory.name(), QString::fromLatin1("inode/directory")); + QCOMPARE(directory.iconName(), QString::fromLatin1("inode-directory")); + QCOMPARE(directory.genericIconName(), QString::fromLatin1("inode-x-generic")); + + QMimeType pub = db.mimeTypeForFile(QString::fromLatin1("foo.epub"), QMimeDatabase::MatchExtension); + QCOMPARE(pub.name(), QString::fromLatin1("application/epub+zip")); + QCOMPARE(pub.iconName(), QString::fromLatin1("application-epub+zip")); + QCOMPARE(pub.genericIconName(), QString::fromLatin1("x-office-document")); +} + +// In here we do the tests that need some content in a temporary file. +// This could also be added to shared-mime-info's testsuite... +void tst_QMimeDatabase::mimeTypeForFileWithContent() +{ + QMimeDatabase db; + QMimeType mime; + + // Test a real PDF file. + // If we find x-matlab because it starts with '%' then we are not ordering by priority. + QTemporaryFile tempFile; + QVERIFY(tempFile.open()); + QString tempFileName = tempFile.fileName(); + tempFile.write("%PDF-"); + tempFile.close(); + mime = db.mimeTypeForFile(tempFileName); + QCOMPARE(mime.name(), QString::fromLatin1("application/pdf")); + QFile file(tempFileName); + mime = db.mimeTypeForData(&file); // QIODevice ctor + QCOMPARE(mime.name(), QString::fromLatin1("application/pdf")); + // by name only, we cannot find the mimetype + mime = db.mimeTypeForFile(tempFileName, QMimeDatabase::MatchExtension); + QVERIFY(mime.isValid()); + QVERIFY(mime.isDefault()); + + // Test the case where the extension doesn't match the contents: extension wins + { + QTemporaryFile txtTempFile(QDir::tempPath() + QLatin1String("/tst_QMimeDatabase_XXXXXX.txt")); + QVERIFY(txtTempFile.open()); + txtTempFile.write("%PDF-"); + QString txtTempFileName = txtTempFile.fileName(); + txtTempFile.close(); + mime = db.mimeTypeForFile(txtTempFileName); + QCOMPARE(mime.name(), QString::fromLatin1("text/plain")); + // fast mode finds the same + mime = db.mimeTypeForFile(txtTempFileName, QMimeDatabase::MatchExtension); + QCOMPARE(mime.name(), QString::fromLatin1("text/plain")); + } + + // Now the case where extension differs from contents, but contents has >80 magic rule + // XDG spec says: contents wins. But we can't sniff all files... + { + QTemporaryFile txtTempFile(QDir::tempPath() + QLatin1String("/tst_QMimeDatabase_XXXXXX.txt")); + QVERIFY(txtTempFile.open()); + txtTempFile.write("<smil"); + QString txtTempFileName = txtTempFile.fileName(); + txtTempFile.close(); + mime = db.mimeTypeForFile(txtTempFileName); + QCOMPARE(mime.name(), QString::fromLatin1("text/plain")); + } + + // Test what happens with an incorrect path + mime = db.mimeTypeForFile(QString::fromLatin1("file:///etc/passwd" /* incorrect code, use a path instead */)); + QVERIFY(mime.isDefault()); + + // findByData when the device cannot be opened (e.g. a directory) + QFile dir("/"); + mime = db.mimeTypeForData(&dir); + QVERIFY(mime.isDefault()); +} + +void tst_QMimeDatabase::mimeTypeForUrl() +{ + QMimeDatabase db; + QVERIFY(db.mimeTypeForUrl(QUrl::fromEncoded("http://foo/bar.png")).isDefault()); // HTTP can't know before downloading + QCOMPARE(db.mimeTypeForUrl(QUrl::fromEncoded("ftp://foo/bar.png")).name(), QString::fromLatin1("image/png")); + QCOMPARE(db.mimeTypeForUrl(QUrl::fromEncoded("ftp://foo/bar")).name(), QString::fromLatin1("application/octet-stream")); // unknown extension +} + +void tst_QMimeDatabase::mimeTypeForData_data() +{ + QTest::addColumn<QByteArray>("data"); + QTest::addColumn<QString>("expectedMimeTypeName"); + + QTest::newRow("tnef data, needs smi >= 0.20") << QByteArray("\x78\x9f\x3e\x22") << "application/vnd.ms-tnef"; + QTest::newRow("PDF magic") << QByteArray("%PDF-") << "application/pdf"; + QTest::newRow("PHP, High-priority rule") << QByteArray("<?php") << "application/x-php"; + QTest::newRow("unknown") << QByteArray("\001abc?}") << "application/octet-stream"; +} + +void tst_QMimeDatabase::mimeTypeForData() +{ + QFETCH(QByteArray, data); + QFETCH(QString, expectedMimeTypeName); + + QMimeDatabase db; + QCOMPARE(db.mimeTypeForData(data).name(), expectedMimeTypeName); + QBuffer buffer(&data); + QCOMPARE(db.mimeTypeForData(&buffer).name(), expectedMimeTypeName); + QVERIFY(!buffer.isOpen()); // initial state was restored + + QVERIFY(buffer.open(QIODevice::ReadOnly)); + QCOMPARE(db.mimeTypeForData(&buffer).name(), expectedMimeTypeName); + QVERIFY(buffer.isOpen()); + QCOMPARE(buffer.pos(), qint64(0)); +} + +void tst_QMimeDatabase::mimeTypeForFileAndContent_data() +{ + QTest::addColumn<QString>("name"); + QTest::addColumn<QByteArray>("data"); + QTest::addColumn<QString>("expectedMimeTypeName"); + + QTest::newRow("plain text, no extension") << QString::fromLatin1("textfile") << QByteArray("Hello world") << "text/plain"; + QTest::newRow("plain text, unknown extension") << QString::fromLatin1("textfile.foo") << QByteArray("Hello world") << "text/plain"; + // Needs kde/mimetypes.xml + //QTest::newRow("plain text, doc extension") << QString::fromLatin1("textfile.doc") << QByteArray("Hello world") << "text/plain"; + + // If you get powerpoint instead, then you're hit by https://bugs.freedesktop.org/show_bug.cgi?id=435, + // upgrade to shared-mime-info >= 0.22 + const QByteArray oleData("\320\317\021\340\241\261\032\341"); // same as \xD0\xCF\x11\xE0 \xA1\xB1\x1A\xE1 + QTest::newRow("msword file, unknown extension") << QString::fromLatin1("mswordfile") << oleData << "application/x-ole-storage"; + QTest::newRow("excel file, found by extension") << QString::fromLatin1("excelfile.xls") << oleData << "application/vnd.ms-excel"; + QTest::newRow("text.xls, found by extension, user is in control") << QString::fromLatin1("text.xls") << oleData << "application/vnd.ms-excel"; +} + +void tst_QMimeDatabase::mimeTypeForFileAndContent() +{ + QFETCH(QString, name); + QFETCH(QByteArray, data); + QFETCH(QString, expectedMimeTypeName); + + QMimeDatabase db; + QCOMPARE(db.mimeTypeForNameAndData(name, data).name(), expectedMimeTypeName); + + QBuffer buffer(&data); + QCOMPARE(db.mimeTypeForNameAndData(name, &buffer).name(), expectedMimeTypeName); + QVERIFY(!buffer.isOpen()); // initial state was restored + + QVERIFY(buffer.open(QIODevice::ReadOnly)); + QCOMPARE(db.mimeTypeForNameAndData(name, &buffer).name(), expectedMimeTypeName); + QVERIFY(buffer.isOpen()); + QCOMPARE(buffer.pos(), qint64(0)); +} + +void tst_QMimeDatabase::allMimeTypes() +{ + QMimeDatabase db; + const QList<QMimeType> lst = db.allMimeTypes(); // does NOT include aliases + QVERIFY(!lst.isEmpty()); + + // Hardcoding this is the only way to check both providers find the same number of mimetypes. + QCOMPARE(lst.count(), 661); + + foreach (const QMimeType &mime, lst) { + const QString name = mime.name(); + QVERIFY(!name.isEmpty()); + QCOMPARE(name.count(QLatin1Char('/')), 1); + const QMimeType lookedupMime = db.mimeTypeForName(name); + QVERIFY(lookedupMime.isValid()); + QCOMPARE(lookedupMime.name(), name); // if this fails, you have an alias defined as a real mimetype too! + } +} + +void tst_QMimeDatabase::inheritsPerformance() +{ + // Check performance of inherits(). + // This benchmark (which started in 2009 in kmimetypetest.cpp) uses 40 mimetypes. + QStringList mimeTypes; mimeTypes << QLatin1String("image/jpeg") << QLatin1String("image/png") << QLatin1String("image/tiff") << QLatin1String("text/plain") << QLatin1String("text/html"); + mimeTypes += mimeTypes; + mimeTypes += mimeTypes; + mimeTypes += mimeTypes; + QCOMPARE(mimeTypes.count(), 40); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForName(QString::fromLatin1("text/x-chdr")); + QVERIFY(mime.isValid()); + QBENCHMARK { + QString match; + foreach (const QString &mt, mimeTypes) { + if (mime.inherits(mt)) { + match = mt; + // of course there would normally be a "break" here, but we're testing worse-case + // performance here + } + } + QCOMPARE(match, QString::fromLatin1("text/plain")); + } + // Numbers from 2011, in release mode: + // KDE 4.7 numbers: 0.21 msec / 494,000 ticks / 568,345 instr. loads per iteration + // QMimeBinaryProvider (with Qt 5): 0.16 msec / NA / 416,049 instr. reads per iteration + // QMimeXmlProvider (with Qt 5): 0.062 msec / NA / 172,889 instr. reads per iteration + // (but the startup time is way higher) + // And memory usage is flat at 200K with QMimeBinaryProvider, while it peaks at 6 MB when + // parsing XML, and then keeps being around 4.5 MB for all the in-memory hashes. +} + +void tst_QMimeDatabase::suffixes_data() +{ + QTest::addColumn<QString>("mimeType"); + QTest::addColumn<QString>("patterns"); + QTest::addColumn<QString>("preferredSuffix"); + + QTest::newRow("mimetype with a single pattern") << "application/pdf" << "*.pdf" << "pdf"; + QTest::newRow("mimetype with multiple patterns") << "application/x-kpresenter" << "*.kpr;*.kpt" << "kpr"; + //if (KMimeType::sharedMimeInfoVersion() > KDE_MAKE_VERSION(0, 60, 0)) { + QTest::newRow("mimetype with many patterns") << "application/vnd.wordperfect" << "*.wp;*.wp4;*.wp5;*.wp6;*.wpd;*.wpp" << "wp"; + //} + QTest::newRow("oasis text mimetype") << "application/vnd.oasis.opendocument.text" << "*.odt" << "odt"; + QTest::newRow("oasis presentation mimetype") << "application/vnd.oasis.opendocument.presentation" << "*.odp" << "odp"; + QTest::newRow("mimetype with multiple patterns") << "text/plain" << "*.asc;*.txt;*,v" << "txt"; + QTest::newRow("mimetype with uncommon pattern") << "text/x-readme" << "README*" << QString(); + QTest::newRow("mimetype with no patterns") << "application/x-ole-storage" << QString() << QString(); +} + +void tst_QMimeDatabase::suffixes() +{ + QFETCH(QString, mimeType); + QFETCH(QString, patterns); + QFETCH(QString, preferredSuffix); + QMimeDatabase db; + QMimeType mime = db.mimeTypeForName(mimeType); + QVERIFY(mime.isValid()); + // Sort both lists; order is unreliable since shared-mime-info uses hashes internally. + QStringList expectedPatterns = patterns.split(QLatin1Char(';')); + expectedPatterns.sort(); + QStringList mimePatterns = mime.globPatterns(); + mimePatterns.sort(); + QCOMPARE(mimePatterns.join(QLatin1String(";")), expectedPatterns.join(QLatin1String(";"))); + QCOMPARE(mime.preferredSuffix(), preferredSuffix); +} + +void tst_QMimeDatabase::knownSuffix() +{ + QMimeDatabase db; + QCOMPARE(db.suffixForFileName(QString::fromLatin1("foo.tar")), QString::fromLatin1("tar")); + QCOMPARE(db.suffixForFileName(QString::fromLatin1("foo.bz2")), QString::fromLatin1("bz2")); + QCOMPARE(db.suffixForFileName(QString::fromLatin1("foo.bar.bz2")), QString::fromLatin1("bz2")); + QCOMPARE(db.suffixForFileName(QString::fromLatin1("foo.tar.bz2")), QString::fromLatin1("tar.bz2")); +} + +void tst_QMimeDatabase::findByFileName_data() +{ + QTest::addColumn<QString>("filePath"); + QTest::addColumn<QString>("mimeTypeName"); + QTest::addColumn<QString>("xFail"); + + QString prefix = QLatin1String(SRCDIR "testfiles/"); + + QFile f(prefix + QLatin1String("list")); + if (!f.open(QIODevice::ReadOnly)) { + const QString warning = QString::fromLatin1( + "Please download the shared-mime-info test suite:\n" + "cd tests/auto/corelib/mimetypes/qmimedatabase\n" + "wget http://cgit.freedesktop.org/xdg/shared-mime-info/snapshot/Release-1-0.zip\n" + "unzip Release-1-0.zip\n" + "ln -s Release-1-0/tests testfiles\n" + ); + qWarning() << warning; + QSKIP("shared-mime-info test suite not available."); + } + + QByteArray line(1024, Qt::Uninitialized); + + while (!f.atEnd()) { + int len = f.readLine(line.data(), 1023); + + if (len <= 2 || line.at(0) == '#') + continue; + + QString string = QString::fromLatin1(line.constData(), len - 1).trimmed(); + QStringList list = string.split(QLatin1Char(' '), QString::SkipEmptyParts); + QVERIFY(list.size() >= 2); + + QString filePath = list.at(0); + QString mimeTypeType = list.at(1); + QString xFail; + if (list.size() >= 3) + xFail = list.at(2); + + QTest::newRow(filePath.toLatin1().constData()) << QString(prefix + filePath) << mimeTypeType << xFail; + } +} + +void tst_QMimeDatabase::findByFileName() +{ + QFETCH(QString, filePath); + QFETCH(QString, mimeTypeName); + QFETCH(QString, xFail); + + QMimeDatabase database; + + //qDebug() << Q_FUNC_INFO << filePath; + + const QMimeType resultMimeType(database.mimeTypeForFile(filePath, QMimeDatabase::MatchExtension)); + if (resultMimeType.isValid()) { + //qDebug() << Q_FUNC_INFO << "MIME type" << resultMimeType.name() << "has generic icon name" << resultMimeType.genericIconName() << "and icon name" << resultMimeType.iconName(); + +// Loading icons depend on the icon theme, we can't enable this test +#if 0 + QCOMPARE(resultMimeType.genericIconName(), QIcon::fromTheme(resultMimeType.genericIconName()).name()); + QVERIFY2(!QIcon::fromTheme(resultMimeType.genericIconName()).isNull(), qPrintable(resultMimeType.genericIconName())); + QVERIFY2(QIcon::hasThemeIcon(resultMimeType.genericIconName()), qPrintable(resultMimeType.genericIconName())); + + QCOMPARE(resultMimeType.iconName(), QIcon::fromTheme(resultMimeType.iconName()).name()); + QVERIFY2(!QIcon::fromTheme(resultMimeType.iconName()).isNull(), qPrintable(resultMimeType.iconName())); + QVERIFY2(QIcon::hasThemeIcon(resultMimeType.iconName()), qPrintable(resultMimeType.iconName())); +#endif + } + const QString resultMimeTypeName = resultMimeType.name(); + //qDebug() << Q_FUNC_INFO << "mimeTypeForFile() returned" << resultMimeTypeName; + + const bool failed = resultMimeTypeName != mimeTypeName; + const bool shouldFail = (xFail.length() >= 1 && xFail.at(0) == QLatin1Char('x')); + if (shouldFail != failed) { + // Results are ambiguous when multiple MIME types have the same glob + // -> accept the current result if the found MIME type actually + // matches the file's extension. + // TODO: a better file format in testfiles/list! + const QMimeType foundMimeType = database.mimeTypeForName(resultMimeTypeName); + QVERIFY2(resultMimeType == foundMimeType, qPrintable(resultMimeType.name() + QString::fromLatin1(" vs. ") + foundMimeType.name())); + if (foundMimeType.isValid()) { + const QString extension = QFileInfo(filePath).suffix(); + //qDebug() << Q_FUNC_INFO << "globPatterns:" << foundMimeType.globPatterns() << "- extension:" << QString() + "*." + extension; + if (foundMimeType.globPatterns().contains(QString::fromLatin1("*.") + extension)) + return; + } + } + if (shouldFail) { + // Expected to fail + QVERIFY2(resultMimeTypeName != mimeTypeName, qPrintable(resultMimeTypeName)); + } else { + QCOMPARE(resultMimeTypeName, mimeTypeName); + } + + // Test QFileInfo overload + const QMimeType mimeForFileInfo = database.mimeTypeForFile(QFileInfo(filePath), QMimeDatabase::MatchExtension); + QCOMPARE(mimeForFileInfo.name(), resultMimeTypeName); +} + +void tst_QMimeDatabase::findByData_data() +{ + findByFileName_data(); +} + +void tst_QMimeDatabase::findByData() +{ + QFETCH(QString, filePath); + QFETCH(QString, mimeTypeName); + QFETCH(QString, xFail); + + QMimeDatabase database; + QFile f(filePath); + QVERIFY(f.open(QIODevice::ReadOnly)); + QByteArray data = f.read(16384); + + const QString resultMimeTypeName = database.mimeTypeForData(data).name(); + if (xFail.length() >= 2 && xFail.at(1) == QLatin1Char('x')) { + // Expected to fail + QVERIFY2(resultMimeTypeName != mimeTypeName, qPrintable(resultMimeTypeName)); + } else { + QCOMPARE(resultMimeTypeName, mimeTypeName); + } + + QFileInfo info(filePath); + QString mimeForInfo = database.mimeTypeForFile(info, QMimeDatabase::MatchContent).name(); + QCOMPARE(mimeForInfo, resultMimeTypeName); +} + +void tst_QMimeDatabase::findByFile_data() +{ + findByFileName_data(); +} + +void tst_QMimeDatabase::findByFile() +{ + QFETCH(QString, filePath); + QFETCH(QString, mimeTypeName); + QFETCH(QString, xFail); + + QMimeDatabase database; + const QString resultMimeTypeName = database.mimeTypeForFile(filePath).name(); + //qDebug() << Q_FUNC_INFO << filePath << "->" << resultMimeTypeName; + if (xFail.length() >= 3 && xFail.at(2) == QLatin1Char('x')) { + // Expected to fail + QVERIFY2(resultMimeTypeName != mimeTypeName, qPrintable(resultMimeTypeName)); + } else { + QCOMPARE(resultMimeTypeName, mimeTypeName); + } + + // Test QFileInfo overload + const QMimeType mimeForFileInfo = database.mimeTypeForFile(QFileInfo(filePath)); + QCOMPARE(mimeForFileInfo.name(), resultMimeTypeName); +} + + +void tst_QMimeDatabase::fromThreads() +{ + QThreadPool::globalInstance()->setMaxThreadCount(20); + // Note that data-based tests cannot be used here (QTest::fetchData asserts). + QList<QFuture<void> > futures; + futures << QtConcurrent::run(this, &tst_QMimeDatabase::mimeTypeForName); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::aliases); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::allMimeTypes); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::icons); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::inheritance); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::knownSuffix); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::mimeTypeForFileWithContent); + futures << QtConcurrent::run(this, &tst_QMimeDatabase::allMimeTypes); // a second time + Q_FOREACH (QFuture<void> f, futures) + f.waitForFinished(); +} + +static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDatabase method? +{ + const QString umd = QStandardPaths::findExecutable(QString::fromLatin1("update-mime-database")); + if (umd.isEmpty()) + return false; + + QProcess proc; + proc.setProcessChannelMode(QProcess::MergedChannels); // silence output + proc.start(umd, QStringList() << path); + proc.waitForFinished(); + //qDebug() << "runUpdateMimeDatabase" << path; + return true; +} + +static bool waitAndRunUpdateMimeDatabase(const QString &path) +{ + QFileInfo mimeCacheInfo(path + QString::fromLatin1("/mime.cache")); + if (mimeCacheInfo.exists()) { + // Wait until the begining of the next second + while (mimeCacheInfo.lastModified().secsTo(QDateTime::currentDateTime()) == 0) { + QTest::qSleep(200); + } + } + return runUpdateMimeDatabase(path); +} + +static void checkHasMimeType(const QString &mimeType) +{ + QMimeDatabase db; + QVERIFY(db.mimeTypeForName(mimeType).isValid()); + + bool found = false; + foreach (const QMimeType &mt, db.allMimeTypes()) { + if (mt.name() == mimeType) { + found = true; + break; + } + } + QVERIFY(found); +} + +QT_BEGIN_NAMESPACE +extern Q_CORE_EXPORT int qmime_secondsBetweenChecks; // see qmimeprovider.cpp +QT_END_NAMESPACE + +void tst_QMimeDatabase::installNewGlobalMimeType() +{ + qmime_secondsBetweenChecks = 0; + + QMimeDatabase db; + QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); + + const QString fileName = QLatin1String("yast2-metapackage-handler-mimetypes.xml"); + const QString srcFile = QFile::decodeName(SRCDIR) + fileName; + + QDir here = QDir::currentPath(); + const QString mimeDir = here.absolutePath() + QLatin1String("/mime"); + const QString destDir = mimeDir + QLatin1String("/packages/"); + const QString destFile = destDir + fileName; + QFile::remove(destFile); + //qDebug() << destFile; + QVERIFY(QFile::copy(srcFile, destFile)); + if (!waitAndRunUpdateMimeDatabase(mimeDir)) + QSKIP("shared-mime-info not found, skipping mime.cache test"); + + QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(), + QString::fromLatin1("text/x-suse-ymu")); + QVERIFY(db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); + checkHasMimeType("text/x-suse-ymp"); + + // Now test removing it again + QFile::remove(destFile); + if (!waitAndRunUpdateMimeDatabase(mimeDir)) + QSKIP("shared-mime-info not found, skipping mime.cache test"); + QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(), + QString::fromLatin1("application/octet-stream")); + QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); +} + +void tst_QMimeDatabase::installNewLocalMimeType() +{ + qmime_secondsBetweenChecks = 0; + + QMimeDatabase db; + QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); + + const QString fileName = QLatin1String("yast2-metapackage-handler-mimetypes.xml"); + const QString srcFile = QFile::decodeName(SRCDIR) + fileName; + const QString mimeDir = m_dataHome + QLatin1String("/mime"); + const QString destDir = mimeDir + QLatin1String("/packages/"); + QDir().mkpath(destDir); + const QString destFile = destDir + fileName; + QFile::remove(destFile); + QVERIFY(QFile::copy(srcFile, destFile)); + if (!runUpdateMimeDatabase(mimeDir)) + QSKIP("shared-mime-info not found, skipping mime.cache test");; + + QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(), + QString::fromLatin1("text/x-suse-ymu")); + QVERIFY(db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); + checkHasMimeType("text/x-suse-ymp"); + + // Now test removing it again (note, this leaves a mostly-empty mime.cache file) + QFile::remove(destFile); + if (!waitAndRunUpdateMimeDatabase(mimeDir)) + QSKIP("shared-mime-info not found, skipping mime.cache test"); + QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(), + QString::fromLatin1("application/octet-stream")); + QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); + + // And now the user goes wild and uses rm -rf + QFile::remove(mimeDir + QString::fromLatin1("/mime.cache")); + QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(), + QString::fromLatin1("application/octet-stream")); + QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid()); +} + +QTEST_GUILESS_MAIN(tst_QMimeDatabase) diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h new file mode 100644 index 0000000000..869990401c --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 TST_QMIMEDATABASE_H +#define TST_QMIMEDATABASE_H + +#include <QtCore/QObject> + +class tst_QMimeDatabase : public QObject +{ + Q_OBJECT + +public: + tst_QMimeDatabase(); + +private slots: + void initTestCase(); + void cleanupTestCase(); + + void mimeTypeForName(); + void mimeTypeForFileName_data(); + void mimeTypeForFileName(); + void mimeTypesForFileName_data(); + void mimeTypesForFileName(); + void inheritance(); + void aliases(); + void icons(); + void mimeTypeForFileWithContent(); + void mimeTypeForUrl(); + void mimeTypeForData_data(); + void mimeTypeForData(); + void mimeTypeForFileAndContent_data(); + void mimeTypeForFileAndContent(); + void allMimeTypes(); + void inheritsPerformance(); + void suffixes_data(); + void suffixes(); + void knownSuffix(); + void fromThreads(); + + // shared-mime-info test suite + + void findByFileName_data(); + void findByFileName(); + + void findByData_data(); + void findByData(); + + void findByFile_data(); + void findByFile(); + + // + + void installNewGlobalMimeType(); + void installNewLocalMimeType(); + +private: + QString m_dataHome; +}; + +#endif // TST_QMIMEDATABASE_H diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/yast2-metapackage-handler-mimetypes.xml b/tests/auto/corelib/mimetypes/qmimedatabase/yast2-metapackage-handler-mimetypes.xml new file mode 100644 index 0000000000..ef3035ef4a --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimedatabase/yast2-metapackage-handler-mimetypes.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<!-- http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec --> +<!-- to to ${PREFIX-~/.local}/share/mime/packages --> +<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> + <mime-type type="text/x-suse-ymp"> + <comment>YaST Meta Package</comment> + <glob pattern="*.ymp"/> + </mime-type> + + <mime-type type="text/x-suse-ymu"> + <comment>URL of a YaST Meta Package</comment> + <glob pattern="*.ymu"/> + </mime-type> +</mime-info> + diff --git a/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro b/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro new file mode 100644 index 0000000000..125d0d280f --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimetype/qmimetype.pro @@ -0,0 +1,7 @@ +CONFIG += testcase parallel_test +TARGET = tst_qmimetype +QT = core-private testlib + +*-g++*:QMAKE_CXXFLAGS += -W -Wall -Wextra -Werror -Wshadow -Wno-long-long -Wnon-virtual-dtor + +SOURCES = tst_qmimetype.cpp diff --git a/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp b/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp new file mode 100644 index 0000000000..6f24bfe6f1 --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp @@ -0,0 +1,257 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <private/qmimetype_p.h> + +#include <qmimetype.h> +#include <qmimedatabase.h> + +#include <QtTest/QtTest> + + +class tst_qmimetype : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + + void isValid(); + void name(); + void genericIconName(); + void iconName(); + void suffixes(); +}; + +// ------------------------------------------------------------------------------------------------ + +void tst_qmimetype::initTestCase() +{ + qputenv("XDG_DATA_DIRS", "doesnotexist"); +} + +// ------------------------------------------------------------------------------------------------ + +static QString qMimeTypeName() +{ + static const QString result ("No name of the MIME type"); + return result; +} + +static QString qMimeTypeGenericIconName() +{ + static const QString result ("No file name of an icon image that represents the MIME type"); + return result; +} + +static QString qMimeTypeIconName() +{ + static const QString result ("No file name of an icon image that represents the MIME type"); + return result; +} + +static QStringList buildQMimeTypeFilenameExtensions() +{ + QStringList result; + result << QString::fromLatin1("*.png"); + return result; +} + +static QStringList qMimeTypeGlobPatterns() +{ + static const QStringList result (buildQMimeTypeFilenameExtensions()); + return result; +} + +// ------------------------------------------------------------------------------------------------ + +#ifndef Q_COMPILER_RVALUE_REFS +QMIMETYPE_BUILDER +#else +QMIMETYPE_BUILDER_FROM_RVALUE_REFS +#endif + +// ------------------------------------------------------------------------------------------------ + +void tst_qmimetype::isValid() +{ + QMimeType instantiatedQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + qMimeTypeGlobPatterns() + ) + ); + + QVERIFY(instantiatedQMimeType.isValid()); + + QMimeType otherQMimeType (instantiatedQMimeType); + + QVERIFY(otherQMimeType.isValid()); + QCOMPARE(instantiatedQMimeType, otherQMimeType); + + QMimeType defaultQMimeType; + + QVERIFY(!defaultQMimeType.isValid()); +} + +// ------------------------------------------------------------------------------------------------ + +void tst_qmimetype::name() +{ + QMimeType instantiatedQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + qMimeTypeGlobPatterns() + ) + ); + + QMimeType otherQMimeType ( + buildQMimeType ( + QString(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + qMimeTypeGlobPatterns() + ) + ); + + // Verify that the Name is part of the equality test: + QCOMPARE(instantiatedQMimeType.name(), qMimeTypeName()); + + QVERIFY(instantiatedQMimeType != otherQMimeType); + QVERIFY(!(instantiatedQMimeType == otherQMimeType)); +} + +// ------------------------------------------------------------------------------------------------ + +void tst_qmimetype::genericIconName() +{ + QMimeType instantiatedQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + qMimeTypeGlobPatterns() + ) + ); + + QMimeType otherQMimeType ( + buildQMimeType ( + qMimeTypeName(), + QString(), + qMimeTypeGenericIconName(), + qMimeTypeGlobPatterns() + ) + ); + + // Verify that the GenericIconName is part of the equality test: + QCOMPARE(instantiatedQMimeType.genericIconName(), qMimeTypeGenericIconName()); + + QVERIFY(instantiatedQMimeType != otherQMimeType); + QVERIFY(!(instantiatedQMimeType == otherQMimeType)); +} + +// ------------------------------------------------------------------------------------------------ + +void tst_qmimetype::iconName() +{ + QMimeType instantiatedQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + qMimeTypeGlobPatterns() + ) + ); + + QMimeType otherQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + QString(), + qMimeTypeGlobPatterns() + ) + ); + + // Verify that the IconName is part of the equality test: + QCOMPARE(instantiatedQMimeType.iconName(), qMimeTypeIconName()); + + QVERIFY(instantiatedQMimeType != otherQMimeType); + QVERIFY(!(instantiatedQMimeType == otherQMimeType)); +} + +// ------------------------------------------------------------------------------------------------ + +void tst_qmimetype::suffixes() +{ + QMimeType instantiatedQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + qMimeTypeGlobPatterns() + ) + ); + + QMimeType otherQMimeType ( + buildQMimeType ( + qMimeTypeName(), + qMimeTypeGenericIconName(), + qMimeTypeIconName(), + QStringList() + ) + ); + + // Verify that the Suffixes are part of the equality test: + QCOMPARE(instantiatedQMimeType.globPatterns(), qMimeTypeGlobPatterns()); + QCOMPARE(instantiatedQMimeType.suffixes(), QStringList() << QString::fromLatin1("png")); + + QVERIFY(instantiatedQMimeType != otherQMimeType); + QVERIFY(!(instantiatedQMimeType == otherQMimeType)); +} + +// ------------------------------------------------------------------------------------------------ + +QTEST_GUILESS_MAIN(tst_qmimetype) +#include "tst_qmimetype.moc" diff --git a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro index 6e71ec8ff9..ae6cf97891 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro +++ b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro @@ -1,4 +1,5 @@ CONFIG += testcase +CONFIG -= app_bundle TARGET = ../tst_qlibrary QT = core testlib SOURCES = ../tst_qlibrary.cpp @@ -12,3 +13,5 @@ win32 { } TESTDATA += ../library_path/invalid.so + +win32:CONFIG += insignificant_test # QTBUG-24151 diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index cff98de54f..efbc89880f 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -258,7 +258,7 @@ void tst_QLibrary::unload() void tst_QLibrary::unload_after_implicit_load() { - QLibrary library( "./mylib" ); + QLibrary library( QCoreApplication::applicationDirPath() + "/mylib" ); QFunctionPointer p = library.resolve("mylibversion"); QVERIFY(p); // Check if it was loaded QVERIFY(library.isLoaded()); diff --git a/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro b/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro index cd87e68848..0ad311de99 100644 --- a/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro +++ b/tests/auto/corelib/thread/qsemaphore/qsemaphore.pro @@ -2,5 +2,3 @@ CONFIG += testcase parallel_test TARGET = tst_qsemaphore QT = core testlib SOURCES = tst_qsemaphore.cpp - -mac*:CONFIG+=insignificant_test diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp index 1d54c8e036..884e8718cb 100644 --- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp +++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp @@ -223,11 +223,21 @@ void tst_QSemaphore::tryAcquireWithTimeout() { QFETCH(int, timeout); + // timers are not guaranteed to be accurate down to the last millisecond, + // so we permit the elapsed times to be up to this far from the expected value. + int fuzz = 10; + QSemaphore semaphore; QTime time; -#define QVERIFYGE(a,b) QVERIFY2(a >= b, qPrintable(QString("%1 = %2 !>= %3 = %4").arg(#a).arg(a).arg(#b).arg(b))); -#define QVERIFYLE(a,b) QVERIFY2(a <= b, qPrintable(QString("%1 = %2 !<= %3 = %4").arg(#a).arg(a).arg(#b).arg(b))); +#define FUZZYCOMPARE(a,e) \ + do { \ + int a1 = a; \ + int e1 = e; \ + QVERIFY2(qAbs(a1-e1) < fuzz, \ + qPrintable(QString("(%1=%2) is more than %3 milliseconds different from (%4=%5)") \ + .arg(#a).arg(a1).arg(fuzz).arg(#e).arg(e1))); \ + } while (0) QCOMPARE(semaphore.available(), 0); @@ -235,73 +245,72 @@ void tst_QSemaphore::tryAcquireWithTimeout() QCOMPARE(semaphore.available(), 1); time.start(); QVERIFY(!semaphore.tryAcquire(2, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 1); semaphore.release(); QCOMPARE(semaphore.available(), 2); time.start(); QVERIFY(!semaphore.tryAcquire(3, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 2); semaphore.release(10); QCOMPARE(semaphore.available(), 12); time.start(); QVERIFY(!semaphore.tryAcquire(100, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 12); semaphore.release(10); QCOMPARE(semaphore.available(), 22); time.start(); QVERIFY(!semaphore.tryAcquire(100, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 22); time.start(); QVERIFY(semaphore.tryAcquire(1, timeout)); - QVERIFYLE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), 0); QCOMPARE(semaphore.available(), 21); time.start(); QVERIFY(semaphore.tryAcquire(1, timeout)); - QVERIFYLE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), 0); QCOMPARE(semaphore.available(), 20); time.start(); QVERIFY(semaphore.tryAcquire(10, timeout)); - QVERIFYLE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), 0); QCOMPARE(semaphore.available(), 10); time.start(); QVERIFY(semaphore.tryAcquire(10, timeout)); - QVERIFYLE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), 0); QCOMPARE(semaphore.available(), 0); // should not be able to acquire more time.start(); QVERIFY(!semaphore.tryAcquire(1, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 0); time.start(); QVERIFY(!semaphore.tryAcquire(1, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 0); time.start(); QVERIFY(!semaphore.tryAcquire(10, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 0); time.start(); QVERIFY(!semaphore.tryAcquire(10, timeout)); - QVERIFYGE(time.elapsed(), timeout); + FUZZYCOMPARE(time.elapsed(), timeout); QCOMPARE(semaphore.available(), 0); -#undef QVERIFYGE -#undef QVERIFYLE +#undef FUZZYCOMPARE } void tst_QSemaphore::tryAcquireWithTimeoutStarvation() diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 1dd0410f41..aa4d163fc4 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -367,17 +367,17 @@ void tst_QThreadPool::setMaxThreadCount_data() { QTest::addColumn<int>("limit"); - QTest::newRow("") << 1; - QTest::newRow("") << -1; - QTest::newRow("") << 2; - QTest::newRow("") << -2; - QTest::newRow("") << 4; - QTest::newRow("") << -4; - QTest::newRow("") << 0; - QTest::newRow("") << 12345; - QTest::newRow("") << -6789; - QTest::newRow("") << 42; - QTest::newRow("") << -666; + QTest::newRow("1") << 1; + QTest::newRow("-1") << -1; + QTest::newRow("2") << 2; + QTest::newRow("-2") << -2; + QTest::newRow("4") << 4; + QTest::newRow("-4") << -4; + QTest::newRow("0") << 0; + QTest::newRow("12345") << 12345; + QTest::newRow("-6789") << -6789; + QTest::newRow("42") << 42; + QTest::newRow("-666") << -666; } void tst_QThreadPool::setMaxThreadCount() diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp index 578f867032..0e1fa47a3e 100644 --- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp @@ -59,14 +59,8 @@ private slots: void wait_RaceCondition(); }; -static const int iterations = 10; - -// Note: some tests rely on ThreadCount being multiple of 2 -#if defined(Q_OS_SOLARIS) || ( defined(Q_OS_LINUX) && defined(QT_ARCH_ARMV6) ) +static const int iterations = 4; static const int ThreadCount = 4; -#else -static const int ThreadCount = 10; -#endif class wait_QMutex_Thread_1 : public QThread { diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index e442aa7e1a..13a6b3d471 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -521,7 +521,10 @@ void tst_QByteArray::qvsnprintf() QCOMPARE(::qsnprintf(buf, 10, "%s", "bubu"), 4); QCOMPARE(static_cast<const char *>(buf), "bubu"); +#ifndef Q_CC_MSVC + // MSVC implementation of vsnprintf overwrites bytes after null terminator so this would fail. QCOMPARE(buf[5], char(42)); +#endif qMemSet(buf, 42, sizeof(buf)); QCOMPARE(::qsnprintf(buf, 5, "%s", "bubu"), 4); @@ -862,7 +865,7 @@ void tst_QByteArray::indexOf_data() QTest::newRow("BoyerMooreStressTest4") << QByteArray(veryBigHaystack) << QByteArray(veryBigHaystack + 'c') << 0 << -1; QTest::newRow("BoyerMooreStressTest5") << QByteArray(veryBigHaystack) << QByteArray('c' + veryBigHaystack) << 0 << -1; QTest::newRow("BoyerMooreStressTest6") << QByteArray('d' + veryBigHaystack) << QByteArray('c' + veryBigHaystack) << 0 << -1; - QTest::newRow("BoyerMooreStressTest6") << QByteArray(veryBigHaystack + 'c') << QByteArray('c' + veryBigHaystack) << 0 << -1; + QTest::newRow("BoyerMooreStressTest7") << QByteArray(veryBigHaystack + 'c') << QByteArray('c' + veryBigHaystack) << 0 << -1; } void tst_QByteArray::indexOf() @@ -985,13 +988,13 @@ void tst_QByteArray::toInt_data() QTest::addColumn<bool>("expectedok"); QTest::newRow("base 10") << QByteArray("100") << 10 << int(100) << true; - QTest::newRow("base 16") << QByteArray("100") << 16 << int(256) << true; - QTest::newRow("base 16") << QByteArray("0400") << 16 << int(1024) << true; + QTest::newRow("base 16-1") << QByteArray("100") << 16 << int(256) << true; + QTest::newRow("base 16-2") << QByteArray("0400") << 16 << int(1024) << true; QTest::newRow("base 2") << QByteArray("1111") << 2 << int(15) << true; QTest::newRow("base 8") << QByteArray("100") << 8 << int(64) << true; - QTest::newRow("base 0") << QByteArray("0x10") << 0 << int(16) << true; - QTest::newRow("base 0") << QByteArray("10") << 0 << int(10) << true; - QTest::newRow("base 0") << QByteArray("010") << 0 << int(8) << true; + QTest::newRow("base 0-1") << QByteArray("0x10") << 0 << int(16) << true; + QTest::newRow("base 0-2") << QByteArray("10") << 0 << int(10) << true; + QTest::newRow("base 0-3") << QByteArray("010") << 0 << int(8) << true; QTest::newRow("empty") << QByteArray() << 0 << int(0) << false; // using fromRawData @@ -999,7 +1002,7 @@ void tst_QByteArray::toInt_data() QTest::newRow("raw2") << QByteArray::fromRawData("1foo", 1) << 10 << 1 << true; QTest::newRow("raw3") << QByteArray::fromRawData("12", 1) << 10 << 1 << true; QTest::newRow("raw4") << QByteArray::fromRawData("123456789", 1) << 10 << 1 << true; - QTest::newRow("raw4") << QByteArray::fromRawData("123456789", 2) << 10 << 12 << true; + QTest::newRow("raw5") << QByteArray::fromRawData("123456789", 2) << 10 << 12 << true; QTest::newRow("raw-static") << QByteArray::fromRawData(&globalChar, 1) << 10 << 1 << true; } @@ -1398,58 +1401,58 @@ void tst_QByteArray::repeated_data() const QTest::addColumn<int>("count" ); /* Empty strings. */ - QTest::newRow("") + QTest::newRow("data1") << QByteArray() << QByteArray() << 0; - QTest::newRow("") + QTest::newRow("data2") << QByteArray() << QByteArray() << -1004; - QTest::newRow("") + QTest::newRow("data3") << QByteArray() << QByteArray() << 1; - QTest::newRow("") + QTest::newRow("data4") << QByteArray() << QByteArray() << 5; /* On simple string. */ - QTest::newRow("") + QTest::newRow("data5") << QByteArray("abc") << QByteArray() << -1004; - QTest::newRow("") + QTest::newRow("data6") << QByteArray("abc") << QByteArray() << -1; - QTest::newRow("") + QTest::newRow("data7") << QByteArray("abc") << QByteArray() << 0; - QTest::newRow("") + QTest::newRow("data8") << QByteArray("abc") << QByteArray("abc") << 1; - QTest::newRow("") + QTest::newRow("data9") << QByteArray(("abc")) << QByteArray(("abcabc")) << 2; - QTest::newRow("") + QTest::newRow("data10") << QByteArray(("abc")) << QByteArray(("abcabcabc")) << 3; - QTest::newRow("") + QTest::newRow("data11") << QByteArray(("abc")) << QByteArray(("abcabcabcabc")) << 4; diff --git a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro index fddd67fbd6..1c4b74e16d 100644 --- a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro +++ b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro @@ -3,14 +3,4 @@ TARGET = tst_qcryptographichash QT = core testlib SOURCES = tst_qcryptographichash.cpp - -wince* { - addFiles.files = data/* - addFiles.path = data/ - DEPLOYMENT += addFiles - - DEFINES += SRCDIR=\\\".\\\" -} -else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -}
\ No newline at end of file +TESTDATA += data/* diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp index 3a257c2f11..81cc66f045 100644 --- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp +++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp @@ -158,8 +158,8 @@ void tst_QCryptographicHash::files_data() { QTest::addColumn<QString>("filename"); QTest::addColumn<QCryptographicHash::Algorithm>("algorithm"); QTest::addColumn<QByteArray>("md5sum"); - QTest::newRow("Line") << QString::fromAscii("data/2c1517dad3678f03917f15849b052fd5.md5") << QCryptographicHash::Md5 << QByteArray("2c1517dad3678f03917f15849b052fd5"); - QTest::newRow("Line") << QString::fromAscii("data/d41d8cd98f00b204e9800998ecf8427e.md5") << QCryptographicHash::Md5 << QByteArray("d41d8cd98f00b204e9800998ecf8427e"); + QTest::newRow("data1") << QString::fromAscii("data/2c1517dad3678f03917f15849b052fd5.md5") << QCryptographicHash::Md5 << QByteArray("2c1517dad3678f03917f15849b052fd5"); + QTest::newRow("data2") << QString::fromAscii("data/d41d8cd98f00b204e9800998ecf8427e.md5") << QCryptographicHash::Md5 << QByteArray("d41d8cd98f00b204e9800998ecf8427e"); } @@ -169,7 +169,9 @@ void tst_QCryptographicHash::files() QFETCH(QCryptographicHash::Algorithm, algorithm); QFETCH(QByteArray, md5sum); { - QFile f(QString::fromLocal8Bit(SRCDIR) + filename); + QString testData = QFINDTESTDATA(filename); + QVERIFY2(!testData.isEmpty(), qPrintable(QString("Cannot find test data: %1").arg(filename))); + QFile f(testData); QCryptographicHash hash(algorithm); QVERIFY(! hash.addData(&f)); // file is not open for reading; if (f.open(QIODevice::ReadOnly)) { diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp index 4921a7e734..258dbf8625 100644 --- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp +++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp @@ -147,14 +147,14 @@ void tst_QDate::isValid_data() QTest::newRow("month 13") << 2000 << 13 << 1 << nullJd << false; // test leap years - QTest::newRow("non-leap") << 2006 << 2 << 29 << nullJd << false; - QTest::newRow("normal leap") << 2004 << 2 << 29 << qint64(2453065) << true; - QTest::newRow("century leap") << 1900 << 2 << 29 << nullJd << false; - QTest::newRow("century leap") << 2100 << 2 << 29 << nullJd << false; - QTest::newRow("400-years leap") << 2000 << 2 << 29 << qint64(2451604) << true; - QTest::newRow("400-years leap 2") << 2400 << 2 << 29 << qint64(2597701) << true; - QTest::newRow("400-years leap 3") << 1600 << 2 << 29 << qint64(2305507) << true; - QTest::newRow("year 0") << 0 << 2 << 27 << nullJd << false; + QTest::newRow("non-leap") << 2006 << 2 << 29 << nullJd << false; + QTest::newRow("normal leap") << 2004 << 2 << 29 << qint64(2453065) << true; + QTest::newRow("century leap 1900") << 1900 << 2 << 29 << nullJd << false; + QTest::newRow("century leap 2100") << 2100 << 2 << 29 << nullJd << false; + QTest::newRow("400-years leap 2000") << 2000 << 2 << 29 << qint64(2451604) << true; + QTest::newRow("400-years leap 2400") << 2400 << 2 << 29 << qint64(2597701) << true; + QTest::newRow("400-years leap 1600") << 1600 << 2 << 29 << qint64(2305507) << true; + QTest::newRow("year 0") << 0 << 2 << 27 << nullJd << false; // test the number of days in months: QTest::newRow("jan") << 2000 << 1 << 31 << qint64(2451575) << true; @@ -262,7 +262,7 @@ void tst_QDate::dayOfWeek_data() QTest::newRow("data8") << -4800 << 1 << 1 << 1; QTest::newRow("data9") << -4800 << 1 << 2 << 2; QTest::newRow("data10") << -4800 << 1 << 3 << 3; - QTest::newRow("data12") << -4800 << 1 << 4 << 4; + QTest::newRow("data11") << -4800 << 1 << 4 << 4; QTest::newRow("data12") << -4800 << 1 << 5 << 5; QTest::newRow("data13") << -4800 << 1 << 6 << 6; QTest::newRow("data14") << -4800 << 1 << 7 << 7; @@ -580,10 +580,10 @@ void tst_QDate::addMonths_data() QTest::newRow( "data14" ) << 2000 << 2 << 29 << -12 << 1999 << 2 << 28; // year sign change: - QTest::newRow( "data14" ) << 1 << 1 << 1 << -1 << -1 << 12 << 1; - QTest::newRow( "data15" ) << 1 << 1 << 1 << -12 << -1 << 1 << 1; - QTest::newRow( "data16" ) << -1 << 12 << 1 << 1 << 1 << 1 << 1; - QTest::newRow( "data17" ) << -1 << 1 << 1 << 12 << 1 << 1 << 1; + QTest::newRow( "data15" ) << 1 << 1 << 1 << -1 << -1 << 12 << 1; + QTest::newRow( "data16" ) << 1 << 1 << 1 << -12 << -1 << 1 << 1; + QTest::newRow( "data17" ) << -1 << 12 << 1 << 1 << 1 << 1 << 1; + QTest::newRow( "data18" ) << -1 << 1 << 1 << 12 << 1 << 1 << 1; } void tst_QDate::addYears() diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index af8deefa4c..eb6af23ba5 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -1363,19 +1363,19 @@ void tst_QDateTime::dateFromStringFormat_data() QTest::newRow("data24") << tuesday << QString("dddd") << QDate(1900, 1, 2); QTest::newRow("data25") << wednesday << QString("dddd") << QDate(1900, 1, 3); QTest::newRow("data26") << thursday << QString("dddd") << QDate(1900, 1, 4); - QTest::newRow("data26") << friday << QString("dddd") << QDate(1900, 1, 5); - QTest::newRow("data27") << saturday << QString("dddd") << QDate(1900, 1, 6); - QTest::newRow("data28") << sunday << QString("dddd") << QDate(1900, 1, 7); - - QTest::newRow("data29") << monday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 2); - QTest::newRow("data30") << tuesday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 3); - QTest::newRow("data31") << wednesday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 4); - QTest::newRow("data32") << thursday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 5); - QTest::newRow("data33") << friday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 6); - QTest::newRow("data34") << saturday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 7); - QTest::newRow("data35") << sunday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 1); - - QTest::newRow("data36 ") << tuesday + " 2007 " + march << QString("dddd yyyy MMMM") << QDate(2007, 3, 6); + QTest::newRow("data27") << friday << QString("dddd") << QDate(1900, 1, 5); + QTest::newRow("data28") << saturday << QString("dddd") << QDate(1900, 1, 6); + QTest::newRow("data29") << sunday << QString("dddd") << QDate(1900, 1, 7); + + QTest::newRow("data30") << monday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 2); + QTest::newRow("data31") << tuesday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 3); + QTest::newRow("data32") << wednesday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 4); + QTest::newRow("data33") << thursday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 5); + QTest::newRow("data34") << friday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 6); + QTest::newRow("data35") << saturday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 7); + QTest::newRow("data36") << sunday + " 2006" << QString("dddd yyyy") << QDate(2006, 1, 1); + + QTest::newRow("data37") << tuesday + " 2007 " + march << QString("dddd yyyy MMMM") << QDate(2007, 3, 6); } diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 5544c0fd71..db7f503f57 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -59,7 +59,6 @@ #endif #ifdef Q_OS_WINCE -#include <qcoreapplication.h> #include <windows.h> // needed for GetUserDefaultLCID #define _control87 _controlfp extern "C" DWORD GetThreadLocale(void) { @@ -141,11 +140,6 @@ tst_QLocale::tst_QLocale() void tst_QLocale::ctor() { -#ifdef Q_OS_WINCE - int argc = 1; - char argv[20] = "tst_qlocale.exe"; - QCoreApplication app(argc, (char**)&argv); -#endif QLocale default_locale = QLocale::system(); QLocale::Language default_lang = default_locale.language(); QLocale::Country default_country = default_locale.country(); @@ -934,7 +928,7 @@ void tst_QLocale::formatDateTime_data() << "\"yymm\"" << "\"7414\""; QTest::newRow("27C") << "C" << QDateTime(QDate(1974, 12, 1), QTime(15, 14, 13)) << "'\"yymm\"'" << "\"yymm\""; - QTest::newRow("27C") << "C" << QDateTime() + QTest::newRow("28C") << "C" << QDateTime() << "'\"yymm\"'" << ""; QTest::newRow("1no_NO") << "no_NO" << QDateTime(QDate(1974, 12, 1), QTime(5, 14, 13)) @@ -976,7 +970,7 @@ void tst_QLocale::formatDateTime_data() << "\"yymm\"" << "\"7414\""; QTest::newRow("27no_NO") << "no_NO" << QDateTime(QDate(1974, 12, 1), QTime(15, 14, 13)) << "'\"yymm\"'" << "\"yymm\""; - QTest::newRow("27no_NO") << "no_NO" << QDateTime() + QTest::newRow("28no_NO") << "no_NO" << QDateTime() << "'\"yymm\"'" << ""; } @@ -1988,5 +1982,5 @@ void tst_QLocale::listPatterns() QCOMPARE(zh_CN.createSeparatedList(sl5), QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe3\x80\x81" "ccc" "\xe5\x92\x8c" "ddd")); } -QTEST_APPLESS_MAIN(tst_QLocale) +QTEST_MAIN(tst_QLocale) #include "tst_qlocale.moc" diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri index e12bb914c0..10d30e3c76 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri @@ -3,5 +3,5 @@ HEADERS += $$PWD/externaltests.h cleanedQMAKESPEC = $$replace(QMAKESPEC, \\\\, /) DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\" -embedded:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED +cross_compile:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED wince*:DEFINES += QTEST_CROSS_COMPILED QTEST_NO_RTTI diff --git a/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro b/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro index b1cd309293..1b227109b3 100644 --- a/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro +++ b/tests/auto/corelib/tools/qsharedpointer/qsharedpointer.pro @@ -13,3 +13,5 @@ HEADERS = forwarddeclared.h \ TESTDATA += forwarddeclared.cpp forwarddeclared.h include(externaltests.pri) + +win32:CONFIG += insignificant_test # QTBUG-24160 diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 2bae52a622..5b697a3509 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -76,6 +76,7 @@ private slots: void upCast(); void qobjectWeakManagement(); void noSharedPointerFromWeakQObject(); + void sharedPointerFromQObjectWithWeak(); void weakQObjectFromSharedPointer(); void objectCast(); void differentPointers(); @@ -692,12 +693,34 @@ void tst_QSharedPointer::noSharedPointerFromWeakQObject() QObject obj; QWeakPointer<QObject> weak(&obj); - QSharedPointer<QObject> strong = weak.toStrongRef(); - QVERIFY(strong.isNull()); + { + QTest::ignoreMessage(QtWarningMsg , "QSharedPointer: cannot create a QSharedPointer from a QObject-tracking QWeakPointer"); + QSharedPointer<QObject> strong = weak.toStrongRef(); + QVERIFY(strong.isNull()); + } + { + QTest::ignoreMessage(QtWarningMsg , "QSharedPointer: cannot create a QSharedPointer from a QObject-tracking QWeakPointer"); + QSharedPointer<QObject> strong = weak; + QVERIFY(strong.isNull()); + } + QCOMPARE(weak.data(), &obj); // if something went wrong, we'll probably crash here } +void tst_QSharedPointer::sharedPointerFromQObjectWithWeak() +{ + QObject *ptr = new QObject; + QWeakPointer<QObject> weak = ptr; + { + QSharedPointer<QObject> shared(ptr); + QVERIFY(!weak.isNull()); + QCOMPARE(shared.data(), ptr); + QCOMPARE(weak.data(), ptr); + } + QVERIFY(weak.isNull()); +} + void tst_QSharedPointer::weakQObjectFromSharedPointer() { // this is the inverse of the above: you're allowed to create a QWeakPointer @@ -1070,10 +1093,6 @@ void tst_QSharedPointer::constCorrectness() ptr = cptr.constCast<Data>(); ptr = vptr.constCast<Data>(); -#if !defined(Q_CC_HPACC) && !defined(QT_ARCH_PARISC) - // the aCC series 3 compiler we have on the PA-RISC - // machine crashes compiling this code - QSharedPointer<const volatile Data> cvptr(ptr); QSharedPointer<const volatile Data> cvptr2(cptr); QSharedPointer<const volatile Data> cvptr3(vptr); @@ -1082,7 +1101,6 @@ void tst_QSharedPointer::constCorrectness() cvptr3 = vptr; ptr = qSharedPointerConstCast<Data>(cvptr); ptr = cvptr.constCast<Data>(); -#endif } safetyCheck(); @@ -1767,12 +1785,6 @@ void tst_QSharedPointer::invalidConstructs_data() << "Data *ptr = 0;\n" "QWeakPointer<Data> weakptr(ptr);\n"; - QTest::newRow("shared-pointer-from-unmanaged-qobject") - << &QTest::QExternalTest::tryRunFail - << "QObject *ptr = new QObject;\n" - "QWeakPointer<QObject> weak = ptr;\n" // this makes the object unmanaged - "QSharedPointer<QObject> shared(ptr);\n"; - QTest::newRow("shared-pointer-implicit-from-uninitialized") << &QTest::QExternalTest::tryCompileFail << "Data *ptr = 0;\n" diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 7dd801b50b..e3808244d3 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -447,7 +447,7 @@ void tst_QString::replace_uint_uint_data() QTest::newRow( "rep08" ) << QString("ACABCAB") << 3 << 2 << QString("XX") << QString("ACAXXAB"); QTest::newRow( "rep09" ) << QString("ACABCAB") << 4 << 2 << QString("XX") << QString("ACABXXB"); QTest::newRow( "rep10" ) << QString("ACABCAB") << 5 << 2 << QString("XX") << QString("ACABCXX"); - QTest::newRow( "rep10" ) << QString("ACABCAB") << 6 << 2 << QString("XX") << QString("ACABCAXX"); + QTest::newRow( "rep11" ) << QString("ACABCAB") << 6 << 2 << QString("XX") << QString("ACABCAXX"); QTest::newRow( "rep12" ) << QString() << 0 << 10 << QString("X") << QString("X"); QTest::newRow( "rep13" ) << QString("short") << 0 << 10 << QString("X") << QString("X"); QTest::newRow( "rep14" ) << QString() << 0 << 10 << QString("XX") << QString("XX"); @@ -1042,7 +1042,7 @@ void tst_QString::indexOf_data() QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << QString(veryBigHaystack + 'c') << 0 << true << -1; QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << QString('c' + veryBigHaystack) << 0 << true << -1; QTest::newRow("BoyerMooreStressTest6") << QString('d' + veryBigHaystack) << QString('c' + veryBigHaystack) << 0 << true << -1; - QTest::newRow("BoyerMooreStressTest6") << QString(veryBigHaystack + 'c') << QString('c' + veryBigHaystack) << 0 << true << -1; + QTest::newRow("BoyerMooreStressTest7") << QString(veryBigHaystack + 'c') << QString('c' + veryBigHaystack) << 0 << true << -1; QTest::newRow("BoyerMooreInsensitiveStressTest") << veryBigHaystack << veryBigHaystack << 0 << false << 0; @@ -1211,15 +1211,15 @@ void tst_QString::lastIndexOf_data() QTest::newRow("4") << a << "G" << 14 << 14 << true; QTest::newRow("5") << a << "G" << 13 << 11 << true; QTest::newRow("6") << a << "B" << a.size() - 1 << 1 << true; - QTest::newRow("6") << a << "B" << - 1 << 1 << true; - QTest::newRow("7") << a << "B" << 1 << 1 << true; - QTest::newRow("8") << a << "B" << 0 << -1 << true; + QTest::newRow("7") << a << "B" << - 1 << 1 << true; + QTest::newRow("8") << a << "B" << 1 << 1 << true; + QTest::newRow("9") << a << "B" << 0 << -1 << true; - QTest::newRow("9") << a << "G" << -1 << a.size()-1 << true; - QTest::newRow("10") << a << "G" << a.size()-1 << a.size()-1 << true; - QTest::newRow("11") << a << "G" << a.size() << -1 << true; - QTest::newRow("12") << a << "A" << 0 << 0 << true; - QTest::newRow("13") << a << "A" << -1*a.size() << 0 << true; + QTest::newRow("10") << a << "G" << -1 << a.size()-1 << true; + QTest::newRow("11") << a << "G" << a.size()-1 << a.size()-1 << true; + QTest::newRow("12") << a << "G" << a.size() << -1 << true; + QTest::newRow("13") << a << "A" << 0 << 0 << true; + QTest::newRow("14") << a << "A" << -1*a.size() << 0 << true; QTest::newRow("15") << a << "efg" << 0 << -1 << false; QTest::newRow("16") << a << "efg" << a.size() << -1 << false; @@ -4742,8 +4742,8 @@ void tst_QString::compare_data() // different length QTest::newRow("data6") << QString("abcdef") << QString("abc") << 1 << 1; - QTest::newRow("data6") << QString("abCdef") << QString("abc") << -1 << 1; - QTest::newRow("data7") << QString("abc") << QString("abcdef") << -1 << -1; + QTest::newRow("data7") << QString("abCdef") << QString("abc") << -1 << 1; + QTest::newRow("data8") << QString("abc") << QString("abcdef") << -1 << -1; QString upper; upper += QChar(QChar::highSurrogate(0x10400)); @@ -4755,12 +4755,12 @@ void tst_QString::compare_data() // embedded nulls // These don't work as of now. It's OK that these don't work since \0 is not a valid unicode - /*QTest::newRow("data9") << QString(QByteArray("\0", 1)) << QString(QByteArray("\0", 1)) << 0 << 0; - QTest::newRow("data10") << QString(QByteArray("\0", 1)) << QString("") << 1 << 1; - QTest::newRow("data11") << QString("") << QString(QByteArray("\0", 1)) << -1 << -1; - QTest::newRow("data12") << QString("ab\0c") << QString(QByteArray("ab\0c", 4)) << 0 << 0; - QTest::newRow("data13") << QString(QByteArray("ab\0c", 4)) << QString("abc") << -1 << -1; - QTest::newRow("data14") << QString("abc") << QString(QByteArray("ab\0c", 4)) << 1 << 1;*/ + /*QTest::newRow("data10") << QString(QByteArray("\0", 1)) << QString(QByteArray("\0", 1)) << 0 << 0; + QTest::newRow("data11") << QString(QByteArray("\0", 1)) << QString("") << 1 << 1; + QTest::newRow("data12") << QString("") << QString(QByteArray("\0", 1)) << -1 << -1; + QTest::newRow("data13") << QString("ab\0c") << QString(QByteArray("ab\0c", 4)) << 0 << 0; + QTest::newRow("data14") << QString(QByteArray("ab\0c", 4)) << QString("abc") << -1 << -1; + QTest::newRow("data15") << QString("abc") << QString(QByteArray("ab\0c", 4)) << 1 << 1;*/ } static bool isLatin(const QString &s) @@ -5004,58 +5004,58 @@ void tst_QString::repeated_data() const QTest::addColumn<int>("count" ); /* Empty strings. */ - QTest::newRow("") + QTest::newRow("data1") << QString() << QString() << 0; - QTest::newRow("") + QTest::newRow("data2") << QString() << QString() << -1004; - QTest::newRow("") + QTest::newRow("data3") << QString() << QString() << 1; - QTest::newRow("") + QTest::newRow("data4") << QString() << QString() << 5; /* On simple string. */ - QTest::newRow("") + QTest::newRow("data5") << QString(QLatin1String("abc")) << QString() << -1004; - QTest::newRow("") + QTest::newRow("data6") << QString(QLatin1String("abc")) << QString() << -1; - QTest::newRow("") + QTest::newRow("data7") << QString(QLatin1String("abc")) << QString() << 0; - QTest::newRow("") + QTest::newRow("data8") << QString(QLatin1String("abc")) << QString(QLatin1String("abc")) << 1; - QTest::newRow("") + QTest::newRow("data9") << QString(QLatin1String("abc")) << QString(QLatin1String("abcabc")) << 2; - QTest::newRow("") + QTest::newRow("data10") << QString(QLatin1String("abc")) << QString(QLatin1String("abcabcabc")) << 3; - QTest::newRow("") + QTest::newRow("data11") << QString(QLatin1String("abc")) << QString(QLatin1String("abcabcabcabc")) << 4; diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp index e3eb1a21ac..6066f7c8e0 100644 --- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp @@ -193,8 +193,8 @@ void tst_QStringList::removeDuplicates_data() QTest::addColumn<QString>("after"); QTest::addColumn<int>("count"); - QTest::newRow("empty") << "Hello,Hello" << "Hello" << 1; - QTest::newRow("empty") << "Hello,World" << "Hello,World" << 0; + QTest::newRow("empty-1") << "Hello,Hello" << "Hello" << 1; + QTest::newRow("empty-2") << "Hello,World" << "Hello,World" << 0; } void tst_QStringList::removeDuplicates() @@ -245,35 +245,35 @@ void tst_QStringList::join_data() const QTest::addColumn<QString>("separator"); QTest::addColumn<QString>("expectedResult"); - QTest::newRow("") + QTest::newRow("data1") << QStringList() << QString() << QString(); - QTest::newRow("") + QTest::newRow("data2") << QStringList() << QString(QLatin1String("separator")) << QString(); - QTest::newRow("") + QTest::newRow("data3") << QStringList("one") << QString(QLatin1String("separator")) << QString("one"); - QTest::newRow("") + QTest::newRow("data4") << QStringList("one") << QString(QLatin1String("separator")) << QString("one"); - QTest::newRow("") + QTest::newRow("data5") << (QStringList() << QLatin1String("a") << QLatin1String("b")) << QString(QLatin1String(" ")) << QString("a b"); - QTest::newRow("") + QTest::newRow("data6") << (QStringList() << QLatin1String("a") << QLatin1String("b") diff --git a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp index ebbad86c81..5829c0e917 100644 --- a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp +++ b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp @@ -81,16 +81,16 @@ void tst_QStringMatcher::indexIn_data() QTest::addColumn<QString>("haystack"); QTest::addColumn<int>("from"); QTest::addColumn<int>("indexIn"); - QTest::newRow("empty") << QString() << QString("foo") << 0 << 0; - QTest::newRow("empty") << QString() << QString("foo") << 10 << -1; - QTest::newRow("empty") << QString() << QString("foo") << -10 << 0; - - QTest::newRow("simple") << QString("a") << QString("foo") << 0 << -1; - QTest::newRow("simple") << QString("a") << QString("bar") << 0 << 1; - QTest::newRow("harder") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 0 << 26; - QTest::newRow("harder") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 20 << 26; - QTest::newRow("harder") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 26 << 26; - QTest::newRow("harder") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 27 << -1; + QTest::newRow("empty-1") << QString() << QString("foo") << 0 << 0; + QTest::newRow("empty-2") << QString() << QString("foo") << 10 << -1; + QTest::newRow("empty-3") << QString() << QString("foo") << -10 << 0; + + QTest::newRow("simple-1") << QString("a") << QString("foo") << 0 << -1; + QTest::newRow("simple-2") << QString("a") << QString("bar") << 0 << 1; + QTest::newRow("harder-1") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 0 << 26; + QTest::newRow("harder-2") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 20 << 26; + QTest::newRow("harder-3") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 26 << 26; + QTest::newRow("harder-4") << QString("foo") << QString("slkdf sldkjf slakjf lskd ffools ldjf") << 27 << -1; } void tst_QStringMatcher::indexIn() diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp index 77d2101320..de01df2001 100644 --- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp +++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp @@ -288,7 +288,7 @@ void tst_QStringRef::indexOf_data() QTest::newRow("BoyerMooreStressTest4") << veryBigHaystack << veryBigHaystack + 'c' << 0 << true << -1; QTest::newRow("BoyerMooreStressTest5") << veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1; QTest::newRow("BoyerMooreStressTest6") << 'd' + veryBigHaystack << 'c' + veryBigHaystack << 0 << true << -1; - QTest::newRow("BoyerMooreStressTest6") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << true << -1; + QTest::newRow("BoyerMooreStressTest7") << veryBigHaystack + 'c' << 'c' + veryBigHaystack << 0 << true << -1; QTest::newRow("BoyerMooreInsensitiveStressTest") << veryBigHaystack << veryBigHaystack << 0 << false << 0; @@ -441,15 +441,15 @@ void tst_QStringRef::lastIndexOf_data() QTest::newRow("4") << a << "G" << 14 << 14 << true; QTest::newRow("5") << a << "G" << 13 << 11 << true; QTest::newRow("6") << a << "B" << a.size() - 1 << 1 << true; - QTest::newRow("6") << a << "B" << - 1 << 1 << true; - QTest::newRow("7") << a << "B" << 1 << 1 << true; - QTest::newRow("8") << a << "B" << 0 << -1 << true; + QTest::newRow("7") << a << "B" << - 1 << 1 << true; + QTest::newRow("8") << a << "B" << 1 << 1 << true; + QTest::newRow("9") << a << "B" << 0 << -1 << true; - QTest::newRow("9") << a << "G" << -1 << a.size()-1 << true; - QTest::newRow("10") << a << "G" << a.size()-1 << a.size()-1 << true; - QTest::newRow("11") << a << "G" << a.size() << -1 << true; - QTest::newRow("12") << a << "A" << 0 << 0 << true; - QTest::newRow("13") << a << "A" << -1*a.size() << 0 << true; + QTest::newRow("10") << a << "G" << -1 << a.size()-1 << true; + QTest::newRow("11") << a << "G" << a.size()-1 << a.size()-1 << true; + QTest::newRow("12") << a << "G" << a.size() << -1 << true; + QTest::newRow("13") << a << "A" << 0 << 0 << true; + QTest::newRow("14") << a << "A" << -1*a.size() << 0 << true; QTest::newRow("15") << a << "efg" << 0 << -1 << false; QTest::newRow("16") << a << "efg" << a.size() << -1 << false; @@ -777,8 +777,8 @@ void tst_QStringRef::compare_data() // different length QTest::newRow("data6") << QString("abcdef") << QString("abc") << 1 << 1; - QTest::newRow("data6") << QString("abCdef") << QString("abc") << -1 << 1; - QTest::newRow("data7") << QString("abc") << QString("abcdef") << -1 << -1; + QTest::newRow("data7") << QString("abCdef") << QString("abc") << -1 << 1; + QTest::newRow("data8") << QString("abc") << QString("abcdef") << -1 << -1; QString upper; upper += QChar(QChar::highSurrogate(0x10400)); @@ -786,7 +786,7 @@ void tst_QStringRef::compare_data() QString lower; lower += QChar(QChar::highSurrogate(0x10428)); lower += QChar(QChar::lowSurrogate(0x10428)); - QTest::newRow("data8") << upper << lower << -1 << 0; + QTest::newRow("data9") << upper << lower << -1 << 0; } static bool isLatin(const QString &s) diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp index 89dd01ac3a..b8ae709fd0 100644 --- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp +++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp @@ -302,22 +302,22 @@ void tst_QTextBoundaryFinder::toNextBoundary_data() QList<int> boundaries; boundaries << 0 << 3 << 4 << 7 << 8 << 11 << 12 << 13 << 16 << 17 << 20 << 21 << 24 << 25; - QTest::newRow("Line") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Word) \ + QTest::newRow("data1") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Word) \ << boundaries; boundaries.clear(); boundaries << 0 << 13 << 25; - QTest::newRow("Line") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Sentence) \ + QTest::newRow("data2") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Sentence) \ << boundaries; boundaries.clear(); boundaries << 0 << 4 << 8 << 13 << 17 << 21 << 25; - QTest::newRow("Line") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Line) \ + QTest::newRow("data3") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Line) \ << boundaries; boundaries.clear(); boundaries << 0 << 5 << 9 << 15 << 17 << 21 << 28; - QTest::newRow("Line") << QString::fromUtf8("Diga-nos qualé a sua opinião") << int(QTextBoundaryFinder::Line) + QTest::newRow("data4") << QString::fromUtf8("Diga-nos qualé a sua opinião") << int(QTextBoundaryFinder::Line) << boundaries; } @@ -344,22 +344,22 @@ void tst_QTextBoundaryFinder::toPreviousBoundary_data() QList<int> boundaries; boundaries << 25 << 24 << 21 << 20 << 17 << 16 << 13 << 12 << 11 << 8 << 7 << 4 << 3 << 0; - QTest::newRow("Line") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Word) + QTest::newRow("data1") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Word) << boundaries; boundaries.clear(); boundaries << 25 << 13 << 0; - QTest::newRow("Line") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Sentence) + QTest::newRow("data2") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Sentence) << boundaries; boundaries.clear(); boundaries << 25 << 21 << 17 << 13 << 8 << 4 << 0; - QTest::newRow("Line") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Line) + QTest::newRow("data3") << QString("Aaa bbb ccc. Ddd eee fff.") << int(QTextBoundaryFinder::Line) << boundaries; boundaries.clear(); boundaries << 28 << 21 << 17 << 15 << 9 << 5 << 0; - QTest::newRow("Line") << QString::fromUtf8("Diga-nos qualé a sua opinião") << int(QTextBoundaryFinder::Line) + QTest::newRow("data4") << QString::fromUtf8("Diga-nos qualé a sua opinião") << int(QTextBoundaryFinder::Line) << boundaries; } diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp index 0ce0da06aa..bd9fa2a8db 100644 --- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp +++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp @@ -674,7 +674,7 @@ void tst_QXmlStream::reportSuccess_data() const const int len = m_handler.successes.count(); for(int i = 0; i < len; ++i) - QTest::newRow(m_handler.successes.at(i).toLatin1().constData()) << false; + QTest::newRow(qPrintable(QString("%1. %2").arg(i).arg(m_handler.successes.at(i)))) << false; if(len == 0) QTest::newRow("No test cases succeeded.") << true; diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 28dfd0b63f..b696294005 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -89,7 +89,9 @@ public: private slots: void initTestCase(); - void cleanupTestCase(); + + void init(); + void cleanup(); void makeVoidCall(); void makeStringCall(); @@ -194,39 +196,6 @@ private: QProcess proc; }; -class WaitForQPinger: public QObject -{ - Q_OBJECT -public: - WaitForQPinger(); - bool ok(); -public Q_SLOTS: - void ownerChange(const QString &name) - { - if (name == serviceName) - loop.quit(); - } - -private: - QEventLoop loop; -}; - -WaitForQPinger::WaitForQPinger() -{ - QDBusConnection con = QDBusConnection::sessionBus(); - if (!ok()) { - connect(con.interface(), SIGNAL(serviceOwnerChanged(QString,QString,QString)), - SLOT(ownerChange(QString))); - QTimer::singleShot(2000, &loop, SLOT(quit())); - loop.exec(); - } -} - -bool WaitForQPinger::ok() -{ - return QDBusConnection::sessionBus().isConnected() && - QDBusConnection::sessionBus().interface()->isServiceRegistered(serviceName); -} tst_QDBusAbstractInterface::tst_QDBusAbstractInterface() { @@ -244,6 +213,16 @@ void tst_QDBusAbstractInterface::initTestCase() QDBusConnection con = QDBusConnection::sessionBus(); QVERIFY(con.isConnected()); con.registerObject("/", &targetObj, QDBusConnection::ExportScriptableContents); +} + +void tst_QDBusAbstractInterface::init() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY(con.isConnected()); + + // verify service isn't registered by something else + // (e.g. a left over qpinger from a previous test run) + QVERIFY(!con.interface()->isServiceRegistered(serviceName)); // start peer server #ifdef Q_OS_WIN @@ -253,9 +232,8 @@ void tst_QDBusAbstractInterface::initTestCase() #endif QVERIFY(proc.waitForStarted()); - WaitForQPinger w; - QVERIFY(w.ok()); - //QTest::qWait(2000); + // verify service is now registered + QTRY_VERIFY(con.interface()->isServiceRegistered(serviceName)); // get peer server address QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "address"); @@ -273,10 +251,24 @@ void tst_QDBusAbstractInterface::initTestCase() QVERIFY(rpl2.arguments().at(0).toBool()); } -void tst_QDBusAbstractInterface::cleanupTestCase() +void tst_QDBusAbstractInterface::cleanup() { - proc.close(); - proc.kill(); + QDBusConnection::disconnectFromPeer("peer"); + + // Kill peer, resetting the object exported by a separate process + proc.terminate(); + QVERIFY(proc.waitForFinished() || proc.state() == QProcess::NotRunning); + + // Reset the object exported by this process + targetObj.m_stringProp = QString(); + targetObj.m_variantProp = QDBusVariant(); + targetObj.m_complexProp = RegisteredType(); + + // Wait until the service is certainly not registered + QDBusConnection con = QDBusConnection::sessionBus(); + if (con.isConnected()) { + QTRY_VERIFY(!con.interface()->isServiceRegistered(serviceName)); + } } void tst_QDBusAbstractInterface::makeVoidCall() @@ -635,6 +627,7 @@ void tst_QDBusAbstractInterface::stringPropWritePeer() QString expectedValue = "This is a value"; QVERIFY(p->setProperty("stringProp", expectedValue)); + QEXPECT_FAIL("", "QTBUG-24262 peer tests are broken", Abort); QCOMPARE(targetObj.m_stringProp, expectedValue); } @@ -660,6 +653,7 @@ void tst_QDBusAbstractInterface::variantPropWritePeer() QDBusVariant expectedValue = QDBusVariant(Q_INT64_C(-47)); QVERIFY(p->setProperty("variantProp", qVariantFromValue(expectedValue))); + QEXPECT_FAIL("", "QTBUG-24262 peer tests are broken", Abort); QCOMPARE(targetObj.m_variantProp.variant(), expectedValue.variant()); } @@ -683,6 +677,7 @@ void tst_QDBusAbstractInterface::complexPropWritePeer() RegisteredType expectedValue = RegisteredType("This is a value"); QVERIFY(p->setProperty("complexProp", qVariantFromValue(expectedValue))); + QEXPECT_FAIL("", "QTBUG-24262 peer tests are broken", Abort); QCOMPARE(targetObj.m_complexProp, expectedValue); } @@ -762,6 +757,7 @@ void tst_QDBusAbstractInterface::stringPropDirectWritePeer() QString expectedValue = "This is a value"; p->setStringProp(expectedValue); + QEXPECT_FAIL("", "QTBUG-24262 peer tests are broken", Abort); QCOMPARE(targetObj.m_stringProp, expectedValue); } @@ -783,6 +779,7 @@ void tst_QDBusAbstractInterface::variantPropDirectWritePeer() QDBusVariant expectedValue = QDBusVariant(Q_INT64_C(-47)); p->setVariantProp(expectedValue); + QEXPECT_FAIL("", "QTBUG-24262 peer tests are broken", Abort); QCOMPARE(targetObj.m_variantProp.variant().userType(), expectedValue.variant().userType()); QCOMPARE(targetObj.m_variantProp.variant(), expectedValue.variant()); } @@ -805,6 +802,7 @@ void tst_QDBusAbstractInterface::complexPropDirectWritePeer() RegisteredType expectedValue = RegisteredType("This is a value"); p->setComplexProp(expectedValue); + QEXPECT_FAIL("", "QTBUG-24262 peer tests are broken", Abort); QCOMPARE(targetObj.m_complexProp, expectedValue); } diff --git a/tests/auto/dbus/qdbusmarshall/common.h b/tests/auto/dbus/qdbusmarshall/common.h index d49f4eff30..87c434b71e 100644 --- a/tests/auto/dbus/qdbusmarshall/common.h +++ b/tests/auto/dbus/qdbusmarshall/common.h @@ -610,10 +610,6 @@ template<> bool compare(const QVariant &v1, const QVariant &v2) else if (id == QVariant::ByteArray) return compare(v1.toByteArray(), v2.toByteArray()); - else if (id < int(QVariant::UserType)) // yes, v1.type() - // QVariant can compare - return v1 == v2; - else if (id == QMetaType::UChar) return qvariant_cast<uchar>(v1) == qvariant_cast<uchar>(v2); @@ -716,6 +712,10 @@ template<> bool compare(const QVariant &v1, const QVariant &v2) else if (id == qMetaTypeId<MyStruct>()) // (is) return qvariant_cast<MyStruct>(v1) == qvariant_cast<MyStruct>(v2); + else if (id < int(QVariant::UserType)) // yes, v1.type() + // QVariant can compare + return v1 == v2; + else { qWarning() << "Please write a comparison case for type" << v1.typeName(); return false; // unknown type diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp index 7eb31ffb41..25e3fdeabd 100644 --- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp +++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp @@ -470,12 +470,12 @@ void tst_QDBusXmlParser::properties_data() prop.type = "i"; prop.access = QDBusIntrospection::Property::Read; map << prop; - QTest::newRow("two") << + QTest::newRow("two-1") << "<property name=\"foo\" type=\"s\" access=\"readwrite\"/>" "<property name=\"bar\" type=\"i\" access=\"read\"/>" << map; // invert the order of the declaration - QTest::newRow("two") << + QTest::newRow("two-2") << "<property name=\"bar\" type=\"i\" access=\"read\"/>" "<property name=\"foo\" type=\"s\" access=\"readwrite\"/>" << map; diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp index 25c6c81b2a..74eec26c52 100644 --- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp +++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp @@ -127,8 +127,8 @@ void tst_QIcoImageFormat::canRead_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 1; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 1; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 1; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 1; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 1; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 1; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 1; QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << 0; QTest::newRow("103x16px, 24BPP") << "valid/trolltechlogo_tiny.ico" << 1; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 1; @@ -198,8 +198,8 @@ void tst_QIcoImageFormat::imageCount_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3; QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << 0; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; QTest::newRow("PNG compression") << "valid/Qt.ico" << 4; @@ -227,8 +227,8 @@ void tst_QIcoImageFormat::jumpToNextImage_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; QTest::newRow("PNG compression") << "valid/Qt.ico" << 4; } @@ -276,8 +276,8 @@ void tst_QIcoImageFormat::nextImageDelay_data() QTest::newRow("16px,32px,48px - 16,256,16M colors") << "valid/Obj_N2_Internal_Mem.ico" << 9; QTest::newRow("16px - 16,256,16M colors") << "valid/Status_Play.ico" << 3; QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLD.ico" << 3; - QTest::newRow("16px16c, 32px32c, 32px256c") << "valid/WORLDH.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3; + QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3; QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << -1; QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9; QTest::newRow("PNG compression") << "valid/Qt.ico" << 4; diff --git a/tests/auto/gui/image/qicon/heart.svg b/tests/auto/gui/image/qicon/heart.svg deleted file mode 100644 index 8c982cd93c..0000000000 --- a/tests/auto/gui/image/qicon/heart.svg +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="841.88976pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"> -<metadata> -<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> -<cc:Work rdf:about=""> -<dc:title>Heart Left-Highlight</dc:title> -<dc:description>This is a normal valentines day heart.</dc:description> -<dc:subject> -<rdf:Bag> -<rdf:li>holiday</rdf:li> -<rdf:li>valentines</rdf:li> -<rdf:li></rdf:li> -<rdf:li>valentine</rdf:li> -<rdf:li>hash(0x8a091c0)</rdf:li> -<rdf:li>hash(0x8a0916c)</rdf:li> -<rdf:li>signs_and_symbols</rdf:li> -<rdf:li>hash(0x8a091f0)</rdf:li> -<rdf:li>day</rdf:li> -</rdf:Bag> -</dc:subject> -<dc:publisher> -<cc:Agent rdf:about="http://www.openclipart.org"> -<dc:title>Jon Phillips</dc:title> -</cc:Agent> -</dc:publisher> -<dc:creator> -<cc:Agent> -<dc:title>Jon Phillips</dc:title> -</cc:Agent> -</dc:creator> -<dc:rights> -<cc:Agent> -<dc:title>Jon Phillips</dc:title> -</cc:Agent> -</dc:rights> -<dc:date></dc:date> -<dc:format>image/svg+xml</dc:format> -<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> -<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/> -<dc:language>en</dc:language> -</cc:Work> -<cc:License rdf:about="http://web.resource.org/cc/PublicDomain"> -<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/> -<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/> -<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/> -</cc:License> -</rdf:RDF> -</metadata> -<defs id="defs3"/> -<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/> -<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1"> -<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/> -<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/> -</g> -</svg> diff --git a/tests/auto/gui/image/qicon/heart.svgz b/tests/auto/gui/image/qicon/heart.svgz Binary files differdeleted file mode 100644 index 0f0913ffa7..0000000000 --- a/tests/auto/gui/image/qicon/heart.svgz +++ /dev/null diff --git a/tests/auto/gui/image/qicon/rect.svg b/tests/auto/gui/image/qicon/rect.svg deleted file mode 100644 index 8eb24727be..0000000000 --- a/tests/auto/gui/image/qicon/rect.svg +++ /dev/null @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="40px" - height="5px" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.46" - sodipodi:docname="test.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape"> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview - inkscape:window-height="1005" - inkscape:window-width="1280" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - guidetolerance="10.0" - gridtolerance="10.0" - objecttolerance="10.0" - borderopacity="1.0" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" - showgrid="false" - inkscape:zoom="13.6" - inkscape:cx="20" - inkscape:cy="2.5" - inkscape:window-x="-4" - inkscape:window-y="-4" - inkscape:current-layer="svg2" /> - <defs - id="defs4"> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 2.5 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="40 : 2.5 : 1" - inkscape:persp3d-origin="20 : 1.6666667 : 1" - id="perspective9" /> - </defs> - <g - id="layer1"> - <rect - width="40px" - height="5px" - x="0px" - y="0px" - id="rect2393" - style="fill:#ff0000" /> - </g> - <rect - style="fill:#000000" - id="rect2382" - width="2" - height="2" - x="19" - y="1.5" /> -</svg> diff --git a/tests/auto/gui/image/qicon/trash.svg b/tests/auto/gui/image/qicon/trash.svg deleted file mode 100644 index c44e4c75a2..0000000000 --- a/tests/auto/gui/image/qicon/trash.svg +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 10, SVG Export Plug-In . SVG Version: 3.0.0 Build 76) --><svg enable-background="new 0 0 347 348" height="348" i:pageBounds="0 792 612 0" i:rulerOrigin="0 0" i:viewOrigin="131 567" overflow="visible" space="preserve" viewBox="-20 -20 387 388" width="347" xmlns="http://www.w3.org/2000/svg" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" xmlns:graph="http://ns.adobe.com/Graphs/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:x="http://ns.adobe.com/Extensibility/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink"> -<metadata> -<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> -<cc:Work rdf:about=""> -<dc:title>Keep Tidy Inside</dc:title> -<dc:description></dc:description> -<dc:subject> -<rdf:Bag> -<rdf:li></rdf:li> -<rdf:li>symbol</rdf:li> -<rdf:li>bin</rdf:li> -<rdf:li>signs_and_symbols</rdf:li> -<rdf:li>clean</rdf:li> -<rdf:li>rubish</rdf:li> -<rdf:li>trash</rdf:li> -<rdf:li>inside</rdf:li> -<rdf:li>garbage</rdf:li> -<rdf:li>sign</rdf:li> -</rdf:Bag> -</dc:subject> -<dc:publisher> -<cc:Agent rdf:about="http://www.openclipart.org"> -<dc:title>Martin Owens</dc:title> -</cc:Agent> -</dc:publisher> -<dc:creator> -<cc:Agent> -<dc:title>Martin Owens</dc:title> -</cc:Agent> -</dc:creator> -<dc:rights> -<cc:Agent> -<dc:title>Martin Owens</dc:title> -</cc:Agent> -</dc:rights> -<dc:date></dc:date> -<dc:format>image/svg+xml</dc:format> -<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> -<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/> -<dc:language>en</dc:language> -</cc:Work> -<cc:License rdf:about="http://web.resource.org/cc/PublicDomain"> -<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/> -<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/> -<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/> -</cc:License> -</rdf:RDF> -</metadata> -<g i:dimmedPercent="50" i:knockout="Off" i:layer="yes" i:rgbTrio="#4F008000FFFF" id="Layer_1"> -<path d="M347,174c0,96.098-77.679,174-173.5,174C77.679,348,0,270.098,0,174 C0,77.902,77.679,0,173.5,0C269.321,0,347,77.902,347,174z" fill="#10A040" i:knockout="Off"/> -<path d="M238,53c0,13.807-11.864,25-26.5,25S185,66.807,185,53s11.864-25,26.5-25 S238,39.193,238,53z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M66,175c1.055,6.355,19.333,126.417,19.333,126.417h68.333 c0,0,14.105-122.524,14.333-126.417c6.224-0.622,6.667-13-2-13c-12.164,0-89.205-0.059-98,0S61.167,174.487,66,175z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M78,141c17.292-5.325,24.179-23.532,27-31c14.513,6.596,40.333,12.265,59,8 c3.683,19.419-28.043,19.31-23,37C132.577,145.705,89.404,167.292,78,141z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M103,82l139-1c-0.6,3.421,33.633,57.497,29,67c-4.089,0.418-67,5-67,5 c6.109-9.379-13-43-13-43L103,82z" fill="#FFFFFF" i:knockout="Off"/> -<path d="M270,156l-66-3c0,0-23.565,143.355-24,145s1.855,2.536,3,1s51-82,51-82 s19.754,80.701,20,82s3.721,1.209,4,0S270,156,270,156z" fill="#FFFFFF" i:knockout="Off"/> -</g> -</svg> diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 7d455f1010..4a9ab93921 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -58,13 +58,11 @@ private slots: void actualSize(); void actualSize2_data(); // test with 2 pixmaps with different aspect ratio void actualSize2(); - void svgActualSize(); void isNull(); void swap(); void bestMatch(); void cacheKey(); void detach(); - void svg(); void addFile(); void availableSizes(); void name(); @@ -181,28 +179,6 @@ void tst_QIcon::actualSize2() QCOMPARE(icon.pixmap(argument).size(), result); } -void tst_QIcon::svgActualSize() -{ - if (!haveImageFormat("svg")) { - QSKIP("SVG support is not available"); - } - - const QString prefix = QFileInfo(QFINDTESTDATA("icons")).absolutePath() + "/"; - QIcon icon(prefix + "rect.svg"); - QCOMPARE(icon.actualSize(QSize(16, 16)), QSize(16, 2)); - QCOMPARE(icon.pixmap(QSize(16, 16)).size(), QSize(16, 2)); - - QPixmap p(16, 16); - p.fill(Qt::cyan); - icon.addPixmap(p); - - QCOMPARE(icon.actualSize(QSize(16, 16)), QSize(16, 16)); - QCOMPARE(icon.pixmap(QSize(16, 16)).size(), QSize(16, 16)); - - QCOMPARE(icon.actualSize(QSize(16, 14)), QSize(16, 2)); - QCOMPARE(icon.pixmap(QSize(16, 14)).size(), QSize(16, 2)); -} - void tst_QIcon::isNull() { // test default constructor QIcon defaultConstructor; @@ -395,54 +371,6 @@ void tst_QIcon::detach() QVERIFY(img1 == img2); } -void tst_QIcon::svg() -{ - if (!haveImageFormat("svg")) { - QSKIP("SVG support is not available"); - } - QIcon icon1("heart.svg"); - - QVERIFY(!icon1.pixmap(32).isNull()); - QImage img1 = icon1.pixmap(32).toImage(); - QVERIFY(!icon1.pixmap(32, QIcon::Disabled).isNull()); - QImage img2 = icon1.pixmap(32, QIcon::Disabled).toImage(); - - icon1.addFile("trash.svg", QSize(), QIcon::Disabled); - QVERIFY(!icon1.pixmap(32, QIcon::Disabled).isNull()); - QImage img3 = icon1.pixmap(32, QIcon::Disabled).toImage(); - QVERIFY(img3 != img2); - QVERIFY(img3 != img1); - - QPixmap pm("image.png"); - icon1.addPixmap(pm, QIcon::Normal, QIcon::On); - QVERIFY(!icon1.pixmap(128, QIcon::Normal, QIcon::On).isNull()); - QImage img4 = icon1.pixmap(128, QIcon::Normal, QIcon::On).toImage(); - QVERIFY(img4 != img3); - QVERIFY(img4 != img2); - QVERIFY(img4 != img1); - - QIcon icon2; - icon2.addFile("heart.svg"); - QVERIFY(icon2.pixmap(57).toImage() == icon1.pixmap(57).toImage()); - - QIcon icon3("trash.svg"); - icon3.addFile("heart.svg"); - QVERIFY(icon3.pixmap(57).toImage() == icon1.pixmap(57).toImage()); - - QIcon icon4("heart.svg"); - icon4.addFile("image.png", QSize(), QIcon::Active); - QVERIFY(!icon4.pixmap(32).isNull()); - QVERIFY(!icon4.pixmap(32, QIcon::Active).isNull()); - QVERIFY(icon4.pixmap(32).toImage() == img1); - QIcon pmIcon(pm); - QVERIFY(icon4.pixmap(pm.size(), QIcon::Active).toImage() == pmIcon.pixmap(pm.size(), QIcon::Active).toImage()); - -#ifndef QT_NO_COMPRESS - QIcon icon5("heart.svgz"); - QVERIFY(!icon5.pixmap(32).isNull()); -#endif -} - void tst_QIcon::addFile() { QIcon icon; @@ -506,22 +434,6 @@ void tst_QIcon::availableSizes() QCOMPARE(availableSizes.at(0), QSize(16,16)); } - if (haveImageFormat("svg")) { - // checks that there are no availableSizes for scalable images. - QIcon icon("heart.svg"); - QList<QSize> availableSizes = icon.availableSizes(); - QVERIFY(availableSizes.isEmpty()); - } - - if (haveImageFormat("svg")) { - // even if an a scalable image contain added pixmaps, - // availableSizes still should be empty. - QIcon icon("heart.svg"); - icon.addFile("image.png", QSize(32,32)); - QList<QSize> availableSizes = icon.availableSizes(); - QVERIFY(availableSizes.isEmpty()); - } - { // we try to load an icon from resources QIcon icon(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")); diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index cda887d8e1..c5c2b13b3e 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -1025,17 +1025,17 @@ void tst_QImage::setPixel_data() QTest::newRow("RGB16 blue") << int(QImage::Format_RGB16) << 0xff0000ff << 0x001fu; QTest::newRow("ARGB8565_Premultiplied red") << int(QImage::Format_ARGB8565_Premultiplied) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0xf800ffu; QTest::newRow("ARGB8565_Premultiplied green") << int(QImage::Format_ARGB8565_Premultiplied) - << 0xff00ff00 << 0xff00ff00; + << 0xff00ff00 << 0x07e0ffu; QTest::newRow("ARGB8565_Premultiplied blue") << int(QImage::Format_ARGB8565_Premultiplied) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0x001fffu; QTest::newRow("RGB666 red") << int(QImage::Format_RGB666) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0x03f000u; QTest::newRow("RGB666 green") << int(QImage::Format_RGB666) - << 0xff00ff00 << 0xff00ff00;; + << 0xff00ff00 << 0x000fc0u; QTest::newRow("RGB666 blue") << int(QImage::Format_RGB666) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0x00003fu; QTest::newRow("RGB555 red") << int(QImage::Format_RGB555) << 0xffff0000 << 0x7c00u; QTest::newRow("RGB555 green") << int(QImage::Format_RGB555) @@ -1043,17 +1043,17 @@ void tst_QImage::setPixel_data() QTest::newRow("RGB555 blue") << int(QImage::Format_RGB555) << 0xff0000ff << 0x001fu; QTest::newRow("ARGB8555_Premultiplied red") << int(QImage::Format_ARGB8555_Premultiplied) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0x7c00ffu; QTest::newRow("ARGB8555_Premultiplied green") << int(QImage::Format_ARGB8555_Premultiplied) - << 0xff00ff00 << 0xff00ff00; + << 0xff00ff00 << 0x03e0ffu; QTest::newRow("ARGB8555_Premultiplied blue") << int(QImage::Format_ARGB8555_Premultiplied) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0x001fffu; QTest::newRow("RGB888 red") << int(QImage::Format_RGB888) - << 0xffff0000 << 0xffff0000; + << 0xffff0000 << 0x0000ffu; QTest::newRow("RGB888 green") << int(QImage::Format_RGB888) - << 0xff00ff00 << 0xff00ff00; + << 0xff00ff00 << 0x00ff00u; QTest::newRow("RGB888 blue") << int(QImage::Format_RGB888) - << 0xff0000ff << 0xff0000ff; + << 0xff0000ff << 0xff0000u; } void tst_QImage::setPixel() @@ -1106,37 +1106,12 @@ void tst_QImage::setPixel() break; } case int(QImage::Format_RGB666): - { - for (int y = 0; y < h; ++y) { - const qrgb666 *row = (const qrgb666*)(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - quint32 result = row[x]; - if (result != expected) - printf("[x,y]: %d,%d, expected=%04x, result=%04x\n", - x, y, expected, result); - QCOMPARE(result, expected); - } - } - break; - } case int(QImage::Format_ARGB8565_Premultiplied): - { - for (int y = 0; y < h; ++y) { - const qargb8565 *row = (const qargb8565*)(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - quint32 result = row[x]; - if (result != expected) - printf("[x,y]: %d,%d, expected=%04x, result=%04x\n", - x, y, expected, result); - QCOMPARE(result, expected); - } - } - break; - } case int(QImage::Format_ARGB8555_Premultiplied): + case int(QImage::Format_RGB888): { for (int y = 0; y < h; ++y) { - const qargb8555 *row = (const qargb8555*)(img.scanLine(y)); + const quint24 *row = (const quint24*)(img.scanLine(y)); for (int x = 0; x < w; ++x) { quint32 result = row[x]; if (result != expected) @@ -1147,20 +1122,6 @@ void tst_QImage::setPixel() } break; } - case int(QImage::Format_RGB888): - { - for (int y = 0; y < h; ++y) { - const qrgb888 *row = (const qrgb888*)(img.scanLine(y)); - for (int x = 0; x < w; ++x) { - qrgb888 result = row[x]; - if (result != expected) - printf("[x,y]: %d,%d, expected=%04x, result=%04x\n", - x, y, expected, quint32(result)); - QCOMPARE(uint(result), expected); - } - } - break; - } default: qFatal("Test not implemented for format %d", format); } diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 8a18bee83f..96171740e2 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -623,7 +623,6 @@ void tst_QImageReader::supportsAnimation_data() QTest::newRow("XPM: marble") << QString("marble.xpm") << false; QTest::newRow("PNG: kollada") << QString("kollada.png") << false; QTest::newRow("PPM: teapot") << QString("teapot.ppm") << false; - QTest::newRow("PPM: teapot") << QString("teapot.ppm") << false; QTest::newRow("PPM: runners") << QString("runners.ppm") << false; QTest::newRow("XBM: gnus") << QString("gnus.xbm") << false; diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index 8473597dac..ad9da27c7e 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -52,6 +52,11 @@ #include <QPainter> #include <QSet> +#ifdef Q_OS_UNIX // for geteuid() +# include <sys/types.h> +# include <unistd.h> +#endif + typedef QMap<QString, QString> QStringMap; typedef QList<int> QIntList; Q_DECLARE_METATYPE(QImage) diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro index 15098770c6..91d93a781d 100644 --- a/tests/auto/gui/image/qpixmap/qpixmap.pro +++ b/tests/auto/gui/image/qpixmap/qpixmap.pro @@ -10,3 +10,5 @@ SOURCES += tst_qpixmap.cpp RESOURCES += qpixmap.qrc TESTDATA += convertFromImage/* convertFromToHICON/* loadFromData/* images/* + +win32:CONFIG += insignificant_test # QTBUG-24183 diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 527dcce916..563baef486 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -52,6 +52,7 @@ #include <qsplashscreen.h> #include <qplatformpixmap_qpa.h> +#include <qplatformintegration_qpa.h> #include <private/qguiapplication_p.h> #include <private/qdrawhelper_p.h> @@ -1342,7 +1343,7 @@ void tst_QPixmap::fromImageReader_data() QTest::newRow("designer_indexed8_with_alpha.gif") << prefix + "/designer_indexed8_with_alpha.gif"; QTest::newRow("designer_rgb32.jpg") << prefix + "/designer_rgb32.jpg"; QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_with_alpha_animated.gif"; - QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_no_alpha_animated.gif"; + QTest::newRow("designer_indexed8_no_alpha_animated") << prefix + "/designer_indexed8_no_alpha_animated.gif"; } void tst_QPixmap::fromImageReader() diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro index 1adae128cf..116e9dd1f1 100644 --- a/tests/auto/gui/kernel/kernel.pro +++ b/tests/auto/gui/kernel/kernel.pro @@ -4,6 +4,7 @@ SUBDIRS=\ qdrag \ qevent \ qfileopenevent \ + qguieventdispatcher \ qguimetatype \ qguivariant \ qinputmethod \ diff --git a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro index fffa097d73..777e2c6b1a 100644 --- a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro +++ b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro @@ -2,3 +2,5 @@ CONFIG += testcase TARGET = tst_qguiapplication QT += core gui testlib SOURCES = tst_qguiapplication.cpp + +win32:CONFIG += insignificant_test # QTBUG-24186 diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index 2fd875b7f4..7664706b93 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -53,6 +53,7 @@ private slots: void focusObject(); void allWindows(); void topLevelWindows(); + void abortQuitOnShow(); }; class DummyWindow : public QWindow @@ -77,6 +78,9 @@ public: void tst_QGuiApplication::focusObject() { +#ifdef Q_OS_MAC + QSKIP("This test fails intermittently, and at different locations. See QTBUG-24322"); +#endif int argc = 0; QGuiApplication app(argc, 0); @@ -152,5 +156,44 @@ void tst_QGuiApplication::topLevelWindows() QCOMPARE(app.topLevelWindows().count(), 0); } +class ShowCloseShowWindow : public QWindow +{ + Q_OBJECT +public: + ShowCloseShowWindow(bool showAgain, QWindow *parent = 0) + : QWindow(parent), showAgain(showAgain) + { + QTimer::singleShot(0, this, SLOT(doClose())); + QTimer::singleShot(500, this, SLOT(exitApp())); + } + +private slots: + void doClose() { + close(); + if (showAgain) + show(); + } + + void exitApp() { + qApp->exit(1); + } + +private: + bool showAgain; +}; + +void tst_QGuiApplication::abortQuitOnShow() +{ + int argc = 0; + QGuiApplication app(argc, 0); + QWindow *window1 = new ShowCloseShowWindow(false); + window1->show(); + QCOMPARE(app.exec(), 0); + + QWindow *window2 = new ShowCloseShowWindow(true); + window2->show(); + QCOMPARE(app.exec(), 1); +} + QTEST_APPLESS_MAIN(tst_QGuiApplication) #include "tst_qguiapplication.moc" diff --git a/tests/auto/gui/kernel/qguieventdispatcher/qguieventdispatcher.pro b/tests/auto/gui/kernel/qguieventdispatcher/qguieventdispatcher.pro new file mode 100644 index 0000000000..3057037e74 --- /dev/null +++ b/tests/auto/gui/kernel/qguieventdispatcher/qguieventdispatcher.pro @@ -0,0 +1,4 @@ +CONFIG += testcase +TARGET = tst_qguieventdispatcher +QT = core gui testlib +SOURCES += ../../../corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp diff --git a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro index c6eb02919e..1e0baafd09 100644 --- a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro +++ b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro @@ -7,5 +7,3 @@ QT += core-private gui-private SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc - -mac: CONFIG += insignificant_test # QTBUG-23058 diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index eed7977c82..29588e2ee9 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -576,6 +576,11 @@ void tst_QKeySequence::parseString() QFETCH( QString, strSequence ); QFETCH( QKeySequence, keycode ); +#ifdef Q_OS_MAC + QEXPECT_FAIL("Win+A", "QTBUG-24406 - This test fails on OSX", Abort); + QEXPECT_FAIL("Simon+G", "QTBUG-24406 - This test fails on OSX", Abort); +#endif + QCOMPARE( QKeySequence(strSequence).toString(), keycode.toString() ); QVERIFY( QKeySequence(strSequence) == keycode ); } diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro index 0115d96c56..363f7dd92e 100644 --- a/tests/auto/gui/kernel/qwindow/qwindow.pro +++ b/tests/auto/gui/kernel/qwindow/qwindow.pro @@ -6,3 +6,4 @@ QT += core-private gui-private testlib SOURCES += tst_qwindow.cpp mac: CONFIG += insignificant_test # QTBUG-23059 + diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index d7c153dca1..90c96b4030 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -45,6 +45,9 @@ #include <QEvent> +// For QSignalSpy slot connections. +Q_DECLARE_METATYPE(Qt::ScreenOrientation) + class tst_QWindow: public QObject { Q_OBJECT @@ -57,6 +60,8 @@ private slots: void touchToMouseTranslation(); void mouseToTouchTranslation(); void mouseToTouchLoop(); + void touchCancel(); + void touchCancelWithTouchToMouse(); void orientation(); void close(); void initTestCase() @@ -274,6 +279,7 @@ public: event->ignore(); return; } + touchEventType = event->type(); QList<QTouchEvent::TouchPoint> points = event->touchPoints(); for (int i = 0; i < points.count(); ++i) { switch (points.at(i).state()) { @@ -283,6 +289,9 @@ public: case Qt::TouchPointReleased: ++touchReleasedCount; break; + case Qt::TouchPointMoved: + ++touchMovedCount; + break; default: break; } @@ -292,14 +301,15 @@ public: InputTestWindow() { keyPressCode = keyReleaseCode = 0; mousePressButton = mouseReleaseButton = 0; - touchPressedCount = touchReleasedCount = 0; - ignoreMouse = ignoreTouch = 0; + touchPressedCount = touchReleasedCount = touchMovedCount = 0; + ignoreMouse = ignoreTouch = false; } int keyPressCode, keyReleaseCode; int mousePressButton, mouseReleaseButton, mouseMoveButton; QPointF mousePressScreenPos, mouseMoveScreenPos; - int touchPressedCount, touchReleasedCount; + int touchPressedCount, touchReleasedCount, touchMovedCount; + QEvent::Type touchEventType; bool ignoreMouse, ignoreTouch; }; @@ -480,11 +490,114 @@ void tst_QWindow::mouseToTouchLoop() QCoreApplication::processEvents(); qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, false); - qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false); + qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, true); +} + +void tst_QWindow::touchCancel() +{ + InputTestWindow window; + window.setGeometry(80, 80, 40, 40); + window.show(); + QTest::qWaitForWindowShown(&window); + + QList<QWindowSystemInterface::TouchPoint> points; + QWindowSystemInterface::TouchPoint tp1; + tp1.id = 1; + + // Start a touch. + tp1.state = Qt::TouchPointPressed; + tp1.area = QRect(10, 10, 4, 4); + points << tp1; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchEventType, QEvent::TouchBegin); + QTRY_COMPARE(window.touchPressedCount, 1); + + // Cancel the active touch sequence. + QWindowSystemInterface::handleTouchCancelEvent(&window, touchDevice); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchEventType, QEvent::TouchCancel); + + // Send a move -> will not be delivered due to the cancellation. + QTRY_COMPARE(window.touchMovedCount, 0); + points[0].state = Qt::TouchPointMoved; + tp1.area.adjust(2, 2, 2, 2); + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchMovedCount, 0); + + // Likewise. The only allowed transition is TouchCancel -> TouchBegin. + QTRY_COMPARE(window.touchReleasedCount, 0); + points[0].state = Qt::TouchPointReleased; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchReleasedCount, 0); + + // Start a new sequence -> from this point on everything should go through normally. + points[0].state = Qt::TouchPointPressed; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchEventType, QEvent::TouchBegin); + QTRY_COMPARE(window.touchPressedCount, 2); + + points[0].state = Qt::TouchPointMoved; + tp1.area.adjust(2, 2, 2, 2); + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchMovedCount, 1); + + points[0].state = Qt::TouchPointReleased; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.touchReleasedCount, 1); +} + +void tst_QWindow::touchCancelWithTouchToMouse() +{ + InputTestWindow window; + window.ignoreTouch = true; + window.setGeometry(80, 80, 40, 40); + window.show(); + QTest::qWaitForWindowShown(&window); + + QList<QWindowSystemInterface::TouchPoint> points; + QWindowSystemInterface::TouchPoint tp1; + tp1.id = 1; + + tp1.state = Qt::TouchPointPressed; + tp1.area = QRect(100, 100, 4, 4); + points << tp1; + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.mousePressButton, int(Qt::LeftButton)); + QTRY_COMPARE(window.mousePressScreenPos, points[0].area.center()); + + // Cancel the touch. Should result in a mouse release for windows that have + // have an active touch-to-mouse sequence. + QWindowSystemInterface::handleTouchCancelEvent(0, touchDevice); + QCoreApplication::processEvents(); + + QTRY_COMPARE(window.mouseReleaseButton, int(Qt::LeftButton)); + + // Now change the window to accept touches. + window.mousePressButton = window.mouseReleaseButton = 0; + window.ignoreTouch = false; + + // Send a touch, there will be no mouse event generated. + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.mousePressButton, 0); + + // Cancel the touch. It should not result in a mouse release with this window. + QWindowSystemInterface::handleTouchCancelEvent(0, touchDevice); + QCoreApplication::processEvents(); + QTRY_COMPARE(window.mouseReleaseButton, 0); } void tst_QWindow::orientation() { + qRegisterMetaType<Qt::ScreenOrientation>("Qt::ScreenOrientation"); + QWindow window; window.setGeometry(80, 80, 40, 40); window.create(); diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index 0209043d20..2cbd5b7e1c 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -5,6 +5,7 @@ QT += widgets widgets-private printsupport testlib SOURCES += tst_qpainter.cpp mac*:CONFIG+=insignificant_test +win32:CONFIG += insignificant_test # QTBUG-24188 TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp index bcd009dfb4..44006d4571 100644 --- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp +++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp @@ -282,13 +282,13 @@ void tst_QPainterPath::contains_QPointF_data() inside.addEllipse(base_rect.adjusted(5, 5, -5, -5)); QPolygonF inside_poly = inside.toFillPolygon(); for (int i=0; i<inside_poly.size(); ++i) - QTest::newRow("inside_ellipse") << path << inside_poly.at(i) << true; + QTest::newRow(qPrintable(QString("inside_ellipse %1").arg(i))) << path << inside_poly.at(i) << true; QPainterPath outside; outside.addEllipse(base_rect.adjusted(-5, -5, 5, 5)); QPolygonF outside_poly = outside.toFillPolygon(); for (int i=0; i<outside_poly.size(); ++i) - QTest::newRow("outside_ellipse") << path << outside_poly.at(i) << false; + QTest::newRow(qPrintable(QString("outside_ellipse %1").arg(i))) << path << outside_poly.at(i) << false; path = QPainterPath(); base_rect = QRectF(50, 50, 200, 200); @@ -865,12 +865,12 @@ void tst_QPainterPath::testArcMoveTo_data() for (int domain=0; domain<rects.size(); ++domain) { for (int i=-360; i<=360; ++i) { - QTest::newRow("test") << rects.at(domain) << (qreal) i; + QTest::newRow(qPrintable(QString("test %1 %2").arg(domain).arg(i))) << rects.at(domain) << (qreal) i; } // test low angles - QTest::newRow("test") << rects.at(domain) << (qreal) 1e-10; - QTest::newRow("test") << rects.at(domain) << (qreal)-1e-10; + QTest::newRow("low angles 1") << rects.at(domain) << (qreal) 1e-10; + QTest::newRow("low angles 2") << rects.at(domain) << (qreal)-1e-10; } } diff --git a/tests/auto/gui/painting/qprinter/qprinter.pro b/tests/auto/gui/painting/qprinter/qprinter.pro index ebf8edea32..7543e91f8c 100644 --- a/tests/auto/gui/painting/qprinter/qprinter.pro +++ b/tests/auto/gui/painting/qprinter/qprinter.pro @@ -4,3 +4,4 @@ QT += printsupport widgets testlib SOURCES += tst_qprinter.cpp mac*:CONFIG+=insignificant_test +win32:CONFIG += insignificant_test # QTBUG-24191 diff --git a/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro b/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro index b0e69dca2e..88cb07f338 100644 --- a/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro +++ b/tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro @@ -7,3 +7,4 @@ QT += printsupport network testlib DEFINES += QT_USE_USING_NAMESPACE mac: CONFIG += insignificant_test # QTBUG-23060 +win32:CONFIG += insignificant_test # QTBUG-24190 diff --git a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp index d312469449..2323dc8df3 100644 --- a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp @@ -110,7 +110,7 @@ QString tst_QPrinterInfo::getDefaultPrinterFromSystem() return QString(); } - QRegExp defaultReg("default.*: *([a-zA-Z0-9_]+)"); + QRegExp defaultReg("default.*: *([a-zA-Z0-9_-]+)"); defaultReg.indexIn(output); QString printer = defaultReg.cap(1); macFixNameFormat(&printer); @@ -221,7 +221,8 @@ void tst_QPrinterInfo::testForDefaultPrinter() # else QString defSysPrinter = getDefaultPrinterFromSystem(); # endif - if (defSysPrinter == "") return; + if (defSysPrinter == "") + QSKIP("No default printer available"); QList<QPrinterInfo> list = QPrinterInfo::availablePrinters(); bool found = false; diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index f3c020dde2..d0af96df37 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -9,3 +9,4 @@ QT += gui gui-private core-private testlib SOURCES += tst_qopengl.cpp mac: CONFIG += insignificant_test # QTBUG-23061 +win32:CONFIG += insignificant_test # QTBUG-24192 diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index 7eda35efb8..7e0a60c859 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -344,7 +344,6 @@ void tst_QCssParser::term_data() val.variant = QVariant(QColor("#ffbb00")); QTest::newRow("hexcolor2") << true << "#fb0" << val; - QTest::ignoreMessage(QtWarningMsg, "QCssParser::parseHexColor: Unknown color name '#cafebabe'"); QTest::newRow("hexcolor_failure") << false << "#cafebabe" << val; val.type = QCss::Value::Uri; @@ -368,6 +367,9 @@ void tst_QCssParser::term() QFETCH(QString, css); QFETCH(QCss::Value, expectedValue); + if (strcmp(QTest::currentDataTag(), "hexcolor_failure") == 0) + QTest::ignoreMessage(QtWarningMsg, "QCssParser::parseHexColor: Unknown color name '#cafebabe'"); + QCss::Parser parser(css); QCss::Value val; QVERIFY(parser.testTerm()); diff --git a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro index c853aaa100..034d08fc8f 100644 --- a/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/gui/text/qfontdatabase/qfontdatabase.pro @@ -11,3 +11,4 @@ wince* { } mac: CONFIG += insignificant_test # QTBUG-23062 +win32:CONFIG += insignificant_test # QTBUG-24193 diff --git a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro index a636651724..bb0d8e3c4a 100644 --- a/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro +++ b/tests/auto/gui/text/qfontmetrics/qfontmetrics.pro @@ -4,3 +4,4 @@ QT += testlib SOURCES += tst_qfontmetrics.cpp RESOURCES += testfont.qrc +win32:CONFIG += insignificant_test # QTBUG-24195 diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp index 0b5486dd5a..4dbdf9a4f1 100644 --- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp @@ -140,7 +140,7 @@ void tst_QFontMetrics::metrics() font = fdb.font(family, style, 12); QFontMetrics fontmetrics(font); - QCOMPARE(fontmetrics.ascent() + fontmetrics.descent() + 1, + QCOMPARE(fontmetrics.ascent() + fontmetrics.descent(), fontmetrics.height()); QCOMPARE(fontmetrics.height() + fontmetrics.leading(), @@ -156,7 +156,7 @@ void tst_QFontMetrics::metrics() font = fdb.font(family, style, size); QFontMetrics fontmetrics(font); - QCOMPARE(fontmetrics.ascent() + fontmetrics.descent() + 1, + QCOMPARE(fontmetrics.ascent() + fontmetrics.descent(), fontmetrics.height()); QCOMPARE(fontmetrics.height() + fontmetrics.leading(), fontmetrics.lineSpacing()); diff --git a/tests/auto/gui/text/qglyphrun/qglyphrun.pro b/tests/auto/gui/text/qglyphrun/qglyphrun.pro index acdff0584f..97b9806c11 100644 --- a/tests/auto/gui/text/qglyphrun/qglyphrun.pro +++ b/tests/auto/gui/text/qglyphrun/qglyphrun.pro @@ -10,3 +10,5 @@ wince* { } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } + +win32:CONFIG += insignificant_test # QTBUG-24196 diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro index 149ad6442e..8cac4abc57 100644 --- a/tests/auto/gui/text/qrawfont/qrawfont.pro +++ b/tests/auto/gui/text/qrawfont/qrawfont.pro @@ -9,3 +9,5 @@ SOURCES += \ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src TESTDATA += testfont_bold_italic.ttf testfont.ttf + +win32:CONFIG += insignificant_test # QTBUG-24197 diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index c2ae853a92..213b388895 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -1171,7 +1171,7 @@ void tst_QTextDocument::toHtml_data() fmt.setVerticalAlignment(QTextCharFormat::AlignMiddle); cursor.insertImage(fmt); - QTest::newRow("image-malign") << QTextDocumentFragment(&doc) + QTest::newRow("image-align-middle") << QTextDocumentFragment(&doc) << QString("<p DEFAULTBLOCKSTYLE><img src=\"foo\" style=\"vertical-align: middle;\" /></p>"); } @@ -1183,7 +1183,7 @@ void tst_QTextDocument::toHtml_data() fmt.setVerticalAlignment(QTextCharFormat::AlignTop); cursor.insertImage(fmt); - QTest::newRow("image-malign") << QTextDocumentFragment(&doc) + QTest::newRow("image-align-top") << QTextDocumentFragment(&doc) << QString("<p DEFAULTBLOCKSTYLE><img src=\"foo\" style=\"vertical-align: top;\" /></p>"); } diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 33293400c2..50ae22c530 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -3078,7 +3078,7 @@ void tst_QTextDocumentFragment::html_preNewlineHandling_data() << QString("Foo\nBar"); QTest::newRow("pre2") << QString("Foo<pre>\nBar") << QString("Foo\nBar"); - QTest::newRow("pre2") << QString("Foo<pre>\n\nBar") + QTest::newRow("pre3") << QString("Foo<pre>\n\nBar") << QString("Foo\n\nBar"); QTest::newRow("pre4") << QString("<html>Foo<pre>\nBar") << QString("Foo\nBar"); diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index e7435743e5..8920e63957 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -352,7 +352,7 @@ void tst_QTextLayout::threeLineBoundingRect() QCOMPARE(qRound(line.naturalTextWidth()), thirdLineWidth); y += qRound(line.ascent() + line.descent()); - QCOMPARE(layout.boundingRect(), QRectF(0, 0, longestLine, y + 1)); + QCOMPARE(layout.boundingRect(), QRectF(0, 0, longestLine, y)); } void tst_QTextLayout::boundingRectWithLongLineAndNoWrap() @@ -386,7 +386,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(), pos); QCOMPARE(line.textLength(),2); QCOMPARE(qRound(line.naturalTextWidth()),testFont.pixelSize()); - QCOMPARE((int) line.height(), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE((int) line.height(), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); pos += line.textLength(); @@ -395,7 +395,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(),pos); QCOMPARE(line.textLength(),1); QCOMPARE(qRound(line.naturalTextWidth()), 0); - QCOMPARE((int) line.height(), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE((int) line.height(), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); pos += line.textLength(); @@ -404,7 +404,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(),pos); QCOMPARE(line.textLength(),2); QCOMPARE(qRound(line.naturalTextWidth()),testFont.pixelSize()); - QCOMPARE(qRound(line.height()), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE(qRound(line.height()), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); pos += line.textLength(); @@ -413,7 +413,7 @@ void tst_QTextLayout::forcedBreaks() QCOMPARE(line.textStart(),pos); QCOMPARE(line.textLength(),1); QCOMPARE(qRound(line.naturalTextWidth()), testFont.pixelSize()); - QCOMPARE((int) line.height(), testFont.pixelSize() + 1); // + 1 baseline + QCOMPARE((int) line.height(), testFont.pixelSize()); QCOMPARE(line.xToCursor(0), line.textStart()); } diff --git a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro index 719c34f286..ef47a4b458 100644 --- a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro @@ -4,10 +4,6 @@ QT += network testlib QT -= gui SOURCES += tst_qabstractnetworkcache.cpp -wince* { - testFiles.files = tests - testFiles.path = . - DEPLOYMENT += testFiles -} +TESTDATA += tests/* CONFIG += insignificant_test # QTBUG-20686; note, assumed unstable on all platforms diff --git a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp index 7c27973b56..bcd9cbdff7 100644 --- a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp +++ b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp @@ -165,11 +165,11 @@ void tst_QNetworkCookie::parseSingleCookie_data() QTest::newRow("with-value2") << " a=b" << cookie; QTest::newRow("with-value3") << "a=b " << cookie; QTest::newRow("with-value4") << " a=b " << cookie; - QTest::newRow("with-value4") << " a=b ;" << cookie; - QTest::newRow("with-value5") << "a =b" << cookie; - QTest::newRow("with-value6") << "a= b" << cookie; - QTest::newRow("with-value7") << "a = b" << cookie; - QTest::newRow("with-value8") << "a = b " << cookie; + QTest::newRow("with-value5") << " a=b ;" << cookie; + QTest::newRow("with-value6") << "a =b" << cookie; + QTest::newRow("with-value7") << "a= b" << cookie; + QTest::newRow("with-value8") << "a = b" << cookie; + QTest::newRow("with-value9") << "a = b " << cookie; cookie.setValue("\",\""); QTest::newRow("with-value-with-special1") << "a = \",\" " << cookie; @@ -376,31 +376,31 @@ void tst_QNetworkCookie::parseSingleCookie_data() // extra offsets cookie.setExpirationDate(QDateTime(QDate(1989, 1, 2), QTime(0, 0), Qt::UTC)); - QTest::newRow("zoneoffset-14") << "a=b;expires=Jan 1 89 15:0 JST+1" << cookie; + QTest::newRow("zoneoffset-15") << "a=b;expires=Jan 1 89 15:0 JST+1" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(1, 0), Qt::UTC)); - QTest::newRow("zoneoffset-15") << "a=b;expires=Jan 1 89 0:0 GMT+1" << cookie; + QTest::newRow("zoneoffset-16") << "a=b;expires=Jan 1 89 0:0 GMT+1" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(0, 0), Qt::UTC)); - QTest::newRow("zoneoffset-15b") << "a=b;expires=Jan 1 89 1:0 GMT-1" << cookie; + QTest::newRow("zoneoffset-17") << "a=b;expires=Jan 1 89 1:0 GMT-1" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(1, 0), Qt::UTC)); - QTest::newRow("zoneoffset-16") << "a=b;expires=Jan 1 89 0:0 GMT+01" << cookie; + QTest::newRow("zoneoffset-18") << "a=b;expires=Jan 1 89 0:0 GMT+01" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(1, 5), Qt::UTC)); - QTest::newRow("zoneoffset-17") << "a=b;expires=Jan 1 89 0:0 GMT+0105" << cookie; + QTest::newRow("zoneoffset-19") << "a=b;expires=Jan 1 89 0:0 GMT+0105" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(0, 0), Qt::UTC)); - QTest::newRow("zoneoffset-18") << "a=b;expires=Jan 1 89 0:0 GMT+015" << cookie; + QTest::newRow("zoneoffset-20") << "a=b;expires=Jan 1 89 0:0 GMT+015" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(0, 0), Qt::UTC)); - QTest::newRow("zoneoffset-19") << "a=b;expires=Jan 1 89 0:0 GM" << cookie; + QTest::newRow("zoneoffset-21") << "a=b;expires=Jan 1 89 0:0 GM" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(0, 0), Qt::UTC)); - QTest::newRow("zoneoffset-19b") << "a=b;expires=Jan 1 89 0:0 GMT" << cookie; + QTest::newRow("zoneoffset-22") << "a=b;expires=Jan 1 89 0:0 GMT" << cookie; // offsets from gmt cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(1, 0), Qt::UTC)); - QTest::newRow("zoneoffset-20") << "a=b;expires=Jan 1 89 0:0 +1" << cookie; + QTest::newRow("zoneoffset-23") << "a=b;expires=Jan 1 89 0:0 +1" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(1, 0), Qt::UTC)); - QTest::newRow("zoneoffset-21") << "a=b;expires=Jan 1 89 0:0 +01" << cookie; + QTest::newRow("zoneoffset-24") << "a=b;expires=Jan 1 89 0:0 +01" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(1, 1), Qt::UTC)); - QTest::newRow("zoneoffset-22") << "a=b;expires=Jan 1 89 0:0 +0101" << cookie; + QTest::newRow("zoneoffset-25") << "a=b;expires=Jan 1 89 0:0 +0101" << cookie; cookie.setExpirationDate(QDateTime(QDate(1989, 1, 1), QTime(0, 0), Qt::UTC)); - QTest::newRow("zoneoffset-23") << "a=b;expires=Jan 1 89 1:0 -1" << cookie; + QTest::newRow("zoneoffset-26") << "a=b;expires=Jan 1 89 1:0 -1" << cookie; // Y2k cookie.setExpirationDate(QDateTime(QDate(2000, 1, 1), QTime(0, 0), Qt::UTC)); diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index 73d0a4a650..0e046ad6f9 100644 --- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -284,7 +284,7 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() QTest::newRow("match-2") << allCookies << "http://nokia.com/web/" << result; QTest::newRow("match-3") << allCookies << "http://nokia.com/web/content" << result; QTest::newRow("match-4") << allCookies << "http://qt.nokia.com/web" << result; - QTest::newRow("match-4") << allCookies << "http://qt.nokia.com/web/" << result; + QTest::newRow("match-5") << allCookies << "http://qt.nokia.com/web/" << result; QTest::newRow("match-6") << allCookies << "http://qt.nokia.com/web/content" << result; cookie.setPath("/web/wiki"); @@ -295,7 +295,7 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() QTest::newRow("one-match-2") << allCookies << "http://nokia.com/web/" << result; QTest::newRow("one-match-3") << allCookies << "http://nokia.com/web/content" << result; QTest::newRow("one-match-4") << allCookies << "http://qt.nokia.com/web" << result; - QTest::newRow("one-match-4") << allCookies << "http://qt.nokia.com/web/" << result; + QTest::newRow("one-match-5") << allCookies << "http://qt.nokia.com/web/" << result; QTest::newRow("one-match-6") << allCookies << "http://qt.nokia.com/web/content" << result; result.prepend(cookie); // longer path, it must match first @@ -317,7 +317,7 @@ void tst_QNetworkCookieJar::cookiesForUrl_data() QTest::newRow("exp-match-2") << allCookies << "http://nokia.com/web/" << result; QTest::newRow("exp-match-3") << allCookies << "http://nokia.com/web/content" << result; QTest::newRow("exp-match-4") << allCookies << "http://qt.nokia.com/web" << result; - QTest::newRow("exp-match-4") << allCookies << "http://qt.nokia.com/web/" << result; + QTest::newRow("exp-match-5") << allCookies << "http://qt.nokia.com/web/" << result; QTest::newRow("exp-match-6") << allCookies << "http://qt.nokia.com/web/content" << result; // path matching diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index 533108e76b..8a3c52cf72 100644 --- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -306,7 +306,7 @@ void tst_QNetworkDiskCache::data_data() QNetworkCacheMetaData::RawHeaderList headers; headers.append(QNetworkCacheMetaData::RawHeader("type", "bin")); metaData.setRawHeaders(headers); - QTest::newRow("null") << metaData; + QTest::newRow("non-null") << metaData; } // public QIODevice* data(QUrl const& url) diff --git a/tests/auto/network/access/qnetworkreply/echo/main.cpp b/tests/auto/network/access/qnetworkreply/echo/main.cpp index 8e6811d2ff..90217e4923 100644 --- a/tests/auto/network/access/qnetworkreply/echo/main.cpp +++ b/tests/auto/network/access/qnetworkreply/echo/main.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ - -#include <QtCore> +#include <QtCore/QFile> int main(int argc, char **) { diff --git a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro index 0bcf067c4f..885e7f15b6 100644 --- a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro +++ b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = test !wince*:SUBDIRS += echo +test.depends += $$SUBDIRS +SUBDIRS += test diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro index 1dfd67a1c8..f267b09631 100644 --- a/tests/auto/network/access/qnetworkreply/test/test.pro +++ b/tests/auto/network/access/qnetworkreply/test/test.pro @@ -5,26 +5,13 @@ TARGET = ../tst_qnetworkreply contains(QT_CONFIG,xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102 -win32 { - CONFIG(debug, debug|release) { - TARGET = ../../debug/tst_qnetworkreply -} else { - TARGET = ../../release/tst_qnetworkreply - } -} - -DEFINES += SRCDIR=\\\"$$PWD/..\\\" - QT = core-private network-private testlib RESOURCES += ../qnetworkreply.qrc -wince* { - # For cross compiled targets, reference data files need to be deployed - addFiles.files = ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg - addFiles.path = . - DEPLOYMENT += addFiles +contains(QT_CONFIG,ipv6ifname): DEFINES += HAVE_IPV6 +TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \ + ../index.html ../smb-file.txt - certFiles.files = ../certs - certFiles.path = . - DEPLOYMENT += certFiles -} +win32:CONFIG += insignificant_test # QTBUG-24226 +load(testcase) # for target.path and installTestHelperApp() +installTestHelperApp("../echo/echo",echo,echo) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 959250acb4..279570b547 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -135,6 +135,7 @@ class tst_QNetworkReply: public QObject enum RunSimpleRequestReturn { Timeout = 0, Success, Failure }; int returnCode; QString testFileName; + QString echoProcessDir; #if !defined Q_OS_WIN QString wronlyFileName; #endif @@ -162,6 +163,7 @@ public: QString runCustomRequest(const QNetworkRequest &request, QNetworkReplyPtr &reply, const QByteArray &verb, QIODevice *data); + int waitForFinish(QNetworkReplyPtr &reply); public Q_SLOTS: void finished(); @@ -391,8 +393,13 @@ private Q_SLOTS: void synchronousAuthenticationCache(); void pipelining(); + void closeDuringDownload_data(); + void closeDuringDownload(); + // NOTE: This test must be last! void parentingRepliesToTheApp(); +private: + QString testDataDir; }; bool tst_QNetworkReply::seedCreated = false; @@ -446,9 +453,13 @@ QT_END_NAMESPACE #ifndef QT_NO_OPENSSL static void setupSslServer(QSslSocket* serverSocket) { + QString testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath(); + if (testDataDir.isEmpty()) + testDataDir = QCoreApplication::applicationDirPath(); + serverSocket->setProtocol(QSsl::AnyProtocol); - serverSocket->setLocalCertificate(SRCDIR "/certs/server.pem"); - serverSocket->setPrivateKey(SRCDIR "/certs/server.key"); + serverSocket->setLocalCertificate(testDataDir + "/certs/server.pem"); + serverSocket->setPrivateKey(testDataDir + "/certs/server.key"); } #endif @@ -1231,9 +1242,18 @@ QString tst_QNetworkReply::runSimpleRequest(QNetworkAccessManager::Operation op, connect(reply, SIGNAL(finished()), SLOT(finished())); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(gotError())); + int count = 0; loop = new QEventLoop; - QTimer::singleShot(20000, loop, SLOT(quit())); - code = returnCode == Timeout ? loop->exec() : returnCode; + QSignalSpy spy(reply, SIGNAL(downloadProgress(qint64,qint64))); + while (!reply->isFinished()) { + QTimer::singleShot(20000, loop, SLOT(quit())); + code = loop->exec(); + if (count == spy.count() && !reply->isFinished()) { + code = Timeout; + break; + } + count = spy.count(); + } delete loop; loop = 0; } @@ -1273,6 +1293,31 @@ QString tst_QNetworkReply::runCustomRequest(const QNetworkRequest &request, return QString(); } +int tst_QNetworkReply::waitForFinish(QNetworkReplyPtr &reply) +{ + int code = Success; + int count = 0; + + connect(reply, SIGNAL(finished()), SLOT(finished())); + connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(gotError())); + + loop = new QEventLoop; + QSignalSpy spy(reply, SIGNAL(downloadProgress(qint64,qint64))); + while (!reply->isFinished()) { + QTimer::singleShot(10000, loop, SLOT(quit())); + code = loop->exec(); + if (count == spy.count() && !reply->isFinished()) { + code = Timeout; + break; + } + count = spy.count(); + } + delete loop; + loop = 0; + + return code; +} + void tst_QNetworkReply::finished() { loop->exit(returnCode = Success); @@ -1286,16 +1331,20 @@ void tst_QNetworkReply::gotError() void tst_QNetworkReply::initTestCase() { + testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath(); + if (testDataDir.isEmpty()) + testDataDir = QCoreApplication::applicationDirPath(); + QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); #if !defined Q_OS_WIN - wronlyFileName = QDir::currentPath() + "/write-only"; + wronlyFileName = testDataDir + "/write-only"; QFile wr(wronlyFileName); QVERIFY(wr.open(QIODevice::WriteOnly | QIODevice::Truncate)); wr.setPermissions(QFile::WriteOwner | QFile::WriteUser); wr.close(); #endif - QDir::setSearchPaths("srcdir", QStringList() << SRCDIR); + QDir::setSearchPaths("testdata", QStringList() << testDataDir); #ifndef QT_NO_OPENSSL QSslSocket::defaultCaCertificates(); //preload certificates #endif @@ -1308,6 +1357,10 @@ void tst_QNetworkReply::initTestCase() QVERIFY(networkSession->waitForOpened(30000)); } #endif + + echoProcessDir = QFINDTESTDATA("echo"); + QVERIFY2(!echoProcessDir.isEmpty(), qPrintable( + QString::fromLatin1("Couldn't find echo dir starting from %1.").arg(QDir::currentPath()))); } void tst_QNetworkReply::cleanupTestCase() @@ -1528,10 +1581,10 @@ void tst_QNetworkReply::getFromFileSpecial_data() QTest::addColumn<QString>("url"); QTest::newRow("resource") << ":/resource" << "qrc:/resource"; - QTest::newRow("search-path") << "srcdir:/rfc3252.txt" << "srcdir:/rfc3252.txt"; - QTest::newRow("bigfile-path") << "srcdir:/bigfile" << "srcdir:/bigfile"; + QTest::newRow("search-path") << "testdata:/rfc3252.txt" << "testdata:/rfc3252.txt"; + QTest::newRow("bigfile-path") << "testdata:/bigfile" << "testdata:/bigfile"; #ifdef Q_OS_WIN - QTest::newRow("smb-path") << "srcdir:/smb-file.txt" << "file://" + QtNetworkSettings::winServerName() + "/testshare/test.pri"; + QTest::newRow("smb-path") << "testdata:/smb-file.txt" << "file://" + QtNetworkSettings::winServerName() + "/testshare/test.pri"; #endif } @@ -1561,8 +1614,8 @@ void tst_QNetworkReply::getFromFtp_data() QTest::addColumn<QString>("referenceName"); QTest::addColumn<QString>("url"); - QTest::newRow("rfc3252.txt") << SRCDIR "/rfc3252.txt" << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"; - QTest::newRow("bigfile") << SRCDIR "/bigfile" << "ftp://" + QtNetworkSettings::serverName() + "/qtest/bigfile"; + QTest::newRow("rfc3252.txt") << (testDataDir + "/rfc3252.txt") << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"; + QTest::newRow("bigfile") << (testDataDir + "/bigfile") << "ftp://" + QtNetworkSettings::serverName() + "/qtest/bigfile"; } void tst_QNetworkReply::getFromFtp() @@ -1589,9 +1642,9 @@ void tst_QNetworkReply::getFromHttp_data() QTest::addColumn<QString>("referenceName"); QTest::addColumn<QString>("url"); - QTest::newRow("success-internal") << SRCDIR "/rfc3252.txt" << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"; - QTest::newRow("success-external") << SRCDIR "/rfc3252.txt" << "http://www.ietf.org/rfc/rfc3252.txt"; - QTest::newRow("bigfile-internal") << SRCDIR "/bigfile" << "http://" + QtNetworkSettings::serverName() + "/qtest/bigfile"; + QTest::newRow("success-internal") << (testDataDir + "/rfc3252.txt") << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"; + QTest::newRow("success-external") << (testDataDir + "/rfc3252.txt") << "http://www.ietf.org/rfc/rfc3252.txt"; + QTest::newRow("bigfile-internal") << (testDataDir + "/bigfile") << "http://" + QtNetworkSettings::serverName() + "/qtest/bigfile"; } void tst_QNetworkReply::getFromHttp() @@ -1628,9 +1681,9 @@ void tst_QNetworkReply::headFromHttp_data() QTest::addColumn<QString>("contentType"); QTest::addColumn<QNetworkProxy>("proxy"); - qint64 rfcsize = QFileInfo(SRCDIR "/rfc3252.txt").size(); - qint64 bigfilesize = QFileInfo(SRCDIR "/bigfile").size(); - qint64 indexsize = QFileInfo(SRCDIR "/index.html").size(); + qint64 rfcsize = QFileInfo(testDataDir + "/rfc3252.txt").size(); + qint64 bigfilesize = QFileInfo(testDataDir + "/bigfile").size(); + qint64 indexsize = QFileInfo(testDataDir + "/index.html").size(); //testing proxies, mainly for the 407 response from http proxy for (int i = 0; i < proxies.count(); ++i) { @@ -1689,7 +1742,7 @@ void tst_QNetworkReply::getErrors_data() // empties QTest::newRow("empty-url") << QString() << int(QNetworkReply::ProtocolUnknownError) << 0 << true; - QTest::newRow("empty-scheme-host") << SRCDIR "/rfc3252.txt" << int(QNetworkReply::ProtocolUnknownError) << 0 << true; + QTest::newRow("empty-scheme-host") << (testDataDir + "/rfc3252.txt") << int(QNetworkReply::ProtocolUnknownError) << 0 << true; QTest::newRow("empty-scheme") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QNetworkReply::ProtocolUnknownError) << 0 << true; @@ -1742,6 +1795,14 @@ void tst_QNetworkReply::getErrors() QFETCH(QString, url); QNetworkRequest request(url); +#ifdef Q_OS_UNIX + if ((qstrcmp(QTest::currentDataTag(), "file-is-wronly") == 0) || + (qstrcmp(QTest::currentDataTag(), "file-permissions") == 0)) { + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); + } +#endif + QNetworkReplyPtr reply = manager.get(request); reply->setParent(this); // we have expect-fails @@ -1749,11 +1810,7 @@ void tst_QNetworkReply::getErrors() QCOMPARE(reply->error(), QNetworkReply::NoError); // now run the request: - connect(reply, SIGNAL(finished()), - &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - //qDebug() << reply->errorString(); + QVERIFY(waitForFinish(reply) != Timeout); QFETCH(int, error); QEXPECT_FAIL("ftp-is-dir", "QFtp cannot provide enough detail", Abort); @@ -1859,8 +1916,15 @@ void tst_QNetworkReply::putToFtp() QNetworkReply *r = qnam.get(req); QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + int count = 0; + QSignalSpy spy(r, SIGNAL(downloadProgress(qint64,qint64))); + while (!r->isFinished()) { + QTestEventLoop::instance().enterLoop(10); + if (count == spy.count() && !r->isFinished()) + break; + count = spy.count(); + } + QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QByteArray uploaded = r->readAll(); QCOMPARE(uploaded.size(), data.size()); @@ -2103,7 +2167,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() imagePart11.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage\"")); imagePart11.setRawHeader("Content-Location", "http://my.test.location.tld"); imagePart11.setRawHeader("Content-ID", "my@id.tld"); - QFile *file11 = new QFile(SRCDIR "/image1.jpg"); + QFile *file11 = new QFile(testDataDir + "/image1.jpg"); file11->open(QIODevice::ReadOnly); imagePart11.setBodyDevice(file11); QHttpMultiPart *imageMultiPart1 = new QHttpMultiPart(QHttpMultiPart::FormDataType); @@ -2117,7 +2181,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() imagePart21.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage1\"")); imagePart21.setRawHeader("Content-Location", "http://my.test.location.tld"); imagePart21.setRawHeader("Content-ID", "my@id.tld"); - QFile *file21 = new QFile(SRCDIR "/image1.jpg"); + QFile *file21 = new QFile(testDataDir + "/image1.jpg"); file21->open(QIODevice::ReadOnly); imagePart21.setBodyDevice(file21); QHttpMultiPart *imageMultiPart2 = new QHttpMultiPart(); @@ -2128,7 +2192,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() QHttpPart imagePart22; imagePart22.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); imagePart22.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage2\"")); - QFile *file22 = new QFile(SRCDIR "/image2.jpg"); + QFile *file22 = new QFile(testDataDir + "/image2.jpg"); file22->open(QIODevice::ReadOnly); imagePart22.setBodyDevice(file22); imageMultiPart2->append(imagePart22); @@ -2144,7 +2208,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() imagePart31.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage1\"")); imagePart31.setRawHeader("Content-Location", "http://my.test.location.tld"); imagePart31.setRawHeader("Content-ID", "my@id.tld"); - QFile *file31 = new QFile(SRCDIR "/image1.jpg"); + QFile *file31 = new QFile(testDataDir + "/image1.jpg"); file31->open(QIODevice::ReadOnly); imagePart31.setBodyDevice(file31); QHttpMultiPart *imageMultiPart3 = new QHttpMultiPart(QHttpMultiPart::FormDataType); @@ -2153,7 +2217,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() QHttpPart imagePart32; imagePart32.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); imagePart32.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage2\"")); - QFile *file32 = new QFile(SRCDIR "/image2.jpg"); + QFile *file32 = new QFile(testDataDir + "/image2.jpg"); file32->open(QIODevice::ReadOnly); imagePart32.setBodyDevice(file31); // check that resetting works imagePart32.setBodyDevice(file32); @@ -2162,7 +2226,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() QHttpPart imagePart33; imagePart33.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); imagePart33.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage3\"")); - QFile *file33 = new QFile(SRCDIR "/image3.jpg"); + QFile *file33 = new QFile(testDataDir + "/image3.jpg"); file33->open(QIODevice::ReadOnly); imagePart33.setBodyDevice(file33); imageMultiPart3->append(imagePart33); @@ -2177,7 +2241,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() // QHttpPart imagePart41; // imagePart41.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); -// QFile *file41 = new QFile(SRCDIR "/image1.jpg"); +// QFile *file41 = new QFile(testDataDir + "/image1.jpg"); // file41->open(QIODevice::ReadOnly); // imagePart41.setBodyDevice(file41); // @@ -2211,7 +2275,7 @@ void tst_QNetworkReply::postToHttpMultipart_data() QHttpPart imagePart51; imagePart51.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg")); imagePart51.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"testImage\"")); - QFile *file51 = new QFile(SRCDIR "/image1.jpg"); + QFile *file51 = new QFile(testDataDir + "/image1.jpg"); file51->open(QIODevice::ReadOnly); QByteArray imageData = file51->readAll(); file51->close(); @@ -2418,6 +2482,10 @@ void tst_QNetworkReply::connectToIPv6Address() QFETCH(QByteArray, dataToSend); QFETCH(QByteArray, hostfield); +#if !defined(HAVE_IPV6) && defined(Q_OS_UNIX) + QSKIP("system doesn't support ipv6!"); +#endif + QByteArray httpResponse = QByteArray("HTTP/1.0 200 OK\r\nContent-Length: "); httpResponse += QByteArray::number(dataToSend.size()); httpResponse += "\r\n\r\n"; @@ -2430,9 +2498,7 @@ void tst_QNetworkReply::connectToIPv6Address() QNetworkRequest request(url); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QByteArray content = reply->readAll(); //qDebug() << server.receivedData; QByteArray hostinfo = "\r\nHost: " + hostfield + ":" + QByteArray::number(server.serverPort()) + "\r\n"; @@ -2599,7 +2665,7 @@ void tst_QNetworkReply::ioGetFromFtp_data() QTest::newRow("bigfile") << "bigfile" << Q_INT64_C(519240); - QFile file(SRCDIR "/rfc3252.txt"); + QFile file(testDataDir + "/rfc3252.txt"); QTest::newRow("rfc3252.txt") << "rfc3252.txt" << file.size(); } @@ -2613,9 +2679,7 @@ void tst_QNetworkReply::ioGetFromFtp() QNetworkReplyPtr reply = manager.get(request); DataReader reader(reply); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -2630,7 +2694,7 @@ void tst_QNetworkReply::ioGetFromFtp() void tst_QNetworkReply::ioGetFromFtpWithReuse() { - QString fileName = SRCDIR "/rfc3252.txt"; + QString fileName = testDataDir + "/rfc3252.txt"; QFile reference(fileName); reference.open(QIODevice::ReadOnly); @@ -2643,14 +2707,8 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse() DataReader reader2(reply2); QSignalSpy spy(reply1, SIGNAL(finished())); - connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - if (spy.count() == 0) { - connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - } + QVERIFY(waitForFinish(reply1) == Success); + QVERIFY(waitForFinish(reply2) == Success); QCOMPARE(reply1->url(), request.url()); QCOMPARE(reply2->url(), request.url()); @@ -2669,16 +2727,14 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse() void tst_QNetworkReply::ioGetFromHttp() { - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); QNetworkReplyPtr reply = manager.get(request); DataReader reader(reply); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -2692,7 +2748,7 @@ void tst_QNetworkReply::ioGetFromHttp() void tst_QNetworkReply::ioGetFromHttpWithReuseParallel() { - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); @@ -2702,14 +2758,8 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseParallel() DataReader reader2(reply2); QSignalSpy spy(reply1, SIGNAL(finished())); - connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - if (spy.count() == 0) { - connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - } + QVERIFY(waitForFinish(reply2) == Success); + QVERIFY(waitForFinish(reply1) == Success); QCOMPARE(reply1->url(), request.url()); QCOMPARE(reply2->url(), request.url()); @@ -2730,7 +2780,7 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseParallel() void tst_QNetworkReply::ioGetFromHttpWithReuseSequential() { - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); @@ -2738,9 +2788,7 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseSequential() QNetworkReplyPtr reply = manager.get(request); DataReader reader(reply); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -2758,9 +2806,7 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseSequential() QNetworkReplyPtr reply = manager.get(request); DataReader reader(reply); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -2777,12 +2823,21 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth_data() { QTest::addColumn<QUrl>("url"); QTest::addColumn<QByteArray>("expectedData"); + QTest::addColumn<int>("expectedAuth"); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); reference.open(QIODevice::ReadOnly); QByteArray referenceData = reference.readAll(); - QTest::newRow("basic") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData; - QTest::newRow("digest") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n"); + QTest::newRow("basic") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 1; + QTest::newRow("digest") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 1; + //if url contains username & password, then it should be used + QTest::newRow("basic-in-url") << QUrl("http://httptest:httptest@" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 0; + QTest::newRow("digest-in-url") << QUrl("http://httptest:httptest@" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 0; + // if url contains incorrect credentials, expect QNAM to ask for good ones (even if cached - matches behaviour of browsers) + QTest::newRow("basic-bad-user-in-url") << QUrl("http://baduser:httptest@" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 3; + QTest::newRow("basic-bad-password-in-url") << QUrl("http://httptest:wrong@" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 3; + QTest::newRow("digest-bad-user-in-url") << QUrl("http://baduser:httptest@" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 3; + QTest::newRow("digest-bad-password-in-url") << QUrl("http://httptest:wrong@" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 3; } void tst_QNetworkReply::ioGetFromHttpWithAuth() @@ -2793,6 +2848,7 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth() QFETCH(QUrl, url); QFETCH(QByteArray, expectedData); + QFETCH(int, expectedAuth); QNetworkRequest request(url); { QNetworkReplyPtr reply1 = manager.get(request); @@ -2805,14 +2861,9 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth() connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - if (finishedspy.count() == 0) { - connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - } + QVERIFY(waitForFinish(reply2) == Success); + QVERIFY(waitForFinish(reply1) == Success); + manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); @@ -2821,7 +2872,8 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth() QCOMPARE(reader1.data, expectedData); QCOMPARE(reader2.data, expectedData); - QCOMPARE(authspy.count(), 1); + QCOMPARE(authspy.count(), (expectedAuth ? 1 : 0)); + expectedAuth = qMax(0, expectedAuth - 1); } // rinse and repeat: @@ -2832,16 +2884,17 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth() QSignalSpy authspy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*))); connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); + manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); QCOMPARE(reader.data, expectedData); - QCOMPARE(authspy.count(), 0); + QCOMPARE(authspy.count(), (expectedAuth ? 1 : 0)); + expectedAuth = qMax(0, expectedAuth - 1); } // now check with synchronous calls: @@ -2853,14 +2906,45 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth() QSignalSpy authspy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*))); QNetworkReplyPtr replySync = manager.get(request); QVERIFY(replySync->isFinished()); // synchronous - QCOMPARE(authspy.count(), 0); + if (expectedAuth) { + // bad credentials in a synchronous request should just fail + QCOMPARE(replySync->error(), QNetworkReply::AuthenticationRequiredError); + } else { + QCOMPARE(authspy.count(), 0); - // we cannot use a data reader here, since that connects to the readyRead signal, - // just use readAll() + // we cannot use a data reader here, since that connects to the readyRead signal, + // just use readAll() - // the only thing we check here is that the auth cache was used when using synchronous requests - QCOMPARE(replySync->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); - QCOMPARE(replySync->readAll(), expectedData); + // the only thing we check here is that the auth cache was used when using synchronous requests + QCOMPARE(replySync->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); + QCOMPARE(replySync->readAll(), expectedData); + } + } + + // check that credentials are used from cache if the same url is requested without credentials + { + url.setUserInfo(QString()); + request.setUrl(url); + request.setAttribute( + QNetworkRequest::SynchronousRequestAttribute, + true); + + QSignalSpy authspy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*))); + QNetworkReplyPtr replySync = manager.get(request); + QVERIFY(replySync->isFinished()); // synchronous + if (expectedAuth) { + // bad credentials in a synchronous request should just fail + QCOMPARE(replySync->error(), QNetworkReply::AuthenticationRequiredError); + } else { + QCOMPARE(authspy.count(), 0); + + // we cannot use a data reader here, since that connects to the readyRead signal, + // just use readAll() + + // the only thing we check here is that the auth cache was used when using synchronous requests + QCOMPARE(replySync->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); + QCOMPARE(replySync->readAll(), expectedData); + } } } @@ -2890,7 +2974,7 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth() // This test sends three requests // The first two in parallel // The third after the first two finished - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129); @@ -2909,14 +2993,9 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth() connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - if (finishedspy.count() == 0) { - connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); - } + QVERIFY(waitForFinish(reply2) == Success); + QVERIFY(waitForFinish(reply1) == Success); + manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); @@ -2940,9 +3019,9 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth() QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); + manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); @@ -3002,7 +3081,7 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy() qRegisterMetaType<QNetworkProxy>(); // for QSignalSpy qRegisterMetaType<QAuthenticator *>(); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080); @@ -3016,9 +3095,9 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy() QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); + manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); @@ -3039,9 +3118,9 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy() QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Failure); + manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); @@ -3062,7 +3141,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslErrors() qRegisterMetaType<QNetworkReply*>(); // for QSignalSpy qRegisterMetaType<QList<QSslError> >(); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); @@ -3074,9 +3153,8 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslErrors() SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); connect(reply, SIGNAL(metaDataChanged()), SLOT(storeSslConfiguration())); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); + manager.disconnect(SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); @@ -3097,7 +3175,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithIgnoreSslErrors() qRegisterMetaType<QNetworkReply*>(); // for QSignalSpy qRegisterMetaType<QList<QSslError> >(); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); @@ -3108,9 +3186,8 @@ void tst_QNetworkReply::ioGetFromHttpsWithIgnoreSslErrors() QSignalSpy sslspy(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>))); connect(reply, SIGNAL(metaDataChanged()), SLOT(storeSslConfiguration())); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); QCOMPARE(reader.data, reference.readAll()); @@ -3126,7 +3203,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslHandshakeError() qRegisterMetaType<QNetworkReply*>(); // for QSignalSpy qRegisterMetaType<QList<QSslError> >(); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + ":80")); @@ -3137,9 +3214,8 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslHandshakeError() QSignalSpy sslspy(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>))); connect(reply, SIGNAL(metaDataChanged()), SLOT(storeSslConfiguration())); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Failure); QCOMPARE(reply->error(), QNetworkReply::SslHandshakeFailedError); QCOMPARE(sslspy.count(), 0); @@ -3197,10 +3273,7 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer() QNetworkReplyPtr reply = manager.get(request); QSignalSpy spy(reply, SIGNAL(error(QNetworkReply::NetworkError))); - - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Failure); QCOMPARE(reply->url(), request.url()); QCOMPARE(spy.count(), 1); @@ -3230,9 +3303,7 @@ void tst_QNetworkReply::ioGetFromHttpStatus100() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3255,9 +3326,7 @@ void tst_QNetworkReply::ioGetFromHttpNoHeaders() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3426,9 +3495,7 @@ void tst_QNetworkReply::ioGetFromHttpWithCache() QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) != Timeout); QTEST(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), "loadedFromCache"); QTEST(server.totalConnections > 0, "networkUsed"); @@ -3641,7 +3708,7 @@ void tst_QNetworkReply::ioGetWithManyProxies() qRegisterMetaType<QNetworkProxy>(); // for QSignalSpy qRegisterMetaType<QAuthenticator *>(); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); // set the proxy factory: @@ -3659,13 +3726,12 @@ void tst_QNetworkReply::ioGetWithManyProxies() QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); #ifndef QT_NO_OPENSSL connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); #endif - QTestEventLoop::instance().enterLoop(15); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) != Timeout); manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); @@ -3706,10 +3772,10 @@ void tst_QNetworkReply::ioPutToFileFromFile_data() { QTest::addColumn<QString>("fileName"); - QTest::newRow("empty") << SRCDIR "/empty"; - QTest::newRow("real-file") << SRCDIR "/rfc3252.txt"; + QTest::newRow("empty") << (testDataDir + "/empty"); + QTest::newRow("real-file") << (testDataDir + "/rfc3252.txt"); QTest::newRow("resource") << ":/resource"; - QTest::newRow("search-path") << "srcdir:/rfc3252.txt"; + QTest::newRow("search-path") << "testdata:/rfc3252.txt"; } void tst_QNetworkReply::ioPutToFileFromFile() @@ -3724,9 +3790,7 @@ void tst_QNetworkReply::ioPutToFileFromFile() QNetworkRequest request(url); QNetworkReplyPtr reply = manager.put(request, &sourceFile); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3762,10 +3826,8 @@ void tst_QNetworkReply::ioPutToFileFromSocket() QNetworkReplyPtr reply = manager.put(QNetworkRequest(url), socketpair.endPoints[1]); socketpair.endPoints[0]->close(); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->error(), QNetworkReply::NoError); - QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3808,10 +3870,8 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket() QNetworkReplyPtr reply = manager.put(QNetworkRequest(url), passive); passive->setParent(reply); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->error(), QNetworkReply::NoError); - QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3849,15 +3909,16 @@ void tst_QNetworkReply::ioPutToFileFromProcess() QFETCH(QByteArray, data); QProcess process; - process.start("echo/echo all"); + QString echoExe = echoProcessDir + "/echo"; + process.start(echoExe, QStringList("all")); + QVERIFY2(process.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(echoExe, process.errorString()))); process.write(data); process.closeWriteChannel(); QNetworkReplyPtr reply = manager.put(QNetworkRequest(url), &process); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3891,9 +3952,7 @@ void tst_QNetworkReply::ioPutToFtpFromFile() QNetworkRequest request(url); QNetworkReplyPtr reply = manager.put(request, &sourceFile); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3911,7 +3970,7 @@ void tst_QNetworkReply::ioPutToFtpFromFile() QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(3); - QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QByteArray uploaded = r->readAll(); QCOMPARE(qint64(uploaded.size()), sourceFile.size()); @@ -3942,9 +4001,7 @@ void tst_QNetworkReply::ioPutToHttpFromFile() QNetworkRequest request(url); QNetworkReplyPtr reply = manager.put(request, &sourceFile); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3958,9 +4015,8 @@ void tst_QNetworkReply::ioPutToHttpFromFile() // download the file again from HTTP to make sure it was uploaded // correctly reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -3986,9 +4042,7 @@ void tst_QNetworkReply::ioPostToHttpFromFile() QNetworkReplyPtr reply = manager.post(request, &sourceFile); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -4066,7 +4120,6 @@ void tst_QNetworkReply::ioPostToHttpFromSocket() QNetworkReplyPtr reply = manager.post(request, socketpair.endPoints[1]); socketpair.endPoints[0]->close(); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), @@ -4075,13 +4128,13 @@ void tst_QNetworkReply::ioPostToHttpFromSocket() QSignalSpy authenticationRequiredSpy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*))); QSignalSpy proxyAuthenticationRequiredSpy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - QTestEventLoop::instance().enterLoop(12); + QVERIFY(waitForFinish(reply) == Success); + disconnect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); QCOMPARE(reply->error(), QNetworkReply::NoError); - QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), url); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -4159,7 +4212,7 @@ void tst_QNetworkReply::ioPostToHttpFromSocketSynchronous() // worked. void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileToEnd() { - QFile sourceFile(SRCDIR "/rfc3252.txt"); + QFile sourceFile(testDataDir + "/rfc3252.txt"); QVERIFY(sourceFile.open(QIODevice::ReadOnly)); // seeking to the middle sourceFile.seek(sourceFile.size() / 2); @@ -4169,14 +4222,13 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileToEnd() request.setRawHeader("Content-Type", "application/octet-stream"); QNetworkReplyPtr reply = manager.post(request, &sourceFile); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QTestEventLoop::instance().enterLoop(2); + QVERIFY(waitForFinish(reply) == Success); + disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QVERIFY(!QTestEventLoop::instance().timeout()); // compare half data sourceFile.seek(sourceFile.size() / 2); @@ -4186,7 +4238,7 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileToEnd() void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileFiveBytes() { - QFile sourceFile(SRCDIR "/rfc3252.txt"); + QFile sourceFile(testDataDir + "/rfc3252.txt"); QVERIFY(sourceFile.open(QIODevice::ReadOnly)); // seeking to the middle sourceFile.seek(sourceFile.size() / 2); @@ -4199,14 +4251,13 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileFiveBytes() QVERIFY(request.header(QNetworkRequest::ContentLengthHeader).isValid()); QNetworkReplyPtr reply = manager.post(request, &sourceFile); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QTestEventLoop::instance().enterLoop(2); + QVERIFY(waitForFinish(reply) == Success); + disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QVERIFY(!QTestEventLoop::instance().timeout()); // compare half data sourceFile.seek(sourceFile.size() / 2); @@ -4228,14 +4279,13 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfQBufferFiveBytes() request.setRawHeader("Content-Type", "application/octet-stream"); QNetworkReplyPtr reply = manager.post(request, &uploadBuffer); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QTestEventLoop::instance().enterLoop(2); + QVERIFY(waitForFinish(reply) == Success); + disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QVERIFY(!QTestEventLoop::instance().timeout()); // compare half data uploadBuffer.seek(5); @@ -4262,11 +4312,11 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag() QNetworkReplyPtr reply = manager.post(request, socketpair.endPoints[1]); socketpair.endPoints[0]->close(); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); - QTestEventLoop::instance().enterLoop(2); + QVERIFY(waitForFinish(reply) == Failure); + disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*))); @@ -4284,12 +4334,16 @@ public: serverSocket->setParent(this); if (serverSocket->setSocketDescriptor(socketDescriptor)) { + QString testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath(); + if (testDataDir.isEmpty()) + testDataDir = QCoreApplication::applicationDirPath(); + connect(serverSocket, SIGNAL(encrypted()), this, SLOT(encryptedSlot())); connect(serverSocket, SIGNAL(readyRead()), this, SLOT(readyReadSlot())); serverSocket->setProtocol(QSsl::AnyProtocol); connect(serverSocket, SIGNAL(sslErrors(const QList<QSslError>&)), serverSocket, SLOT(ignoreSslErrors())); - serverSocket->setLocalCertificate(SRCDIR "/certs/server.pem"); - serverSocket->setPrivateKey(SRCDIR "/certs/server.key"); + serverSocket->setLocalCertificate(testDataDir + "/certs/server.pem"); + serverSocket->setPrivateKey(testDataDir + "/certs/server.key"); serverSocket->startServerEncryption(); } else { delete serverSocket; @@ -4314,7 +4368,7 @@ public: // very similar to ioPostToHttpUploadProgress but for SSL void tst_QNetworkReply::ioPostToHttpsUploadProgress() { - //QFile sourceFile(SRCDIR "/bigfile"); + //QFile sourceFile(testDataDir + "/bigfile"); //QVERIFY(sourceFile.open(QIODevice::ReadOnly)); qint64 wantedSize = 2*1024*1024; // 2 MB QByteArray sourceFile; @@ -4366,13 +4420,11 @@ void tst_QNetworkReply::ioPostToHttpsUploadProgress() QCOMPARE(args3.at(0).toLongLong(), qint64(sourceFile.size())); // after sending this, the QNAM should emit finished() - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); incomingSocket->write("HTTP/1.0 200 OK\r\n"); incomingSocket->write("Content-Length: 0\r\n"); incomingSocket->write("\r\n"); - QTestEventLoop::instance().enterLoop(10); - // not timeouted -> finished() was emitted - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); incomingSocket->close(); server.close(); @@ -4429,10 +4481,11 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp() const int rate = 200; // in kB per sec RateControlledReader reader(server, reply, rate, bufferSize); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QTime loopTime; loopTime.start(); - QTestEventLoop::instance().enterLoop(30); + + QVERIFY(waitForFinish(reply) == Success); + const int elapsedTime = loopTime.elapsed(); server.wait(); reader.wrapUp(); @@ -4441,8 +4494,6 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp() qDebug() << "receive rate:" << reader.totalBytesRead * 1000 / elapsedTime << "(it received" << reader.totalBytesRead << "bytes in" << elapsedTime << "ms)"; - QVERIFY(!QTestEventLoop::instance().timeout()); - QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); @@ -4472,7 +4523,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp() void tst_QNetworkReply::ioPostToHttpUploadProgress() { - QFile sourceFile(SRCDIR "/bigfile"); + QFile sourceFile(testDataDir + "/bigfile"); QVERIFY(sourceFile.open(QIODevice::ReadOnly)); // emulate a minimal http server @@ -4577,16 +4628,15 @@ void tst_QNetworkReply::ioPostToHttpEmptyUploadProgress() void tst_QNetworkReply::lastModifiedHeaderForFile() { - QFileInfo fileInfo(SRCDIR "/bigfile"); + QFileInfo fileInfo(testDataDir + "/bigfile"); QVERIFY(fileInfo.exists()); QUrl url = QUrl::fromLocalFile(fileInfo.filePath()); QNetworkRequest request(url); QNetworkReplyPtr reply = manager.head(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); QDateTime header = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime(); QCOMPARE(header, fileInfo.lastModified()); @@ -4599,9 +4649,8 @@ void tst_QNetworkReply::lastModifiedHeaderForHttp() QNetworkRequest request(url); QNetworkReplyPtr reply = manager.head(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply) == Success); QDateTime header = reply->header(QNetworkRequest::LastModifiedHeader).toDateTime(); QDateTime realDate = QDateTime::fromString("2007-05-22T12:04:57", Qt::ISODate); @@ -4615,9 +4664,8 @@ void tst_QNetworkReply::httpCanReadLine() QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); + QCOMPARE(reply->error(), QNetworkReply::NoError); QVERIFY(reply->canReadLine()); @@ -4645,13 +4693,16 @@ void tst_QNetworkReply::rateControl() // faster than the data is being consumed. QFETCH(int, rate); +#if !defined(QT_BUILD_INTERNAL) + QSKIP("backend for testing not available!"); +#endif + // ask for 20 seconds worth of data FastSender sender(20 * rate * 1024); QNetworkRequest request("debugpipe://localhost:" + QString::number(sender.serverPort())); QNetworkReplyPtr reply = manager.get(request); reply->setReadBufferSize(32768); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError"); QSignalSpy errorSpy(reply, SIGNAL(error(QNetworkReply::NetworkError))); @@ -4660,7 +4711,9 @@ void tst_QNetworkReply::rateControl() // this test is designed to run for 25 seconds at most QTime loopTime; loopTime.start(); - QTestEventLoop::instance().enterLoop(40); + + QVERIFY(waitForFinish(reply) == Success); + int elapsedTime = loopTime.elapsed(); if (!errorSpy.isEmpty()) { @@ -4672,7 +4725,6 @@ void tst_QNetworkReply::rateControl() << "(it received" << reader.totalBytesRead << "bytes in" << elapsedTime << "ms)"; sender.wait(); - QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), request.url()); QCOMPARE(reply->error(), QNetworkReply::NoError); @@ -4695,6 +4747,9 @@ void tst_QNetworkReply::downloadProgress_data() void tst_QNetworkReply::downloadProgress() { +#if !defined(QT_BUILD_INTERNAL) + QSKIP("backend for testing not available!"); +#endif QTcpServer server; QVERIFY(server.listen()); @@ -4758,6 +4813,9 @@ void tst_QNetworkReply::uploadProgress_data() void tst_QNetworkReply::uploadProgress() { QFETCH(QByteArray, data); +#if !defined(QT_BUILD_INTERNAL) + QSKIP("backend for testing not available!"); +#endif QTcpServer server; QVERIFY(server.listen()); @@ -4776,9 +4834,7 @@ void tst_QNetworkReply::uploadProgress() QTcpSocket *receiver = server.nextPendingConnection(); if (finished.count() == 0) { // it's not finished yet, so wait for it to be - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(2); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); } delete receiver; @@ -4814,9 +4870,7 @@ void tst_QNetworkReply::chaining() request.setUrl(url); QNetworkReplyPtr putReply = manager.put(request, getReply); - connect(putReply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(putReply) == Success); QCOMPARE(getReply->url(), QUrl::fromLocalFile(sourceFile.fileName())); QCOMPARE(getReply->error(), QNetworkReply::NoError); @@ -5097,11 +5151,7 @@ void tst_QNetworkReply::httpProxyCommands() //manager.setProxy(QNetworkProxy()); // wait for the finished signal - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - - QTestEventLoop::instance().enterLoop(15); - - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) != Timeout); //qDebug() << reply->error() << reply->errorString(); //qDebug() << proxyServer.receivedData; @@ -5234,9 +5284,8 @@ void tst_QNetworkReply::proxyChange() manager.setProxy(dummyProxy); QNetworkReplyPtr reply3 = manager.get(req); - connect(reply3, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(5); - QVERIFY(!QTestEventLoop::instance().timeout()); + + QVERIFY(waitForFinish(reply3) == Failure); QVERIFY(int(reply3->error()) > 0); } @@ -5272,10 +5321,7 @@ void tst_QNetworkReply::authorizationError() QSignalSpy errorSpy(reply, SIGNAL(error(QNetworkReply::NetworkError))); QSignalSpy finishedSpy(reply, SIGNAL(finished())); // now run the request: - connect(reply, SIGNAL(finished()), - &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Failure); QFETCH(int, errorSignalCount); QCOMPARE(errorSpy.count(), errorSignalCount); @@ -5501,8 +5547,7 @@ void tst_QNetworkReply::ignoreSslErrorsList_data() QTest::addColumn<QNetworkReply::NetworkError>("expectedNetworkError"); QList<QSslError> expectedSslErrors; - // apparently, because of some weird behaviour of SRCDIR, the file name below needs to start with a slash - QList<QSslCertificate> certs = QSslCertificate::fromPath(QLatin1String(SRCDIR "/certs/qt-test-server-cacert.pem")); + QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem"); QSslError rightError(QSslError::SelfSignedCertificate, certs.at(0)); QSslError wrongError(QSslError::SelfSignedCertificate); @@ -5526,9 +5571,7 @@ void tst_QNetworkReply::ignoreSslErrorsList() QFETCH(QList<QSslError>, expectedSslErrors); reply->ignoreSslErrors(expectedSslErrors); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) != Timeout); QFETCH(QNetworkReply::NetworkError, expectedNetworkError); QCOMPARE(reply->error(), expectedNetworkError); @@ -5559,9 +5602,7 @@ void tst_QNetworkReply::ignoreSslErrorsListWithSlot() this, SLOT(ignoreSslErrorListSlot(QNetworkReply *, const QList<QSslError> &))); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) != Timeout); QFETCH(QNetworkReply::NetworkError, expectedNetworkError); QCOMPARE(reply->error(), expectedNetworkError); @@ -5575,7 +5616,7 @@ void tst_QNetworkReply::sslConfiguration_data() QTest::newRow("empty") << QSslConfiguration() << false; QSslConfiguration conf = QSslConfiguration::defaultConfiguration(); QTest::newRow("default") << conf << false; // does not contain test server cert - QList<QSslCertificate> testServerCert = QSslCertificate::fromPath(SRCDIR "/certs/qt-test-server-cacert.pem"); + QList<QSslCertificate> testServerCert = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem"); conf.setCaCertificates(testServerCert); QTest::newRow("set-root-cert") << conf << true; conf.setProtocol(QSsl::SecureProtocols); @@ -5589,9 +5630,7 @@ void tst_QNetworkReply::sslConfiguration() request.setSslConfiguration(configuration); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) != Timeout); QFETCH(bool, works); QNetworkReply::NetworkError expectedError = works ? QNetworkReply::NoError : QNetworkReply::SslHandshakeFailedError; @@ -5675,12 +5714,11 @@ void tst_QNetworkReply::getFromHttpIntoBuffer() QNetworkAccessManager manager; QNetworkReply *reply = manager.get(request); connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(reply->isFinished()); - QFile reference(SRCDIR "/rfc3252.txt"); + QFile reference(testDataDir + "/rfc3252.txt"); QVERIFY(reference.open(QIODevice::ReadOnly)); QCOMPARE(reference.bytesAvailable(), reply->bytesAvailable()); @@ -5850,7 +5888,7 @@ void tst_QNetworkReply::getFromHttpIntoBuffer2() QFETCH(bool, useDownloadBuffer); // On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results. -#if defined(Q_WS_WINCE_WM) +#if defined(Q_OS_WINCE_WM) // Show some mercy to non-desktop platform/s enum {UploadSize = 4*1024*1024}; // 4 MB #else @@ -5886,9 +5924,7 @@ void tst_QNetworkReply::getFromHttpIntoBufferCanReadLine() request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 1024*1024*128); // 128 MB is max allowed QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->error(), QNetworkReply::NoError); QVERIFY(reply->canReadLine()); @@ -5912,9 +5948,7 @@ void tst_QNetworkReply::ioGetFromHttpWithoutContentLength() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->url(), request.url()); QVERIFY(reply->isFinished()); @@ -5962,9 +5996,7 @@ void tst_QNetworkReply::qtbug12908compressedHttpReply() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->size(), qint64(16384)); @@ -5987,9 +6019,7 @@ void tst_QNetworkReply::compressedHttpReplyBrokenGzip() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Failure); QCOMPARE(reply->error(), QNetworkReply::ProtocolFailure); } @@ -6002,9 +6032,7 @@ void tst_QNetworkReply::getFromUnreachableIp() QNetworkRequest request(QUrl("http://255.255.255.255/42/23/narf/narf/narf")); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Failure); QVERIFY(reply->error() != QNetworkReply::NoError); } @@ -6337,9 +6365,8 @@ void tst_QNetworkReply::qtbug15311doubleContentLength() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); + QVERIFY(reply->isFinished()); QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->size(), qint64(3)); @@ -6357,9 +6384,8 @@ void tst_QNetworkReply::qtbug18232gzipContentLengthZero() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); + QVERIFY(reply->isFinished()); QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->size(), qint64(0)); @@ -6379,9 +6405,8 @@ void tst_QNetworkReply::qtbug22660gzipNoContentLengthEmptyContent() QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); + QVERIFY(reply->isFinished()); QCOMPARE(reply->error(), QNetworkReply::NoError); QCOMPARE(reply->size(), qint64(0)); @@ -6400,13 +6425,13 @@ void tst_QNetworkReply::synchronousRequest_data() QTest::newRow("http") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") - << QString("file:" SRCDIR "/rfc3252.txt") + << QString("file:" + testDataDir + "/rfc3252.txt") << true << QString("text/plain"); QTest::newRow("http-gzip") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/deflate/rfc3252.txt") - << QString("file:" SRCDIR "/rfc3252.txt") + << QString("file:" + testDataDir + "/rfc3252.txt") << false // don't check content length, because it's gzip encoded // ### we would need to enflate (un-deflate) the file content and compare the sizes << QString("text/plain"); @@ -6414,7 +6439,7 @@ void tst_QNetworkReply::synchronousRequest_data() #ifndef QT_NO_OPENSSL QTest::newRow("https") << QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") - << QString("file:" SRCDIR "/rfc3252.txt") + << QString("file:" + testDataDir + "/rfc3252.txt") << true << QString("text/plain"); #endif @@ -6426,8 +6451,8 @@ void tst_QNetworkReply::synchronousRequest_data() << QString("text/plain"); QTest::newRow("simple-file") - << QUrl::fromLocalFile(SRCDIR "/rfc3252.txt") - << QString("file:" SRCDIR "/rfc3252.txt") + << QUrl::fromLocalFile(testDataDir + "/rfc3252.txt") + << QString("file:" + testDataDir + "/rfc3252.txt") << true << QString(); } @@ -6449,7 +6474,7 @@ void tst_QNetworkReply::synchronousRequest() // QNetworkRequest, see http://bugreports.qt.nokia.com/browse/QTBUG-14774 if (url.scheme() == "https") { QSslConfiguration sslConf; - QList<QSslCertificate> certs = QSslCertificate::fromPath(SRCDIR "/certs/qt-test-server-cacert.pem"); + QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem"); sslConf.setCaCertificates(certs); request.setSslConfiguration(sslConf); } @@ -6559,8 +6584,9 @@ void tst_QNetworkReply::httpAbort() // Abort after the finished() QNetworkRequest request3("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"); QNetworkReplyPtr reply3 = manager.get(request3); - connect(reply3, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); + + QVERIFY(waitForFinish(reply3) == Success); + QVERIFY(reply3->isFinished()); reply3->abort(); QCOMPARE(reply3->error(), QNetworkReply::NoError); @@ -6590,9 +6616,7 @@ void tst_QNetworkReply::dontInsertPartialContentIntoTheCache() QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); QVERIFY(server.totalConnections > 0); QCOMPARE(reply->readAll().constData(), "load"); @@ -6609,9 +6633,8 @@ void tst_QNetworkReply::httpUserAgent() request.setHeader(QNetworkRequest::UserAgentHeader, "abcDEFghi"); QNetworkReplyPtr reply = manager.get(request); - connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(waitForFinish(reply) == Success); + QVERIFY(reply->isFinished()); QCOMPARE(reply->error(), QNetworkReply::NoError); QVERIFY(server.receivedData.contains("\r\nUser-Agent: abcDEFghi\r\n")); @@ -6728,6 +6751,27 @@ void tst_QNetworkReply::pipeliningHelperSlot() { } } +void tst_QNetworkReply::closeDuringDownload_data() +{ + QTest::addColumn<QUrl>("url"); + QTest::newRow("http") << QUrl("http://" + QtNetworkSettings::serverName() + "/bigfile"); + QTest::newRow("ftp") << QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/bigfile"); +} + +void tst_QNetworkReply::closeDuringDownload() +{ + QFETCH(QUrl, url); + QNetworkRequest request(url); + QNetworkReply* reply = manager.get(request); + connect(reply, SIGNAL(readyRead()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + reply->close(); + reply->deleteLater(); + QTest::qWait(1000); //cancelling ftp takes some time, this avoids a warning caused by test's cleanup() destroying the connection cache before the abort is finished +} + // NOTE: This test must be last testcase in tst_qnetworkreply! void tst_QNetworkReply::parentingRepliesToTheApp() { diff --git a/tests/auto/network/bearer/qnetworksession/qnetworksession.pro b/tests/auto/network/bearer/qnetworksession/qnetworksession.pro index a85925bc17..f1cb47d14e 100644 --- a/tests/auto/network/bearer/qnetworksession/qnetworksession.pro +++ b/tests/auto/network/bearer/qnetworksession/qnetworksession.pro @@ -1,2 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = lackey test +SUBDIRS = lackey +test.depends = $$SUBDIRS +SUBDIRS += test diff --git a/tests/auto/network/bearer/qnetworksession/test/test.pro b/tests/auto/network/bearer/qnetworksession/test/test.pro index 5567e35b02..2f1a9ba6ea 100644 --- a/tests/auto/network/bearer/qnetworksession/test/test.pro +++ b/tests/auto/network/bearer/qnetworksession/test/test.pro @@ -14,3 +14,6 @@ CONFIG(debug_and_release) { } else { DESTDIR = .. } + +load(testcase) # for target.path and installTestHelperApp() +installTestHelperApp("../lackey/lackey",lackey,lackey) diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp index a51b4e5632..27e1e7f013 100644 --- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp +++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp @@ -96,6 +96,7 @@ private slots: private: QNetworkConfigurationManager manager; int inProcessSessionManagementCount; + QString lackeyDir; #endif }; @@ -117,6 +118,10 @@ void tst_QNetworkSession::initTestCase() QSignalSpy spy(&manager, SIGNAL(updateCompleted())); manager.updateConfigurations(); QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); + + lackeyDir = QFINDTESTDATA("lackey"); + QVERIFY2(!lackeyDir.isEmpty(), qPrintable( + QString::fromLatin1("Couldn't find lackey dir starting from %1.").arg(QDir::currentPath()))); } void tst_QNetworkSession::cleanupTestCase() @@ -916,10 +921,10 @@ void tst_QNetworkSession::outOfProcessSession() oopServer.listen("tst_qnetworksession"); QProcess lackey; - lackey.start("lackey/lackey"); - qDebug() << lackey.error() << lackey.errorString(); - QVERIFY(lackey.waitForStarted()); - + QString lackeyExe = lackeyDir + "/lackey"; + lackey.start(lackeyExe); + QVERIFY2(lackey.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(lackeyExe, lackey.errorString()))); QVERIFY(oopServer.waitForNewConnection(-1)); QLocalSocket *oopSocket = oopServer.nextPendingConnection(); diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp index 9b8391d6be..43b1f225c4 100644 --- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -294,7 +294,7 @@ void tst_QHttpSocketEngine::errorTest() connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(5); + QTestEventLoop::instance().enterLoop(30); QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(int(socket.error()), expectedError); @@ -371,7 +371,7 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates() QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState); QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); - if (socketDevice.waitForWrite(15000)) { + if (socketDevice.waitForWrite(30000)) { QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState || socketDevice.state() == QAbstractSocket::UnconnectedState); } else { @@ -425,7 +425,7 @@ void tst_QHttpSocketEngine::tcpLoopbackPerformance() QTime timer; timer.start(); qlonglong readBytes = 0; - while (timer.elapsed() < 5000) { + while (timer.elapsed() < 30000) { qlonglong written = serverSocket.write(message1.data(), message1.size()); while (written > 0) { client.waitForRead(); @@ -458,7 +458,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() QCOMPARE(socket.state(), QTcpSocket::ConnectedState); // Read greeting - QVERIFY(socket.waitForReadyRead(5000)); + QVERIFY(socket.waitForReadyRead(30000)); QString s = socket.readLine(); QVERIFY2(QtNetworkSettings::compareReplyIMAP(s.toLatin1()), qPrintable(s)); @@ -466,7 +466,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); if (!socket.canReadLine()) - QVERIFY(socket.waitForReadyRead(5000)); + QVERIFY(socket.waitForReadyRead(30000)); // Read response s = socket.readLine(); @@ -476,14 +476,14 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() QCOMPARE((int) socket.write("2 LOGOUT\r\n", 10), 10); if (!socket.canReadLine()) - QVERIFY(socket.waitForReadyRead(5000)); + QVERIFY(socket.waitForReadyRead(30000)); // Read two lines of respose s = socket.readLine(); QCOMPARE(s.toLatin1().constData(), "* BYE LOGOUT received\r\n"); if (!socket.canReadLine()) - QVERIFY(socket.waitForReadyRead(5000)); + QVERIFY(socket.waitForReadyRead(30000)); s = socket.readLine(); QCOMPARE(s.toLatin1().constData(), "2 OK Completed\r\n"); diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 221ef602a1..72fa9f74a4 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -46,17 +46,21 @@ #include <QtNetwork/qlocalsocket.h> #include <QtNetwork/qlocalserver.h> +#ifdef Q_OS_UNIX +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/un.h> +#endif + Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError) Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState) +Q_DECLARE_METATYPE(QLocalServer::SocketOption) +Q_DECLARE_METATYPE(QFile::Permissions) class tst_QLocalSocket : public QObject { Q_OBJECT -public: - tst_QLocalSocket(); - virtual ~tst_QLocalSocket(); - public Q_SLOTS: void init(); void cleanup(); @@ -108,26 +112,21 @@ private slots: void bytesWrittenSignal(); void syncDisconnectNotify(); void asyncDisconnectNotify(); -}; -tst_QLocalSocket::tst_QLocalSocket() -{ - if (!QFile::exists("lackey/lackey" -#ifdef Q_OS_WIN - ".exe" -#endif - )) - qWarning() << "lackey executable doesn't exists!"; -} + void verifySocketOptions(); + void verifySocketOptions_data(); -tst_QLocalSocket::~tst_QLocalSocket() -{ -} + void verifyListenWithDescriptor(); + void verifyListenWithDescriptor_data(); + +}; void tst_QLocalSocket::init() { qRegisterMetaType<QLocalSocket::LocalSocketState>("QLocalSocket::LocalSocketState"); qRegisterMetaType<QLocalSocket::LocalSocketError>("QLocalSocket::LocalSocketError"); + qRegisterMetaType<QLocalServer::SocketOption>("QLocalServer::SocketOption"); + qRegisterMetaType<QFile::Permissions>("QFile::Permissions"); } void tst_QLocalSocket::cleanup() @@ -749,6 +748,16 @@ void tst_QLocalSocket::processConnection_data() */ void tst_QLocalSocket::processConnection() { +#ifdef Q_OS_WIN +# define EXE_SUFFIX ".exe" +#else +# define EXE_SUFFIX +#endif + +// ### lackey is currently not build + QEXPECT_FAIL("", "lackey is currently not built due to qscript dependency, QTBUG-24142", Abort); + QVERIFY(QFile::exists("lackey/lackey" EXE_SUFFIX)); + QFETCH(int, processes); QStringList serverArguments = QStringList() << SRCDIR "lackey/scripts/server.js" << QString::number(processes); QProcess producer; @@ -758,7 +767,7 @@ void tst_QLocalSocket::processConnection() #endif QList<QProcess*> consumers; producer.start("lackey/lackey", serverArguments); - QVERIFY(producer.waitForStarted(-1)); + QVERIFY2(producer.waitForStarted(-1), qPrintable(producer.errorString())); QTest::qWait(2000); for (int i = 0; i < processes; ++i) { QStringList arguments = QStringList() << SRCDIR "lackey/scripts/client.js"; @@ -1018,6 +1027,140 @@ void tst_QLocalSocket::asyncDisconnectNotify() QTRY_VERIFY(!disconnectedSpy.isEmpty()); } +void tst_QLocalSocket::verifySocketOptions_data() +{ +#ifdef Q_OS_LINUX + QTest::addColumn<QString>("service"); + QTest::addColumn<QLocalServer::SocketOption>("opts"); + QTest::addColumn<QFile::Permissions>("perms"); + + QFile::Permissions p = QFile::ExeOwner|QFile::WriteOwner|QFile::ReadOwner | + QFile::ExeUser|QFile::WriteUser|QFile::ReadUser; + QTest::newRow("user") << "userPerms" << QLocalServer::UserAccessOption << p; + + p = QFile::ExeGroup|QFile::WriteGroup|QFile::ReadGroup; + QTest::newRow("group") << "groupPerms" << QLocalServer::GroupAccessOption << p; + + p = QFile::ExeOther|QFile::WriteOther|QFile::ReadOther; + QTest::newRow("other") << "otherPerms" << QLocalServer::OtherAccessOption << p; + + p = QFile::ExeOwner|QFile::WriteOwner|QFile::ReadOwner| + QFile::ExeUser|QFile::WriteUser|QFile::ReadUser | + QFile::ExeGroup|QFile::WriteGroup|QFile::ReadGroup| + QFile::ExeOther|QFile::WriteOther|QFile::ReadOther; + QTest::newRow("all") << "worldPerms" << QLocalServer::WorldAccessOption << p; +#endif +} + +void tst_QLocalSocket::verifySocketOptions() +{ + // These are only guaranteed to be useful on linux at this time +#ifdef Q_OS_LINUX + QFETCH(QString, service); + QFETCH(QLocalServer::SocketOption, opts); + QFETCH(QFile::Permissions, perms); + + + QLocalServer::removeServer(service); + QLocalServer server; + server.setSocketOptions(opts); + QVERIFY2(server.listen(service), "service failed to start listening"); + + // find the socket + QString fullServerPath = QDir::cleanPath(QDir::tempPath()); + fullServerPath += QLatin1Char('/') + service; + + QFile socketFile(fullServerPath); + QVERIFY2(perms == socketFile.permissions(), "permissions on the socket don't match"); +#endif +} + +void tst_QLocalSocket::verifyListenWithDescriptor() +{ +#ifdef Q_OS_UNIX + QFETCH(QString, path); + QFETCH(bool, abstract); + QFETCH(bool, bound); + + qDebug() << "socket" << path << abstract; + + int listenSocket; + + if (bound) { + // create the unix socket + listenSocket = ::socket(PF_UNIX, SOCK_STREAM, 0); + QVERIFY2(listenSocket != -1, "failed to create test socket"); + + // Construct the unix address + struct ::sockaddr_un addr; + addr.sun_family = PF_UNIX; + + QVERIFY2(sizeof(addr.sun_path) > ((uint)path.size() + 1), "path to large to create socket"); + + ::memset(addr.sun_path, 0, sizeof(addr.sun_path)); + if (abstract) + ::memcpy(addr.sun_path+1, path.toLatin1().data(), path.toLatin1().size()); + else + ::memcpy(addr.sun_path, path.toLatin1().data(), path.toLatin1().size()); + + if (path.startsWith(QLatin1Char('/'))) { + ::unlink(path.toLatin1()); + } + + QVERIFY2(-1 != ::bind(listenSocket, (sockaddr *)&addr, sizeof(sockaddr_un)), "failed to bind test socket to address"); + + // listen for connections + QVERIFY2(-1 != ::listen(listenSocket, 50), "failed to call listen on test socket"); + } else { + int fds[2]; + QVERIFY2(-1 != ::socketpair(PF_UNIX, SOCK_STREAM, 0, fds), "failed to create socket pair"); + + listenSocket = fds[0]; + close(fds[1]); + } + + QLocalServer server; + QVERIFY2(server.listen(listenSocket), "failed to start create QLocalServer with local socket"); + +#ifdef Q_OS_LINUX + if (!bound) { + QVERIFY(server.serverName().at(0) == QLatin1Char('@')); + QVERIFY(server.fullServerName().at(0) == QLatin1Char('@')); + } else if (abstract) { + QVERIFY2(server.fullServerName().at(0) == QLatin1Char('@'), "abstract sockets should start with a '@'"); + } else { + QVERIFY2(server.fullServerName() == path, "full server path doesn't match patch provided"); + if (path.contains(QLatin1String("/"))) { + QVERIFY2(server.serverName() == path.mid(path.lastIndexOf(QLatin1Char('/'))+1), "server name invalid short name"); + } else { + QVERIFY2(server.serverName() == path, "servier name doesn't match the path provided"); + } + } +#else + QVERIFY(server.serverName().isEmpty()); + QVERIFY(server.fullServerName().isEmpty()); +#endif + + +#endif +} + +void tst_QLocalSocket::verifyListenWithDescriptor_data() +{ +#ifdef Q_OS_UNIX + QTest::addColumn<QString>("path"); + QTest::addColumn<bool>("abstract"); + QTest::addColumn<bool>("bound"); + + QTest::newRow("normal") << QDir::tempPath() + QLatin1Literal("/testsocket") << false << true; + QTest::newRow("absrtact") << QString::fromLatin1("abstractsocketname") << true << true; + QTest::newRow("abstractwithslash") << QString::fromLatin1("abstractsocketwitha/inthename") << true << true; + QTest::newRow("no path") << QString::fromLatin1("/invalid/no path name speficied") << true << false; + +#endif + +} + QTEST_MAIN(tst_QLocalSocket) #include "tst_qlocalsocket.moc" diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index 941e0b2142..ac27a621bb 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -119,6 +119,7 @@ private: #ifndef QT_NO_BEARERMANAGEMENT QNetworkSession *networkSession; #endif + QString crashingServerDir; }; // Testing get/set functions @@ -150,6 +151,10 @@ void tst_QTcpServer::initTestCase_data() QTest::newRow("WithoutProxy") << false << 0; QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); + + crashingServerDir = QFINDTESTDATA("crashingServer"); + QVERIFY2(!crashingServerDir.isEmpty(), qPrintable( + QString::fromLatin1("Couldn't find crashingServer dir starting from %1.").arg(QDir::currentPath()))); } void tst_QTcpServer::initTestCase() @@ -538,7 +543,10 @@ void tst_QTcpServer::addressReusable() QFile::remove(signalName); // The crashingServer process will crash once it gets a connection. QProcess process; - process.start("crashingServer/crashingServer"); + QString processExe = crashingServerDir + "/crashingServer"; + process.start(processExe); + QVERIFY2(process.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(processExe, process.errorString()))); int waitCount = 5; while (waitCount-- && !QFile::exists(signalName)) QTest::qWait(1000); @@ -547,7 +555,10 @@ void tst_QTcpServer::addressReusable() #else // The crashingServer process will crash once it gets a connection. QProcess process; - process.start("crashingServer/crashingServer"); + QString processExe = crashingServerDir + "/crashingServer"; + process.start(processExe); + QVERIFY2(process.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(processExe, process.errorString()))); QVERIFY(process.waitForReadyRead(5000)); #endif diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index 829ddd2054..abeb1ed06d 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -246,6 +246,7 @@ private: SocketPair *earlyConstructedSockets; int earlyBytesWrittenCount; int earlyReadyReadCount; + QString stressTestDir; }; enum ProxyTests { @@ -340,6 +341,10 @@ void tst_QTcpSocket::initTestCase_data() QTest::newRow("WithHttpProxyBasicAuth SSL") << true << int(HttpProxy | AuthBasic) << true; // QTest::newRow("WithHttpProxyNtlmAuth SSL") << true << int(HttpProxy | AuthNtlm) << true; #endif + + stressTestDir = QFINDTESTDATA("stressTest"); + QVERIFY2(!stressTestDir.isEmpty(), qPrintable( + QString::fromLatin1("Couldn't find stressTest dir starting from %1.").arg(QDir::currentPath()))); } void tst_QTcpSocket::initTestCase() @@ -2225,11 +2230,14 @@ void tst_QTcpSocket::suddenRemoteDisconnect() if (ssl) return; + QString processExe = stressTestDir + "/stressTest"; + // Start server QProcess serverProcess; serverProcess.setReadChannel(QProcess::StandardError); - serverProcess.start(QString::fromLatin1("stressTest/stressTest %1").arg(server), - QIODevice::ReadWrite | QIODevice::Text); + serverProcess.start(processExe, QStringList(server), QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(serverProcess.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(processExe, serverProcess.errorString()))); while (!serverProcess.canReadLine()) QVERIFY(serverProcess.waitForReadyRead(10000)); QCOMPARE(serverProcess.readLine().data(), (server.toLatin1() + "\n").data()); @@ -2237,8 +2245,9 @@ void tst_QTcpSocket::suddenRemoteDisconnect() // Start client QProcess clientProcess; clientProcess.setReadChannel(QProcess::StandardError); - clientProcess.start(QString::fromLatin1("stressTest/stressTest %1").arg(client), - QIODevice::ReadWrite | QIODevice::Text); + clientProcess.start(processExe, QStringList(client), QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(clientProcess.waitForStarted(), qPrintable( + QString::fromLatin1("Could not start %1: %2").arg(processExe, clientProcess.errorString()))); while (!clientProcess.canReadLine()) QVERIFY(clientProcess.waitForReadyRead(10000)); QCOMPARE(clientProcess.readLine().data(), (client.toLatin1() + "\n").data()); diff --git a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro index 7e2abac3f8..60ad3cbfd1 100644 --- a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro @@ -6,19 +6,4 @@ QT = core network testlib TARGET = tst_qsslcertificate -win32 { - CONFIG(debug, debug|release) { - DESTDIR = debug -} else { - DESTDIR = release - } -} - -wince* { - certFiles.files = certificates more-certificates - certFiles.path = . - DEPLOYMENT += certFiles - DEFINES += SRCDIR=\\\".\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} +TESTDATA += certificates/* more-certificates/* verify-certs/* diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index 8003ad1932..da2dd989c7 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -71,14 +71,10 @@ class tst_QSslCertificate : public QObject #endif QString oldCurrentDir; -public: - tst_QSslCertificate(); - virtual ~tst_QSslCertificate(); public slots: - void initTestCase_data(); - void init(); - void cleanup(); + void initTestCase(); + void cleanupTestCase(); #ifndef QT_NO_OPENSSL private slots: @@ -120,11 +116,23 @@ private slots: // ### add tests for certificate bundles (multiple certificates concatenated into a single // structure); both PEM and DER formatted #endif +private: + QString testDataDir; }; -tst_QSslCertificate::tst_QSslCertificate() +void tst_QSslCertificate::initTestCase() { - QDir dir(SRCDIR + QLatin1String("/certificates")); + testDataDir = QFileInfo(QFINDTESTDATA("certificates")).absolutePath(); + if (testDataDir.isEmpty()) + testDataDir = QCoreApplication::applicationDirPath(); + + if (QDir::current().absolutePath() != testDataDir) { + oldCurrentDir = QDir::current().absolutePath(); + QVERIFY2(QDir::setCurrent(testDataDir), + qPrintable(QString("Cannot change directory to %1").arg(testDataDir))); + } + + QDir dir(testDataDir + "/certificates"); QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Readable); QRegExp rxCert(QLatin1String("^.+\\.(pem|der)$")); QRegExp rxSan(QLatin1String("^(.+\\.(?:pem|der))\\.san$")); @@ -148,29 +156,11 @@ tst_QSslCertificate::tst_QSslCertificate() } } -tst_QSslCertificate::~tst_QSslCertificate() -{ -} - -void tst_QSslCertificate::initTestCase_data() -{ -} - -void tst_QSslCertificate::init() -{ - QString srcdir(QLatin1String(SRCDIR)); - if (!srcdir.isEmpty()) { - oldCurrentDir = QDir::current().absolutePath(); - QDir::setCurrent(srcdir); - } -} - -void tst_QSslCertificate::cleanup() +void tst_QSslCertificate::cleanupTestCase() { if (!oldCurrentDir.isEmpty()) { QDir::setCurrent(oldCurrentDir); } - } static QByteArray readFile(const QString &absFilePath) @@ -569,7 +559,7 @@ void tst_QSslCertificate::fromPath_data() QTest::newRow("\"d.*/c.*.pem\" wildcard pem") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << true << 0; QTest::newRow("\"d.*/c.*.pem\" wildcard der") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << false << 0; #ifdef Q_OS_LINUX - QTest::newRow("absolute path wildcard pem") << QString(QDir::currentPath() + "/certificates/*.pem") << int(QRegExp::Wildcard) << true << 5; + QTest::newRow("absolute path wildcard pem") << (testDataDir + "/certificates/*.pem") << int(QRegExp::Wildcard) << true << 5; #endif QTest::newRow("trailing-whitespace") << QString("more-certificates/trailing-whitespace.pem") << int(QRegExp::FixedString) << true << 1; @@ -783,7 +773,7 @@ void tst_QSslCertificate::task256066toPem() void tst_QSslCertificate::nulInCN() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/badguy-nul-cn.crt"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/badguy-nul-cn.crt"); QCOMPARE(certList.size(), 1); const QSslCertificate &cert = certList.at(0); @@ -799,7 +789,7 @@ void tst_QSslCertificate::nulInCN() void tst_QSslCertificate::nulInSan() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/badguy-nul-san.crt"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/badguy-nul-san.crt"); QCOMPARE(certList.size(), 1); const QSslCertificate &cert = certList.at(0); @@ -819,7 +809,7 @@ void tst_QSslCertificate::nulInSan() void tst_QSslCertificate::largeSerialNumber() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/cert-large-serial-number.pem"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/cert-large-serial-number.pem"); QCOMPARE(certList.size(), 1); @@ -831,7 +821,7 @@ void tst_QSslCertificate::largeSerialNumber() void tst_QSslCertificate::largeExpirationDate() // QTBUG-12489 { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/cert-large-expiration-date.pem"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/cert-large-expiration-date.pem"); QCOMPARE(certList.size(), 1); @@ -854,18 +844,18 @@ void tst_QSslCertificate::blacklistedCertificates() void tst_QSslCertificate::toText() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/cert-large-expiration-date.pem"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/cert-large-expiration-date.pem"); QCOMPARE(certList.size(), 1); const QSslCertificate &cert = certList.at(0); // Openssl's cert dump method changed slightly between 0.9.8 and 1.0.0 versions, so we want it to match any output - QFile fOld(SRCDIR "more-certificates/cert-large-expiration-date.txt.0.9.8"); + QFile fOld(testDataDir + "/more-certificates/cert-large-expiration-date.txt.0.9.8"); QVERIFY(fOld.open(QIODevice::ReadOnly | QFile::Text)); QByteArray txtOld = fOld.readAll(); - QFile fNew(SRCDIR "more-certificates/cert-large-expiration-date.txt.1.0.0"); + QFile fNew(testDataDir + "/more-certificates/cert-large-expiration-date.txt.1.0.0"); QVERIFY(fNew.open(QIODevice::ReadOnly | QFile::Text)); QByteArray txtNew = fNew.readAll(); QVERIFY(txtOld == cert.toText() || txtNew == cert.toText()); @@ -874,7 +864,7 @@ void tst_QSslCertificate::toText() void tst_QSslCertificate::multipleCommonNames() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/test-cn-two-cns-cert.pem"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/test-cn-two-cns-cert.pem"); QVERIFY2(certList.count() > 0, "Please run this test from the source directory"); QStringList commonNames = certList[0].subjectInfo(QSslCertificate::CommonName); @@ -885,14 +875,14 @@ void tst_QSslCertificate::multipleCommonNames() void tst_QSslCertificate::subjectAndIssuerAttributes() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/test-cn-with-drink-cert.pem"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/test-cn-with-drink-cert.pem"); QVERIFY2(certList.count() > 0, "Please run this test from the source directory"); QList<QByteArray> attributes = certList[0].subjectInfoAttributes(); QVERIFY(attributes.contains(QByteArray("favouriteDrink"))); attributes.clear(); - certList = QSslCertificate::fromPath(SRCDIR "more-certificates/natwest-banking.pem"); + certList = QSslCertificate::fromPath(testDataDir + "/more-certificates/natwest-banking.pem"); QVERIFY2(certList.count() > 0, "Please run this test from the source directory"); attributes = certList[0].subjectInfoAttributes(); @@ -917,17 +907,17 @@ void tst_QSslCertificate::verify() errors.clear(); // Verify a valid cert signed by a CA - QList<QSslCertificate> caCerts = QSslCertificate::fromPath(SRCDIR "verify-certs/cacert.pem"); + QList<QSslCertificate> caCerts = QSslCertificate::fromPath(testDataDir + "/verify-certs/cacert.pem"); QSslSocket::addDefaultCaCertificate(caCerts.first()); - toVerify = QSslCertificate::fromPath(SRCDIR "verify-certs/test-ocsp-good-cert.pem"); + toVerify = QSslCertificate::fromPath(testDataDir + "/verify-certs/test-ocsp-good-cert.pem"); errors = QSslCertificate::verify(toVerify); VERIFY_VERBOSE(errors.count() == 0); errors.clear(); // Test a blacklisted certificate - toVerify = QSslCertificate::fromPath(SRCDIR "verify-certs/test-addons-mozilla-org-cert.pem"); + toVerify = QSslCertificate::fromPath(testDataDir + "/verify-certs/test-addons-mozilla-org-cert.pem"); errors = QSslCertificate::verify(toVerify); bool foundBlack = false; foreach (const QSslError &error, errors) { @@ -940,7 +930,7 @@ void tst_QSslCertificate::verify() errors.clear(); // This one is expired and untrusted - toVerify = QSslCertificate::fromPath(SRCDIR "more-certificates/cert-large-serial-number.pem"); + toVerify = QSslCertificate::fromPath(testDataDir + "/more-certificates/cert-large-serial-number.pem"); errors = QSslCertificate::verify(toVerify); VERIFY_VERBOSE(errors.contains(QSslError(QSslError::SelfSignedCertificate, toVerify[0]))); VERIFY_VERBOSE(errors.contains(QSslError(QSslError::CertificateExpired, toVerify[0]))); @@ -948,15 +938,15 @@ void tst_QSslCertificate::verify() toVerify.clear(); // This one is signed by a valid cert, but the signer is not a valid CA - toVerify << QSslCertificate::fromPath(SRCDIR "verify-certs/test-intermediate-not-ca-cert.pem").first(); - toVerify << QSslCertificate::fromPath(SRCDIR "verify-certs/test-ocsp-good-cert.pem").first(); + toVerify << QSslCertificate::fromPath(testDataDir + "/verify-certs/test-intermediate-not-ca-cert.pem").first(); + toVerify << QSslCertificate::fromPath(testDataDir + "/verify-certs/test-ocsp-good-cert.pem").first(); errors = QSslCertificate::verify(toVerify); VERIFY_VERBOSE(errors.contains(QSslError(QSslError::InvalidCaCertificate, toVerify[1]))); toVerify.clear(); // This one is signed by a valid cert, and the signer is a valid CA - toVerify << QSslCertificate::fromPath(SRCDIR "verify-certs/test-intermediate-is-ca-cert.pem").first(); - toVerify << QSslCertificate::fromPath(SRCDIR "verify-certs/test-intermediate-ca-cert.pem").first(); + toVerify << QSslCertificate::fromPath(testDataDir + "/verify-certs/test-intermediate-is-ca-cert.pem").first(); + toVerify << QSslCertificate::fromPath(testDataDir + "/verify-certs/test-intermediate-ca-cert.pem").first(); errors = QSslCertificate::verify(toVerify); VERIFY_VERBOSE(errors.count() == 0); @@ -986,7 +976,7 @@ QString tst_QSslCertificate::toString(const QList<QSslError>& errors) void tst_QSslCertificate::extensions() { QList<QSslCertificate> certList = - QSslCertificate::fromPath(SRCDIR "more-certificates/natwest-banking.pem"); + QSslCertificate::fromPath(testDataDir + "/more-certificates/natwest-banking.pem"); QVERIFY2(certList.count() > 0, "Please run this test from the source directory"); QSslCertificate cert = certList[0]; diff --git a/tests/auto/network/ssl/qsslkey/qsslkey.pro b/tests/auto/network/ssl/qsslkey/qsslkey.pro index 4af35487cd..d794c0faf0 100644 --- a/tests/auto/network/ssl/qsslkey/qsslkey.pro +++ b/tests/auto/network/ssl/qsslkey/qsslkey.pro @@ -6,23 +6,4 @@ QT = core network testlib TARGET = tst_qsslkey -win32 { - CONFIG(debug, debug|release) { - DESTDIR = debug -} else { - DESTDIR = release - } -} - -wince* { - keyFiles.files = keys - keyFiles.path = . - - passphraseFiles.files = rsa-without-passphrase.pem rsa-with-passphrase.pem - passphraseFiles.path = . - - DEPLOYMENT += keyFiles passphraseFiles - DEFINES += SRCDIR=\\\".\\\" -} else { - DEFINES+= SRCDIR=\\\"$$PWD\\\" -} +TESTDATA += keys/* rsa-without-passphrase.pem rsa-with-passphrase.pem diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp index f59f0bb5a9..e8941a2642 100644 --- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp +++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp @@ -68,14 +68,8 @@ class tst_QSslKey : public QObject void createPlainTestRows(); -public: - tst_QSslKey(); - virtual ~tst_QSslKey(); - public slots: - void initTestCase_data(); - void init(); - void cleanup(); + void initTestCase(); #ifndef QT_NO_OPENSSL @@ -95,16 +89,17 @@ private slots: void passphraseChecks(); #endif +private: + QString testDataDir; }; -tst_QSslKey::tst_QSslKey() +void tst_QSslKey::initTestCase() { -#ifdef Q_OS_MAC - // applicationDirPath() points to a path inside the app bundle on Mac. - QDir dir(qApp->applicationDirPath() + QLatin1String("/../../../keys")); -#else - QDir dir(SRCDIR + QLatin1String("/keys")); // prefer this way to avoid ifdeffery and support shadow builds? -#endif + testDataDir = QFileInfo(QFINDTESTDATA("rsa-without-passphrase.pem")).absolutePath(); + if (testDataDir.isEmpty()) + testDataDir = QCoreApplication::applicationDirPath(); + + QDir dir(testDataDir + "/keys"); QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Readable); QRegExp rx(QLatin1String("^(rsa|dsa)-(pub|pri)-(\\d+)\\.(pem|der)$")); foreach (QFileInfo fileInfo, fileInfoList) { @@ -118,22 +113,6 @@ tst_QSslKey::tst_QSslKey() } } -tst_QSslKey::~tst_QSslKey() -{ -} - -void tst_QSslKey::initTestCase_data() -{ -} - -void tst_QSslKey::init() -{ -} - -void tst_QSslKey::cleanup() -{ -} - static QByteArray readFile(const QString &absFilePath) { QFile file(absFilePath); @@ -295,10 +274,11 @@ void tst_QSslKey::toEncryptedPemOrDer_data() << "aAzZ`1234567890-=~!@#$%^&*()_+[]{}\\|;:'\",.<>/?"; // ### add more (?) foreach (KeyInfo keyInfo, keyInfoList) { foreach (QString password, passwords) { - QString testName = QString("%1-%2-%3-%4").arg(keyInfo.fileInfo.fileName()) + QString testName = QString("%1-%2-%3-%4-%5").arg(keyInfo.fileInfo.fileName()) .arg(keyInfo.algorithm == QSsl::Rsa ? "RSA" : "DSA") .arg(keyInfo.type == QSsl::PrivateKey ? "PrivateKey" : "PublicKey") - .arg(keyInfo.format == QSsl::Pem ? "PEM" : "DER"); + .arg(keyInfo.format == QSsl::Pem ? "PEM" : "DER") + .arg(password); QTest::newRow(testName.toLatin1()) << keyInfo.fileInfo.absoluteFilePath() << keyInfo.algorithm << keyInfo.type << keyInfo.format << password; @@ -367,7 +347,7 @@ void tst_QSslKey::toEncryptedPemOrDer() void tst_QSslKey::passphraseChecks() { { - QString fileName(SRCDIR "/rsa-with-passphrase.pem"); + QString fileName(testDataDir + "/rsa-with-passphrase.pem"); QFile keyFile(fileName); QVERIFY(keyFile.exists()); { @@ -406,7 +386,7 @@ void tst_QSslKey::passphraseChecks() { // be sure and check a key without passphrase too - QString fileName(SRCDIR "/rsa-without-passphrase.pem"); + QString fileName(testDataDir + "/rsa-without-passphrase.pem"); QFile keyFile(fileName); { if (!keyFile.isOpen()) diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro index a8763d69af..bb04e0b9c4 100644 --- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro +++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro @@ -35,3 +35,5 @@ wince* { linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC requires(contains(QT_CONFIG,private_tests)) + +win32:CONFIG += insignificant_test # QTBUG-24234 diff --git a/tests/auto/other/headersclean/headersclean.pro b/tests/auto/other/headersclean/headersclean.pro index 814f19c865..5444bebfb9 100644 --- a/tests/auto/other/headersclean/headersclean.pro +++ b/tests/auto/other/headersclean/headersclean.pro @@ -1,7 +1,28 @@ CONFIG += testcase TARGET = tst_headersclean SOURCES += tst_headersclean.cpp -QT = core network xml sql testlib -contains(QT_CONFIG,dbus): QT += dbus -contains(QT_CONFIG,opengl): QT += opengl +# No need to link to all modules, only those actually used +QT = core testlib gui widgets + +*-g++*: QMAKE_CXXFLAGS += -W -Wall -Wextra -Werror + +# The flags here come from http://wiki.qt-project.org/Coding_Conventions#Conventions_for_public_header_files +# -Wold-style-cast cannot be used, /usr/include/bits/byteswap.h defines the macro bswap_16 using C style casts :( +# -Wfloat-equal cannot be used, qrect.h and qvector2d.h do exact comparisons in isNull and operator==. Would need #pragmas. +*-g++*: QMAKE_CXXFLAGS += -Woverloaded-virtual -Wshadow -Wundef + +# Other nice flags +*-g++*: QMAKE_CXXFLAGS += -Wnon-virtual-dtor -ansi -Wcast-align -Wchar-subscripts -Wpointer-arith -Wformat-security + +# Enable pedantic mode, but accept variadic macros and 'long long' usage. +*-g++*: QMAKE_CXXFLAGS += -Wno-long-long -Wno-variadic-macros -pedantic-errors + +QMAKE_CXXFLAGS += -DQT_NO_CAST_TO_ASCII \ + -DQT_NO_CAST_FROM_ASCII \ + -DQT_STRICT_ITERATORS \ + -DQT_NO_URL_CAST_FROM_STRING \ + -DQT_NO_CAST_FROM_BYTEARRAY \ + -DQT_NO_KEYWORDS \ + -DQT_USE_FAST_CONCATENATION \ + -DQT_USE_FAST_OPERATOR_PLUS diff --git a/tests/auto/other/headersclean/tst_headersclean.cpp b/tests/auto/other/headersclean/tst_headersclean.cpp index 41992b8d2a..81d0aa3a4a 100644 --- a/tests/auto/other/headersclean/tst_headersclean.cpp +++ b/tests/auto/other/headersclean/tst_headersclean.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#define QT_NO_KEYWORDS #define signals int #define slots int #define emit public:; @@ -47,12 +46,16 @@ #define forever public:; #include <QtCore/QtCore> +#include <QtConcurrent/QtConcurrent> #include <QtTest/QtTest> #include <QtNetwork/QtNetwork> #include <QtXml/QtXml> #include <QtSql/QtSql> #include <QtGui/QtGui> +#include <QtWidgets/QtWidgets> +#include <QtPrintSupport/QtPrintSupport> +#include <QtPlatformSupport/QtPlatformSupport> #ifndef QT_NO_OPENGL #include <QtOpenGL/QtOpenGL> diff --git a/tests/auto/other/networkselftest/networkselftest.pro b/tests/auto/other/networkselftest/networkselftest.pro index 3cd5f26689..1c0d256dbb 100644 --- a/tests/auto/other/networkselftest/networkselftest.pro +++ b/tests/auto/other/networkselftest/networkselftest.pro @@ -4,14 +4,3 @@ TARGET = tst_networkselftest SOURCES += tst_networkselftest.cpp QT = core network testlib -wince*: { - addFiles.files = rfc3252.txt - addFiles.path = . - DEPLOYMENT += addFiles - DEFINES += SRCDIR=\\\"\\\" -} else:vxworks*: { - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} - diff --git a/tests/auto/other/networkselftest/rfc3252.txt b/tests/auto/other/networkselftest/rfc3252.txt deleted file mode 100644 index b80c61bf0a..0000000000 --- a/tests/auto/other/networkselftest/rfc3252.txt +++ /dev/null @@ -1,899 +0,0 @@ - - - - - - -Network Working Group H. Kennedy -Request for Comments: 3252 Mimezine -Category: Informational 1 April 2002 - - - Binary Lexical Octet Ad-hoc Transport - -Status of this Memo - - This memo provides information for the Internet community. It does - not specify an Internet standard of any kind. Distribution of this - memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (2002). All Rights Reserved. - -Abstract - - This document defines a reformulation of IP and two transport layer - protocols (TCP and UDP) as XML applications. - -1. Introduction - -1.1. Overview - - This document describes the Binary Lexical Octet Ad-hoc Transport - (BLOAT): a reformulation of a widely-deployed network-layer protocol - (IP [RFC791]), and two associated transport layer protocols (TCP - [RFC793] and UDP [RFC768]) as XML [XML] applications. It also - describes methods for transporting BLOAT over Ethernet and IEEE 802 - networks as well as encapsulating BLOAT in IP for gatewaying BLOAT - across the public Internet. - -1.2. Motivation - - The wild popularity of XML as a basis for application-level protocols - such as the Blocks Extensible Exchange Protocol [RFC3080], the Simple - Object Access Protocol [SOAP], and Jabber [JABBER] prompted - investigation into the possibility of extending the use of XML in the - protocol stack. Using XML at both the transport and network layer in - addition to the application layer would provide for an amazing amount - of power and flexibility while removing dependencies on proprietary - and hard-to-understand binary protocols. This protocol unification - would also allow applications to use a single XML parser for all - aspects of their operation, eliminating developer time spent figuring - out the intricacies of each new protocol, and moving the hard work of - - - - -Kennedy Informational [Page 1] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - parsing to the XML toolset. The use of XML also mitigates concerns - over "network vs. host" byte ordering which is at the root of many - network application bugs. - -1.3. Relation to Existing Protocols - - The reformulations specified in this RFC follow as closely as - possible the spirit of the RFCs on which they are based, and so MAY - contain elements or attributes that would not be needed in a pure - reworking (e.g. length attributes, which are implicit in XML.) - - The layering of network and transport protocols are maintained in - this RFC despite the optimizations that could be made if the line - were somewhat blurred (i.e. merging TCP and IP into a single, larger - element in the DTD) in order to foster future use of this protocol as - a basis for reformulating other protocols (such as ICMP.) - - Other than the encoding, the behavioral aspects of each of the - existing protocols remain unchanged. Routing, address spaces, TCP - congestion control, etc. behave as specified in the extant standards. - Adapting to new standards and experimental algorithm heuristics for - improving performance will become much easier once the move to BLOAT - has been completed. - -1.4. Requirement Levels - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in BCP 14, RFC 2119 - [RFC2119]. - -2. IPoXML - - This protocol MUST be implemented to be compliant with this RFC. - IPoXML is the root protocol REQUIRED for effective use of TCPoXML - (section 3.) and higher-level application protocols. - - The DTD for this document type can be found in section 7.1. - - The routing of IPoXML can be easily implemented on hosts with an XML - parser, as the regular structure lends itself handily to parsing and - validation of the document/datagram and then processing the - destination address, TTL, and checksum before sending it on to its - next-hop. - - The reformulation of IPv4 was chosen over IPv6 [RFC2460] due to the - wider deployment of IPv4 and the fact that implementing IPv6 as XML - would have exceeded the 1500 byte Ethernet MTU. - - - -Kennedy Informational [Page 2] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - All BLOAT implementations MUST use - and specify - the UTF-8 encoding - of RFC 2279 [RFC2279]. All BLOAT document/datagrams MUST be well- - formed and include the XMLDecl. - -2.1. IP Description - - A number of items have changed (for the better) from the original IP - specification. Bit-masks, where present have been converted into - human-readable values. IP addresses are listed in their dotted- - decimal notation [RFC1123]. Length and checksum values are present - as decimal integers. - - To calculate the length and checksum fields of the IP element, a - canonicalized form of the element MUST be used. The canonical form - SHALL have no whitespace (including newline characters) between - elements and only one space character between attributes. There - SHALL NOT be a space following the last attribute in an element. - - An iterative method SHOULD be used to calculate checksums, as the - length field will vary based on the size of the checksum. - - The payload element bears special attention. Due to the character - set restrictions of XML, the payload of IP datagrams (which MAY - contain arbitrary data) MUST be encoded for transport. This RFC - REQUIRES the contents of the payload to be encoded in the base-64 - encoding of RFC 2045 [RFC2045], but removes the requirement that the - encoded output MUST be wrapped on 76-character lines. - - - - - - - - - - - - - - - - - - - - - - - - -Kennedy Informational [Page 3] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - -2.2. Example Datagram - - The following is an example IPoXML datagram with an empty payload: - - <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd"> - <ip> - <header length="474"> - <version value="4"/> - <tos precedence="Routine" delay="Normal" throughput="Normal" - relibility="Normal" reserved="0"/> - <total.length value="461"/> - <id value="1"/> - <flags reserved="0" df="dont" mf="last"/> - <offset value="0"/> - <ttl value="255"/> - <protocol value="6"/> - <checksum value="8707"/> - <source address="10.0.0.22"/> - <destination address="10.0.0.1"/> - <options> - <end copied="0" class="0" number="0"/> - </options> - <padding pad="0"/> - </header> - <payload> - </payload> - </ip> - -3. TCPoXML - - This protocol MUST be implemented to be compliant with this RFC. The - DTD for this document type can be found in section 7.2. - -3.1. TCP Description - - A number of items have changed from the original TCP specification. - Bit-masks, where present have been converted into human-readable - values. Length and checksum and port values are present as decimal - integers. - - To calculate the length and checksum fields of the TCP element, a - canonicalized form of the element MUST be used as in section 2.1. - - An iterative method SHOULD be used to calculate checksums as in - section 2.1. - - The payload element MUST be encoded as in section 2.1. - - - -Kennedy Informational [Page 4] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - The TCP offset element was expanded to a maximum of 255 from 16 to - allow for the increased size of the header in XML. - - TCPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header - as well as the <!DOCTYPE> declaration. - -3.2. Example Datagram - - The following is an example TCPoXML datagram with an empty payload: - - <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd"> - <tcp> - <tcp.header> - <src port="31415"/> - <dest port="42424"/> - <sequence number="322622954"/> - <acknowledgement number="689715995"/> - <offset number=""/> - <reserved value="0"/> - <control syn="1" ack="1"/> - <window size="1"/> - <urgent pointer="0"/> - <checksum value="2988"/> - <tcp.options> - <tcp.end kind="0"/> - </tcp.options> - <padding pad="0"/> - </tcp.header> - <payload> - </payload> - </tcp> - -4. UDPoXML - - This protocol MUST be implemented to be compliant with this RFC. The - DTD for this document type can be found in section 7.3. - -4.1. UDP Description - - A number of items have changed from the original UDP specification. - Bit-masks, where present have been converted into human-readable - values. Length and checksum and port values are present as decimal - integers. - - - - - - - -Kennedy Informational [Page 5] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - To calculate the length and checksum fields of the UDP element, a - canonicalized form of the element MUST be used as in section 2.1. An - iterative method SHOULD be used to calculate checksums as in section - 2.1. - - The payload element MUST be encoded as in section 2.1. - - UDPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header - as well as the <!DOCTYPE> declaration. - -4.2. Example Datagram - - The following is an example UDPoXML datagram with an empty payload: - - <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd"> - <udp> - <udp.header> - <src port="31415"/> - <dest port="42424"/> - <udp.length value="143"/> - <checksum value="2988"/> - </udp.header> - <payload> - </payload> - </udp> - -5. Network Transport - - This document provides for the transmission of BLOAT datagrams over - two common families of physical layer transport. Future RFCs will - address additional transports as routing vendors catch up to the - specification, and we begin to see BLOAT routed across the Internet - backbone. - -5.1. Ethernet - - BLOAT is encapsulated in Ethernet datagrams as in [RFC894] with the - exception that the type field of the Ethernet frame MUST contain the - value 0xBEEF. The first 5 octets of the Ethernet frame payload will - be 0x3c 3f 78 6d 6c ("<?xml".) - -5.2. IEEE 802 - - BLOAT is encapsulated in IEEE 802 Networks as in [RFC1042] except - that the protocol type code for IPoXML is 0xBEEF. - - - - - -Kennedy Informational [Page 6] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - -6. Gatewaying over IP - - In order to facilitate the gradual introduction of BLOAT into the - public Internet, BLOAT MAY be encapsulated in IP as in [RFC2003] to - gateway between networks that run BLOAT natively on their LANs. - -7. DTDs - - The Transport DTDs (7.2. and 7.3.) build on the definitions in the - Network DTD (7.1.) - - The DTDs are referenced by their PubidLiteral and SystemLiteral (from - [XML]) although it is understood that most IPoXML implementations - will not need to pull down the DTD, as it will normally be embedded - in the implementation, and presents something of a catch-22 if you - need to load part of your network protocol over the network. - -7.1. IPoXML DTD - - <!-- - DTD for IP over XML. - Refer to this DTD as: - - <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd"> - --> - <!-- - DTD data types: - - Digits [0..9]+ - - Precedence "NetworkControl | InternetworkControl | - CRITIC | FlashOverride | Flash | Immediate | - Priority | Routine" - - IP4Addr "dotted-decimal" notation of [RFC1123] - - Class [0..3] - - Sec "Unclassified | Confidential | EFTO | MMMM | PROG | - Restricted | Secret | Top Secret | Reserved" - - Compartments [0..65535] - - Handling [0..65535] - - TCC [0..16777216] - - --> - - - -Kennedy Informational [Page 7] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - <!ENTITY % Digits "CDATA"> - <!ENTITY % Precedence "CDATA"> - <!ENTITY % IP4Addr "CDATA"> - <!ENTITY % Class "CDATA"> - <!ENTITY % Sec "CDATA"> - <!ENTITY % Compartments "CDATA"> - <!ENTITY % Handling "CDATA"> - <!ENTITY % TCC "CDATA"> - - <!ELEMENT ip (header, payload)> - - <!ELEMENT header (version, tos, total.length, id, flags, offset, ttl, - protocol, checksum, source, destination, options, - padding)> - <!-- length of header in 32-bit words --> - <!ATTLIST header - length %Digits; #REQUIRED> - - <!ELEMENT version EMPTY> - <!-- ip version. SHOULD be "4" --> - <!ATTLIST version - value %Digits; #REQUIRED> - - <!ELEMENT tos EMPTY> - <!ATTLIST tos - precedence %Precedence; #REQUIRED - delay (normal | low) #REQUIRED - throughput (normal | high) #REQUIRED - relibility (normal | high) #REQUIRED - reserved CDATA #FIXED "0"> - - <!ELEMENT total.length EMPTY> - <!-- - total length of datagram (header and payload) in octets, MUST be - less than 65,535 (and SHOULD be less than 1024 for IPoXML on local - ethernets). - --> - <!ATTLIST total.length - value %Digits; #REQUIRED> - - <!ELEMENT id EMPTY> - <!-- 0 <= id <= 65,535 --> - <!ATTLIST id - value %Digits; #REQUIRED> - - <!ELEMENT flags EMPTY> - <!-- df = don't fragment, mf = more fragments --> - <!ATTLIST flags - - - -Kennedy Informational [Page 8] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - reserved CDATA #FIXED "0" - df (may|dont) #REQUIRED - mf (last|more) #REQUIRED> - - <!ELEMENT offset EMPTY> - <!-- 0 <= offset <= 8192 measured in 8 octet (64-bit) chunks --> - <!ATTLIST offset - value %Digits; #REQUIRED> - - <!ELEMENT ttl EMPTY> - <!-- 0 <= ttl <= 255 --> - <!ATTLIST ttl - value %Digits; #REQUIRED> - - <!ELEMENT protocol EMPTY> - <!-- 0 <= protocol <= 255 (per IANA) --> - <!ATTLIST protocol - value %Digits; #REQUIRED> - - <!ELEMENT checksum EMPTY> - <!-- 0 <= checksum <= 65535 (over header only) --> - <!ATTLIST checksum - value %Digits; #REQUIRED> - - <!ELEMENT source EMPTY> - <!ATTLIST source - address %IP4Addr; #REQUIRED> - - <!ELEMENT destination EMPTY> - <!ATTLIST destination - address %IP4Addr; #REQUIRED> - - <!ELEMENT options ( end | noop | security | loose | strict | record - | stream | timestamp )*> - - <!ELEMENT end EMPTY> - <!ATTLIST end - copied (0|1) #REQUIRED - class CDATA #FIXED "0" - number CDATA #FIXED "0"> - - <!ELEMENT noop EMPTY> - <!ATTLIST noop - copied (0|1) #REQUIRED - class CDATA #FIXED "0" - number CDATA #FIXED "1"> - - <!ELEMENT security EMPTY> - - - -Kennedy Informational [Page 9] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - <!ATTLIST security - copied CDATA #FIXED "1" - class CDATA #FIXED "0" - number CDATA #FIXED "2" - length CDATA #FIXED "11" - security %Sec; #REQUIRED - compartments %Compartments; #REQUIRED - handling %Handling; #REQUIRED - tcc %TCC; #REQUIRED> - <!ELEMENT loose (hop)+> - <!ATTLIST loose - copied CDATA #FIXED "1" - class CDATA #FIXED "0" - number CDATA #FIXED "3" - length %Digits; #REQUIRED - pointer %Digits; #REQUIRED> - - <!ELEMENT hop EMPTY> - <!ATTLIST hop - address %IP4Addr; #REQUIRED> - - <!ELEMENT strict (hop)+> - <!ATTLIST strict - copied CDATA #FIXED "1" - class CDATA #FIXED "0" - number CDATA #FIXED "9" - length %Digits; #REQUIRED - pointer %Digits; #REQUIRED> - - <!ELEMENT record (hop)+> - <!ATTLIST record - copied CDATA #FIXED "0" - class CDATA #FIXED "0" - number CDATA #FIXED "7" - length %Digits; #REQUIRED - pointer %Digits; #REQUIRED> - - <!ELEMENT stream EMPTY> - <!-- 0 <= id <= 65,535 --> - <!ATTLIST stream - copied CDATA #FIXED "1" - class CDATA #FIXED "0" - number CDATA #FIXED "8" - length CDATA #FIXED "4" - id %Digits; #REQUIRED> - - <!ELEMENT timestamp (tstamp)+> - <!-- 0 <= oflw <=15 --> - - - -Kennedy Informational [Page 10] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - <!ATTLIST timestamp - copied CDATA #FIXED "0" - class CDATA #FIXED "2" - number CDATA #FIXED "4" - length %Digits; #REQUIRED - pointer %Digits; #REQUIRED - oflw %Digits; #REQUIRED - flag (0 | 1 | 3) #REQUIRED> - - <!ELEMENT tstamp EMPTY> - <!ATTLIST tstamp - time %Digits; #REQUIRED - address %IP4Addr; #IMPLIED> - <!-- - padding to bring header to 32-bit boundary. - pad MUST be "0"* - --> - <!ELEMENT padding EMPTY> - <!ATTLIST padding - pad CDATA #REQUIRED> - - <!-- payload MUST be encoded as base-64 [RFC2045], as modified - by section 2.1 of this RFC --> - <!ELEMENT payload (CDATA)> - -7.2. TCPoXML DTD - - <!-- - DTD for TCP over XML. - Refer to this DTD as: - - <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd"> - --> - - <!-- the pseudoheader is only included for checksum calculations --> - <!ELEMENT tcp (tcp.pseudoheader?, tcp.header, payload)> - - <!ELEMENT tcp.header (src, dest, sequence, acknowledgement, offset, - reserved, control, window, checksum, urgent, - tcp.options, padding)> - - <!ELEMENT src EMPTY> - <!-- 0 <= port <= 65,535 --> - <!ATTLIST src - port %Digits; #REQUIRED> - - <!ELEMENT dest EMPTY> - <!-- 0 <= port <= 65,535 --> - - - -Kennedy Informational [Page 11] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - <!ATTLIST dest - port %Digits; #REQUIRED> - - <!ELEMENT sequence EMPTY> - <!-- 0 <= number <= 4294967295 --> - <!ATTLIST sequence - number %Digits; #REQUIRED> - - <!ELEMENT acknowledgement EMPTY> - <!-- 0 <= number <= 4294967295 --> - <!ATTLIST acknowledgement - number %Digits; #REQUIRED> - - <!ELEMENT offset EMPTY> - <!-- 0 <= number <= 255 --> - <!ATTLIST offset - number %Digits; #REQUIRED> - - <!ELEMENT reserved EMPTY> - <!ATTLIST reserved - value CDATA #FIXED "0"> - - <!ELEMENT control EMPTY> - <!ATTLIST control - urg (0|1) #IMPLIED - ack (0|1) #IMPLIED - psh (0|1) #IMPLIED - rst (0|1) #IMPLIED - syn (0|1) #IMPLIED - fin (0|1) #IMPLIED> - - <!ELEMENT window EMPTY> - <!-- 0 <= size <= 65,535 --> - <!ATTLIST window - size %Digits; #REQUIRED> - - <!-- - checksum as in ip, but with - the following pseudo-header added into the tcp element: - --> - <!ELEMENT tcp.pseudoheader (source, destination, protocol, - tcp.length)> - - <!-- - tcp header + data length in octets. does not include the size of - - the pseudoheader. - --> - - - -Kennedy Informational [Page 12] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - <!ELEMENT tcp.length EMPTY> - <!ATTLIST tcp.length - value %Digits; #REQUIRED> - - <!ELEMENT urgent EMPTY> - <!-- 0 <= pointer <= 65,535 --> - <!ATTLIST urgent - pointer %Digits; #REQUIRED> - - <!ELEMENT tcp.options (tcp.end | tcp.noop | tcp.mss)+> - - <!ELEMENT tcp.end EMPTY> - <!ATTLIST tcp.end - kind CDATA #FIXED "0"> - - <!ELEMENT tcp.noop EMPTY> - <!ATTLIST tcp.noop - kind CDATA #FIXED "1"> - - <!ELEMENT tcp.mss EMPTY> - <!ATTLIST tcp.mss - kind CDATA #FIXED "2" - length CDATA #FIXED "4" - size %Digits; #REQUIRED> - -7.3. UDPoXML DTD - - <!-- - DTD for UDP over XML. - Refer to this DTD as: - - <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd"> - --> - - <!ELEMENT udp (udp.pseudoheader?, udp.header, payload)> - - <!ELEMENT udp.header (src, dest, udp.length, checksum)> - - <!ELEMENT udp.pseudoheader (source, destination, protocol, - udp.length)> - - <!-- - udp header + data length in octets. does not include the size of - the pseudoheader. - --> - <!ELEMENT udp.length EMPTY> - <!ATTLIST udp.length - value %Digits; #REQUIRED> - - - -Kennedy Informational [Page 13] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - -8. Security Considerations - - XML, as a subset of SGML, has the same security considerations as - specified in SGML Media Types [RFC1874]. Security considerations - that apply to IP, TCP and UDP also likely apply to BLOAT as it does - not attempt to correct for issues not related to message format. - -9. References - - [JABBER] Miller, J., "Jabber", draft-miller-jabber-00.txt, - February 2002. (Work in Progress) - - [RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, - August 1980. - - [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791, - September 1981. - - [RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC - 793, September 1981. - - [RFC894] Hornig, C., "Standard for the Transmission of IP - Datagrams over Ethernet Networks.", RFC 894, April 1984. - - [RFC1042] Postel, J. and J. Reynolds, "Standard for the - Transmission of IP Datagrams Over IEEE 802 Networks", STD - 43, RFC 1042, February 1988. - - [RFC1123] Braden, R., "Requirements for Internet Hosts - - Application and Support", RFC 1123, October 1989. - - [RFC1874] Levinson, E., "SGML Media Types", RFC 1874, December - 1995. - - [RFC2003] Perkins, C., "IP Encapsulation within IP", RFC 2003, - October 1996. - - [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part One: Format of Internet Message - Bodies", RFC 2045, November 1996. - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO - 10646", RFC 2279, January 1998. - - - - - -Kennedy Informational [Page 14] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - - [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 - (IPv6) Specification", RFC 2460, December 1998. - - [RFC3080] Rose, M., "The Blocks Extensible Exchange Protocol Core", - RFC 3080, March 2001. - - [SOAP] Box, D., Ehnebuske, D., Kakivaya, G., Layman, A., - Mendelsohn, N., Nielsen, H. F., Thatte, S. Winer, D., - "Simple Object Access Protocol (SOAP) 1.1" World Wide Web - Consortium Note, May 2000 http://www.w3.org/TR/SOAP/ - - [XML] Bray, T., Paoli, J., Sperberg-McQueen, C. M., "Extensible - Markup Language (XML)" World Wide Web Consortium - Recommendation REC- xml-19980210. - http://www.w3.org/TR/1998/REC-xml-19980210 - -10. Author's Address - - Hugh Kennedy - Mimezine - 1060 West Addison - Chicago, IL 60613 - USA - - EMail: kennedyh@engin.umich.edu - - - - - - - - - - - - - - - - - - - - - - - - - - -Kennedy Informational [Page 15] - -RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002 - - -11. Full Copyright Statement - - Copyright (C) The Internet Society (2002). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - - - - - - - - - - - - - -Kennedy Informational [Page 16] - diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp index c1a3cd17d2..99d4ac9522 100644 --- a/tests/auto/other/networkselftest/tst_networkselftest.cpp +++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp @@ -70,7 +70,6 @@ private slots: void serverReachability(); void remotePortsOpen_data(); void remotePortsOpen(); - void fileLineEndingTest(); // specific protocol tests void ftpServer(); @@ -458,31 +457,6 @@ void tst_NetworkSelfTest::remotePortsOpen() QVERIFY(socket.state() == QAbstractSocket::ConnectedState); } - -void tst_NetworkSelfTest::fileLineEndingTest() -{ - QString referenceName = SRCDIR "/rfc3252.txt"; - long long expectedReferenceSize = 25962; - - QString lineEndingType("LF"); - - QFile reference(referenceName); - QVERIFY(reference.open(QIODevice::ReadOnly)); - QByteArray byteLine = reference.readLine(); - if(byteLine.endsWith("\r\n")) - lineEndingType = "CRLF"; - else if(byteLine.endsWith("\r")) - lineEndingType = "CR"; - - QString referenceAsTextData; - QFile referenceAsText(referenceName); - QVERIFY(referenceAsText.open(QIODevice::ReadOnly)); - referenceAsTextData = referenceAsText.readAll(); - - QVERIFY2(expectedReferenceSize == referenceAsTextData.length(), QString("Reference file %1 has %2 as line ending and file size not matching - Git checkout issue !?!").arg(referenceName, lineEndingType).toLocal8Bit()); - QVERIFY2(!lineEndingType.compare("LF"), QString("Reference file %1 has %2 as line ending - Git checkout issue !?!").arg(referenceName, lineEndingType).toLocal8Bit()); -} - static QList<Chat> ftpChat(const QByteArray &userSuffix = QByteArray()) { QList<Chat> rv; diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index eca5814b8e..b2a4b1cca2 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -846,6 +846,17 @@ public Q_SLOTS: } }; +static QAccessibleInterface *relatedInterface(QAccessibleInterface *iface, QAccessible::RelationFlag flag) +{ + typedef QPair<QAccessibleInterface *, QAccessible::Relation> RelationPair; + QVector<RelationPair> rels = iface->relations(flag); + + for (int i = 1; i < rels.count(); ++i) + delete rels.at(i).first; + + return rels.value(0).first; +} + void tst_QAccessibility::buttonTest() { QWidget window; @@ -879,6 +890,30 @@ void tst_QAccessibility::buttonTest() toggletool.setText("Toggle"); toggletool.setMinimumSize(20,20); + // test Controller/Controlled relations + { + QCheckBox toggler("Toggle me!", &window); + bool ok = connect(&pushButton, SIGNAL(clicked()), &toggler, SLOT(toggle())); + QCOMPARE(ok, true); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&toggler); + QVERIFY(iface); + QCOMPARE(iface->role(), QAccessible::CheckBox); + QAccessibleInterface *buttonIFace = relatedInterface(iface, QAccessible::Controller); + QVERIFY(buttonIFace); + QCOMPARE(buttonIFace->role(), QAccessible::Button); + QCOMPARE(buttonIFace->object(), &pushButton); + delete buttonIFace; + delete iface; + + buttonIFace = QAccessible::queryAccessibleInterface(&pushButton); + QVERIFY(buttonIFace); + QCOMPARE(buttonIFace->role(), QAccessible::Button); + iface = relatedInterface(buttonIFace, QAccessible::Controlled); + QVERIFY(iface); + QCOMPARE(iface->object(), &toggler); + + } + // test push button QAccessibleInterface* interface = QAccessible::queryAccessibleInterface(&pushButton); QAccessibleActionInterface* actionInterface = interface->actionInterface(); @@ -1516,6 +1551,12 @@ void tst_QAccessibility::textEditTest() QCOMPARE(iface->textInterface()->characterRect(0, QAccessible2::RelativeToParent).size(), QSize(fm.width("h"), fm.height())); QCOMPARE(iface->textInterface()->characterRect(5, QAccessible2::RelativeToParent).size(), QSize(fm.width(" "), fm.height())); QCOMPARE(iface->textInterface()->characterRect(6, QAccessible2::RelativeToParent).size(), QSize(fm.width("w"), fm.height())); + + iface->editableTextInterface()->copyText(6, 11); + QCOMPARE(QApplication::clipboard()->text(), QLatin1String("world")); + iface->editableTextInterface()->cutText(12, 16); + QCOMPARE(QApplication::clipboard()->text(), QLatin1String("how ")); + QCOMPARE(iface->textInterface()->text(12, 15), QLatin1String("are")); } QTestAccessibility::clearEvents(); } @@ -1685,7 +1726,7 @@ void tst_QAccessibility::lineEditTest() QCOMPARE(iface->childCount(), 0); QVERIFY(iface->state().sizeable); QVERIFY(iface->state().movable); - QCOMPARE(bool(iface->state().focusable), le->isActiveWindow()); + QVERIFY(iface->state().focusable); QVERIFY(iface->state().selectable); QVERIFY(iface->state().hasPopup); QCOMPARE(bool(iface->state().focused), le->hasFocus()); @@ -1714,7 +1755,7 @@ void tst_QAccessibility::lineEditTest() QApplication::processEvents(); QVERIFY(!(iface->state().sizeable)); QVERIFY(!(iface->state().movable)); - QCOMPARE(bool(iface->state().focusable), le->isActiveWindow()); + QVERIFY(iface->state().focusable); QVERIFY(iface->state().selectable); QVERIFY(iface->state().hasPopup); QCOMPARE(bool(iface->state().focused), le->hasFocus()); diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp index c8b5513a29..270de8292b 100644 --- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp +++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp @@ -412,10 +412,10 @@ void tst_QSqlTableModel::setRecord() model.submit(); else { // dataChanged() is not emitted when submitAll() is called - QCOMPARE(spy.count(), 2); + QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).count(), 2); - QCOMPARE(qvariant_cast<QModelIndex>(spy.at(0).at(0)), model.index(i, 1)); - QCOMPARE(qvariant_cast<QModelIndex>(spy.at(0).at(1)), model.index(i, 1)); + QCOMPARE(qvariant_cast<QModelIndex>(spy.at(0).at(0)), model.index(i, 0)); + QCOMPARE(qvariant_cast<QModelIndex>(spy.at(0).at(1)), model.index(i, rec.count() - 1)); } } @@ -699,14 +699,13 @@ void tst_QSqlTableModel::removeRows() QVERIFY(!model.removeRows(-1,1)); // negative start QVERIFY(!model.removeRows(-1, 0)); // negative start, and zero count QVERIFY(!model.removeRows(1, 0)); // zero count - QVERIFY(!model.removeRows(5, 1)); // past end (causes a beforeDelete to be emitted) + QVERIFY(!model.removeRows(5, 1)); // past end (DOESN'T causes a beforeDelete to be emitted) QVERIFY(!model.removeRows(1, 0, model.index(2, 0))); // can't pass a valid modelindex QVERIFY_SQL(model, removeRows(0, 2)); - QCOMPARE(beforeDeleteSpy.count(), 3); - QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 5); - QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 0); - QVERIFY(beforeDeleteSpy.at(2).at(0).toInt() == 1); + QCOMPARE(beforeDeleteSpy.count(), 2); + QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 0); + QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 1); QCOMPARE(model.rowCount(), 1); QCOMPARE(model.data(model.index(0, 1)).toString(), QString("vohi")); model.clear(); @@ -1200,9 +1199,13 @@ void tst_QSqlTableModel::insertRecordsInLoop() model.submitAll(); // submitAll() calls select() which clears and repopulates the table int firstRowIndex = 0, lastRowIndex = 12; - QCOMPARE(spyRowsRemoved.count(), 1); - QCOMPARE(spyRowsRemoved.at(0).at(1).toInt(), firstRowIndex); - QCOMPARE(spyRowsRemoved.at(0).at(2).toInt(), lastRowIndex); + QCOMPARE(spyRowsRemoved.count(), 11); + // QSqlTableModel emits 10 signals for its 10 inserted rows + QCOMPARE(spyRowsRemoved.at(0).at(1).toInt(), lastRowIndex); + QCOMPARE(spyRowsRemoved.at(9).at(1).toInt(), firstRowIndex + 3); + // QSqlQueryModel emits 1 signal for its 3 rows + QCOMPARE(spyRowsRemoved.at(10).at(1).toInt(), firstRowIndex); + QCOMPARE(spyRowsRemoved.at(10).at(2).toInt(), firstRowIndex + 2); QCOMPARE(spyRowsInserted.at(10).at(1).toInt(), firstRowIndex); QCOMPARE(spyRowsInserted.at(10).at(2).toInt(), lastRowIndex); diff --git a/tests/auto/testlib/selftests/badxml/tst_badxml.cpp b/tests/auto/testlib/selftests/badxml/tst_badxml.cpp index 1c9a0d9493..1a143e5243 100644 --- a/tests/auto/testlib/selftests/badxml/tst_badxml.cpp +++ b/tests/auto/testlib/selftests/badxml/tst_badxml.cpp @@ -106,15 +106,18 @@ void tst_BadXml::badDataTag() const QBENCHMARK { } - QFAIL("a failure"); + QFETCH(bool, shouldFail); + if (shouldFail) + QFAIL("a failure"); } void tst_BadXml::badDataTag_data() const { - QTest::addColumn<int>("dummy"); + QTest::addColumn<bool>("shouldFail"); foreach (char const* str, badStrings()) { - QTest::newRow(str) << 0; + QTest::newRow(qPrintable(QString("fail %1").arg(str))) << true; + QTest::newRow(qPrintable(QString("pass %1").arg(str))) << false; } } diff --git a/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro b/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro new file mode 100644 index 0000000000..b495995eac --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibcounting/benchlibcounting.pro @@ -0,0 +1,7 @@ +SOURCES += tst_benchlibcounting.cpp +QT = core testlib + +mac:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = benchlibcounting diff --git a/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp b/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp new file mode 100644 index 0000000000..847bc1a81d --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <QtCore/QCoreApplication> +#include <QtTest/QtTest> + +class tst_BenchlibCounting : public QObject +{ + Q_OBJECT + +private slots: + void passingBenchmark(); + void skippingBenchmark(); + void failingBenchmark(); +}; + +void tst_BenchlibCounting::passingBenchmark() +{ + QBENCHMARK { + } +} + +void tst_BenchlibCounting::skippingBenchmark() +{ + QBENCHMARK { + QSKIP("This is a skipping benchmark"); + } +} + +void tst_BenchlibCounting::failingBenchmark() +{ + QBENCHMARK { + QFAIL("This is a failing benchmark"); + }; +} + +QTEST_MAIN(tst_BenchlibCounting) +#include "tst_benchlibcounting.moc" diff --git a/tests/auto/testlib/selftests/counting/tst_counting.cpp b/tests/auto/testlib/selftests/counting/tst_counting.cpp index 6758b533bb..fa61fce173 100644 --- a/tests/auto/testlib/selftests/counting/tst_counting.cpp +++ b/tests/auto/testlib/selftests/counting/tst_counting.cpp @@ -47,6 +47,8 @@ class tst_Counting : public QObject Q_OBJECT private slots: + // The following test functions exercise each possible combination of test + // results for two data rows. void testPassPass_data(); void testPassPass(); @@ -74,6 +76,19 @@ private slots: void testFailFail_data(); void testFailFail(); + // The following test functions test skips and fails in the special + // init() and cleanup() slots. + void init(); + void cleanup(); + void testFailInInit_data(); + void testFailInInit(); + void testFailInCleanup_data(); + void testFailInCleanup(); + void testSkipInInit_data(); + void testSkipInInit(); + void testSkipInCleanup_data(); + void testSkipInCleanup(); + private: void helper(); }; @@ -212,5 +227,77 @@ void tst_Counting::testFailFail() helper(); } +void tst_Counting::init() +{ + if (strcmp(QTest::currentTestFunction(), "testFailInInit") == 0 && strcmp(QTest::currentDataTag(), "fail") == 0) + QFAIL("Fail in init()"); + else if (strcmp(QTest::currentTestFunction(), "testSkipInInit") == 0 && strcmp(QTest::currentDataTag(), "skip") == 0) + QSKIP("Skip in init()"); +} + +void tst_Counting::cleanup() +{ + if (strcmp(QTest::currentTestFunction(), "testFailInCleanup") == 0 && strcmp(QTest::currentDataTag(), "fail") == 0) + QFAIL("Fail in cleanup()"); + else if (strcmp(QTest::currentTestFunction(), "testSkipInCleanup") == 0 && strcmp(QTest::currentDataTag(), "skip") == 0) + QSKIP("Skip in cleanup()"); +} + +void tst_Counting::testFailInInit_data() +{ + QTest::addColumn<bool>("dummy"); + QTest::newRow("before") << true; + QTest::newRow("fail") << true; + QTest::newRow("after") << true; +} + +void tst_Counting::testFailInInit() +{ + if (strcmp(QTest::currentDataTag(), "fail") == 0) + QFAIL("This test function should have been skipped due to QFAIL in init()"); +} + +void tst_Counting::testFailInCleanup_data() +{ + QTest::addColumn<bool>("dummy"); + QTest::newRow("before") << true; + QTest::newRow("fail") << true; + QTest::newRow("after") << true; +} + +void tst_Counting::testFailInCleanup() +{ + if (strcmp(QTest::currentDataTag(), "fail") == 0) + qDebug() << "This test function should execute and then QFAIL in cleanup()"; +} + +void tst_Counting::testSkipInInit_data() +{ + QTest::addColumn<bool>("dummy"); + QTest::newRow("before") << true; + QTest::newRow("skip") << true; + QTest::newRow("after") << true; +} + +void tst_Counting::testSkipInInit() +{ + if (strcmp(QTest::currentDataTag(), "skip") == 0) + QFAIL("This test function should have been skipped due to QSKIP in init()"); +} + +void tst_Counting::testSkipInCleanup_data() +{ + QTest::addColumn<bool>("dummy"); + QTest::newRow("before") << true; + QTest::newRow("skip") << true; + QTest::newRow("after") << true; +} + +void tst_Counting::testSkipInCleanup() +{ + if (strcmp(QTest::currentDataTag(), "skip") == 0) + qDebug() << "This test function should execute and then QSKIP in cleanup()"; +} + QTEST_MAIN(tst_Counting) #include "tst_counting.moc" diff --git a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp index b6298f5e63..c2174e90e8 100644 --- a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp +++ b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp @@ -61,8 +61,14 @@ void tst_Crashes::crash() //we avoid the error dialogbox to appear on windows SetErrorMode( SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); #endif + /* + We deliberately dereference an invalid but non-zero address; + it should be non-zero because a few platforms may have special crash behavior + when dereferencing exactly 0 (e.g. some macs have been observed to generate SIGILL + rather than SIGSEGV). + */ int *i = 0; - *i = 1; + i[1] = 1; } QTEST_MAIN(tst_Crashes) diff --git a/tests/auto/testlib/selftests/datetime/tst_datetime.cpp b/tests/auto/testlib/selftests/datetime/tst_datetime.cpp index 60ebbfc104..c98f119f75 100644 --- a/tests/auto/testlib/selftests/datetime/tst_datetime.cpp +++ b/tests/auto/testlib/selftests/datetime/tst_datetime.cpp @@ -78,10 +78,10 @@ void tst_DateTime::qurl_data() const QTest::addColumn<QUrl>("operandA"); QTest::addColumn<QUrl>("operandB"); - QTest::newRow("") << QUrl() << QUrl(); - QTest::newRow("") << QUrl(QLatin1String("http://example.com")) << QUrl(); - QTest::newRow("") << QUrl() << QUrl(QLatin1String("http://example.com")); - QTest::newRow("") << QUrl(QLatin1String("http://example.com")) << QUrl(QLatin1String("http://example.com")); + QTest::newRow("empty urls") << QUrl() << QUrl(); + QTest::newRow("empty rhs") << QUrl(QLatin1String("http://example.com")) << QUrl(); + QTest::newRow("empty lhs") << QUrl() << QUrl(QLatin1String("http://example.com")); + QTest::newRow("same urls") << QUrl(QLatin1String("http://example.com")) << QUrl(QLatin1String("http://example.com")); } QTEST_MAIN(tst_DateTime) diff --git a/tests/auto/testlib/selftests/expected_badxml.lightxml b/tests/auto/testlib/selftests/expected_badxml.lightxml index 43446c3169..08ba497efa 100644 --- a/tests/auto/testlib/selftests/expected_badxml.lightxml +++ b/tests/auto/testlib/selftests/expected_badxml.lightxml @@ -7,60 +7,99 @@ </TestFunction> <TestFunction name="badDataTag"> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> + <DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="end cdata ]]> text ]]> more text" value="0" iterations="1" /> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[quotes " text" more text]]></DataTag> + <DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[quotes " text" more text]]></DataTag> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass end cdata ]]> text ]]> more text" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail quotes " text" more text]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail quotes " text" more text]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="quotes " text" more text" value="0" iterations="1" /> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[xml close > open < tags < text]]></DataTag> + <DataTag><![CDATA[pass quotes " text" more text]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[xml close > open < tags < text]]></DataTag> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass quotes " text" more text]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass quotes " text" more text" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="xml close > open < tags < text" value="0" iterations="1" /> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> + <DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass xml close > open < tags < text" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" value="0" iterations="1" /> </TestFunction> <TestFunction name="badMessage"> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 0]]></DataTag> <Description><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 0]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 1]]></DataTag> <Description><![CDATA[quotes " text" more text]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 2]]></DataTag> <Description><![CDATA[xml close > open < tags < text]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 2]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 3]]></DataTag> <Description><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 3]]></DataTag> +</Incident> </TestFunction> <TestFunction name="failWithNoFile"> <Incident type="fail" file="" line="0"> diff --git a/tests/auto/testlib/selftests/expected_badxml.txt b/tests/auto/testlib/selftests/expected_badxml.txt index 0db292e269..68d333ec30 100644 --- a/tests/auto/testlib/selftests/expected_badxml.txt +++ b/tests/auto/testlib/selftests/expected_badxml.txt @@ -1,32 +1,43 @@ ********* Start testing of tst_BadXml ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_BadXml::initTestCase() -QDEBUG : tst_BadXml::badDataTag(end cdata ]]> text ]]> more text) a message -FAIL! : tst_BadXml::badDataTag(end cdata ]]> text ]]> more text) a failure - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(109)] -RESULT : tst_BadXml::badDataTag():"end cdata ]]> text ]]> more text": +QDEBUG : tst_BadXml::badDataTag(fail end cdata ]]> text ]]> more text) a message +FAIL! : tst_BadXml::badDataTag(fail end cdata ]]> text ]]> more text) a failure + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(111)] +QDEBUG : tst_BadXml::badDataTag(pass end cdata ]]> text ]]> more text) a message +PASS : tst_BadXml::badDataTag(pass end cdata ]]> text ]]> more text) +RESULT : tst_BadXml::badDataTag():"pass end cdata ]]> text ]]> more text": 0 events per iteration (total: 0, iterations: 1) -QDEBUG : tst_BadXml::badDataTag(quotes " text" more text) a message -FAIL! : tst_BadXml::badDataTag(quotes " text" more text) a failure - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(109)] -RESULT : tst_BadXml::badDataTag():"quotes " text" more text": +QDEBUG : tst_BadXml::badDataTag(fail quotes " text" more text) a message +FAIL! : tst_BadXml::badDataTag(fail quotes " text" more text) a failure + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(111)] +QDEBUG : tst_BadXml::badDataTag(pass quotes " text" more text) a message +PASS : tst_BadXml::badDataTag(pass quotes " text" more text) +RESULT : tst_BadXml::badDataTag():"pass quotes " text" more text": 0 events per iteration (total: 0, iterations: 1) -QDEBUG : tst_BadXml::badDataTag(xml close > open < tags < text) a message -FAIL! : tst_BadXml::badDataTag(xml close > open < tags < text) a failure - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(109)] -RESULT : tst_BadXml::badDataTag():"xml close > open < tags < text": +QDEBUG : tst_BadXml::badDataTag(fail xml close > open < tags < text) a message +FAIL! : tst_BadXml::badDataTag(fail xml close > open < tags < text) a failure + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(111)] +QDEBUG : tst_BadXml::badDataTag(pass xml close > open < tags < text) a message +PASS : tst_BadXml::badDataTag(pass xml close > open < tags < text) +RESULT : tst_BadXml::badDataTag():"pass xml close > open < tags < text": 0 events per iteration (total: 0, iterations: 1) -QDEBUG : tst_BadXml::badDataTag(all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a message -FAIL! : tst_BadXml::badDataTag(all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a failure - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(109)] -RESULT : tst_BadXml::badDataTag():"all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs": +QDEBUG : tst_BadXml::badDataTag(fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a message +FAIL! : tst_BadXml::badDataTag(fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a failure + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(111)] +QDEBUG : tst_BadXml::badDataTag(pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a message +PASS : tst_BadXml::badDataTag(pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) +RESULT : tst_BadXml::badDataTag():"pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs": 0 events per iteration (total: 0, iterations: 1) QDEBUG : tst_BadXml::badMessage(string 0) end cdata ]]> text ]]> more text +PASS : tst_BadXml::badMessage(string 0) QDEBUG : tst_BadXml::badMessage(string 1) quotes " text" more text +PASS : tst_BadXml::badMessage(string 1) QDEBUG : tst_BadXml::badMessage(string 2) xml close > open < tags < text +PASS : tst_BadXml::badMessage(string 2) QDEBUG : tst_BadXml::badMessage(string 3) all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs -PASS : tst_BadXml::badMessage() +PASS : tst_BadXml::badMessage(string 3) FAIL! : tst_BadXml::failWithNoFile() failure message PASS : tst_BadXml::cleanupTestCase() -Totals: 3 passed, 5 failed, 0 skipped +Totals: 10 passed, 5 failed, 0 skipped ********* Finished testing of tst_BadXml ********* diff --git a/tests/auto/testlib/selftests/expected_badxml.xml b/tests/auto/testlib/selftests/expected_badxml.xml index fbb584d5e5..849bc07bfc 100644 --- a/tests/auto/testlib/selftests/expected_badxml.xml +++ b/tests/auto/testlib/selftests/expected_badxml.xml @@ -9,60 +9,99 @@ </TestFunction> <TestFunction name="badDataTag"> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> + <DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="end cdata ]]> text ]]> more text" value="0" iterations="1" /> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[quotes " text" more text]]></DataTag> + <DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[quotes " text" more text]]></DataTag> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass end cdata ]]> text ]]> more text" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail quotes " text" more text]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail quotes " text" more text]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="quotes " text" more text" value="0" iterations="1" /> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[xml close > open < tags < text]]></DataTag> + <DataTag><![CDATA[pass quotes " text" more text]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[xml close > open < tags < text]]></DataTag> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass quotes " text" more text]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass quotes " text" more text" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="xml close > open < tags < text" value="0" iterations="1" /> <Message type="qdebug" file="" line="0"> - <DataTag><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> + <DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass xml close > open < tags < text]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass xml close > open < tags < text" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> <Description><![CDATA[a message]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="109"> - <DataTag><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="111"> + <DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> <Description><![CDATA[a failure]]></Description> </Incident> -<BenchmarkResult metric="Events" tag="all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" value="0" iterations="1" /> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> + <Description><![CDATA[a message]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[pass all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag> +</Incident> +<BenchmarkResult metric="Events" tag="pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" value="0" iterations="1" /> </TestFunction> <TestFunction name="badMessage"> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 0]]></DataTag> <Description><![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 0]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 1]]></DataTag> <Description><![CDATA[quotes " text" more text]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 2]]></DataTag> <Description><![CDATA[xml close > open < tags < text]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 2]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[string 3]]></DataTag> <Description><![CDATA[all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[string 3]]></DataTag> +</Incident> </TestFunction> <TestFunction name="failWithNoFile"> <Incident type="fail" file="" line="0"> diff --git a/tests/auto/testlib/selftests/expected_badxml.xunitxml b/tests/auto/testlib/selftests/expected_badxml.xunitxml index 724aed59e7..939e887a88 100644 --- a/tests/auto/testlib/selftests/expected_badxml.xunitxml +++ b/tests/auto/testlib/selftests/expected_badxml.xunitxml @@ -1,19 +1,23 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="8" failures="5" tests="5" name="tst_BadXml"> +<testsuite errors="12" failures="5" tests="5" name="tst_BadXml"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="fail" name="badDataTag"> - <!-- tag="end cdata ]]> text ]]> more text" message="a message" type="qdebug" --> - <failure tag="end cdata ]]> text ]]> more text" message="a failure" result="fail"/> - <!-- tag="quotes " text" more text" message="a message" type="qdebug" --> - <failure tag="quotes " text" more text" message="a failure" result="fail"/> - <!-- tag="xml close > open < tags < text" message="a message" type="qdebug" --> - <failure tag="xml close > open < tags < text" message="a failure" result="fail"/> - <!-- tag="all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" message="a message" type="qdebug" --> - <failure tag="all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" message="a failure" result="fail"/> + <!-- tag="fail end cdata ]]> text ]]> more text" message="a message" type="qdebug" --> + <failure tag="fail end cdata ]]> text ]]> more text" message="a failure" result="fail"/> + <!-- tag="pass end cdata ]]> text ]]> more text" message="a message" type="qdebug" --> + <!-- tag="fail quotes " text" more text" message="a message" type="qdebug" --> + <failure tag="fail quotes " text" more text" message="a failure" result="fail"/> + <!-- tag="pass quotes " text" more text" message="a message" type="qdebug" --> + <!-- tag="fail xml close > open < tags < text" message="a message" type="qdebug" --> + <failure tag="fail xml close > open < tags < text" message="a failure" result="fail"/> + <!-- tag="pass xml close > open < tags < text" message="a message" type="qdebug" --> + <!-- tag="fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" message="a message" type="qdebug" --> + <failure tag="fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" message="a failure" result="fail"/> + <!-- tag="pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs" message="a message" type="qdebug" --> </testcase> <testcase result="pass" name="badMessage"> <!-- tag="string 0" message="end cdata ]]> text ]]> more text" type="qdebug" --> @@ -30,6 +34,10 @@ <![CDATA[a message]]> <![CDATA[a message]]> <![CDATA[a message]]> +<![CDATA[a message]]> +<![CDATA[a message]]> +<![CDATA[a message]]> +<![CDATA[a message]]> <![CDATA[end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]> <![CDATA[quotes " text" more text]]> <![CDATA[xml close > open < tags < text]]> diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.txt b/tests/auto/testlib/selftests/expected_benchlibcallgrind.txt index 2498c81138..13e9a39aff 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcallgrind.txt +++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind.txt @@ -1,9 +1,9 @@ ********* Start testing of tst_BenchlibCallgrind ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_BenchlibCallgrind::initTestCase() -RESULT : tst_BenchlibCallgrind::twoHundredMillionInstructions(): - 200,000,000 instruction reads per iteration (total: 200000000, iterations: 1) PASS : tst_BenchlibCallgrind::twoHundredMillionInstructions() +RESULT : tst_BenchlibCallgrind::twoHundredMillionInstructions(): + 200,000,158 instruction reads per iteration (total: 200,000,158, iterations: 1) PASS : tst_BenchlibCallgrind::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped ********* Finished testing of tst_BenchlibCallgrind ********* diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml new file mode 100644 index 0000000000..5c436a53e0 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml @@ -0,0 +1,24 @@ +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> +</TestFunction> +<TestFunction name="passingBenchmark"> +<Incident type="pass" file="" line="0" /> +<BenchmarkResult metric="Events" tag="" value="0" iterations="1" /> +</TestFunction> +<TestFunction name="skippingBenchmark"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="64"> + <Description><![CDATA[This is a skipping benchmark]]></Description> +</Message> +</TestFunction> +<TestFunction name="failingBenchmark"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="71"> + <Description><![CDATA[This is a failing benchmark]]></Description> +</Incident> +</TestFunction> +<TestFunction name="cleanupTestCase"> +<Incident type="pass" file="" line="0" /> +</TestFunction> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.txt b/tests/auto/testlib/selftests/expected_benchlibcounting.txt new file mode 100644 index 0000000000..e1af40b9e0 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.txt @@ -0,0 +1,13 @@ +********* Start testing of tst_BenchlibCounting ********* +Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ +PASS : tst_BenchlibCounting::initTestCase() +PASS : tst_BenchlibCounting::passingBenchmark() +RESULT : tst_BenchlibCounting::passingBenchmark(): + 0 events per iteration (total: 0, iterations: 1) +SKIP : tst_BenchlibCounting::skippingBenchmark() This is a skipping benchmark + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(64)] +FAIL! : tst_BenchlibCounting::failingBenchmark() This is a failing benchmark + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(71)] +PASS : tst_BenchlibCounting::cleanupTestCase() +Totals: 3 passed, 1 failed, 1 skipped +********* Finished testing of tst_BenchlibCounting ********* diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xml b/tests/auto/testlib/selftests/expected_benchlibcounting.xml new file mode 100644 index 0000000000..5bf71fbf8e --- /dev/null +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<TestCase name="tst_BenchlibCounting"> +<Environment> + <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> + <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> +</Environment> +<TestFunction name="initTestCase"> +<Incident type="pass" file="" line="0" /> +</TestFunction> +<TestFunction name="passingBenchmark"> +<Incident type="pass" file="" line="0" /> +<BenchmarkResult metric="Events" tag="" value="0" iterations="1" /> +</TestFunction> +<TestFunction name="skippingBenchmark"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="64"> + <Description><![CDATA[This is a skipping benchmark]]></Description> +</Message> +</TestFunction> +<TestFunction name="failingBenchmark"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="71"> + <Description><![CDATA[This is a failing benchmark]]></Description> +</Incident> +</TestFunction> +<TestFunction name="cleanupTestCase"> +<Incident type="pass" file="" line="0" /> +</TestFunction> +</TestCase> diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml b/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml new file mode 100644 index 0000000000..83e429aa3a --- /dev/null +++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xunitxml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<testsuite errors="1" failures="1" tests="5" name="tst_BenchlibCounting"> + <properties> + <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> + <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> + </properties> + <testcase result="pass" name="initTestCase"/> + <testcase result="pass" name="passingBenchmark"> + </testcase> + <testcase name="skippingBenchmark"> + <!-- message="This is a skipping benchmark" type="skip" --> + </testcase> + <testcase result="fail" name="failingBenchmark"> + <failure message="This is a failing benchmark" result="fail"/> + </testcase> + <testcase result="pass" name="cleanupTestCase"/> + <system-err> +<![CDATA[This is a skipping benchmark]]> + </system-err> +</testsuite> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml index 3bede6de83..3cb59d209b 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml @@ -6,14 +6,34 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="events"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[0]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="0" value="0" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="1" value="1" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[10]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="10" value="10" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[100]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="100" value="100" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[500]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="500" value="500" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[5000]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="5000" value="5000" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[100000]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" /> -<Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt b/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt index e3dc6c0411..7be4bcccc4 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt @@ -1,21 +1,27 @@ ********* Start testing of tst_BenchlibEventCounter ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_BenchlibEventCounter::initTestCase() +PASS : tst_BenchlibEventCounter::events(0) RESULT : tst_BenchlibEventCounter::events():"0": 0 events per iteration (total: 0, iterations: 1) +PASS : tst_BenchlibEventCounter::events(1) RESULT : tst_BenchlibEventCounter::events():"1": 1 events per iteration (total: 1, iterations: 1) +PASS : tst_BenchlibEventCounter::events(10) RESULT : tst_BenchlibEventCounter::events():"10": 10 events per iteration (total: 10, iterations: 1) +PASS : tst_BenchlibEventCounter::events(100) RESULT : tst_BenchlibEventCounter::events():"100": 100 events per iteration (total: 100, iterations: 1) +PASS : tst_BenchlibEventCounter::events(500) RESULT : tst_BenchlibEventCounter::events():"500": 500 events per iteration (total: 500, iterations: 1) +PASS : tst_BenchlibEventCounter::events(5000) RESULT : tst_BenchlibEventCounter::events():"5000": - 5,000 events per iteration (total: 5000, iterations: 1) + 5,000 events per iteration (total: 5,000, iterations: 1) +PASS : tst_BenchlibEventCounter::events(100000) RESULT : tst_BenchlibEventCounter::events():"100000": - 100,000 events per iteration (total: 100000, iterations: 1) -PASS : tst_BenchlibEventCounter::events() + 100,000 events per iteration (total: 100,000, iterations: 1) PASS : tst_BenchlibEventCounter::cleanupTestCase() -Totals: 3 passed, 0 failed, 0 skipped +Totals: 9 passed, 0 failed, 0 skipped ********* Finished testing of tst_BenchlibEventCounter ********* diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml index 646cf22b80..47b497881a 100644 --- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml +++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml @@ -8,14 +8,34 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="events"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[0]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="0" value="0" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="1" value="1" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[10]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="10" value="10" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[100]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="100" value="100" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[500]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="500" value="500" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[5000]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="5000" value="5000" iterations="1" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[100000]]></DataTag> +</Incident> <BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" /> -<Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.txt b/tests/auto/testlib/selftests/expected_benchliboptions.txt index 3e75d209d0..ef9f0c5ad0 100644 --- a/tests/auto/testlib/selftests/expected_benchliboptions.txt +++ b/tests/auto/testlib/selftests/expected_benchliboptions.txt @@ -1,27 +1,27 @@ ********* Start testing of tst_BenchlibOptions ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_BenchlibOptions::initTestCase() +PASS : tst_BenchlibOptions::threeEvents() RESULT : tst_BenchlibOptions::threeEvents(): 3 events per iteration (total: 3, iterations: 1) -PASS : tst_BenchlibOptions::threeEvents() PASS : tst_BenchlibOptions::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped ********* Finished testing of tst_BenchlibOptions ********* ********* Start testing of tst_BenchlibFifteenIterations ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_BenchlibFifteenIterations::initTestCase() +PASS : tst_BenchlibFifteenIterations::threeEvents() RESULT : tst_BenchlibFifteenIterations::threeEvents(): 3.0 events per iteration (total: 45, iterations: 15) -PASS : tst_BenchlibFifteenIterations::threeEvents() PASS : tst_BenchlibFifteenIterations::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped ********* Finished testing of tst_BenchlibFifteenIterations ********* ********* Start testing of tst_BenchlibOneHundredMinimum ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_BenchlibOneHundredMinimum::initTestCase() +PASS : tst_BenchlibOneHundredMinimum::threeEvents() RESULT : tst_BenchlibOneHundredMinimum::threeEvents(): 3.00 events per iteration (total: 192, iterations: 64) -PASS : tst_BenchlibOneHundredMinimum::threeEvents() PASS : tst_BenchlibOneHundredMinimum::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped ********* Finished testing of tst_BenchlibOneHundredMinimum ********* diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.xml b/tests/auto/testlib/selftests/expected_benchliboptions.xml deleted file mode 100644 index 40bff95f79..0000000000 --- a/tests/auto/testlib/selftests/expected_benchliboptions.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<TestCase name="tst_BenchlibOneHundredMinimum"> -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="threeEvents"> -<BenchmarkResult metric="walltime" tag="" value="123" iterations="2097152" /> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -</TestCase> diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.xunitxml b/tests/auto/testlib/selftests/expected_benchliboptions.xunitxml deleted file mode 100644 index 7317e90470..0000000000 --- a/tests/auto/testlib/selftests/expected_benchliboptions.xunitxml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="0" tests="3" name="tst_BenchlibOneHundredMinimum"> - <properties> - <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> - <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> - </properties> - <testcase result="pass" name="initTestCase"/> - <testcase result="pass" name="threeEvents"> - </testcase> - <testcase result="pass" name="cleanupTestCase"/> - <system-err/> -</testsuite> diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml index 17f3e6ec3a..d1cccd4bd2 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.lightxml +++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml @@ -12,25 +12,28 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="compare_tostring"> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[int, string]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(int,123) Expected (expected): QVariant(QString,hi)]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[both invalid]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[null hash, invalid]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(QVariantHash) Expected (expected): QVariant()]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[string, null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(QString,A simple string) Expected (expected): QVariant(PhonyClass)]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[both non-null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(PhonyClass,<value not representable as string>) @@ -38,31 +41,37 @@ </Incident> </TestFunction> <TestFunction name="compareQStringLists"> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[empty lists]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[equal lists]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[last item different]]></DataTag> <Description><![CDATA[Compared QStringLists differ at index 2. Actual (opA) : 'string3' Expected (opB) : 'DIFFERS']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[second-last item different]]></DataTag> <Description><![CDATA[Compared QStringLists differ at index 2. Actual (opA) : 'string3' Expected (opB) : 'DIFFERS']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[prefix]]></DataTag> <Description><![CDATA[Compared QStringLists have different sizes. Actual (opA) size : '2' Expected (opB) size: '1']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[short list second]]></DataTag> <Description><![CDATA[Compared QStringLists have different sizes. Actual (opA) size : '12' Expected (opB) size: '1']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[short list first]]></DataTag> <Description><![CDATA[Compared QStringLists have different sizes. Actual (opA) size : '1' @@ -70,55 +79,67 @@ </Incident> </TestFunction> <TestFunction name="compareQPixmaps"> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[both null]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull() : 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull() : 0 Expected (opB).isNull(): 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[equal]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QPixmaps differ in size. Actual (opA) : 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> </TestFunction> <TestFunction name="compareQImages"> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[both null]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull() : 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull() : 0 Expected (opB).isNull(): 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[equal]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QImages differ in size. Actual (opA) : 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[different format]]></DataTag> <Description><![CDATA[Compared QImages differ in format. Actual (opA) : 6 Expected (opB): 3]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt index 36a4995d91..fce635ae5a 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.txt +++ b/tests/auto/testlib/selftests/expected_cmptest.txt @@ -6,71 +6,78 @@ PASS : tst_Cmptest::compare_pointerfuncs() FAIL! : tst_Cmptest::compare_tostring(int, string) Compared values are not the same Actual (actual): QVariant(int,123) Expected (expected): QVariant(QString,hi) - Loc: [tst_cmptest.cpp(214)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(214)] +PASS : tst_Cmptest::compare_tostring(both invalid) FAIL! : tst_Cmptest::compare_tostring(null hash, invalid) Compared values are not the same Actual (actual): QVariant(QVariantHash) Expected (expected): QVariant() - Loc: [tst_cmptest.cpp(214)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(214)] FAIL! : tst_Cmptest::compare_tostring(string, null user type) Compared values are not the same Actual (actual): QVariant(QString,A simple string) Expected (expected): QVariant(PhonyClass) - Loc: [tst_cmptest.cpp(214)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(214)] FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values are not the same Actual (actual): QVariant(PhonyClass,<value not representable as string>) Expected (expected): QVariant(PhonyClass,<value not representable as string>) - Loc: [tst_cmptest.cpp(214)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(214)] +PASS : tst_Cmptest::compareQStringLists(empty lists) +PASS : tst_Cmptest::compareQStringLists(equal lists) FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared QStringLists differ at index 2. Actual (opA) : 'string3' Expected (opB) : 'DIFFERS' - Loc: [tst_cmptest.cpp(308)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(308)] FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared QStringLists differ at index 2. Actual (opA) : 'string3' Expected (opB) : 'DIFFERS' - Loc: [tst_cmptest.cpp(308)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(308)] FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared QStringLists have different sizes. Actual (opA) size : '2' Expected (opB) size: '1' - Loc: [tst_cmptest.cpp(308)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(308)] FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared QStringLists have different sizes. Actual (opA) size : '12' Expected (opB) size: '1' - Loc: [tst_cmptest.cpp(308)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(308)] FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared QStringLists have different sizes. Actual (opA) size : '1' Expected (opB) size: '12' - Loc: [tst_cmptest.cpp(308)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(308)] +PASS : tst_Cmptest::compareQPixmaps(both null) FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ. Actual (opA).isNull() : 1 Expected (opB).isNull(): 0 - Loc: [tst_cmptest.cpp(333)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(333)] FAIL! : tst_Cmptest::compareQPixmaps(other null) Compared QPixmaps differ. Actual (opA).isNull() : 0 Expected (opB).isNull(): 1 - Loc: [tst_cmptest.cpp(333)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(333)] +PASS : tst_Cmptest::compareQPixmaps(equal) FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ in size. Actual (opA) : 11x20 Expected (opB): 20x20 - Loc: [tst_cmptest.cpp(333)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(333)] FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same - Loc: [tst_cmptest.cpp(333)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(333)] +PASS : tst_Cmptest::compareQImages(both null) FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ. Actual (opA).isNull() : 1 Expected (opB).isNull(): 0 - Loc: [tst_cmptest.cpp(360)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(360)] FAIL! : tst_Cmptest::compareQImages(other null) Compared QImages differ. Actual (opA).isNull() : 0 Expected (opB).isNull(): 1 - Loc: [tst_cmptest.cpp(360)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(360)] +PASS : tst_Cmptest::compareQImages(equal) FAIL! : tst_Cmptest::compareQImages(different size) Compared QImages differ in size. Actual (opA) : 11x20 Expected (opB): 20x20 - Loc: [tst_cmptest.cpp(360)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(360)] FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ in format. Actual (opA) : 6 Expected (opB): 3 - Loc: [tst_cmptest.cpp(360)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(360)] FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same - Loc: [tst_cmptest.cpp(360)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(360)] PASS : tst_Cmptest::cleanupTestCase() -Totals: 4 passed, 18 failed, 0 skipped +Totals: 11 passed, 18 failed, 0 skipped ********* Finished testing of tst_Cmptest ********* diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml index aba1ce5edd..90bb313518 100644 --- a/tests/auto/testlib/selftests/expected_cmptest.xml +++ b/tests/auto/testlib/selftests/expected_cmptest.xml @@ -14,25 +14,28 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="compare_tostring"> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[int, string]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(int,123) Expected (expected): QVariant(QString,hi)]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[both invalid]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[null hash, invalid]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(QVariantHash) Expected (expected): QVariant()]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[string, null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(QString,A simple string) Expected (expected): QVariant(PhonyClass)]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="214"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="214"> <DataTag><![CDATA[both non-null user type]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (actual): QVariant(PhonyClass,<value not representable as string>) @@ -40,31 +43,37 @@ </Incident> </TestFunction> <TestFunction name="compareQStringLists"> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[empty lists]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[equal lists]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[last item different]]></DataTag> <Description><![CDATA[Compared QStringLists differ at index 2. Actual (opA) : 'string3' Expected (opB) : 'DIFFERS']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[second-last item different]]></DataTag> <Description><![CDATA[Compared QStringLists differ at index 2. Actual (opA) : 'string3' Expected (opB) : 'DIFFERS']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[prefix]]></DataTag> <Description><![CDATA[Compared QStringLists have different sizes. Actual (opA) size : '2' Expected (opB) size: '1']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[short list second]]></DataTag> <Description><![CDATA[Compared QStringLists have different sizes. Actual (opA) size : '12' Expected (opB) size: '1']]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="308"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="308"> <DataTag><![CDATA[short list first]]></DataTag> <Description><![CDATA[Compared QStringLists have different sizes. Actual (opA) size : '1' @@ -72,55 +81,67 @@ </Incident> </TestFunction> <TestFunction name="compareQPixmaps"> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[both null]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull() : 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QPixmaps differ. Actual (opA).isNull() : 0 Expected (opB).isNull(): 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[equal]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QPixmaps differ in size. Actual (opA) : 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="333"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="333"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> </TestFunction> <TestFunction name="compareQImages"> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[both null]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[one null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull() : 1 Expected (opB).isNull(): 0]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[other null]]></DataTag> <Description><![CDATA[Compared QImages differ. Actual (opA).isNull() : 0 Expected (opB).isNull(): 1]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[equal]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[different size]]></DataTag> <Description><![CDATA[Compared QImages differ in size. Actual (opA) : 11x20 Expected (opB): 20x20]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[different format]]></DataTag> <Description><![CDATA[Compared QImages differ in format. Actual (opA) : 6 Expected (opB): 3]]></Description> </Incident> -<Incident type="fail" file="tst_cmptest.cpp" line="360"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="360"> <DataTag><![CDATA[different pixels]]></DataTag> <Description><![CDATA[Compared values are not the same]]></Description> </Incident> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml index 8de90f05d8..37eb5f5a2b 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml @@ -10,30 +10,46 @@ <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data2]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data2]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data3]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data3]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data4]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data4]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data5]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="fiveTablePasses"> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.txt b/tests/auto/testlib/selftests/expected_commandlinedata.txt index c1b97e2a30..10e4916b54 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.txt +++ b/tests/auto/testlib/selftests/expected_commandlinedata.txt @@ -4,21 +4,25 @@ INFO : tst_DataTable::initTestCase() entering PASS : tst_DataTable::initTestCase() INFO : tst_DataTable::fiveTablePasses() entering INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data1) QVERIFY(test) - Loc: [tst_commandlinedata.cpp(30)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(65)] +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data1) INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data2) QVERIFY(test) - Loc: [tst_commandlinedata.cpp(30)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(65)] +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data2) INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data3) QVERIFY(test) - Loc: [tst_commandlinedata.cpp(30)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(65)] +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data3) INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data4) QVERIFY(test) - Loc: [tst_commandlinedata.cpp(30)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(65)] +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data4) INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data5) QVERIFY(test) - Loc: [tst_commandlinedata.cpp(30)] -PASS : tst_DataTable::fiveTablePasses() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(65)] +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data5) INFO : tst_DataTable::fiveTablePasses() entering INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data1) QVERIFY(test) - Loc: [tst_commandlinedata.cpp(30)] -PASS : tst_DataTable::fiveTablePasses() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(65)] +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data1) INFO : tst_DataTable::cleanupTestCase() entering PASS : tst_DataTable::cleanupTestCase() -Totals: 4 passed, 0 failed, 0 skipped +Totals: 8 passed, 0 failed, 0 skipped ********* Finished testing of tst_DataTable ********* diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.xml b/tests/auto/testlib/selftests/expected_commandlinedata.xml index bfaf623330..2296ae8e74 100644 --- a/tests/auto/testlib/selftests/expected_commandlinedata.xml +++ b/tests/auto/testlib/selftests/expected_commandlinedata.xml @@ -12,30 +12,46 @@ <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data2]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data2]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data3]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data3]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data4]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data4]]></DataTag> +</Incident> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data5]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="fiveTablePasses"> <Message type="info" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="65"> <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> <Description><![CDATA[QVERIFY(test)]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data1]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_counting.lightxml b/tests/auto/testlib/selftests/expected_counting.lightxml index f16abef128..e7b1136417 100644 --- a/tests/auto/testlib/selftests/expected_counting.lightxml +++ b/tests/auto/testlib/selftests/expected_counting.lightxml @@ -6,73 +6,145 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="testPassPass"> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="testPassSkip"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 1]]></DataTag> +</Incident> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> </TestFunction> <TestFunction name="testPassFail"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 1]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> </TestFunction> <TestFunction name="testSkipPass"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="testSkipSkip"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> </TestFunction> <TestFunction name="testSkipFail"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> </TestFunction> <TestFunction name="testFailPass"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="testFailSkip"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> </TestFunction> <TestFunction name="testFailFail"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> </TestFunction> +<TestFunction name="testFailInInit"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="233"> + <DataTag><![CDATA[fail]]></DataTag> + <Description><![CDATA[Fail in init()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="testFailInCleanup"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail]]></DataTag> + <Description><![CDATA[This test function should execute and then QFAIL in cleanup() ]]></Description> +</Message> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="241"> + <DataTag><![CDATA[fail]]></DataTag> + <Description><![CDATA[Fail in cleanup()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="testSkipInInit"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="235"> + <DataTag><![CDATA[skip]]></DataTag> + <Description><![CDATA[Skip in init()]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="testSkipInCleanup"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[skip]]></DataTag> + <Description><![CDATA[This test function should execute and then QSKIP in cleanup() ]]></Description> +</Message> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="243"> + <DataTag><![CDATA[skip]]></DataTag> + <Description><![CDATA[Skip in cleanup()]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> diff --git a/tests/auto/testlib/selftests/expected_counting.txt b/tests/auto/testlib/selftests/expected_counting.txt index adf80012c7..5c17e3c257 100644 --- a/tests/auto/testlib/selftests/expected_counting.txt +++ b/tests/auto/testlib/selftests/expected_counting.txt @@ -1,32 +1,54 @@ ********* Start testing of tst_Counting ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_Counting::initTestCase() -PASS : tst_Counting::testPassPass() +PASS : tst_Counting::testPassPass(row 1) +PASS : tst_Counting::testPassPass(row 2) +PASS : tst_Counting::testPassSkip(row 1) SKIP : tst_Counting::testPassSkip(row 2) Skipping - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(102)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(117)] +PASS : tst_Counting::testPassFail(row 1) FAIL! : tst_Counting::testPassFail(row 2) 'false' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(114)] SKIP : tst_Counting::testSkipPass(row 1) Skipping - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(102)] -PASS : tst_Counting::testSkipPass() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(117)] +PASS : tst_Counting::testSkipPass(row 2) SKIP : tst_Counting::testSkipSkip(row 1) Skipping - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(102)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(117)] SKIP : tst_Counting::testSkipSkip(row 2) Skipping - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(102)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(117)] SKIP : tst_Counting::testSkipFail(row 1) Skipping - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(102)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(117)] FAIL! : tst_Counting::testSkipFail(row 2) 'false' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(114)] FAIL! : tst_Counting::testFailPass(row 1) 'false' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(114)] +PASS : tst_Counting::testFailPass(row 2) FAIL! : tst_Counting::testFailSkip(row 1) 'false' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(114)] SKIP : tst_Counting::testFailSkip(row 2) Skipping - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(102)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(117)] FAIL! : tst_Counting::testFailFail(row 1) 'false' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(114)] FAIL! : tst_Counting::testFailFail(row 2) 'false' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(114)] +PASS : tst_Counting::testFailInInit(before) +FAIL! : tst_Counting::testFailInInit(fail) Fail in init() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(233)] +PASS : tst_Counting::testFailInInit(after) +PASS : tst_Counting::testFailInCleanup(before) +QDEBUG : tst_Counting::testFailInCleanup(fail) This test function should execute and then QFAIL in cleanup() +FAIL! : tst_Counting::testFailInCleanup(fail) Fail in cleanup() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(241)] +PASS : tst_Counting::testFailInCleanup(after) +PASS : tst_Counting::testSkipInInit(before) +SKIP : tst_Counting::testSkipInInit(skip) Skip in init() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(235)] +PASS : tst_Counting::testSkipInInit(after) +PASS : tst_Counting::testSkipInCleanup(before) +QDEBUG : tst_Counting::testSkipInCleanup(skip) This test function should execute and then QSKIP in cleanup() +SKIP : tst_Counting::testSkipInCleanup(skip) Skip in cleanup() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(243)] +PASS : tst_Counting::testSkipInCleanup(after) PASS : tst_Counting::cleanupTestCase() -Totals: 4 passed, 6 failed, 6 skipped +Totals: 16 passed, 8 failed, 8 skipped ********* Finished testing of tst_Counting ********* diff --git a/tests/auto/testlib/selftests/expected_counting.xml b/tests/auto/testlib/selftests/expected_counting.xml index f5982d7052..a97296807d 100644 --- a/tests/auto/testlib/selftests/expected_counting.xml +++ b/tests/auto/testlib/selftests/expected_counting.xml @@ -8,73 +8,145 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="testPassPass"> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="testPassSkip"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 1]]></DataTag> +</Incident> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> </TestFunction> <TestFunction name="testPassFail"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 1]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> </TestFunction> <TestFunction name="testSkipPass"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="testSkipSkip"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> </TestFunction> <TestFunction name="testSkipFail"> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> </TestFunction> <TestFunction name="testFailPass"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[row 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="testFailSkip"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> -<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="102"> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="117"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA[Skipping]]></Description> </Message> </TestFunction> <TestFunction name="testFailFail"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 1]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="99"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="114"> <DataTag><![CDATA[row 2]]></DataTag> <Description><![CDATA['false' returned FALSE. ()]]></Description> </Incident> </TestFunction> +<TestFunction name="testFailInInit"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="233"> + <DataTag><![CDATA[fail]]></DataTag> + <Description><![CDATA[Fail in init()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="testFailInCleanup"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[fail]]></DataTag> + <Description><![CDATA[This test function should execute and then QFAIL in cleanup() ]]></Description> +</Message> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="241"> + <DataTag><![CDATA[fail]]></DataTag> + <Description><![CDATA[Fail in cleanup()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="testSkipInInit"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="235"> + <DataTag><![CDATA[skip]]></DataTag> + <Description><![CDATA[Skip in init()]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="testSkipInCleanup"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[before]]></DataTag> +</Incident> +<Message type="qdebug" file="" line="0"> + <DataTag><![CDATA[skip]]></DataTag> + <Description><![CDATA[This test function should execute and then QSKIP in cleanup() ]]></Description> +</Message> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="243"> + <DataTag><![CDATA[skip]]></DataTag> + <Description><![CDATA[Skip in cleanup()]]></Description> +</Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[after]]></DataTag> +</Incident> +</TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> diff --git a/tests/auto/testlib/selftests/expected_counting.xunitxml b/tests/auto/testlib/selftests/expected_counting.xunitxml index c19a1612cb..f317ed5923 100644 --- a/tests/auto/testlib/selftests/expected_counting.xunitxml +++ b/tests/auto/testlib/selftests/expected_counting.xunitxml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="6" failures="6" tests="11" name="tst_Counting"> +<testsuite errors="10" failures="8" tests="15" name="tst_Counting"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="pass" name="testPassPass"/> - <testcase name="testPassSkip"> + <testcase result="pass" name="testPassSkip"> <!-- tag="row 2" message="Skipping" type="skip" --> </testcase> <testcase result="fail" name="testPassFail"> @@ -34,6 +34,20 @@ <failure tag="row 1" message="'false' returned FALSE. ()" result="fail"/> <failure tag="row 2" message="'false' returned FALSE. ()" result="fail"/> </testcase> + <testcase result="fail" name="testFailInInit"> + <failure tag="fail" message="Fail in init()" result="fail"/> + </testcase> + <testcase result="fail" name="testFailInCleanup"> + <!-- tag="fail" message="This test function should execute and then QFAIL in cleanup() " type="qdebug" --> + <failure tag="fail" message="Fail in cleanup()" result="fail"/> + </testcase> + <testcase result="pass" name="testSkipInInit"> + <!-- tag="skip" message="Skip in init()" type="skip" --> + </testcase> + <testcase result="pass" name="testSkipInCleanup"> + <!-- tag="skip" message="This test function should execute and then QSKIP in cleanup() " type="qdebug" --> + <!-- tag="skip" message="Skip in cleanup()" type="skip" --> + </testcase> <testcase result="pass" name="cleanupTestCase"/> <system-err> <![CDATA[Skipping]]> @@ -42,5 +56,9 @@ <![CDATA[Skipping]]> <![CDATA[Skipping]]> <![CDATA[Skipping]]> +<![CDATA[This test function should execute and then QFAIL in cleanup() ]]> +<![CDATA[Skip in init()]]> +<![CDATA[This test function should execute and then QSKIP in cleanup() ]]> +<![CDATA[Skip in cleanup()]]> </system-err> </testsuite> diff --git a/tests/auto/testlib/selftests/expected_crashes.lightxml b/tests/auto/testlib/selftests/expected_crashes.lightxml deleted file mode 100644 index 76890deb75..0000000000 --- a/tests/auto/testlib/selftests/expected_crashes.lightxml +++ /dev/null @@ -1,15 +0,0 @@ -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="crash"> -<Incident type="fail" file="Unknown file" line="0"> -<Message type="qfatal" file="" line="0"> - <Description><![CDATA[Received signal 11]]></Description> -</Message> - <Description><![CDATA[Received a fatal error.]]></Description> -</Incident> -</TestFunction> diff --git a/tests/auto/testlib/selftests/expected_crashes.xml b/tests/auto/testlib/selftests/expected_crashes.xml deleted file mode 100644 index be01e633e9..0000000000 --- a/tests/auto/testlib/selftests/expected_crashes.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<TestCase name="tst_Crashes"> -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="crash"> -<Message type="qfatal" file="" line="0"> - <Description><![CDATA[Received signal 11]]></Description> -</Message> -<Incident type="fail" file="Unknown file" line="0"> - <Description><![CDATA[Received a fatal error.]]></Description> -</Incident> -</TestFunction> -</TestCase> diff --git a/tests/auto/testlib/selftests/expected_datatable.lightxml b/tests/auto/testlib/selftests/expected_datatable.lightxml index 1741b6f1e3..83ac0c0b5d 100644 --- a/tests/auto/testlib/selftests/expected_datatable.lightxml +++ b/tests/auto/testlib/selftests/expected_datatable.lightxml @@ -12,7 +12,21 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="fiveTablePasses"> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 2]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 3]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 4]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="fiveTableFailures"> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="91"> @@ -41,18 +55,54 @@ <DataTag><![CDATA[startsWithFailure_data 1]]></DataTag> <Description><![CDATA['test' returned FALSE. ()]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 2]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 3]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 4]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="endsWithFailure"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 2]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 3]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 4]]></DataTag> +</Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="91"> <DataTag><![CDATA[endsWithFailure 5]]></DataTag> <Description><![CDATA['test' returned FALSE. ()]]></Description> </Incident> </TestFunction> <TestFunction name="failureInMiddle"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 2]]></DataTag> +</Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="91"> <DataTag><![CDATA[failureInMiddle_data 3]]></DataTag> <Description><![CDATA['test' returned FALSE. ()]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 4]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="fiveIsolatedFailures"> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="173"> diff --git a/tests/auto/testlib/selftests/expected_datatable.txt b/tests/auto/testlib/selftests/expected_datatable.txt index 4031ca22dd..68c33e6efd 100644 --- a/tests/auto/testlib/selftests/expected_datatable.txt +++ b/tests/auto/testlib/selftests/expected_datatable.txt @@ -3,33 +3,49 @@ Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE PASS : tst_DataTable::initTestCase() PASS : tst_DataTable::singleTestFunction1() PASS : tst_DataTable::singleTestFunction2() -PASS : tst_DataTable::fiveTablePasses() +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 1) +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 2) +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 3) +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 4) +PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 5) FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 1) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 2) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 3) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 4) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 5) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] FAIL! : tst_DataTable::startsWithFailure(startsWithFailure_data 1) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] +PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 2) +PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 3) +PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 4) +PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 5) +PASS : tst_DataTable::endsWithFailure(endsWithFailure 1) +PASS : tst_DataTable::endsWithFailure(endsWithFailure 2) +PASS : tst_DataTable::endsWithFailure(endsWithFailure 3) +PASS : tst_DataTable::endsWithFailure(endsWithFailure 4) FAIL! : tst_DataTable::endsWithFailure(endsWithFailure 5) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] +PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 1) +PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 2) FAIL! : tst_DataTable::failureInMiddle(failureInMiddle_data 3) 'test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(58)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(91)] +PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 4) +PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 5) FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 1) '!test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(140)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(173)] FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 2) '!test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(140)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(173)] FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 3) '!test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(140)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(173)] FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 4) '!test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(140)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(173)] FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 5) '!test' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(140)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(173)] PASS : tst_DataTable::cleanupTestCase() -Totals: 5 passed, 13 failed, 0 skipped +Totals: 21 passed, 13 failed, 0 skipped ********* Finished testing of tst_DataTable ********* diff --git a/tests/auto/testlib/selftests/expected_datatable.xml b/tests/auto/testlib/selftests/expected_datatable.xml index ce123d836c..132b34ec4a 100644 --- a/tests/auto/testlib/selftests/expected_datatable.xml +++ b/tests/auto/testlib/selftests/expected_datatable.xml @@ -14,7 +14,21 @@ <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="fiveTablePasses"> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 2]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 3]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 4]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[fiveTablePasses_data 5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="fiveTableFailures"> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="91"> @@ -43,18 +57,54 @@ <DataTag><![CDATA[startsWithFailure_data 1]]></DataTag> <Description><![CDATA['test' returned FALSE. ()]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 2]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 3]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 4]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[startsWithFailure_data 5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="endsWithFailure"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 2]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 3]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[endsWithFailure 4]]></DataTag> +</Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="91"> <DataTag><![CDATA[endsWithFailure 5]]></DataTag> <Description><![CDATA['test' returned FALSE. ()]]></Description> </Incident> </TestFunction> <TestFunction name="failureInMiddle"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 2]]></DataTag> +</Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="91"> <DataTag><![CDATA[failureInMiddle_data 3]]></DataTag> <Description><![CDATA['test' returned FALSE. ()]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 4]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[failureInMiddle_data 5]]></DataTag> +</Incident> </TestFunction> <TestFunction name="fiveIsolatedFailures"> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="173"> diff --git a/tests/auto/testlib/selftests/expected_datetime.lightxml b/tests/auto/testlib/selftests/expected_datetime.lightxml index 1b7e601585..17fd48a196 100644 --- a/tests/auto/testlib/selftests/expected_datetime.lightxml +++ b/tests/auto/testlib/selftests/expected_datetime.lightxml @@ -13,16 +13,24 @@ </Incident> </TestFunction> <TestFunction name="qurl"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[empty urls]]></DataTag> +</Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="74"> + <DataTag><![CDATA[empty rhs]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (operandA): http://example.com Expected (operandB): ]]></Description> </Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="74"> + <DataTag><![CDATA[empty lhs]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (operandA): Expected (operandB): http://example.com]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[same urls]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_datetime.txt b/tests/auto/testlib/selftests/expected_datetime.txt index 70d5c5a70c..239886ca8e 100644 --- a/tests/auto/testlib/selftests/expected_datetime.txt +++ b/tests/auto/testlib/selftests/expected_datetime.txt @@ -5,14 +5,16 @@ FAIL! : tst_DateTime::dateTime() Compared values are not the same Actual (local): 2000/05/03 04:03:04.000[local time] Expected (utc): 2000/05/03 04:03:04.000[UTC] Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(33)] -FAIL! : tst_DateTime::qurl() Compared values are not the same +PASS : tst_DateTime::qurl(empty urls) +FAIL! : tst_DateTime::qurl(empty rhs) Compared values are not the same Actual (operandA): http://example.com Expected (operandB): Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(41)] -FAIL! : tst_DateTime::qurl() Compared values are not the same +FAIL! : tst_DateTime::qurl(empty lhs) Compared values are not the same Actual (operandA): Expected (operandB): http://example.com Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(41)] +PASS : tst_DateTime::qurl(same urls) PASS : tst_DateTime::cleanupTestCase() -Totals: 2 passed, 3 failed, 0 skipped +Totals: 4 passed, 3 failed, 0 skipped ********* Finished testing of tst_DateTime ********* diff --git a/tests/auto/testlib/selftests/expected_datetime.xml b/tests/auto/testlib/selftests/expected_datetime.xml index d848e73c82..747ff13730 100644 --- a/tests/auto/testlib/selftests/expected_datetime.xml +++ b/tests/auto/testlib/selftests/expected_datetime.xml @@ -15,16 +15,24 @@ </Incident> </TestFunction> <TestFunction name="qurl"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[empty urls]]></DataTag> +</Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="74"> + <DataTag><![CDATA[empty rhs]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (operandA): http://example.com Expected (operandB): ]]></Description> </Incident> <Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="74"> + <DataTag><![CDATA[empty lhs]]></DataTag> <Description><![CDATA[Compared values are not the same Actual (operandA): Expected (operandB): http://example.com]]></Description> </Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[same urls]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_datetime.xunitxml b/tests/auto/testlib/selftests/expected_datetime.xunitxml index b30d1c441f..f25e20674b 100644 --- a/tests/auto/testlib/selftests/expected_datetime.xunitxml +++ b/tests/auto/testlib/selftests/expected_datetime.xunitxml @@ -11,10 +11,10 @@ Expected (utc): 2000/05/03 04:03:04.000[UTC]" result="fail"/> </testcase> <testcase result="fail" name="qurl"> - <failure message="Compared values are not the same + <failure tag="empty rhs" message="Compared values are not the same Actual (operandA): http://example.com Expected (operandB): " result="fail"/> - <failure message="Compared values are not the same + <failure tag="empty lhs" message="Compared values are not the same Actual (operandA): Expected (operandB): http://example.com" result="fail"/> </testcase> diff --git a/tests/auto/testlib/selftests/expected_expectfail.lightxml b/tests/auto/testlib/selftests/expected_expectfail.lightxml index 02e4dde7d8..34f4f1e70b 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.lightxml +++ b/tests/auto/testlib/selftests/expected_expectfail.lightxml @@ -9,7 +9,7 @@ <Message type="qdebug" file="" line="0"> <Description><![CDATA[begin]]></Description> </Message> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="72"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="78"> <Description><![CDATA[This should xfail]]></Description> </Incident> <Message type="qdebug" file="" line="0"> @@ -21,59 +21,121 @@ <Message type="qdebug" file="" line="0"> <Description><![CDATA[begin]]></Description> </Message> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="80"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="86"> <Description><![CDATA[This should xfail]]></Description> </Incident> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="xfailTwice"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="90"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="96"> <Description><![CDATA[Already expecting a fail]]></Description> </Incident> </TestFunction> <TestFunction name="xfailWithQString"> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="99"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="105"> <Description><![CDATA[A string]]></Description> </Incident> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="104"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="110"> <Description><![CDATA[Bug 5 (The message)]]></Description> </Incident> <Incident type="pass" file="" line="0" /> </TestFunction> -<TestFunction name="xfailDataDriven"> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="133"> +<TestFunction name="xfailDataDrivenWithQVerify"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 2]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="139"> <DataTag><![CDATA[Abort]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="133"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Abort]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="139"> <DataTag><![CDATA[Continue]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Continue]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="xfailDataDrivenWithQCompare"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 2]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="173"> + <DataTag><![CDATA[Abort]]></DataTag> + <Description><![CDATA[This test should xfail]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Abort]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="173"> + <DataTag><![CDATA[Continue]]></DataTag> + <Description><![CDATA[This test should xfail]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Continue]]></DataTag> +</Incident> </TestFunction> <TestFunction name="xfailOnWrongRow"> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[right row]]></DataTag> +</Incident> </TestFunction> <TestFunction name="xfailOnAnyRow"> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="168"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="208"> <DataTag><![CDATA[first row]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="168"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="208"> <DataTag><![CDATA[second row]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="xfailWithoutVerify"> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[QEXPECT_FAIL was called without any subsequent verification statements]]></Description> +</Incident> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[QEXPECT_FAIL was called without any subsequent verification statements]]></Description> +</Incident> </TestFunction> <TestFunction name="xpass"> -<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="174"> - <Description><![CDATA['true' returned FALSE. ()]]></Description> +<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="228"> + <Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description> </Incident> </TestFunction> -<TestFunction name="xpassDataDriven"> -<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="196"> +<TestFunction name="xpassDataDrivenWithQVerify"> +<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="250"> <DataTag><![CDATA[XPass]]></DataTag> - <Description><![CDATA['true' returned FALSE. ()]]></Description> + <Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="xpassDataDrivenWithQCompare"> +<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="271"> + <DataTag><![CDATA[XPass]]></DataTag> + <Description><![CDATA[COMPARE()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass]]></DataTag> </Incident> </TestFunction> <TestFunction name="cleanupTestCase"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.txt b/tests/auto/testlib/selftests/expected_expectfail.txt index 1b98b6b561..bd4e2172d6 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.txt +++ b/tests/auto/testlib/selftests/expected_expectfail.txt @@ -3,35 +3,53 @@ Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE PASS : tst_ExpectFail::initTestCase() QDEBUG : tst_ExpectFail::xfailAndContinue() begin XFAIL : tst_ExpectFail::xfailAndContinue() This should xfail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(72)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(78)] QDEBUG : tst_ExpectFail::xfailAndContinue() after PASS : tst_ExpectFail::xfailAndContinue() QDEBUG : tst_ExpectFail::xfailAndAbort() begin XFAIL : tst_ExpectFail::xfailAndAbort() This should xfail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(80)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(86)] PASS : tst_ExpectFail::xfailAndAbort() FAIL! : tst_ExpectFail::xfailTwice() Already expecting a fail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(90)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(96)] XFAIL : tst_ExpectFail::xfailWithQString() A string - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(99)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(105)] XFAIL : tst_ExpectFail::xfailWithQString() Bug 5 (The message) - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(104)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(110)] PASS : tst_ExpectFail::xfailWithQString() -XFAIL : tst_ExpectFail::xfailDataDriven(Abort) This test should xfail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(133)] -XFAIL : tst_ExpectFail::xfailDataDriven(Continue) This test should xfail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(133)] -PASS : tst_ExpectFail::xfailDataDriven() -PASS : tst_ExpectFail::xfailOnWrongRow() +PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Pass 1) +PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Pass 2) +XFAIL : tst_ExpectFail::xfailDataDrivenWithQVerify(Abort) This test should xfail + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(139)] +PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Abort) +XFAIL : tst_ExpectFail::xfailDataDrivenWithQVerify(Continue) This test should xfail + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(139)] +PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Continue) +PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Pass 1) +PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Pass 2) +XFAIL : tst_ExpectFail::xfailDataDrivenWithQCompare(Abort) This test should xfail + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(173)] +PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Abort) +XFAIL : tst_ExpectFail::xfailDataDrivenWithQCompare(Continue) This test should xfail + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(173)] +PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Continue) +PASS : tst_ExpectFail::xfailOnWrongRow(right row) XFAIL : tst_ExpectFail::xfailOnAnyRow(first row) This test should xfail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(168)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(208)] +PASS : tst_ExpectFail::xfailOnAnyRow(first row) XFAIL : tst_ExpectFail::xfailOnAnyRow(second row) This test should xfail - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(168)] -PASS : tst_ExpectFail::xfailOnAnyRow() -XPASS : tst_ExpectFail::xpass() 'true' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(172)] -XPASS : tst_ExpectFail::xpassDataDriven(XPass) 'true' returned FALSE. () - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(196)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(208)] +PASS : tst_ExpectFail::xfailOnAnyRow(second row) +FAIL! : tst_ExpectFail::xfailWithoutVerify(first row) QEXPECT_FAIL was called without any subsequent verification statements +FAIL! : tst_ExpectFail::xfailWithoutVerify(second row) QEXPECT_FAIL was called without any subsequent verification statements +XPASS : tst_ExpectFail::xpass() 'true' returned TRUE unexpectedly. () + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(228)] +XPASS : tst_ExpectFail::xpassDataDrivenWithQVerify(XPass) 'true' returned TRUE unexpectedly. () + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(250)] +PASS : tst_ExpectFail::xpassDataDrivenWithQVerify(Pass) +XPASS : tst_ExpectFail::xpassDataDrivenWithQCompare(XPass) COMPARE() + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(271)] +PASS : tst_ExpectFail::xpassDataDrivenWithQCompare(Pass) PASS : tst_ExpectFail::cleanupTestCase() -Totals: 8 passed, 3 failed, 0 skipped +Totals: 18 passed, 6 failed, 0 skipped ********* Finished testing of tst_ExpectFail ********* diff --git a/tests/auto/testlib/selftests/expected_expectfail.xml b/tests/auto/testlib/selftests/expected_expectfail.xml index 74b11fb0e5..ff870a6a68 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.xml +++ b/tests/auto/testlib/selftests/expected_expectfail.xml @@ -11,7 +11,7 @@ <Message type="qdebug" file="" line="0"> <Description><![CDATA[begin]]></Description> </Message> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="72"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="78"> <Description><![CDATA[This should xfail]]></Description> </Incident> <Message type="qdebug" file="" line="0"> @@ -23,59 +23,121 @@ <Message type="qdebug" file="" line="0"> <Description><![CDATA[begin]]></Description> </Message> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="80"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="86"> <Description><![CDATA[This should xfail]]></Description> </Incident> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="xfailTwice"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="90"> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="96"> <Description><![CDATA[Already expecting a fail]]></Description> </Incident> </TestFunction> <TestFunction name="xfailWithQString"> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="99"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="105"> <Description><![CDATA[A string]]></Description> </Incident> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="104"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="110"> <Description><![CDATA[Bug 5 (The message)]]></Description> </Incident> <Incident type="pass" file="" line="0" /> </TestFunction> -<TestFunction name="xfailDataDriven"> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="133"> +<TestFunction name="xfailDataDrivenWithQVerify"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 2]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="139"> <DataTag><![CDATA[Abort]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="133"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Abort]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="139"> <DataTag><![CDATA[Continue]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Continue]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="xfailDataDrivenWithQCompare"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 1]]></DataTag> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass 2]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="173"> + <DataTag><![CDATA[Abort]]></DataTag> + <Description><![CDATA[This test should xfail]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Abort]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="173"> + <DataTag><![CDATA[Continue]]></DataTag> + <Description><![CDATA[This test should xfail]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Continue]]></DataTag> +</Incident> </TestFunction> <TestFunction name="xfailOnWrongRow"> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[right row]]></DataTag> +</Incident> </TestFunction> <TestFunction name="xfailOnAnyRow"> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="168"> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="208"> <DataTag><![CDATA[first row]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="168"> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> +</Incident> +<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="208"> <DataTag><![CDATA[second row]]></DataTag> <Description><![CDATA[This test should xfail]]></Description> </Incident> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="xfailWithoutVerify"> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[QEXPECT_FAIL was called without any subsequent verification statements]]></Description> +</Incident> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[QEXPECT_FAIL was called without any subsequent verification statements]]></Description> +</Incident> </TestFunction> <TestFunction name="xpass"> -<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="174"> - <Description><![CDATA['true' returned FALSE. ()]]></Description> +<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="228"> + <Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description> </Incident> </TestFunction> -<TestFunction name="xpassDataDriven"> -<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="196"> +<TestFunction name="xpassDataDrivenWithQVerify"> +<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="250"> <DataTag><![CDATA[XPass]]></DataTag> - <Description><![CDATA['true' returned FALSE. ()]]></Description> + <Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass]]></DataTag> +</Incident> +</TestFunction> +<TestFunction name="xpassDataDrivenWithQCompare"> +<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="271"> + <DataTag><![CDATA[XPass]]></DataTag> + <Description><![CDATA[COMPARE()]]></Description> +</Incident> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[Pass]]></DataTag> </Incident> </TestFunction> <TestFunction name="cleanupTestCase"> diff --git a/tests/auto/testlib/selftests/expected_expectfail.xunitxml b/tests/auto/testlib/selftests/expected_expectfail.xunitxml index 017e4501c1..6040af41ff 100644 --- a/tests/auto/testlib/selftests/expected_expectfail.xunitxml +++ b/tests/auto/testlib/selftests/expected_expectfail.xunitxml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="11" failures="3" tests="11" name="tst_ExpectFail"> +<testsuite errors="13" failures="6" tests="14" name="tst_ExpectFail"> <properties> - <property value="5.0.0" name="QTestVersion"/> - <property value="5.0.0" name="QtVersion"/> + <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> + <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> </properties> <testcase result="pass" name="initTestCase"/> <testcase result="xfail" name="xfailAndContinue"> @@ -21,7 +21,11 @@ <!-- message="A string" type="info" --> <!-- message="Bug 5 (The message)" type="info" --> </testcase> - <testcase result="xfail" name="xfailDataDriven"> + <testcase result="xfail" name="xfailDataDrivenWithQVerify"> + <!-- tag="Abort" message="This test should xfail" type="info" --> + <!-- tag="Continue" message="This test should xfail" type="info" --> + </testcase> + <testcase result="xfail" name="xfailDataDrivenWithQCompare"> <!-- tag="Abort" message="This test should xfail" type="info" --> <!-- tag="Continue" message="This test should xfail" type="info" --> </testcase> @@ -30,11 +34,18 @@ <!-- tag="first row" message="This test should xfail" type="info" --> <!-- tag="second row" message="This test should xfail" type="info" --> </testcase> + <testcase result="fail" name="xfailWithoutVerify"> + <failure tag="first row" message="QEXPECT_FAIL was called without any subsequent verification statements" result="fail"/> + <failure tag="second row" message="QEXPECT_FAIL was called without any subsequent verification statements" result="fail"/> + </testcase> <testcase result="xpass" name="xpass"> - <failure message="'true' returned FALSE. ()" result="xpass"/> + <failure message="'true' returned TRUE unexpectedly. ()" result="xpass"/> </testcase> - <testcase result="xpass" name="xpassDataDriven"> - <failure tag="XPass" message="'true' returned FALSE. ()" result="xpass"/> + <testcase result="xpass" name="xpassDataDrivenWithQVerify"> + <failure tag="XPass" message="'true' returned TRUE unexpectedly. ()" result="xpass"/> + </testcase> + <testcase result="xpass" name="xpassDataDrivenWithQCompare"> + <failure tag="XPass" message="COMPARE()" result="xpass"/> </testcase> <testcase result="pass" name="cleanupTestCase"/> <system-err> @@ -49,5 +60,7 @@ <![CDATA[This test should xfail]]> <![CDATA[This test should xfail]]> <![CDATA[This test should xfail]]> +<![CDATA[This test should xfail]]> +<![CDATA[This test should xfail]]> </system-err> </testsuite> diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.lightxml b/tests/auto/testlib/selftests/expected_failcleanup.lightxml index 63d0218b2c..83ce7a7b15 100644 --- a/tests/auto/testlib/selftests/expected_benchliboptions.lightxml +++ b/tests/auto/testlib/selftests/expected_failcleanup.lightxml @@ -5,11 +5,11 @@ <TestFunction name="initTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> -<TestFunction name="threeEvents"> -<Incident type="pass" file="" line="0"> -<BenchmarkResult metric="walltime" tag="" value="210" iterations="4194304" /> -</Incident> +<TestFunction name="aTestFunction"> +<Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp" line="59"> + <Description><![CDATA['false' returned FALSE. (Fail inside cleanupTestCase)]]></Description> +</Incident> </TestFunction> diff --git a/tests/auto/testlib/selftests/expected_failcleanup.txt b/tests/auto/testlib/selftests/expected_failcleanup.txt new file mode 100644 index 0000000000..08c10b1823 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_failcleanup.txt @@ -0,0 +1,8 @@ +********* Start testing of tst_FailCleanup ********* +Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ +PASS : tst_FailCleanup::initTestCase() +PASS : tst_FailCleanup::aTestFunction() +FAIL! : tst_FailCleanup::cleanupTestCase() 'false' returned FALSE. (Fail inside cleanupTestCase) + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp(59)] +Totals: 2 passed, 1 failed, 0 skipped +********* Finished testing of tst_FailCleanup ********* diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.xml b/tests/auto/testlib/selftests/expected_failcleanup.xml index b29b9c569e..5d0d2c5751 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcallgrind.xml +++ b/tests/auto/testlib/selftests/expected_failcleanup.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<TestCase name="tst_BenchlibCallgrind"> +<TestCase name="tst_FailCleanup"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> @@ -7,11 +7,12 @@ <TestFunction name="initTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> -<TestFunction name="twoHundredMillionInstructions"> -<BenchmarkResult metric="InstructionReads" tag="" value="200000000" iterations="1" /> +<TestFunction name="aTestFunction"> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> +<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp" line="59"> + <Description><![CDATA['false' returned FALSE. (Fail inside cleanupTestCase)]]></Description> +</Incident> </TestFunction> </TestCase> diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.xunitxml b/tests/auto/testlib/selftests/expected_failcleanup.xunitxml index cc58f7fdd4..6e35566be8 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcallgrind.xunitxml +++ b/tests/auto/testlib/selftests/expected_failcleanup.xunitxml @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="0" tests="3" name="tst_BenchlibCallgrind"> +<testsuite errors="0" failures="1" tests="3" name="tst_FailCleanup"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> </properties> <testcase result="pass" name="initTestCase"/> - <testcase result="pass" name="twoHundredMillionInstructions"> + <testcase result="pass" name="aTestFunction"/> + <testcase result="fail" name="cleanupTestCase"> + <failure message="'false' returned FALSE. (Fail inside cleanupTestCase)" result="fail"/> </testcase> - <testcase result="pass" name="cleanupTestCase"/> <system-err/> </testsuite> diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml deleted file mode 100644 index a34618cf02..0000000000 --- a/tests/auto/testlib/selftests/expected_float.lightxml +++ /dev/null @@ -1,44 +0,0 @@ -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="floatComparisons"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="61"> - <DataTag><![CDATA[should FAIL]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (operandLeft): 1 - Expected (operandRight): 3]]></Description> -</Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="61"> - <DataTag><![CDATA[should FAIL]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (operandLeft): 1e-07 - Expected (operandRight): 3e-07]]></Description> -</Incident> -</TestFunction> -<TestFunction name="compareFloatTests"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="100"> - <DataTag><![CDATA[1e0]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (t1): 1 - Expected (t3): 3]]></Description> -</Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="100"> - <DataTag><![CDATA[1e-7]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (t1): 1e-07 - Expected (t3): 3e-07]]></Description> -</Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="100"> - <DataTag><![CDATA[1e+7]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (t1): 1e+07 - Expected (t3): 3e+07]]></Description> -</Incident> -</TestFunction> -<TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt index acd0aaa54a..6ebbeffde5 100644 --- a/tests/auto/testlib/selftests/expected_float.txt +++ b/tests/auto/testlib/selftests/expected_float.txt @@ -1,26 +1,32 @@ ********* Start testing of tst_float ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_float::initTestCase() -FAIL! : tst_float::floatComparisons(should FAIL) Compared floats are not the same (fuzzy compare) +PASS : tst_float::floatComparisons(should SUCCEED 1) +FAIL! : tst_float::floatComparisons(should FAIL 1) Compared floats are not the same (fuzzy compare) Actual (operandLeft): 1 Expected (operandRight): 3 Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(61)] -FAIL! : tst_float::floatComparisons(should FAIL) Compared floats are not the same (fuzzy compare) +FAIL! : tst_float::floatComparisons(should FAIL 2) Compared floats are not the same (fuzzy compare) Actual (operandLeft): 1e-07 Expected (operandRight): 3e-07 Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(61)] +FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the same (fuzzy compare) + Actual (operandLeft): 99998 + Expected (operandRight): 99999 + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(61)] +PASS : tst_float::floatComparisons(should SUCCEED 2) FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare) Actual (t1): 1 Expected (t3): 3 - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(100)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(104)] FAIL! : tst_float::compareFloatTests(1e-7) Compared floats are not the same (fuzzy compare) Actual (t1): 1e-07 Expected (t3): 3e-07 - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(100)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(104)] FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fuzzy compare) Actual (t1): 1e+07 Expected (t3): 3e+07 - Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(100)] + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(104)] PASS : tst_float::cleanupTestCase() -Totals: 2 passed, 5 failed, 0 skipped +Totals: 4 passed, 6 failed, 0 skipped ********* Finished testing of tst_float ********* diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml deleted file mode 100644 index a9c7428250..0000000000 --- a/tests/auto/testlib/selftests/expected_float.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<TestCase name="tst_float"> -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="floatComparisons"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="61"> - <DataTag><![CDATA[should FAIL]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (operandLeft): 1 - Expected (operandRight): 3]]></Description> -</Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="61"> - <DataTag><![CDATA[should FAIL]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (operandLeft): 1e-07 - Expected (operandRight): 3e-07]]></Description> -</Incident> -</TestFunction> -<TestFunction name="compareFloatTests"> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="100"> - <DataTag><![CDATA[1e0]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (t1): 1 - Expected (t3): 3]]></Description> -</Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="100"> - <DataTag><![CDATA[1e-7]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (t1): 1e-07 - Expected (t3): 3e-07]]></Description> -</Incident> -<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="100"> - <DataTag><![CDATA[1e+7]]></DataTag> - <Description><![CDATA[Compared floats are not the same (fuzzy compare) - Actual (t1): 1e+07 - Expected (t3): 3e+07]]></Description> -</Incident> -</TestFunction> -<TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -</TestCase> diff --git a/tests/auto/testlib/selftests/expected_float.xunitxml b/tests/auto/testlib/selftests/expected_float.xunitxml deleted file mode 100644 index f88e5e410e..0000000000 --- a/tests/auto/testlib/selftests/expected_float.xunitxml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="5" tests="4" name="tst_float"> - <properties> - <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> - <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> - </properties> - <testcase result="pass" name="initTestCase"/> - <testcase result="fail" name="floatComparisons"> - <failure tag="should FAIL" message="Compared floats are not the same (fuzzy compare) - Actual (operandLeft): 1 - Expected (operandRight): 3" result="fail"/> - <failure tag="should FAIL" message="Compared floats are not the same (fuzzy compare) - Actual (operandLeft): 1e-07 - Expected (operandRight): 3e-07" result="fail"/> - </testcase> - <testcase result="fail" name="compareFloatTests"> - <failure tag="1e0" message="Compared floats are not the same (fuzzy compare) - Actual (t1): 1 - Expected (t3): 3" result="fail"/> - <failure tag="1e-7" message="Compared floats are not the same (fuzzy compare) - Actual (t1): 1e-07 - Expected (t3): 3e-07" result="fail"/> - <failure tag="1e+7" message="Compared floats are not the same (fuzzy compare) - Actual (t1): 1e+07 - Expected (t3): 3e+07" result="fail"/> - </testcase> - <testcase result="pass" name="cleanupTestCase"/> - <system-err/> -</testsuite> diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml index 7a50f01cb8..6d68bfbdb5 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.lightxml +++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml @@ -25,6 +25,9 @@ <DataTag><![CDATA[1:local 1]]></DataTag> <Description><![CDATA[cleanup testGlobal local 1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[init testGlobal local 2 ]]></Description> @@ -41,6 +44,9 @@ <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[cleanup testGlobal local 2 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 2]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[2:local 1]]></DataTag> <Description><![CDATA[init testGlobal local 1 ]]></Description> @@ -57,6 +63,9 @@ <DataTag><![CDATA[2:local 1]]></DataTag> <Description><![CDATA[cleanup testGlobal local 1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[2:local 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[2:local 2]]></DataTag> <Description><![CDATA[init testGlobal local 2 ]]></Description> @@ -73,7 +82,9 @@ <DataTag><![CDATA[2:local 2]]></DataTag> <Description><![CDATA[cleanup testGlobal local 2 ]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[2:local 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="skip"> <Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="129"> @@ -120,6 +131,9 @@ <DataTag><![CDATA[1:local 1]]></DataTag> <Description><![CDATA[cleanup skipSingle local 1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[init skipSingle local 2 ]]></Description> @@ -132,6 +146,9 @@ <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[cleanup skipSingle local 2 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 2]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[2:local 1]]></DataTag> <Description><![CDATA[init skipSingle local 1 ]]></Description> @@ -156,7 +173,9 @@ <DataTag><![CDATA[2:local 2]]></DataTag> <Description><![CDATA[cleanup skipSingle local 2 ]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[2:local 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Message type="qdebug" file="" line="0"> diff --git a/tests/auto/testlib/selftests/expected_globaldata.txt b/tests/auto/testlib/selftests/expected_globaldata.txt index e3905e2fa3..59b95fa253 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.txt +++ b/tests/auto/testlib/selftests/expected_globaldata.txt @@ -6,19 +6,22 @@ QDEBUG : tst_globaldata::testGlobal(1:local 1) init testGlobal local 1 QDEBUG : tst_globaldata::testGlobal(1:local 1) global: false QDEBUG : tst_globaldata::testGlobal(1:local 1) local: false QDEBUG : tst_globaldata::testGlobal(1:local 1) cleanup testGlobal local 1 +PASS : tst_globaldata::testGlobal(1:local 1) QDEBUG : tst_globaldata::testGlobal(1:local 2) init testGlobal local 2 QDEBUG : tst_globaldata::testGlobal(1:local 2) global: false QDEBUG : tst_globaldata::testGlobal(1:local 2) local: true QDEBUG : tst_globaldata::testGlobal(1:local 2) cleanup testGlobal local 2 +PASS : tst_globaldata::testGlobal(1:local 2) QDEBUG : tst_globaldata::testGlobal(2:local 1) init testGlobal local 1 QDEBUG : tst_globaldata::testGlobal(2:local 1) global: true QDEBUG : tst_globaldata::testGlobal(2:local 1) local: false QDEBUG : tst_globaldata::testGlobal(2:local 1) cleanup testGlobal local 1 +PASS : tst_globaldata::testGlobal(2:local 1) QDEBUG : tst_globaldata::testGlobal(2:local 2) init testGlobal local 2 QDEBUG : tst_globaldata::testGlobal(2:local 2) global: true QDEBUG : tst_globaldata::testGlobal(2:local 2) local: true QDEBUG : tst_globaldata::testGlobal(2:local 2) cleanup testGlobal local 2 -PASS : tst_globaldata::testGlobal() +PASS : tst_globaldata::testGlobal(2:local 2) SKIP : tst_globaldata::skip(1) skipping Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(129)] QDEBUG : tst_globaldata::skipLocal(1:local 1) init skipLocal local 1 @@ -32,9 +35,11 @@ QDEBUG : tst_globaldata::skipLocal(1:local 2) cleanup skipLocal local 2 QDEBUG : tst_globaldata::skipSingle(1:local 1) init skipSingle local 1 QDEBUG : tst_globaldata::skipSingle(1:local 1) global: false local: false QDEBUG : tst_globaldata::skipSingle(1:local 1) cleanup skipSingle local 1 +PASS : tst_globaldata::skipSingle(1:local 1) QDEBUG : tst_globaldata::skipSingle(1:local 2) init skipSingle local 2 QDEBUG : tst_globaldata::skipSingle(1:local 2) global: false local: true QDEBUG : tst_globaldata::skipSingle(1:local 2) cleanup skipSingle local 2 +PASS : tst_globaldata::skipSingle(1:local 2) QDEBUG : tst_globaldata::skipSingle(2:local 1) init skipSingle local 1 SKIP : tst_globaldata::skipSingle(2:local 1) skipping Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(143)] @@ -42,8 +47,8 @@ QDEBUG : tst_globaldata::skipSingle(2:local 1) cleanup skipSingle local 1 QDEBUG : tst_globaldata::skipSingle(2:local 2) init skipSingle local 2 QDEBUG : tst_globaldata::skipSingle(2:local 2) global: true local: true QDEBUG : tst_globaldata::skipSingle(2:local 2) cleanup skipSingle local 2 -PASS : tst_globaldata::skipSingle() +PASS : tst_globaldata::skipSingle(2:local 2) QDEBUG : tst_globaldata::cleanupTestCase() cleanupTestCase cleanupTestCase (null) PASS : tst_globaldata::cleanupTestCase() -Totals: 4 passed, 0 failed, 4 skipped +Totals: 9 passed, 0 failed, 4 skipped ********* Finished testing of tst_globaldata ********* diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml index 9abbeeef35..09edaacd43 100644 --- a/tests/auto/testlib/selftests/expected_globaldata.xml +++ b/tests/auto/testlib/selftests/expected_globaldata.xml @@ -27,6 +27,9 @@ <DataTag><![CDATA[1:local 1]]></DataTag> <Description><![CDATA[cleanup testGlobal local 1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[init testGlobal local 2 ]]></Description> @@ -43,6 +46,9 @@ <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[cleanup testGlobal local 2 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 2]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[2:local 1]]></DataTag> <Description><![CDATA[init testGlobal local 1 ]]></Description> @@ -59,6 +65,9 @@ <DataTag><![CDATA[2:local 1]]></DataTag> <Description><![CDATA[cleanup testGlobal local 1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[2:local 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[2:local 2]]></DataTag> <Description><![CDATA[init testGlobal local 2 ]]></Description> @@ -75,7 +84,9 @@ <DataTag><![CDATA[2:local 2]]></DataTag> <Description><![CDATA[cleanup testGlobal local 2 ]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[2:local 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="skip"> <Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="129"> @@ -122,6 +133,9 @@ <DataTag><![CDATA[1:local 1]]></DataTag> <Description><![CDATA[cleanup skipSingle local 1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[init skipSingle local 2 ]]></Description> @@ -134,6 +148,9 @@ <DataTag><![CDATA[1:local 2]]></DataTag> <Description><![CDATA[cleanup skipSingle local 2 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[1:local 2]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[2:local 1]]></DataTag> <Description><![CDATA[init skipSingle local 1 ]]></Description> @@ -158,7 +175,9 @@ <DataTag><![CDATA[2:local 2]]></DataTag> <Description><![CDATA[cleanup skipSingle local 2 ]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[2:local 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Message type="qdebug" file="" line="0"> diff --git a/tests/auto/testlib/selftests/expected_multiexec.lightxml b/tests/auto/testlib/selftests/expected_multiexec.lightxml deleted file mode 100644 index 1a66e92f8f..0000000000 --- a/tests/auto/testlib/selftests/expected_multiexec.lightxml +++ /dev/null @@ -1,13 +0,0 @@ -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="nothing"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> diff --git a/tests/auto/testlib/selftests/expected_multiexec.xunitxml b/tests/auto/testlib/selftests/expected_multiexec.xunitxml deleted file mode 100644 index 6bc04c3ddd..0000000000 --- a/tests/auto/testlib/selftests/expected_multiexec.xunitxml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="0" tests="3" name="tst_Nothing"> - <properties> - <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> - <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> - </properties> - <testcase result="pass" name="initTestCase"/> - <testcase result="pass" name="nothing"/> - <testcase result="pass" name="cleanupTestCase"/> - <system-err/> -</testsuite> diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.txt b/tests/auto/testlib/selftests/expected_qexecstringlist.txt index 87df97af48..da283e106f 100644 --- a/tests/auto/testlib/selftests/expected_qexecstringlist.txt +++ b/tests/auto/testlib/selftests/expected_qexecstringlist.txt @@ -2,19 +2,23 @@ Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_QExecStringList::initTestCase() PASS : tst_QExecStringList::testA() -PASS : tst_QExecStringList::testB() +PASS : tst_QExecStringList::testB(Data1) +PASS : tst_QExecStringList::testB(Data2) +PASS : tst_QExecStringList::testB(Data3) PASS : tst_QExecStringList::testC() PASS : tst_QExecStringList::cleanupTestCase() -Totals: 5 passed, 0 failed, 0 skipped +Totals: 7 passed, 0 failed, 0 skipped ********* Finished testing of tst_QExecStringList ********* ********* Start testing of tst_QExecStringList ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_QExecStringList::initTestCase() PASS : tst_QExecStringList::testA() -PASS : tst_QExecStringList::testB() +PASS : tst_QExecStringList::testB(Data1) +PASS : tst_QExecStringList::testB(Data2) +PASS : tst_QExecStringList::testB(Data3) PASS : tst_QExecStringList::testC() PASS : tst_QExecStringList::cleanupTestCase() -Totals: 5 passed, 0 failed, 0 skipped +Totals: 7 passed, 0 failed, 0 skipped ********* Finished testing of tst_QExecStringList ********* ********* Start testing of tst_QExecStringList ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ @@ -26,14 +30,16 @@ Totals: 3 passed, 0 failed, 0 skipped ********* Start testing of tst_QExecStringList ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_QExecStringList::initTestCase() -PASS : tst_QExecStringList::testB() +PASS : tst_QExecStringList::testB(Data1) +PASS : tst_QExecStringList::testB(Data2) +PASS : tst_QExecStringList::testB(Data3) PASS : tst_QExecStringList::cleanupTestCase() -Totals: 3 passed, 0 failed, 0 skipped +Totals: 5 passed, 0 failed, 0 skipped ********* Finished testing of tst_QExecStringList ********* ********* Start testing of tst_QExecStringList ********* Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ PASS : tst_QExecStringList::initTestCase() -PASS : tst_QExecStringList::testB() +PASS : tst_QExecStringList::testB(Data2) PASS : tst_QExecStringList::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped ********* Finished testing of tst_QExecStringList ********* diff --git a/tests/auto/testlib/selftests/expected_skip.lightxml b/tests/auto/testlib/selftests/expected_skip.lightxml index 8399a76fa2..b01570e275 100644 --- a/tests/auto/testlib/selftests/expected_skip.lightxml +++ b/tests/auto/testlib/selftests/expected_skip.lightxml @@ -24,7 +24,9 @@ <DataTag><![CDATA[local 2]]></DataTag> <Description><![CDATA[this line should only be reached once (true)]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[local 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_skip.txt b/tests/auto/testlib/selftests/expected_skip.txt index e18386e109..fadbc966f0 100644 --- a/tests/auto/testlib/selftests/expected_skip.txt +++ b/tests/auto/testlib/selftests/expected_skip.txt @@ -8,7 +8,7 @@ SKIP : tst_Skip::emptytest() skipping all SKIP : tst_Skip::singleSkip(local 1) skipping one Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(97)] QDEBUG : tst_Skip::singleSkip(local 2) this line should only be reached once (true) -PASS : tst_Skip::singleSkip() +PASS : tst_Skip::singleSkip(local 2) PASS : tst_Skip::cleanupTestCase() Totals: 3 passed, 0 failed, 3 skipped ********* Finished testing of tst_Skip ********* diff --git a/tests/auto/testlib/selftests/expected_skip.xml b/tests/auto/testlib/selftests/expected_skip.xml index d0e45d0ff8..6609c0464a 100644 --- a/tests/auto/testlib/selftests/expected_skip.xml +++ b/tests/auto/testlib/selftests/expected_skip.xml @@ -26,7 +26,9 @@ <DataTag><![CDATA[local 2]]></DataTag> <Description><![CDATA[this line should only be reached once (true)]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[local 2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.lightxml b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml index c2394e545e..d2bc3b766e 100644 --- a/tests/auto/testlib/selftests/expected_benchlibcallgrind.lightxml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml @@ -5,10 +5,11 @@ <TestFunction name="initTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> -<TestFunction name="twoHundredMillionInstructions"> -<BenchmarkResult metric="InstructionReads" tag="" value="200000000" iterations="1" /> +<TestFunction name="aTestFunction"> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp" line="59"> + <Description><![CDATA[Skip inside cleanupTestCase.]]></Description> +</Message> </TestFunction> diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.txt b/tests/auto/testlib/selftests/expected_skipcleanup.txt new file mode 100644 index 0000000000..c97f31c2a9 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_skipcleanup.txt @@ -0,0 +1,8 @@ +********* Start testing of tst_SkipCleanup ********* +Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@ +PASS : tst_SkipCleanup::initTestCase() +PASS : tst_SkipCleanup::aTestFunction() +SKIP : tst_SkipCleanup::cleanupTestCase() Skip inside cleanupTestCase. + Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp(59)] +Totals: 2 passed, 0 failed, 1 skipped +********* Finished testing of tst_SkipCleanup ********* diff --git a/tests/auto/testlib/selftests/expected_multiexec.xml b/tests/auto/testlib/selftests/expected_skipcleanup.xml index 7f71f6edac..8fbfc7711c 100644 --- a/tests/auto/testlib/selftests/expected_multiexec.xml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<TestCase name="tst_Nothing"> +<TestCase name="tst_SkipCleanup"> <Environment> <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> @@ -7,10 +7,12 @@ <TestFunction name="initTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> -<TestFunction name="nothing"> +<TestFunction name="aTestFunction"> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> +<Message type="skip" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp" line="59"> + <Description><![CDATA[Skip inside cleanupTestCase.]]></Description> +</Message> </TestFunction> </TestCase> diff --git a/tests/auto/testlib/selftests/expected_crashes.xunitxml b/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml index 558491c598..b8f67e2d07 100644 --- a/tests/auto/testlib/selftests/expected_crashes.xunitxml +++ b/tests/auto/testlib/selftests/expected_skipcleanup.xunitxml @@ -1,15 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="1" failures="1" tests="2" name="tst_Crashes"> +<testsuite errors="1" failures="0" tests="3" name="tst_SkipCleanup"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> </properties> <testcase result="pass" name="initTestCase"/> - <testcase result="fail" name="crash"> - <!-- message="Received signal 11" type="qfatal" --> - <failure message="Received a fatal error." result="fail"/> + <testcase result="pass" name="aTestFunction"/> + <testcase name="cleanupTestCase"> + <!-- message="Skip inside cleanupTestCase." type="skip" --> </testcase> <system-err> -<![CDATA[Received signal 11]]> +<![CDATA[Skip inside cleanupTestCase.]]> </system-err> </testsuite> diff --git a/tests/auto/testlib/selftests/expected_sleep.lightxml b/tests/auto/testlib/selftests/expected_sleep.lightxml deleted file mode 100644 index 1a056c8562..0000000000 --- a/tests/auto/testlib/selftests/expected_sleep.lightxml +++ /dev/null @@ -1,13 +0,0 @@ -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="sleep"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> diff --git a/tests/auto/testlib/selftests/expected_sleep.xml b/tests/auto/testlib/selftests/expected_sleep.xml deleted file mode 100644 index cbc4d14004..0000000000 --- a/tests/auto/testlib/selftests/expected_sleep.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<TestCase name="tst_Sleep"> -<Environment> - <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion> - <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion> -</Environment> -<TestFunction name="initTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="sleep"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -<TestFunction name="cleanupTestCase"> -<Incident type="pass" file="" line="0" /> -</TestFunction> -</TestCase> diff --git a/tests/auto/testlib/selftests/expected_sleep.xunitxml b/tests/auto/testlib/selftests/expected_sleep.xunitxml deleted file mode 100644 index 409621e6bc..0000000000 --- a/tests/auto/testlib/selftests/expected_sleep.xunitxml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="0" failures="0" tests="3" name="tst_Sleep"> - <properties> - <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> - <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> - </properties> - <testcase result="pass" name="initTestCase"/> - <testcase result="pass" name="sleep"/> - <testcase result="pass" name="cleanupTestCase"/> - <system-err/> -</testsuite> diff --git a/tests/auto/testlib/selftests/expected_subtest.lightxml b/tests/auto/testlib/selftests/expected_subtest.lightxml index d76ec131de..e7d8d53efc 100644 --- a/tests/auto/testlib/selftests/expected_subtest.lightxml +++ b/tests/auto/testlib/selftests/expected_subtest.lightxml @@ -43,6 +43,9 @@ <DataTag><![CDATA[data0]]></DataTag> <Description><![CDATA[cleanup test2 data0 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data0]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[data1]]></DataTag> <Description><![CDATA[init test2 data1 ]]></Description> @@ -59,6 +62,9 @@ <DataTag><![CDATA[data1]]></DataTag> <Description><![CDATA[cleanup test2 data1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[data2]]></DataTag> <Description><![CDATA[init test2 data2 ]]></Description> @@ -75,7 +81,9 @@ <DataTag><![CDATA[data2]]></DataTag> <Description><![CDATA[cleanup test2 data2 ]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="test3"> <Message type="qdebug" file="" line="0"> @@ -100,6 +108,9 @@ <DataTag><![CDATA[data0]]></DataTag> <Description><![CDATA[cleanup test3 data0 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data0]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[data1]]></DataTag> <Description><![CDATA[init test3 data1 ]]></Description> diff --git a/tests/auto/testlib/selftests/expected_subtest.txt b/tests/auto/testlib/selftests/expected_subtest.txt index e35fb805e0..7b29bfc8c3 100644 --- a/tests/auto/testlib/selftests/expected_subtest.txt +++ b/tests/auto/testlib/selftests/expected_subtest.txt @@ -12,21 +12,24 @@ QDEBUG : tst_Subtest::test2(data0) init test2 data0 QDEBUG : tst_Subtest::test2(data0) test2 test2 data0 QDEBUG : tst_Subtest::test2(data0) test2 end QDEBUG : tst_Subtest::test2(data0) cleanup test2 data0 +PASS : tst_Subtest::test2(data0) QDEBUG : tst_Subtest::test2(data1) init test2 data1 QDEBUG : tst_Subtest::test2(data1) test2 test2 data1 QDEBUG : tst_Subtest::test2(data1) test2 end QDEBUG : tst_Subtest::test2(data1) cleanup test2 data1 +PASS : tst_Subtest::test2(data1) QDEBUG : tst_Subtest::test2(data2) init test2 data2 QDEBUG : tst_Subtest::test2(data2) test2 test2 data2 QDEBUG : tst_Subtest::test2(data2) test2 end QDEBUG : tst_Subtest::test2(data2) cleanup test2 data2 -PASS : tst_Subtest::test2() +PASS : tst_Subtest::test2(data2) QDEBUG : tst_Subtest::test3() test3_data test3 (null) QDEBUG : tst_Subtest::test3() test3_data end QDEBUG : tst_Subtest::test3(data0) init test3 data0 QDEBUG : tst_Subtest::test3(data0) test2 test3 data0 QDEBUG : tst_Subtest::test3(data0) test2 end QDEBUG : tst_Subtest::test3(data0) cleanup test3 data0 +PASS : tst_Subtest::test3(data0) QDEBUG : tst_Subtest::test3(data1) init test3 data1 QDEBUG : tst_Subtest::test3(data1) test2 test3 data1 FAIL! : tst_Subtest::test3(data1) Compared values are not the same @@ -43,5 +46,5 @@ FAIL! : tst_Subtest::test3(data2) Compared values are not the same QDEBUG : tst_Subtest::test3(data2) cleanup test3 data2 QDEBUG : tst_Subtest::cleanupTestCase() cleanupTestCase cleanupTestCase (null) PASS : tst_Subtest::cleanupTestCase() -Totals: 4 passed, 2 failed, 0 skipped +Totals: 7 passed, 2 failed, 0 skipped ********* Finished testing of tst_Subtest ********* diff --git a/tests/auto/testlib/selftests/expected_subtest.xml b/tests/auto/testlib/selftests/expected_subtest.xml index d79242f061..8a3846599c 100644 --- a/tests/auto/testlib/selftests/expected_subtest.xml +++ b/tests/auto/testlib/selftests/expected_subtest.xml @@ -45,6 +45,9 @@ <DataTag><![CDATA[data0]]></DataTag> <Description><![CDATA[cleanup test2 data0 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data0]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[data1]]></DataTag> <Description><![CDATA[init test2 data1 ]]></Description> @@ -61,6 +64,9 @@ <DataTag><![CDATA[data1]]></DataTag> <Description><![CDATA[cleanup test2 data1 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data1]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[data2]]></DataTag> <Description><![CDATA[init test2 data2 ]]></Description> @@ -77,7 +83,9 @@ <DataTag><![CDATA[data2]]></DataTag> <Description><![CDATA[cleanup test2 data2 ]]></Description> </Message> -<Incident type="pass" file="" line="0" /> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data2]]></DataTag> +</Incident> </TestFunction> <TestFunction name="test3"> <Message type="qdebug" file="" line="0"> @@ -102,6 +110,9 @@ <DataTag><![CDATA[data0]]></DataTag> <Description><![CDATA[cleanup test3 data0 ]]></Description> </Message> +<Incident type="pass" file="" line="0"> + <DataTag><![CDATA[data0]]></DataTag> +</Incident> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[data1]]></DataTag> <Description><![CDATA[init test3 data1 ]]></Description> diff --git a/tests/auto/testlib/selftests/expected_warnings.lightxml b/tests/auto/testlib/selftests/expected_warnings.lightxml index 116156ed8a..ad786832ca 100644 --- a/tests/auto/testlib/selftests/expected_warnings.lightxml +++ b/tests/auto/testlib/selftests/expected_warnings.lightxml @@ -37,6 +37,32 @@ <Description><![CDATA[Not all expected messages were received]]></Description> </Incident> </TestFunction> +<TestFunction name="testMissingWarningsWithData"> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning0"]]></Description> +</Message> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning1"]]></Description> +</Message> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[Not all expected messages were received]]></Description> +</Incident> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning0"]]></Description> +</Message> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning1"]]></Description> +</Message> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[Not all expected messages were received]]></Description> +</Incident> +</TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> diff --git a/tests/auto/testlib/selftests/expected_warnings.txt b/tests/auto/testlib/selftests/expected_warnings.txt index 6f7d0f491b..6196ec0261 100644 --- a/tests/auto/testlib/selftests/expected_warnings.txt +++ b/tests/auto/testlib/selftests/expected_warnings.txt @@ -11,6 +11,12 @@ PASS : tst_Warnings::testWarnings() INFO : tst_Warnings::testMissingWarnings() Did not receive message: "Warning0" INFO : tst_Warnings::testMissingWarnings() Did not receive message: "Warning1" FAIL! : tst_Warnings::testMissingWarnings() Not all expected messages were received +INFO : tst_Warnings::testMissingWarningsWithData(first row) Did not receive message: "Warning0" +INFO : tst_Warnings::testMissingWarningsWithData(first row) Did not receive message: "Warning1" +FAIL! : tst_Warnings::testMissingWarningsWithData(first row) Not all expected messages were received +INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning0" +INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning1" +FAIL! : tst_Warnings::testMissingWarningsWithData(second row) Not all expected messages were received PASS : tst_Warnings::cleanupTestCase() -Totals: 3 passed, 1 failed, 0 skipped +Totals: 3 passed, 3 failed, 0 skipped ********* Finished testing of tst_Warnings ********* diff --git a/tests/auto/testlib/selftests/expected_warnings.xml b/tests/auto/testlib/selftests/expected_warnings.xml index 13e6c1df79..12cff7c13d 100644 --- a/tests/auto/testlib/selftests/expected_warnings.xml +++ b/tests/auto/testlib/selftests/expected_warnings.xml @@ -39,6 +39,32 @@ <Description><![CDATA[Not all expected messages were received]]></Description> </Incident> </TestFunction> +<TestFunction name="testMissingWarningsWithData"> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning0"]]></Description> +</Message> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning1"]]></Description> +</Message> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[first row]]></DataTag> + <Description><![CDATA[Not all expected messages were received]]></Description> +</Incident> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning0"]]></Description> +</Message> +<Message type="info" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[Did not receive message: "Warning1"]]></Description> +</Message> +<Incident type="fail" file="" line="0"> + <DataTag><![CDATA[second row]]></DataTag> + <Description><![CDATA[Not all expected messages were received]]></Description> +</Incident> +</TestFunction> <TestFunction name="cleanupTestCase"> <Incident type="pass" file="" line="0" /> </TestFunction> diff --git a/tests/auto/testlib/selftests/expected_warnings.xunitxml b/tests/auto/testlib/selftests/expected_warnings.xunitxml index a96393d648..3e3b9ce18e 100644 --- a/tests/auto/testlib/selftests/expected_warnings.xunitxml +++ b/tests/auto/testlib/selftests/expected_warnings.xunitxml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<testsuite errors="8" failures="1" tests="4" name="tst_Warnings"> +<testsuite errors="12" failures="3" tests="5" name="tst_Warnings"> <properties> <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/> <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/> @@ -18,6 +18,14 @@ <!-- message="Did not receive message: "Warning1"" type="info" --> <failure message="Not all expected messages were received" result="fail"/> </testcase> + <testcase result="fail" name="testMissingWarningsWithData"> + <!-- tag="first row" message="Did not receive message: "Warning0"" type="info" --> + <!-- tag="first row" message="Did not receive message: "Warning1"" type="info" --> + <failure tag="first row" message="Not all expected messages were received" result="fail"/> + <!-- tag="second row" message="Did not receive message: "Warning0"" type="info" --> + <!-- tag="second row" message="Did not receive message: "Warning1"" type="info" --> + <failure tag="second row" message="Not all expected messages were received" result="fail"/> + </testcase> <testcase result="pass" name="cleanupTestCase"/> <system-err> <![CDATA[Warning]]> @@ -28,5 +36,9 @@ <![CDATA[Baba]]> <![CDATA[Did not receive message: "Warning0"]]> <![CDATA[Did not receive message: "Warning1"]]> +<![CDATA[Did not receive message: "Warning0"]]> +<![CDATA[Did not receive message: "Warning1"]]> +<![CDATA[Did not receive message: "Warning0"]]> +<![CDATA[Did not receive message: "Warning1"]]> </system-err> </testsuite> diff --git a/tests/auto/testlib/selftests/expected_xunit.lightxml b/tests/auto/testlib/selftests/expected_xunit.lightxml index 35108fc410..71a57373d6 100644 --- a/tests/auto/testlib/selftests/expected_xunit.lightxml +++ b/tests/auto/testlib/selftests/expected_xunit.lightxml @@ -45,7 +45,7 @@ </TestFunction> <TestFunction name="testFunc7"> <Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="110"> - <Description><![CDATA['true' returned FALSE. ()]]></Description> + <Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description> </Incident> </TestFunction> <TestFunction name="cleanupTestCase"> diff --git a/tests/auto/testlib/selftests/expected_xunit.txt b/tests/auto/testlib/selftests/expected_xunit.txt index ae2508c590..51c8f89599 100644 --- a/tests/auto/testlib/selftests/expected_xunit.txt +++ b/tests/auto/testlib/selftests/expected_xunit.txt @@ -19,7 +19,7 @@ PASS : tst_Xunit::testFunc5() XFAIL : tst_Xunit::testFunc6() this failure is also expected Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(104)] PASS : tst_Xunit::testFunc6() -XPASS : tst_Xunit::testFunc7() 'true' returned FALSE. () +XPASS : tst_Xunit::testFunc7() 'true' returned TRUE unexpectedly. () Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(110)] PASS : tst_Xunit::cleanupTestCase() Totals: 5 passed, 3 failed, 1 skipped diff --git a/tests/auto/testlib/selftests/expected_xunit.xml b/tests/auto/testlib/selftests/expected_xunit.xml index 0fe9735f71..a1e6b20963 100644 --- a/tests/auto/testlib/selftests/expected_xunit.xml +++ b/tests/auto/testlib/selftests/expected_xunit.xml @@ -47,7 +47,7 @@ </TestFunction> <TestFunction name="testFunc7"> <Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="110"> - <Description><![CDATA['true' returned FALSE. ()]]></Description> + <Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description> </Incident> </TestFunction> <TestFunction name="cleanupTestCase"> diff --git a/tests/auto/testlib/selftests/expected_xunit.xunitxml b/tests/auto/testlib/selftests/expected_xunit.xunitxml index e77004f819..e7403443ea 100644 --- a/tests/auto/testlib/selftests/expected_xunit.xunitxml +++ b/tests/auto/testlib/selftests/expected_xunit.xunitxml @@ -27,7 +27,7 @@ <!-- message="this failure is also expected" type="info" --> </testcase> <testcase result="xpass" name="testFunc7"> - <failure message="'true' returned FALSE. ()" result="xpass"/> + <failure message="'true' returned TRUE unexpectedly. ()" result="xpass"/> </testcase> <testcase result="pass" name="cleanupTestCase"/> <system-err> diff --git a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp index 3a000ba182..794b109924 100644 --- a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp +++ b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp @@ -54,15 +54,21 @@ private slots: void xfailAndAbort() const; void xfailTwice() const; void xfailWithQString() const; - void xfailDataDriven_data() const; - void xfailDataDriven() const; + void xfailDataDrivenWithQVerify_data() const; + void xfailDataDrivenWithQVerify() const; + void xfailDataDrivenWithQCompare_data() const; + void xfailDataDrivenWithQCompare() const; void xfailOnWrongRow_data() const; void xfailOnWrongRow() const; void xfailOnAnyRow_data() const; void xfailOnAnyRow() const; + void xfailWithoutVerify_data() const; + void xfailWithoutVerify() const; void xpass() const; - void xpassDataDriven_data() const; - void xpassDataDriven() const; + void xpassDataDrivenWithQVerify_data() const; + void xpassDataDrivenWithQVerify() const; + void xpassDataDrivenWithQCompare_data() const; + void xpassDataDrivenWithQCompare() const; }; void tst_ExpectFail::xfailAndContinue() const @@ -104,7 +110,7 @@ void tst_ExpectFail::xfailWithQString() const QVERIFY(false); } -void tst_ExpectFail::xfailDataDriven_data() const +void tst_ExpectFail::xfailDataDrivenWithQVerify_data() const { QTest::addColumn<bool>("shouldPass"); QTest::addColumn<QTest::TestFailMode>("failMode"); @@ -115,7 +121,7 @@ void tst_ExpectFail::xfailDataDriven_data() const QTest::newRow("Continue") << false << QTest::Continue; } -void tst_ExpectFail::xfailDataDriven() const +void tst_ExpectFail::xfailDataDrivenWithQVerify() const { QFETCH(bool, shouldPass); QFETCH(QTest::TestFailMode, failMode); @@ -138,6 +144,40 @@ void tst_ExpectFail::xfailDataDriven() const QCOMPARE(failMode, QTest::Continue); } +void tst_ExpectFail::xfailDataDrivenWithQCompare_data() const +{ + QTest::addColumn<bool>("shouldPass"); + QTest::addColumn<QTest::TestFailMode>("failMode"); + + QTest::newRow("Pass 1") << true << QTest::Abort; + QTest::newRow("Pass 2") << true << QTest::Continue; + QTest::newRow("Abort") << false << QTest::Abort; + QTest::newRow("Continue") << false << QTest::Continue; +} + +void tst_ExpectFail::xfailDataDrivenWithQCompare() const +{ + QFETCH(bool, shouldPass); + QFETCH(QTest::TestFailMode, failMode); + + // You can't pass a variable as the last parameter of QEXPECT_FAIL, + // because the macro adds "QTest::" in front of the last parameter. + // That is why the following code appears to be a little strange. + if (!shouldPass) { + if (failMode == QTest::Abort) + QEXPECT_FAIL(QTest::currentDataTag(), "This test should xfail", Abort); + else + QEXPECT_FAIL(QTest::currentDataTag(), "This test should xfail", Continue); + } + + QCOMPARE(1, shouldPass ? 1 : 2); + + // If we get here, we either expected to pass or we expected to + // fail and the failure mode was Continue. + if (!shouldPass) + QCOMPARE(failMode, QTest::Continue); +} + void tst_ExpectFail::xfailOnWrongRow_data() const { QTest::addColumn<int>("dummy"); @@ -168,6 +208,20 @@ void tst_ExpectFail::xfailOnAnyRow() const QVERIFY(false); } +void tst_ExpectFail::xfailWithoutVerify_data() const +{ + QTest::addColumn<int>("dummy"); + + QTest::newRow("first row") << 0; + QTest::newRow("second row") << 1; +} + +void tst_ExpectFail::xfailWithoutVerify() const +{ + QVERIFY(true); + QEXPECT_FAIL("", "This expected failure should be ignored", Abort); +} + void tst_ExpectFail::xpass() const { QEXPECT_FAIL("", "This test should xpass", Abort); @@ -178,7 +232,7 @@ void tst_ExpectFail::xpass() const QVERIFY2(false, "This should not be reached"); } -void tst_ExpectFail::xpassDataDriven_data() const +void tst_ExpectFail::xpassDataDrivenWithQVerify_data() const { QTest::addColumn<bool>("shouldXPass"); @@ -186,7 +240,7 @@ void tst_ExpectFail::xpassDataDriven_data() const QTest::newRow("Pass") << false; } -void tst_ExpectFail::xpassDataDriven() const +void tst_ExpectFail::xpassDataDrivenWithQVerify() const { QFETCH(bool, shouldXPass); @@ -199,5 +253,26 @@ void tst_ExpectFail::xpassDataDriven() const QVERIFY2(!shouldXPass, "Test failed to terminate on XPASS"); } +void tst_ExpectFail::xpassDataDrivenWithQCompare_data() const +{ + QTest::addColumn<bool>("shouldXPass"); + + QTest::newRow("XPass") << true; + QTest::newRow("Pass") << false; +} + +void tst_ExpectFail::xpassDataDrivenWithQCompare() const +{ + QFETCH(bool, shouldXPass); + + if (shouldXPass) + QEXPECT_FAIL(QTest::currentDataTag(), "This test should xpass", Abort); + + QCOMPARE(1, 1); + + // We should only get here if the test wasn't supposed to xpass. + QVERIFY2(!shouldXPass, "Test failed to terminate on XPASS"); +} + QTEST_MAIN(tst_ExpectFail) #include "tst_expectfail.moc" diff --git a/tests/auto/testlib/selftests/failcleanup/failcleanup.pro b/tests/auto/testlib/selftests/failcleanup/failcleanup.pro new file mode 100644 index 0000000000..426d7cc45b --- /dev/null +++ b/tests/auto/testlib/selftests/failcleanup/failcleanup.pro @@ -0,0 +1,7 @@ +SOURCES += tst_failcleanup.cpp +QT = core testlib + +mac:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = failcleanup diff --git a/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp b/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp new file mode 100644 index 0000000000..a1b3b2d15a --- /dev/null +++ b/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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> + +class tst_FailCleanup: public QObject +{ +Q_OBJECT +private slots: + void aTestFunction() const; + void cleanupTestCase() const; +}; + +void tst_FailCleanup::aTestFunction() const +{ + QVERIFY(true); +} + +void tst_FailCleanup::cleanupTestCase() const +{ + QVERIFY2(false, "Fail inside cleanupTestCase"); +} + +QTEST_APPLESS_MAIN(tst_FailCleanup) +#include "tst_failcleanup.moc" diff --git a/tests/auto/testlib/selftests/float/tst_float.cpp b/tests/auto/testlib/selftests/float/tst_float.cpp index 9b7865ed25..fb10521604 100644 --- a/tests/auto/testlib/selftests/float/tst_float.cpp +++ b/tests/auto/testlib/selftests/float/tst_float.cpp @@ -66,19 +66,28 @@ void tst_float::floatComparisons_data() const QTest::addColumn<float>("operandLeft"); QTest::addColumn<float>("operandRight"); - QTest::newRow("should SUCCEED") + QTest::newRow("should SUCCEED 1") << float(0) << float(0); - QTest::newRow("should FAIL") + QTest::newRow("should FAIL 1") << float(1.00000) << float(3.00000); - QTest::newRow("should FAIL") + QTest::newRow("should FAIL 2") << float(1.00000e-7f) << float(3.00000e-7f); - QTest::newRow("should FAIL") + // QCOMPARE for floats uses qFuzzyCompare(), which succeeds if the numbers + // differ by no more than 1/100,000th of the smaller value. Thus + // QCOMPARE(99998, 99999) should fail, while QCOMPARE(100001, 100002) + // should pass. + + QTest::newRow("should FAIL 3") + << float(99998) + << float(99999); + + QTest::newRow("should SUCCEED 2") << float(100001) << float(100002); } diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 95664c3793..0809c4d497 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -1,7 +1,42 @@ -SUBPROGRAMS = subtest warnings maxwarnings cmptest globaldata skip \ - strcmp expectfail sleep fetchbogus crashes multiexec failinit failinitdata \ - skipinit skipinitdata datetime singleskip assert differentexec \ - exceptionthrow qexecstringlist datatable commandlinedata\ - benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \ - benchliboptions xunit badxml longstring float printdatatags \ - printdatatagswithglobaltags findtestdata counting +SUBPROGRAMS = \ + #alive \ + assert \ + badxml \ + benchlibcallgrind \ + benchlibcounting \ + benchlibeventcounter \ + benchliboptions \ + benchlibtickcounter \ + benchlibwalltime \ + cmptest \ + commandlinedata \ + counting \ + crashes \ + datatable \ + datetime \ + differentexec \ + exceptionthrow \ + expectfail \ + failcleanup \ + failinit \ + failinitdata \ + fetchbogus \ + findtestdata \ + float \ + globaldata \ + longstring \ + maxwarnings \ + multiexec \ + printdatatags \ + printdatatagswithglobaltags \ + qexecstringlist \ + singleskip \ + skip \ + skipcleanup \ + skipinit \ + skipinitdata \ + sleep \ + strcmp \ + subtest \ + warnings \ + xunit diff --git a/tests/auto/testlib/selftests/selftests.qrc b/tests/auto/testlib/selftests/selftests.qrc index d10aa56ceb..baa539a259 100644 --- a/tests/auto/testlib/selftests/selftests.qrc +++ b/tests/auto/testlib/selftests/selftests.qrc @@ -9,18 +9,16 @@ <file>expected_badxml.txt</file> <file>expected_badxml.xml</file> <file>expected_badxml.xunitxml</file> - <file>expected_benchlibcallgrind.lightxml</file> <file>expected_benchlibcallgrind.txt</file> - <file>expected_benchlibcallgrind.xml</file> - <file>expected_benchlibcallgrind.xunitxml</file> + <file>expected_benchlibcounting.lightxml</file> + <file>expected_benchlibcounting.txt</file> + <file>expected_benchlibcounting.xml</file> + <file>expected_benchlibcounting.xunitxml</file> <file>expected_benchlibeventcounter.lightxml</file> <file>expected_benchlibeventcounter.txt</file> <file>expected_benchlibeventcounter.xml</file> <file>expected_benchlibeventcounter.xunitxml</file> - <file>expected_benchliboptions.lightxml</file> <file>expected_benchliboptions.txt</file> - <file>expected_benchliboptions.xml</file> - <file>expected_benchliboptions.xunitxml</file> <file>expected_benchlibtickcounter.lightxml</file> <file>expected_benchlibtickcounter.txt</file> <file>expected_benchlibtickcounter.xml</file> @@ -41,9 +39,6 @@ <file>expected_counting.txt</file> <file>expected_counting.xml</file> <file>expected_counting.xunitxml</file> - <file>expected_crashes.lightxml</file> - <file>expected_crashes.xml</file> - <file>expected_crashes.xunitxml</file> <file>expected_crashes_1.txt</file> <file>expected_crashes_2.txt</file> <file>expected_crashes_3.txt</file> @@ -64,6 +59,10 @@ <file>expected_expectfail.txt</file> <file>expected_expectfail.xml</file> <file>expected_expectfail.xunitxml</file> + <file>expected_failcleanup.lightxml</file> + <file>expected_failcleanup.txt</file> + <file>expected_failcleanup.xml</file> + <file>expected_failcleanup.xunitxml</file> <file>expected_failinit.lightxml</file> <file>expected_failinit.txt</file> <file>expected_failinit.xml</file> @@ -77,10 +76,7 @@ <file>expected_fetchbogus.txt</file> <file>expected_fetchbogus.xml</file> <file>expected_fetchbogus.xunitxml</file> - <file>expected_float.lightxml</file> <file>expected_float.txt</file> - <file>expected_float.xml</file> - <file>expected_float.xunitxml</file> <file>expected_globaldata.lightxml</file> <file>expected_globaldata.txt</file> <file>expected_globaldata.xml</file> @@ -93,10 +89,7 @@ <file>expected_maxwarnings.txt</file> <file>expected_maxwarnings.xml</file> <file>expected_maxwarnings.xunitxml</file> - <file>expected_multiexec.lightxml</file> <file>expected_multiexec.txt</file> - <file>expected_multiexec.xml</file> - <file>expected_multiexec.xunitxml</file> <file>expected_printdatatags.txt</file> <file>expected_printdatatagswithglobaltags.txt</file> <file>expected_qexecstringlist.txt</file> @@ -108,6 +101,10 @@ <file>expected_skip.txt</file> <file>expected_skip.xml</file> <file>expected_skip.xunitxml</file> + <file>expected_skipcleanup.lightxml</file> + <file>expected_skipcleanup.txt</file> + <file>expected_skipcleanup.xml</file> + <file>expected_skipcleanup.xunitxml</file> <file>expected_skipinit.lightxml</file> <file>expected_skipinit.txt</file> <file>expected_skipinit.xml</file> @@ -116,10 +113,7 @@ <file>expected_skipinitdata.txt</file> <file>expected_skipinitdata.xml</file> <file>expected_skipinitdata.xunitxml</file> - <file>expected_sleep.lightxml</file> <file>expected_sleep.txt</file> - <file>expected_sleep.xml</file> - <file>expected_sleep.xunitxml</file> <file>expected_strcmp.lightxml</file> <file>expected_strcmp.txt</file> <file>expected_strcmp.xml</file> diff --git a/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro b/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro new file mode 100644 index 0000000000..f98cda7596 --- /dev/null +++ b/tests/auto/testlib/selftests/skipcleanup/skipcleanup.pro @@ -0,0 +1,7 @@ +SOURCES += tst_skipcleanup.cpp +QT = core testlib + +mac:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = skipcleanup diff --git a/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp b/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp new file mode 100644 index 0000000000..262aefa982 --- /dev/null +++ b/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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> + +class tst_SkipCleanup: public QObject +{ +Q_OBJECT +private slots: + void aTestFunction() const; + void cleanupTestCase() const; +}; + +void tst_SkipCleanup::aTestFunction() const +{ + QVERIFY(true); +} + +void tst_SkipCleanup::cleanupTestCase() const +{ + QSKIP("Skip inside cleanupTestCase."); +} + +QTEST_APPLESS_MAIN(tst_SkipCleanup) +#include "tst_skipcleanup.moc" diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index aaa58e092c..decaa55386 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -323,6 +323,7 @@ void tst_Selftests::runSubTest_data() // Only run on platforms where callgrind is available. << "benchlibcallgrind" #endif + << "benchlibcounting" << "benchlibeventcounter" << "benchliboptions" << "cmptest" @@ -338,6 +339,7 @@ void tst_Selftests::runSubTest_data() << "exceptionthrow" #endif << "expectfail" + << "failcleanup" << "failinit" << "failinitdata" #if !defined(Q_OS_WIN) @@ -354,6 +356,7 @@ void tst_Selftests::runSubTest_data() << "qexecstringlist" << "singleskip" << "skip" + << "skipcleanup" << "skipinit" << "skipinitdata" << "sleep" @@ -397,6 +400,9 @@ void tst_Selftests::runSubTest_data() else if (subtest == "badxml") { arguments << "-eventcounter"; } + else if (subtest == "benchlibcounting") { + arguments << "-eventcounter"; + } else if (subtest == "printdatatags") { arguments << "-datatags"; } @@ -454,23 +460,26 @@ void tst_Selftests::runSubTest_data() } } +static void insertEnvironmentVariable(QString const& name, QProcessEnvironment &result) +{ + const QProcessEnvironment systemEnvironment = QProcessEnvironment::systemEnvironment(); + const QString value = systemEnvironment.value(name); + if (!value.isEmpty()) + result.insert(name, value); +} + static inline QProcessEnvironment processEnvironment() { QProcessEnvironment result; - const QString path = QStringLiteral("PATH"); - const QProcessEnvironment systemEnvironment = QProcessEnvironment::systemEnvironment(); - result.insert(path, systemEnvironment.value(path)); + insertEnvironmentVariable(QStringLiteral("PATH"), result); // Preserve DISPLAY for X11 as some tests use QtGui. #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - const QString display = QStringLiteral("DISPLAY"); - const QString displayValue = systemEnvironment.value(display); - if (!displayValue.isEmpty()) - result.insert(display, displayValue); + insertEnvironmentVariable(QStringLiteral("DISPLAY"), result); +#endif + insertEnvironmentVariable(QStringLiteral("QT_QPA_PLATFORM"), result); +#ifdef __COVERAGESCANNER__ + insertEnvironmentVariable(QStringLiteral("QT_TESTCOCOON_ACTIVE"), result); #endif - const QString platform = QStringLiteral("QT_QPA_PLATFORM"); - const QString platformValue = systemEnvironment.value(platform); - if (!platformValue.isEmpty()) - result.insert(platform, platformValue); return result; } diff --git a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp index 933d0cc6ce..e53869e18e 100644 --- a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp +++ b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp @@ -49,6 +49,8 @@ class tst_Warnings: public QObject private slots: void testWarnings(); void testMissingWarnings(); + void testMissingWarningsWithData_data(); + void testMissingWarningsWithData(); }; void tst_Warnings::testWarnings() @@ -82,6 +84,23 @@ void tst_Warnings::testMissingWarnings() qWarning("Warning2"); } +void tst_Warnings::testMissingWarningsWithData_data() +{ + QTest::addColumn<int>("dummy"); + + QTest::newRow("first row") << 0; + QTest::newRow("second row") << 1; +} + +void tst_Warnings::testMissingWarningsWithData() +{ + QTest::ignoreMessage(QtWarningMsg, "Warning0"); + QTest::ignoreMessage(QtWarningMsg, "Warning1"); + QTest::ignoreMessage(QtWarningMsg, "Warning2"); + + qWarning("Warning2"); +} + QTEST_MAIN(tst_Warnings) #include "tst_warnings.moc" diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 7c47d60e81..27db6cc59c 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -614,7 +614,7 @@ void tst_Moc::oldStyleCasts() QStringList args; args << "-c" << "-x" << "c++" << "-Wold-style-cast" << "-I" << "." - << "-I" << qtIncludePath << "-o" << "/dev/null" << "-"; + << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIE" << "-"; proc.start("gcc", args); QVERIFY(proc.waitForStarted()); proc.write(mocOut); @@ -683,7 +683,7 @@ void tst_Moc::inputFileNameWithDotsButNoExtension() QStringList args; args << "-c" << "-x" << "c++" << "-I" << ".." - << "-I" << qtIncludePath << "-o" << "/dev/null" << "-"; + << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIE" << "-"; proc.start("gcc", args); QVERIFY(proc.waitForStarted()); proc.write(mocOut); @@ -1623,7 +1623,7 @@ void tst_Moc::warnings_data() << QString("standard input:1: Warning: Property declaration x has no READ accessor function. The property will be invalid."); // Passing "-nn" should NOT suppress the warning - QTest::newRow("Invalid property warning") + QTest::newRow("Invalid property warning with -nn") << QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };") << (QStringList() << "-nn") << 0 @@ -1631,7 +1631,7 @@ void tst_Moc::warnings_data() << QString("standard input:1: Warning: Property declaration x has no READ accessor function. The property will be invalid."); // Passing "-nw" should suppress the warning - QTest::newRow("Invalid property warning") + QTest::newRow("Invalid property warning with -nw") << QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };") << (QStringList() << "-nw") << 0 @@ -1655,7 +1655,7 @@ void tst_Moc::warnings_data() << QString("standard input:1: Error: Class contains Q_OBJECT macro but does not inherit from QObject"); // "-nw" should not suppress the error - QTest::newRow("Does not inherit QObject with -nn") + QTest::newRow("Does not inherit QObject with -nw") << QByteArray("class X { Q_OBJECT };") << (QStringList() << "-nw") << 1 diff --git a/tests/auto/tools/qmake/testdata/substitutes/copy.txt b/tests/auto/tools/qmake/testdata/substitutes/copy.txt new file mode 100644 index 0000000000..65e5840739 --- /dev/null +++ b/tests/auto/tools/qmake/testdata/substitutes/copy.txt @@ -0,0 +1,3 @@ +This file is $processed verbatim. It's not going to "warn about + +anything that is usually substituted in qmake such as $${PWD}. diff --git a/tests/auto/tools/qmake/testdata/substitutes/test.pro b/tests/auto/tools/qmake/testdata/substitutes/test.pro index 26b02722e8..65bb2d85bf 100644 --- a/tests/auto/tools/qmake/testdata/substitutes/test.pro +++ b/tests/auto/tools/qmake/testdata/substitutes/test.pro @@ -1,5 +1,8 @@ -QMAKE_SUBSTITUTES += test.in sub/test2.in indirect +QMAKE_SUBSTITUTES += test.in sub/test2.in indirect copy indirect.input = $$PWD/test3.txt indirect.output = $$OUT_PWD/sub/indirect_test.txt +copy.input = $$PWD/copy.txt +copy.output = $$OUT_PWD/copy_test.txt +copy.config = verbatim diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index fcebd6b821..4da781f763 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -510,6 +510,14 @@ void tst_qmake::substitutes() QVERIFY( test_compiler.exists( buildDir, "test", Plain, "" )); QVERIFY( test_compiler.exists( buildDir, "sub/test2", Plain, "" )); QVERIFY( test_compiler.exists( buildDir, "sub/indirect_test.txt", Plain, "" )); + + QFile copySource(workDir + "/copy.txt"); + QFile copyDestination(buildDir + "/copy_test.txt"); + + QVERIFY(copySource.open(QFile::ReadOnly)); + QVERIFY(copyDestination.open(QFile::ReadOnly)); + QCOMPARE(copySource.readAll(), copyDestination.readAll()); + QVERIFY( test_compiler.makeDistClean( buildDir )); } diff --git a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h index b5b2bb82ea..1725fd6ece 100644 --- a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h +++ b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h @@ -28,10 +28,10 @@ public: void setupUi(QDialog *Dialog) { if (Dialog->objectName().isEmpty()) - Dialog->setObjectName(QString::fromUtf8("Dialog")); + Dialog->setObjectName(QStringLiteral("Dialog")); Dialog->resize(400, 300); buttonBox = new QDialogButtonBox(Dialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setGeometry(QRect(30, 240, 341, 32)); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h index 3d5eabaace..4b25efe6cf 100644 --- a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h +++ b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h @@ -28,10 +28,10 @@ public: void setupUi(QDialog *Dialog) { if (Dialog->objectName().isEmpty()) - Dialog->setObjectName(QString::fromUtf8("Dialog")); + Dialog->setObjectName(QStringLiteral("Dialog")); Dialog->resize(400, 300); buttonBox = new QDialogButtonBox(Dialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setGeometry(QRect(290, 20, 81, 241)); buttonBox->setOrientation(Qt::Vertical); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h b/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h index 267646692d..21b34f86e1 100644 --- a/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h +++ b/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h @@ -26,7 +26,7 @@ public: void setupUi(QDialog *Dialog) { if (Dialog->objectName().isEmpty()) - Dialog->setObjectName(QString::fromUtf8("Dialog")); + Dialog->setObjectName(QStringLiteral("Dialog")); Dialog->resize(400, 300); retranslateUi(Dialog); diff --git a/tests/auto/tools/uic/baseline/Main_Window.ui.h b/tests/auto/tools/uic/baseline/Main_Window.ui.h index d6e0ee4a42..d579688a17 100644 --- a/tests/auto/tools/uic/baseline/Main_Window.ui.h +++ b/tests/auto/tools/uic/baseline/Main_Window.ui.h @@ -32,16 +32,16 @@ public: void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(800, 600); menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); MainWindow->setMenuBar(menubar); centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); MainWindow->setCentralWidget(centralwidget); statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); MainWindow->setStatusBar(statusbar); retranslateUi(MainWindow); diff --git a/tests/auto/tools/uic/baseline/Widget.ui.h b/tests/auto/tools/uic/baseline/Widget.ui.h index 5dcca86903..1ccf8e8d52 100644 --- a/tests/auto/tools/uic/baseline/Widget.ui.h +++ b/tests/auto/tools/uic/baseline/Widget.ui.h @@ -34,22 +34,22 @@ public: void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) - Form->setObjectName(QString::fromUtf8("Form")); + Form->setObjectName(QStringLiteral("Form")); Form->resize(400, 300); vboxLayout = new QVBoxLayout(Form); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); Alabel = new QLabel(Form); - Alabel->setObjectName(QString::fromUtf8("Alabel")); + Alabel->setObjectName(QStringLiteral("Alabel")); vboxLayout->addWidget(Alabel); groupBox = new QGroupBox(Form); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); vboxLayout->addWidget(groupBox); pushButton = new QPushButton(Form); - pushButton->setObjectName(QString::fromUtf8("pushButton")); + pushButton->setObjectName(QStringLiteral("pushButton")); vboxLayout->addWidget(pushButton); diff --git a/tests/auto/tools/uic/baseline/addlinkdialog.ui.h b/tests/auto/tools/uic/baseline/addlinkdialog.ui.h index 79262a1ae6..537fa2d8b1 100644 --- a/tests/auto/tools/uic/baseline/addlinkdialog.ui.h +++ b/tests/auto/tools/uic/baseline/addlinkdialog.ui.h @@ -42,31 +42,31 @@ public: void setupUi(QDialog *AddLinkDialog) { if (AddLinkDialog->objectName().isEmpty()) - AddLinkDialog->setObjectName(QString::fromUtf8("AddLinkDialog")); + AddLinkDialog->setObjectName(QStringLiteral("AddLinkDialog")); AddLinkDialog->setSizeGripEnabled(false); AddLinkDialog->setModal(true); verticalLayout = new QVBoxLayout(AddLinkDialog); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); formLayout = new QFormLayout(); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); label = new QLabel(AddLinkDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); formLayout->setWidget(0, QFormLayout::LabelRole, label); titleInput = new QLineEdit(AddLinkDialog); - titleInput->setObjectName(QString::fromUtf8("titleInput")); + titleInput->setObjectName(QStringLiteral("titleInput")); titleInput->setMinimumSize(QSize(337, 0)); formLayout->setWidget(0, QFormLayout::FieldRole, titleInput); label_2 = new QLabel(AddLinkDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); formLayout->setWidget(1, QFormLayout::LabelRole, label_2); urlInput = new QLineEdit(AddLinkDialog); - urlInput->setObjectName(QString::fromUtf8("urlInput")); + urlInput->setObjectName(QStringLiteral("urlInput")); formLayout->setWidget(1, QFormLayout::FieldRole, urlInput); @@ -78,14 +78,14 @@ public: verticalLayout->addItem(verticalSpacer); line = new QFrame(AddLinkDialog); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); verticalLayout->addWidget(line); buttonBox = new QDialogButtonBox(AddLinkDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/addtorrentform.ui.h b/tests/auto/tools/uic/baseline/addtorrentform.ui.h index a1cb6c56d4..dfca1699ae 100644 --- a/tests/auto/tools/uic/baseline/addtorrentform.ui.h +++ b/tests/auto/tools/uic/baseline/addtorrentform.ui.h @@ -60,7 +60,7 @@ public: void setupUi(QDialog *AddTorrentFile) { if (AddTorrentFile->objectName().isEmpty()) - AddTorrentFile->setObjectName(QString::fromUtf8("AddTorrentFile")); + AddTorrentFile->setObjectName(QStringLiteral("AddTorrentFile")); AddTorrentFile->resize(464, 385); AddTorrentFile->setSizeGripEnabled(false); AddTorrentFile->setModal(true); @@ -69,57 +69,57 @@ public: vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(8, 8, 8, 8); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(AddTorrentFile); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); widget = new QWidget(groupBox); - widget->setObjectName(QString::fromUtf8("widget")); + widget->setObjectName(QStringLiteral("widget")); widget->setGeometry(QRect(10, 40, 364, 33)); gridLayout = new QGridLayout(groupBox); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label_4 = new QLabel(groupBox); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); gridLayout->addWidget(label_4, 6, 0, 1, 1); torrentFile = new QLineEdit(groupBox); - torrentFile->setObjectName(QString::fromUtf8("torrentFile")); + torrentFile->setObjectName(QStringLiteral("torrentFile")); gridLayout->addWidget(torrentFile, 0, 1, 1, 2); label_2 = new QLabel(groupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 1, 0, 1, 1); browseTorrents = new QPushButton(groupBox); - browseTorrents->setObjectName(QString::fromUtf8("browseTorrents")); + browseTorrents->setObjectName(QStringLiteral("browseTorrents")); browseTorrents->setDefault(true); gridLayout->addWidget(browseTorrents, 0, 3, 1, 1); label_5 = new QLabel(groupBox); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); label_5->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); gridLayout->addWidget(label_5, 5, 0, 1, 1); label_3 = new QLabel(groupBox); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout->addWidget(label_3, 4, 0, 1, 1); label_6 = new QLabel(groupBox); - label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setObjectName(QStringLiteral("label_6")); gridLayout->addWidget(label_6, 2, 0, 1, 1); torrentContents = new QTextEdit(groupBox); - torrentContents->setObjectName(QString::fromUtf8("torrentContents")); + torrentContents->setObjectName(QStringLiteral("torrentContents")); torrentContents->setFocusPolicy(Qt::NoFocus); torrentContents->setTabChangesFocus(true); torrentContents->setLineWrapMode(QTextEdit::NoWrap); @@ -128,43 +128,43 @@ public: gridLayout->addWidget(torrentContents, 5, 1, 1, 3); destinationFolder = new QLineEdit(groupBox); - destinationFolder->setObjectName(QString::fromUtf8("destinationFolder")); + destinationFolder->setObjectName(QStringLiteral("destinationFolder")); destinationFolder->setFocusPolicy(Qt::StrongFocus); gridLayout->addWidget(destinationFolder, 6, 1, 1, 2); announceUrl = new QLabel(groupBox); - announceUrl->setObjectName(QString::fromUtf8("announceUrl")); + announceUrl->setObjectName(QStringLiteral("announceUrl")); gridLayout->addWidget(announceUrl, 1, 1, 1, 3); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); browseDestination = new QPushButton(groupBox); - browseDestination->setObjectName(QString::fromUtf8("browseDestination")); + browseDestination->setObjectName(QStringLiteral("browseDestination")); gridLayout->addWidget(browseDestination, 6, 3, 1, 1); label_7 = new QLabel(groupBox); - label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setObjectName(QStringLiteral("label_7")); gridLayout->addWidget(label_7, 3, 0, 1, 1); commentLabel = new QLabel(groupBox); - commentLabel->setObjectName(QString::fromUtf8("commentLabel")); + commentLabel->setObjectName(QStringLiteral("commentLabel")); gridLayout->addWidget(commentLabel, 3, 1, 1, 3); creatorLabel = new QLabel(groupBox); - creatorLabel->setObjectName(QString::fromUtf8("creatorLabel")); + creatorLabel->setObjectName(QStringLiteral("creatorLabel")); gridLayout->addWidget(creatorLabel, 2, 1, 1, 3); sizeLabel = new QLabel(groupBox); - sizeLabel->setObjectName(QString::fromUtf8("sizeLabel")); + sizeLabel->setObjectName(QStringLiteral("sizeLabel")); gridLayout->addWidget(sizeLabel, 4, 1, 1, 3); @@ -176,19 +176,19 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); okButton = new QPushButton(AddTorrentFile); - okButton->setObjectName(QString::fromUtf8("okButton")); + okButton->setObjectName(QStringLiteral("okButton")); okButton->setEnabled(false); hboxLayout->addWidget(okButton); cancelButton = new QPushButton(AddTorrentFile); - cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setObjectName(QStringLiteral("cancelButton")); hboxLayout->addWidget(cancelButton); diff --git a/tests/auto/tools/uic/baseline/authenticationdialog.ui.h b/tests/auto/tools/uic/baseline/authenticationdialog.ui.h index def597f64f..1aef4729f6 100644 --- a/tests/auto/tools/uic/baseline/authenticationdialog.ui.h +++ b/tests/auto/tools/uic/baseline/authenticationdialog.ui.h @@ -41,50 +41,50 @@ public: void setupUi(QDialog *Dialog) { if (Dialog->objectName().isEmpty()) - Dialog->setObjectName(QString::fromUtf8("Dialog")); + Dialog->setObjectName(QStringLiteral("Dialog")); Dialog->resize(389, 243); gridLayout = new QGridLayout(Dialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(Dialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setWordWrap(false); gridLayout->addWidget(label, 0, 0, 1, 2); label_2 = new QLabel(Dialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 2, 0, 1, 1); userEdit = new QLineEdit(Dialog); - userEdit->setObjectName(QString::fromUtf8("userEdit")); + userEdit->setObjectName(QStringLiteral("userEdit")); gridLayout->addWidget(userEdit, 2, 1, 1, 1); label_3 = new QLabel(Dialog); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout->addWidget(label_3, 3, 0, 1, 1); passwordEdit = new QLineEdit(Dialog); - passwordEdit->setObjectName(QString::fromUtf8("passwordEdit")); + passwordEdit->setObjectName(QStringLiteral("passwordEdit")); gridLayout->addWidget(passwordEdit, 3, 1, 1, 1); buttonBox = new QDialogButtonBox(Dialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 5, 0, 1, 2); label_4 = new QLabel(Dialog); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); gridLayout->addWidget(label_4, 1, 0, 1, 1); siteDescription = new QLabel(Dialog); - siteDescription->setObjectName(QString::fromUtf8("siteDescription")); + siteDescription->setObjectName(QStringLiteral("siteDescription")); QFont font; font.setBold(true); font.setWeight(75); diff --git a/tests/auto/tools/uic/baseline/backside.ui.h b/tests/auto/tools/uic/baseline/backside.ui.h index f09c468a34..7e25775c98 100644 --- a/tests/auto/tools/uic/baseline/backside.ui.h +++ b/tests/auto/tools/uic/baseline/backside.ui.h @@ -50,47 +50,47 @@ public: void setupUi(QWidget *BackSide) { if (BackSide->objectName().isEmpty()) - BackSide->setObjectName(QString::fromUtf8("BackSide")); + BackSide->setObjectName(QStringLiteral("BackSide")); BackSide->resize(378, 385); verticalLayout_2 = new QVBoxLayout(BackSide); - verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); + verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); groupBox = new QGroupBox(BackSide); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); groupBox->setFlat(true); groupBox->setCheckable(true); gridLayout = new QGridLayout(groupBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); hostName = new QLineEdit(groupBox); - hostName->setObjectName(QString::fromUtf8("hostName")); + hostName->setObjectName(QStringLiteral("hostName")); gridLayout->addWidget(hostName, 0, 1, 1, 1); label_2 = new QLabel(groupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 1, 0, 1, 1); label_3 = new QLabel(groupBox); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout->addWidget(label_3, 2, 0, 1, 1); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); horizontalSlider = new QSlider(groupBox); - horizontalSlider->setObjectName(QString::fromUtf8("horizontalSlider")); + horizontalSlider->setObjectName(QStringLiteral("horizontalSlider")); horizontalSlider->setValue(42); horizontalSlider->setOrientation(Qt::Horizontal); horizontalLayout->addWidget(horizontalSlider); spinBox = new QSpinBox(groupBox); - spinBox->setObjectName(QString::fromUtf8("spinBox")); + spinBox->setObjectName(QStringLiteral("spinBox")); spinBox->setValue(42); horizontalLayout->addWidget(spinBox); @@ -99,7 +99,7 @@ public: gridLayout->addLayout(horizontalLayout, 2, 1, 1, 1); dateTimeEdit = new QDateTimeEdit(groupBox); - dateTimeEdit->setObjectName(QString::fromUtf8("dateTimeEdit")); + dateTimeEdit->setObjectName(QStringLiteral("dateTimeEdit")); gridLayout->addWidget(dateTimeEdit, 1, 1, 1, 1); @@ -107,11 +107,11 @@ public: verticalLayout_2->addWidget(groupBox); groupBox_2 = new QGroupBox(BackSide); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); groupBox_2->setFlat(true); groupBox_2->setCheckable(true); horizontalLayout_2 = new QHBoxLayout(groupBox_2); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); treeWidget = new QTreeWidget(groupBox_2); QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem(treeWidget); QTreeWidgetItem *__qtreewidgetitem1 = new QTreeWidgetItem(__qtreewidgetitem); @@ -124,7 +124,7 @@ public: QTreeWidgetItem *__qtreewidgetitem4 = new QTreeWidgetItem(treeWidget); QTreeWidgetItem *__qtreewidgetitem5 = new QTreeWidgetItem(__qtreewidgetitem4); new QTreeWidgetItem(__qtreewidgetitem5); - treeWidget->setObjectName(QString::fromUtf8("treeWidget")); + treeWidget->setObjectName(QStringLiteral("treeWidget")); horizontalLayout_2->addWidget(treeWidget); diff --git a/tests/auto/tools/uic/baseline/batchtranslation.ui.h b/tests/auto/tools/uic/baseline/batchtranslation.ui.h index 302dbc2cb4..b1ba5bee31 100644 --- a/tests/auto/tools/uic/baseline/batchtranslation.ui.h +++ b/tests/auto/tools/uic/baseline/batchtranslation.ui.h @@ -95,7 +95,7 @@ public: void setupUi(QDialog *databaseTranslationDialog) { if (databaseTranslationDialog->objectName().isEmpty()) - databaseTranslationDialog->setObjectName(QString::fromUtf8("databaseTranslationDialog")); + databaseTranslationDialog->setObjectName(QStringLiteral("databaseTranslationDialog")); databaseTranslationDialog->resize(425, 370); vboxLayout = new QVBoxLayout(databaseTranslationDialog); #ifndef Q_OS_MAC @@ -104,9 +104,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(databaseTranslationDialog); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(4)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -119,15 +119,15 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); ckOnlyUntranslated = new QCheckBox(groupBox); - ckOnlyUntranslated->setObjectName(QString::fromUtf8("ckOnlyUntranslated")); + ckOnlyUntranslated->setObjectName(QStringLiteral("ckOnlyUntranslated")); ckOnlyUntranslated->setChecked(true); vboxLayout1->addWidget(ckOnlyUntranslated); ckMarkFinished = new QCheckBox(groupBox); - ckMarkFinished->setObjectName(QString::fromUtf8("ckMarkFinished")); + ckMarkFinished->setObjectName(QStringLiteral("ckMarkFinished")); ckMarkFinished->setChecked(true); vboxLayout1->addWidget(ckMarkFinished); @@ -136,7 +136,7 @@ public: vboxLayout->addWidget(groupBox); groupBox_2 = new QGroupBox(databaseTranslationDialog); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(1)); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -149,7 +149,7 @@ public: #ifndef Q_OS_MAC vboxLayout2->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -157,9 +157,9 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); phrasebookList = new QListView(groupBox_2); - phrasebookList->setObjectName(QString::fromUtf8("phrasebookList")); + phrasebookList->setObjectName(QStringLiteral("phrasebookList")); phrasebookList->setUniformItemSizes(true); hboxLayout->addWidget(phrasebookList); @@ -169,14 +169,14 @@ public: vboxLayout3->setSpacing(6); #endif vboxLayout3->setContentsMargins(0, 0, 0, 0); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); + vboxLayout3->setObjectName(QStringLiteral("vboxLayout3")); moveUpButton = new QPushButton(groupBox_2); - moveUpButton->setObjectName(QString::fromUtf8("moveUpButton")); + moveUpButton->setObjectName(QStringLiteral("moveUpButton")); vboxLayout3->addWidget(moveUpButton); moveDownButton = new QPushButton(groupBox_2); - moveDownButton->setObjectName(QString::fromUtf8("moveDownButton")); + moveDownButton->setObjectName(QStringLiteral("moveDownButton")); vboxLayout3->addWidget(moveDownButton); @@ -191,7 +191,7 @@ public: vboxLayout2->addLayout(hboxLayout); label = new QLabel(groupBox_2); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setWordWrap(true); vboxLayout2->addWidget(label); @@ -204,18 +204,18 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); spacerItem1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacerItem1); runButton = new QPushButton(databaseTranslationDialog); - runButton->setObjectName(QString::fromUtf8("runButton")); + runButton->setObjectName(QStringLiteral("runButton")); hboxLayout1->addWidget(runButton); cancelButton = new QPushButton(databaseTranslationDialog); - cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setObjectName(QStringLiteral("cancelButton")); hboxLayout1->addWidget(cancelButton); diff --git a/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h b/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h index a178497e26..33c0d19ee2 100644 --- a/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h +++ b/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h @@ -51,7 +51,7 @@ public: void setupUi(QDialog *BookmarkDialog) { if (BookmarkDialog->objectName().isEmpty()) - BookmarkDialog->setObjectName(QString::fromUtf8("BookmarkDialog")); + BookmarkDialog->setObjectName(QStringLiteral("BookmarkDialog")); BookmarkDialog->resize(450, 135); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); @@ -59,18 +59,18 @@ public: sizePolicy.setHeightForWidth(BookmarkDialog->sizePolicy().hasHeightForWidth()); BookmarkDialog->setSizePolicy(sizePolicy); verticalLayout_3 = new QVBoxLayout(BookmarkDialog); - verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); + verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3")); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); + verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); label = new QLabel(BookmarkDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); verticalLayout_2->addWidget(label); label_2 = new QLabel(BookmarkDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); verticalLayout_2->addWidget(label_2); @@ -78,14 +78,14 @@ public: horizontalLayout->addLayout(verticalLayout_2); verticalLayout = new QVBoxLayout(); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); bookmarkEdit = new QLineEdit(BookmarkDialog); - bookmarkEdit->setObjectName(QString::fromUtf8("bookmarkEdit")); + bookmarkEdit->setObjectName(QStringLiteral("bookmarkEdit")); verticalLayout->addWidget(bookmarkEdit); bookmarkFolders = new QComboBox(BookmarkDialog); - bookmarkFolders->setObjectName(QString::fromUtf8("bookmarkFolders")); + bookmarkFolders->setObjectName(QStringLiteral("bookmarkFolders")); verticalLayout->addWidget(bookmarkFolders); @@ -96,15 +96,15 @@ public: verticalLayout_3->addLayout(horizontalLayout); horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); + horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); toolButton = new QToolButton(BookmarkDialog); - toolButton->setObjectName(QString::fromUtf8("toolButton")); + toolButton->setObjectName(QStringLiteral("toolButton")); toolButton->setMinimumSize(QSize(25, 20)); horizontalLayout_3->addWidget(toolButton); line = new QFrame(BookmarkDialog); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); @@ -114,7 +114,7 @@ public: verticalLayout_3->addLayout(horizontalLayout_3); bookmarkWidget = new BookmarkWidget(BookmarkDialog); - bookmarkWidget->setObjectName(QString::fromUtf8("bookmarkWidget")); + bookmarkWidget->setObjectName(QStringLiteral("bookmarkWidget")); bookmarkWidget->setEnabled(true); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Ignored); sizePolicy1.setHorizontalStretch(0); @@ -125,14 +125,14 @@ public: verticalLayout_3->addWidget(bookmarkWidget); horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); + horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); newFolderButton = new QPushButton(BookmarkDialog); - newFolderButton->setObjectName(QString::fromUtf8("newFolderButton")); + newFolderButton->setObjectName(QStringLiteral("newFolderButton")); horizontalLayout_4->addWidget(newFolderButton); buttonBox = new QDialogButtonBox(BookmarkDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/bookwindow.ui.h b/tests/auto/tools/uic/baseline/bookwindow.ui.h index 0463aeb8c9..d27717296c 100644 --- a/tests/auto/tools/uic/baseline/bookwindow.ui.h +++ b/tests/auto/tools/uic/baseline/bookwindow.ui.h @@ -52,10 +52,10 @@ public: void setupUi(QMainWindow *BookWindow) { if (BookWindow->objectName().isEmpty()) - BookWindow->setObjectName(QString::fromUtf8("BookWindow")); + BookWindow->setObjectName(QStringLiteral("BookWindow")); BookWindow->resize(601, 420); centralWidget = new QWidget(BookWindow); - centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + centralWidget->setObjectName(QStringLiteral("centralWidget")); vboxLayout = new QVBoxLayout(centralWidget); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -63,9 +63,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(centralWidget); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); vboxLayout1 = new QVBoxLayout(groupBox); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -73,57 +73,57 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); bookTable = new QTableView(groupBox); - bookTable->setObjectName(QString::fromUtf8("bookTable")); + bookTable->setObjectName(QStringLiteral("bookTable")); bookTable->setSelectionBehavior(QAbstractItemView::SelectRows); vboxLayout1->addWidget(bookTable); groupBox_2 = new QGroupBox(groupBox); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); formLayout = new QFormLayout(groupBox_2); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); label_5 = new QLabel(groupBox_2); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); formLayout->setWidget(0, QFormLayout::LabelRole, label_5); titleEdit = new QLineEdit(groupBox_2); - titleEdit->setObjectName(QString::fromUtf8("titleEdit")); + titleEdit->setObjectName(QStringLiteral("titleEdit")); titleEdit->setEnabled(true); formLayout->setWidget(0, QFormLayout::FieldRole, titleEdit); label_2_2_2_2 = new QLabel(groupBox_2); - label_2_2_2_2->setObjectName(QString::fromUtf8("label_2_2_2_2")); + label_2_2_2_2->setObjectName(QStringLiteral("label_2_2_2_2")); formLayout->setWidget(1, QFormLayout::LabelRole, label_2_2_2_2); authorEdit = new QComboBox(groupBox_2); - authorEdit->setObjectName(QString::fromUtf8("authorEdit")); + authorEdit->setObjectName(QStringLiteral("authorEdit")); authorEdit->setEnabled(true); formLayout->setWidget(1, QFormLayout::FieldRole, authorEdit); label_3 = new QLabel(groupBox_2); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); formLayout->setWidget(2, QFormLayout::LabelRole, label_3); genreEdit = new QComboBox(groupBox_2); - genreEdit->setObjectName(QString::fromUtf8("genreEdit")); + genreEdit->setObjectName(QStringLiteral("genreEdit")); genreEdit->setEnabled(true); formLayout->setWidget(2, QFormLayout::FieldRole, genreEdit); label_4 = new QLabel(groupBox_2); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); formLayout->setWidget(3, QFormLayout::LabelRole, label_4); yearEdit = new QSpinBox(groupBox_2); - yearEdit->setObjectName(QString::fromUtf8("yearEdit")); + yearEdit->setObjectName(QStringLiteral("yearEdit")); yearEdit->setEnabled(true); yearEdit->setMaximum(2100); yearEdit->setMinimum(-1000); @@ -131,12 +131,12 @@ public: formLayout->setWidget(3, QFormLayout::FieldRole, yearEdit); label = new QLabel(groupBox_2); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); formLayout->setWidget(4, QFormLayout::LabelRole, label); ratingEdit = new QSpinBox(groupBox_2); - ratingEdit->setObjectName(QString::fromUtf8("ratingEdit")); + ratingEdit->setObjectName(QStringLiteral("ratingEdit")); ratingEdit->setMaximum(5); formLayout->setWidget(4, QFormLayout::FieldRole, ratingEdit); diff --git a/tests/auto/tools/uic/baseline/browserwidget.ui.h b/tests/auto/tools/uic/baseline/browserwidget.ui.h index 7214898a4f..9d7a648b21 100644 --- a/tests/auto/tools/uic/baseline/browserwidget.ui.h +++ b/tests/auto/tools/uic/baseline/browserwidget.ui.h @@ -48,22 +48,22 @@ public: void setupUi(QWidget *Browser) { if (Browser->objectName().isEmpty()) - Browser->setObjectName(QString::fromUtf8("Browser")); + Browser->setObjectName(QStringLiteral("Browser")); Browser->resize(765, 515); insertRowAction = new QAction(Browser); - insertRowAction->setObjectName(QString::fromUtf8("insertRowAction")); + insertRowAction->setObjectName(QStringLiteral("insertRowAction")); insertRowAction->setEnabled(false); deleteRowAction = new QAction(Browser); - deleteRowAction->setObjectName(QString::fromUtf8("deleteRowAction")); + deleteRowAction->setObjectName(QStringLiteral("deleteRowAction")); deleteRowAction->setEnabled(false); vboxLayout = new QVBoxLayout(Browser); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(8, 8, 8, 8); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); splitter_2 = new QSplitter(Browser); - splitter_2->setObjectName(QString::fromUtf8("splitter_2")); + splitter_2->setObjectName(QStringLiteral("splitter_2")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -71,7 +71,7 @@ public: splitter_2->setSizePolicy(sizePolicy); splitter_2->setOrientation(Qt::Horizontal); connectionWidget = new ConnectionWidget(splitter_2); - connectionWidget->setObjectName(QString::fromUtf8("connectionWidget")); + connectionWidget->setObjectName(QStringLiteral("connectionWidget")); QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(13), static_cast<QSizePolicy::Policy>(7)); sizePolicy1.setHorizontalStretch(1); sizePolicy1.setVerticalStretch(0); @@ -79,7 +79,7 @@ public: connectionWidget->setSizePolicy(sizePolicy1); splitter_2->addWidget(connectionWidget); table = new QTableView(splitter_2); - table->setObjectName(QString::fromUtf8("table")); + table->setObjectName(QStringLiteral("table")); QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7)); sizePolicy2.setHorizontalStretch(2); sizePolicy2.setVerticalStretch(0); @@ -92,7 +92,7 @@ public: vboxLayout->addWidget(splitter_2); groupBox = new QGroupBox(Browser); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); QSizePolicy sizePolicy3(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(3)); sizePolicy3.setHorizontalStretch(0); sizePolicy3.setVerticalStretch(0); @@ -106,9 +106,9 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); sqlEdit = new QTextEdit(groupBox); - sqlEdit->setObjectName(QString::fromUtf8("sqlEdit")); + sqlEdit->setObjectName(QStringLiteral("sqlEdit")); QSizePolicy sizePolicy4(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(3)); sizePolicy4.setHorizontalStretch(0); sizePolicy4.setVerticalStretch(0); @@ -124,18 +124,18 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(1, 1, 1, 1); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); clearButton = new QPushButton(groupBox); - clearButton->setObjectName(QString::fromUtf8("clearButton")); + clearButton->setObjectName(QStringLiteral("clearButton")); hboxLayout->addWidget(clearButton); submitButton = new QPushButton(groupBox); - submitButton->setObjectName(QString::fromUtf8("submitButton")); + submitButton->setObjectName(QStringLiteral("submitButton")); hboxLayout->addWidget(submitButton); diff --git a/tests/auto/tools/uic/baseline/calculator.ui.h b/tests/auto/tools/uic/baseline/calculator.ui.h index 3d69c9fdfd..8a33fcbbd9 100644 --- a/tests/auto/tools/uic/baseline/calculator.ui.h +++ b/tests/auto/tools/uic/baseline/calculator.ui.h @@ -56,7 +56,7 @@ public: void setupUi(QWidget *Calculator) { if (Calculator->objectName().isEmpty()) - Calculator->setObjectName(QString::fromUtf8("Calculator")); + Calculator->setObjectName(QStringLiteral("Calculator")); Calculator->resize(314, 301); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); @@ -66,88 +66,88 @@ public: Calculator->setMinimumSize(QSize(314, 301)); Calculator->setMaximumSize(QSize(314, 301)); backspaceButton = new QToolButton(Calculator); - backspaceButton->setObjectName(QString::fromUtf8("backspaceButton")); + backspaceButton->setObjectName(QStringLiteral("backspaceButton")); backspaceButton->setGeometry(QRect(10, 50, 91, 41)); clearButton = new QToolButton(Calculator); - clearButton->setObjectName(QString::fromUtf8("clearButton")); + clearButton->setObjectName(QStringLiteral("clearButton")); clearButton->setGeometry(QRect(110, 50, 91, 41)); clearAllButton = new QToolButton(Calculator); - clearAllButton->setObjectName(QString::fromUtf8("clearAllButton")); + clearAllButton->setObjectName(QStringLiteral("clearAllButton")); clearAllButton->setGeometry(QRect(210, 50, 91, 41)); clearMemoryButton = new QToolButton(Calculator); - clearMemoryButton->setObjectName(QString::fromUtf8("clearMemoryButton")); + clearMemoryButton->setObjectName(QStringLiteral("clearMemoryButton")); clearMemoryButton->setGeometry(QRect(10, 100, 41, 41)); readMemoryButton = new QToolButton(Calculator); - readMemoryButton->setObjectName(QString::fromUtf8("readMemoryButton")); + readMemoryButton->setObjectName(QStringLiteral("readMemoryButton")); readMemoryButton->setGeometry(QRect(10, 150, 41, 41)); setMemoryButton = new QToolButton(Calculator); - setMemoryButton->setObjectName(QString::fromUtf8("setMemoryButton")); + setMemoryButton->setObjectName(QStringLiteral("setMemoryButton")); setMemoryButton->setGeometry(QRect(10, 200, 41, 41)); addToMemoryButton = new QToolButton(Calculator); - addToMemoryButton->setObjectName(QString::fromUtf8("addToMemoryButton")); + addToMemoryButton->setObjectName(QStringLiteral("addToMemoryButton")); addToMemoryButton->setGeometry(QRect(10, 250, 41, 41)); sevenButton = new QToolButton(Calculator); - sevenButton->setObjectName(QString::fromUtf8("sevenButton")); + sevenButton->setObjectName(QStringLiteral("sevenButton")); sevenButton->setGeometry(QRect(60, 100, 41, 41)); eightButton = new QToolButton(Calculator); - eightButton->setObjectName(QString::fromUtf8("eightButton")); + eightButton->setObjectName(QStringLiteral("eightButton")); eightButton->setGeometry(QRect(110, 100, 41, 41)); nineButton = new QToolButton(Calculator); - nineButton->setObjectName(QString::fromUtf8("nineButton")); + nineButton->setObjectName(QStringLiteral("nineButton")); nineButton->setGeometry(QRect(160, 100, 41, 41)); fourButton = new QToolButton(Calculator); - fourButton->setObjectName(QString::fromUtf8("fourButton")); + fourButton->setObjectName(QStringLiteral("fourButton")); fourButton->setGeometry(QRect(60, 150, 41, 41)); fiveButton = new QToolButton(Calculator); - fiveButton->setObjectName(QString::fromUtf8("fiveButton")); + fiveButton->setObjectName(QStringLiteral("fiveButton")); fiveButton->setGeometry(QRect(110, 150, 41, 41)); sixButton = new QToolButton(Calculator); - sixButton->setObjectName(QString::fromUtf8("sixButton")); + sixButton->setObjectName(QStringLiteral("sixButton")); sixButton->setGeometry(QRect(160, 150, 41, 41)); oneButton = new QToolButton(Calculator); - oneButton->setObjectName(QString::fromUtf8("oneButton")); + oneButton->setObjectName(QStringLiteral("oneButton")); oneButton->setGeometry(QRect(60, 200, 41, 41)); twoButton = new QToolButton(Calculator); - twoButton->setObjectName(QString::fromUtf8("twoButton")); + twoButton->setObjectName(QStringLiteral("twoButton")); twoButton->setGeometry(QRect(110, 200, 41, 41)); threeButton = new QToolButton(Calculator); - threeButton->setObjectName(QString::fromUtf8("threeButton")); + threeButton->setObjectName(QStringLiteral("threeButton")); threeButton->setGeometry(QRect(160, 200, 41, 41)); zeroButton = new QToolButton(Calculator); - zeroButton->setObjectName(QString::fromUtf8("zeroButton")); + zeroButton->setObjectName(QStringLiteral("zeroButton")); zeroButton->setGeometry(QRect(60, 250, 41, 41)); pointButton = new QToolButton(Calculator); - pointButton->setObjectName(QString::fromUtf8("pointButton")); + pointButton->setObjectName(QStringLiteral("pointButton")); pointButton->setGeometry(QRect(110, 250, 41, 41)); changeSignButton = new QToolButton(Calculator); - changeSignButton->setObjectName(QString::fromUtf8("changeSignButton")); + changeSignButton->setObjectName(QStringLiteral("changeSignButton")); changeSignButton->setGeometry(QRect(160, 250, 41, 41)); plusButton = new QToolButton(Calculator); - plusButton->setObjectName(QString::fromUtf8("plusButton")); + plusButton->setObjectName(QStringLiteral("plusButton")); plusButton->setGeometry(QRect(210, 250, 41, 41)); divisionButton = new QToolButton(Calculator); - divisionButton->setObjectName(QString::fromUtf8("divisionButton")); + divisionButton->setObjectName(QStringLiteral("divisionButton")); divisionButton->setGeometry(QRect(210, 100, 41, 41)); timesButton = new QToolButton(Calculator); - timesButton->setObjectName(QString::fromUtf8("timesButton")); + timesButton->setObjectName(QStringLiteral("timesButton")); timesButton->setGeometry(QRect(210, 150, 41, 41)); minusButton = new QToolButton(Calculator); - minusButton->setObjectName(QString::fromUtf8("minusButton")); + minusButton->setObjectName(QStringLiteral("minusButton")); minusButton->setGeometry(QRect(210, 200, 41, 41)); squareRootButton = new QToolButton(Calculator); - squareRootButton->setObjectName(QString::fromUtf8("squareRootButton")); + squareRootButton->setObjectName(QStringLiteral("squareRootButton")); squareRootButton->setGeometry(QRect(260, 100, 41, 41)); powerButton = new QToolButton(Calculator); - powerButton->setObjectName(QString::fromUtf8("powerButton")); + powerButton->setObjectName(QStringLiteral("powerButton")); powerButton->setGeometry(QRect(260, 150, 41, 41)); reciprocalButton = new QToolButton(Calculator); - reciprocalButton->setObjectName(QString::fromUtf8("reciprocalButton")); + reciprocalButton->setObjectName(QStringLiteral("reciprocalButton")); reciprocalButton->setGeometry(QRect(260, 200, 41, 41)); equalButton = new QToolButton(Calculator); - equalButton->setObjectName(QString::fromUtf8("equalButton")); + equalButton->setObjectName(QStringLiteral("equalButton")); equalButton->setGeometry(QRect(260, 250, 41, 41)); display = new QLineEdit(Calculator); - display->setObjectName(QString::fromUtf8("display")); + display->setObjectName(QStringLiteral("display")); display->setGeometry(QRect(10, 10, 291, 31)); display->setMaxLength(15); display->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); diff --git a/tests/auto/tools/uic/baseline/calculatorform.ui.h b/tests/auto/tools/uic/baseline/calculatorform.ui.h index b38a940448..cbc62367e0 100644 --- a/tests/auto/tools/uic/baseline/calculatorform.ui.h +++ b/tests/auto/tools/uic/baseline/calculatorform.ui.h @@ -47,7 +47,7 @@ public: void setupUi(QWidget *CalculatorForm) { if (CalculatorForm->objectName().isEmpty()) - CalculatorForm->setObjectName(QString::fromUtf8("CalculatorForm")); + CalculatorForm->setObjectName(QStringLiteral("CalculatorForm")); CalculatorForm->resize(276, 98); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5)); sizePolicy.setHorizontalStretch(0); @@ -61,30 +61,30 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - gridLayout->setObjectName(QString::fromUtf8("")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + gridLayout->setObjectName(QStringLiteral("")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(1, 1, 1, 1); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("")); vboxLayout = new QVBoxLayout(); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(1, 1, 1, 1); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("")); label = new QLabel(CalculatorForm); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setGeometry(QRect(1, 1, 45, 19)); vboxLayout->addWidget(label); inputSpinBox1 = new QSpinBox(CalculatorForm); - inputSpinBox1->setObjectName(QString::fromUtf8("inputSpinBox1")); + inputSpinBox1->setObjectName(QStringLiteral("inputSpinBox1")); inputSpinBox1->setGeometry(QRect(1, 26, 45, 25)); inputSpinBox1->setMouseTracking(true); @@ -94,7 +94,7 @@ public: hboxLayout->addLayout(vboxLayout); label_3 = new QLabel(CalculatorForm); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); label_3->setGeometry(QRect(54, 1, 7, 52)); label_3->setAlignment(Qt::AlignCenter); @@ -105,16 +105,16 @@ public: vboxLayout1->setSpacing(6); #endif vboxLayout1->setContentsMargins(1, 1, 1, 1); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - vboxLayout1->setObjectName(QString::fromUtf8("")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("")); label_2 = new QLabel(CalculatorForm); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); label_2->setGeometry(QRect(1, 1, 45, 19)); vboxLayout1->addWidget(label_2); inputSpinBox2 = new QSpinBox(CalculatorForm); - inputSpinBox2->setObjectName(QString::fromUtf8("inputSpinBox2")); + inputSpinBox2->setObjectName(QStringLiteral("inputSpinBox2")); inputSpinBox2->setGeometry(QRect(1, 26, 45, 25)); inputSpinBox2->setMouseTracking(true); @@ -124,7 +124,7 @@ public: hboxLayout->addLayout(vboxLayout1); label_3_2 = new QLabel(CalculatorForm); - label_3_2->setObjectName(QString::fromUtf8("label_3_2")); + label_3_2->setObjectName(QStringLiteral("label_3_2")); label_3_2->setGeometry(QRect(120, 1, 7, 52)); label_3_2->setAlignment(Qt::AlignCenter); @@ -135,16 +135,16 @@ public: vboxLayout2->setSpacing(6); #endif vboxLayout2->setContentsMargins(1, 1, 1, 1); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); - vboxLayout2->setObjectName(QString::fromUtf8("")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("")); label_2_2_2 = new QLabel(CalculatorForm); - label_2_2_2->setObjectName(QString::fromUtf8("label_2_2_2")); + label_2_2_2->setObjectName(QStringLiteral("label_2_2_2")); label_2_2_2->setGeometry(QRect(1, 1, 37, 17)); vboxLayout2->addWidget(label_2_2_2); outputWidget = new QLabel(CalculatorForm); - outputWidget->setObjectName(QString::fromUtf8("outputWidget")); + outputWidget->setObjectName(QStringLiteral("outputWidget")); outputWidget->setGeometry(QRect(1, 24, 37, 27)); outputWidget->setFrameShape(QFrame::Box); outputWidget->setFrameShadow(QFrame::Sunken); diff --git a/tests/auto/tools/uic/baseline/certificateinfo.ui.h b/tests/auto/tools/uic/baseline/certificateinfo.ui.h index e047aeddc0..8ea1ebebf7 100644 --- a/tests/auto/tools/uic/baseline/certificateinfo.ui.h +++ b/tests/auto/tools/uic/baseline/certificateinfo.ui.h @@ -42,16 +42,16 @@ public: void setupUi(QDialog *CertificateInfo) { if (CertificateInfo->objectName().isEmpty()) - CertificateInfo->setObjectName(QString::fromUtf8("CertificateInfo")); + CertificateInfo->setObjectName(QStringLiteral("CertificateInfo")); CertificateInfo->resize(400, 397); vboxLayout = new QVBoxLayout(CertificateInfo); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(CertificateInfo); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); hboxLayout = new QHBoxLayout(groupBox); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); certificationPathView = new QListWidget(groupBox); - certificationPathView->setObjectName(QString::fromUtf8("certificationPathView")); + certificationPathView->setObjectName(QStringLiteral("certificationPathView")); hboxLayout->addWidget(certificationPathView); @@ -59,11 +59,11 @@ public: vboxLayout->addWidget(groupBox); groupBox_2 = new QGroupBox(CertificateInfo); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); hboxLayout1 = new QHBoxLayout(groupBox_2); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); certificateInfoView = new QListWidget(groupBox_2); - certificateInfoView->setObjectName(QString::fromUtf8("certificateInfoView")); + certificateInfoView->setObjectName(QStringLiteral("certificateInfoView")); hboxLayout1->addWidget(certificateInfoView); @@ -71,13 +71,13 @@ public: vboxLayout->addWidget(groupBox_2); hboxLayout2 = new QHBoxLayout(); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout2->addItem(spacerItem); buttonBox = new QDialogButtonBox(CertificateInfo); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setStandardButtons(QDialogButtonBox::Close); hboxLayout2->addWidget(buttonBox); diff --git a/tests/auto/tools/uic/baseline/chatdialog.ui.h b/tests/auto/tools/uic/baseline/chatdialog.ui.h index 216e627e76..473d20de70 100644 --- a/tests/auto/tools/uic/baseline/chatdialog.ui.h +++ b/tests/auto/tools/uic/baseline/chatdialog.ui.h @@ -39,7 +39,7 @@ public: void setupUi(QDialog *ChatDialog) { if (ChatDialog->objectName().isEmpty()) - ChatDialog->setObjectName(QString::fromUtf8("ChatDialog")); + ChatDialog->setObjectName(QStringLiteral("ChatDialog")); ChatDialog->resize(513, 349); vboxLayout = new QVBoxLayout(ChatDialog); #ifndef Q_OS_MAC @@ -48,7 +48,7 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -56,16 +56,16 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); textEdit = new QTextEdit(ChatDialog); - textEdit->setObjectName(QString::fromUtf8("textEdit")); + textEdit->setObjectName(QStringLiteral("textEdit")); textEdit->setFocusPolicy(Qt::NoFocus); textEdit->setReadOnly(true); hboxLayout->addWidget(textEdit); listWidget = new QListWidget(ChatDialog); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); listWidget->setMaximumSize(QSize(180, 16777215)); listWidget->setFocusPolicy(Qt::NoFocus); @@ -79,14 +79,14 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); label = new QLabel(ChatDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout1->addWidget(label); lineEdit = new QLineEdit(ChatDialog); - lineEdit->setObjectName(QString::fromUtf8("lineEdit")); + lineEdit->setObjectName(QStringLiteral("lineEdit")); hboxLayout1->addWidget(lineEdit); diff --git a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h index 1001e85931..c077dd7501 100644 --- a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h @@ -51,16 +51,16 @@ public: void setupUi(QMainWindow *ChatMainWindow) { if (ChatMainWindow->objectName().isEmpty()) - ChatMainWindow->setObjectName(QString::fromUtf8("ChatMainWindow")); + ChatMainWindow->setObjectName(QStringLiteral("ChatMainWindow")); ChatMainWindow->resize(800, 600); actionQuit = new QAction(ChatMainWindow); - actionQuit->setObjectName(QString::fromUtf8("actionQuit")); + actionQuit->setObjectName(QStringLiteral("actionQuit")); actionAboutQt = new QAction(ChatMainWindow); - actionAboutQt->setObjectName(QString::fromUtf8("actionAboutQt")); + actionAboutQt->setObjectName(QStringLiteral("actionAboutQt")); actionChangeNickname = new QAction(ChatMainWindow); - actionChangeNickname->setObjectName(QString::fromUtf8("actionChangeNickname")); + actionChangeNickname->setObjectName(QStringLiteral("actionChangeNickname")); centralwidget = new QWidget(ChatMainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); hboxLayout = new QHBoxLayout(centralwidget); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -68,7 +68,7 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); vboxLayout = new QVBoxLayout(); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -76,9 +76,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(0, 0, 0, 0); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); chatHistory = new QTextBrowser(centralwidget); - chatHistory->setObjectName(QString::fromUtf8("chatHistory")); + chatHistory->setObjectName(QStringLiteral("chatHistory")); chatHistory->setAcceptDrops(false); chatHistory->setAcceptRichText(true); @@ -89,19 +89,19 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); label = new QLabel(centralwidget); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout1->addWidget(label); messageLineEdit = new QLineEdit(centralwidget); - messageLineEdit->setObjectName(QString::fromUtf8("messageLineEdit")); + messageLineEdit->setObjectName(QStringLiteral("messageLineEdit")); hboxLayout1->addWidget(messageLineEdit); sendButton = new QPushButton(centralwidget); - sendButton->setObjectName(QString::fromUtf8("sendButton")); + sendButton->setObjectName(QStringLiteral("sendButton")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -118,15 +118,15 @@ public: ChatMainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(ChatMainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 800, 31)); menuQuit = new QMenu(menubar); - menuQuit->setObjectName(QString::fromUtf8("menuQuit")); + menuQuit->setObjectName(QStringLiteral("menuQuit")); menuFile = new QMenu(menubar); - menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuFile->setObjectName(QStringLiteral("menuFile")); ChatMainWindow->setMenuBar(menubar); statusbar = new QStatusBar(ChatMainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); ChatMainWindow->setStatusBar(statusbar); #ifndef QT_NO_SHORTCUT label->setBuddy(messageLineEdit); diff --git a/tests/auto/tools/uic/baseline/chatsetnickname.ui.h b/tests/auto/tools/uic/baseline/chatsetnickname.ui.h index ee69d36476..e0de690715 100644 --- a/tests/auto/tools/uic/baseline/chatsetnickname.ui.h +++ b/tests/auto/tools/uic/baseline/chatsetnickname.ui.h @@ -41,7 +41,7 @@ public: void setupUi(QDialog *NicknameDialog) { if (NicknameDialog->objectName().isEmpty()) - NicknameDialog->setObjectName(QString::fromUtf8("NicknameDialog")); + NicknameDialog->setObjectName(QStringLiteral("NicknameDialog")); NicknameDialog->resize(396, 105); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(1)); sizePolicy.setHorizontalStretch(0); @@ -55,7 +55,7 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout1 = new QVBoxLayout(); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -63,16 +63,16 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(0, 0, 0, 0); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); label = new QLabel(NicknameDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth()); label->setSizePolicy(sizePolicy); vboxLayout1->addWidget(label); nickname = new QLineEdit(NicknameDialog); - nickname->setObjectName(QString::fromUtf8("nickname")); + nickname->setObjectName(QStringLiteral("nickname")); vboxLayout1->addWidget(nickname); @@ -84,18 +84,18 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); okButton = new QPushButton(NicknameDialog); - okButton->setObjectName(QString::fromUtf8("okButton")); + okButton->setObjectName(QStringLiteral("okButton")); hboxLayout->addWidget(okButton); cancelButton = new QPushButton(NicknameDialog); - cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setObjectName(QStringLiteral("cancelButton")); hboxLayout->addWidget(cancelButton); diff --git a/tests/auto/tools/uic/baseline/config.ui.h b/tests/auto/tools/uic/baseline/config.ui.h index 5606978f09..cf21fd8c6f 100644 --- a/tests/auto/tools/uic/baseline/config.ui.h +++ b/tests/auto/tools/uic/baseline/config.ui.h @@ -135,20 +135,20 @@ public: void setupUi(QDialog *Config) { if (Config->objectName().isEmpty()) - Config->setObjectName(QString::fromUtf8("Config")); + Config->setObjectName(QStringLiteral("Config")); Config->resize(600, 650); Config->setSizeGripEnabled(true); vboxLayout = new QVBoxLayout(Config); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(8, 8, 8, 8); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); hboxLayout->setContentsMargins(0, 0, 0, 0); ButtonGroup1 = new QGroupBox(Config); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); + ButtonGroup1->setObjectName(QStringLiteral("ButtonGroup1")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -157,44 +157,44 @@ public: vboxLayout1 = new QVBoxLayout(ButtonGroup1); vboxLayout1->setSpacing(6); vboxLayout1->setContentsMargins(11, 11, 11, 11); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); vboxLayout1->setContentsMargins(11, 11, 11, 11); size_176_220 = new QRadioButton(ButtonGroup1); - size_176_220->setObjectName(QString::fromUtf8("size_176_220")); + size_176_220->setObjectName(QStringLiteral("size_176_220")); vboxLayout1->addWidget(size_176_220); size_240_320 = new QRadioButton(ButtonGroup1); - size_240_320->setObjectName(QString::fromUtf8("size_240_320")); + size_240_320->setObjectName(QStringLiteral("size_240_320")); vboxLayout1->addWidget(size_240_320); size_320_240 = new QRadioButton(ButtonGroup1); - size_320_240->setObjectName(QString::fromUtf8("size_320_240")); + size_320_240->setObjectName(QStringLiteral("size_320_240")); vboxLayout1->addWidget(size_320_240); size_640_480 = new QRadioButton(ButtonGroup1); - size_640_480->setObjectName(QString::fromUtf8("size_640_480")); + size_640_480->setObjectName(QStringLiteral("size_640_480")); vboxLayout1->addWidget(size_640_480); size_800_600 = new QRadioButton(ButtonGroup1); - size_800_600->setObjectName(QString::fromUtf8("size_800_600")); + size_800_600->setObjectName(QStringLiteral("size_800_600")); vboxLayout1->addWidget(size_800_600); size_1024_768 = new QRadioButton(ButtonGroup1); - size_1024_768->setObjectName(QString::fromUtf8("size_1024_768")); + size_1024_768->setObjectName(QStringLiteral("size_1024_768")); vboxLayout1->addWidget(size_1024_768); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); hboxLayout1->setContentsMargins(0, 0, 0, 0); size_custom = new QRadioButton(ButtonGroup1); - size_custom->setObjectName(QString::fromUtf8("size_custom")); + size_custom->setObjectName(QStringLiteral("size_custom")); QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -204,7 +204,7 @@ public: hboxLayout1->addWidget(size_custom); size_width = new QSpinBox(ButtonGroup1); - size_width->setObjectName(QString::fromUtf8("size_width")); + size_width->setObjectName(QStringLiteral("size_width")); size_width->setMinimum(1); size_width->setMaximum(1280); size_width->setSingleStep(16); @@ -213,7 +213,7 @@ public: hboxLayout1->addWidget(size_width); size_height = new QSpinBox(ButtonGroup1); - size_height->setObjectName(QString::fromUtf8("size_height")); + size_height->setObjectName(QStringLiteral("size_height")); size_height->setMinimum(1); size_height->setMaximum(1024); size_height->setSingleStep(16); @@ -228,59 +228,59 @@ public: hboxLayout->addWidget(ButtonGroup1); ButtonGroup2 = new QGroupBox(Config); - ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2")); + ButtonGroup2->setObjectName(QStringLiteral("ButtonGroup2")); vboxLayout2 = new QVBoxLayout(ButtonGroup2); vboxLayout2->setSpacing(6); vboxLayout2->setContentsMargins(11, 11, 11, 11); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); vboxLayout2->setContentsMargins(11, 11, 11, 11); depth_1 = new QRadioButton(ButtonGroup2); - depth_1->setObjectName(QString::fromUtf8("depth_1")); + depth_1->setObjectName(QStringLiteral("depth_1")); vboxLayout2->addWidget(depth_1); depth_4gray = new QRadioButton(ButtonGroup2); - depth_4gray->setObjectName(QString::fromUtf8("depth_4gray")); + depth_4gray->setObjectName(QStringLiteral("depth_4gray")); vboxLayout2->addWidget(depth_4gray); depth_8 = new QRadioButton(ButtonGroup2); - depth_8->setObjectName(QString::fromUtf8("depth_8")); + depth_8->setObjectName(QStringLiteral("depth_8")); vboxLayout2->addWidget(depth_8); depth_12 = new QRadioButton(ButtonGroup2); - depth_12->setObjectName(QString::fromUtf8("depth_12")); + depth_12->setObjectName(QStringLiteral("depth_12")); vboxLayout2->addWidget(depth_12); depth_15 = new QRadioButton(ButtonGroup2); - depth_15->setObjectName(QString::fromUtf8("depth_15")); + depth_15->setObjectName(QStringLiteral("depth_15")); vboxLayout2->addWidget(depth_15); depth_16 = new QRadioButton(ButtonGroup2); - depth_16->setObjectName(QString::fromUtf8("depth_16")); + depth_16->setObjectName(QStringLiteral("depth_16")); vboxLayout2->addWidget(depth_16); depth_18 = new QRadioButton(ButtonGroup2); - depth_18->setObjectName(QString::fromUtf8("depth_18")); + depth_18->setObjectName(QStringLiteral("depth_18")); vboxLayout2->addWidget(depth_18); depth_24 = new QRadioButton(ButtonGroup2); - depth_24->setObjectName(QString::fromUtf8("depth_24")); + depth_24->setObjectName(QStringLiteral("depth_24")); vboxLayout2->addWidget(depth_24); depth_32 = new QRadioButton(ButtonGroup2); - depth_32->setObjectName(QString::fromUtf8("depth_32")); + depth_32->setObjectName(QStringLiteral("depth_32")); vboxLayout2->addWidget(depth_32); depth_32_argb = new QRadioButton(ButtonGroup2); - depth_32_argb->setObjectName(QString::fromUtf8("depth_32_argb")); + depth_32_argb->setObjectName(QStringLiteral("depth_32_argb")); vboxLayout2->addWidget(depth_32_argb); @@ -292,15 +292,15 @@ public: hboxLayout2 = new QHBoxLayout(); hboxLayout2->setSpacing(6); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); hboxLayout2->setContentsMargins(0, 0, 0, 0); TextLabel1_3 = new QLabel(Config); - TextLabel1_3->setObjectName(QString::fromUtf8("TextLabel1_3")); + TextLabel1_3->setObjectName(QStringLiteral("TextLabel1_3")); hboxLayout2->addWidget(TextLabel1_3); skin = new QComboBox(Config); - skin->setObjectName(QString::fromUtf8("skin")); + skin->setObjectName(QStringLiteral("skin")); QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -313,12 +313,12 @@ public: vboxLayout->addLayout(hboxLayout2); touchScreen = new QCheckBox(Config); - touchScreen->setObjectName(QString::fromUtf8("touchScreen")); + touchScreen->setObjectName(QStringLiteral("touchScreen")); vboxLayout->addWidget(touchScreen); lcdScreen = new QCheckBox(Config); - lcdScreen->setObjectName(QString::fromUtf8("lcdScreen")); + lcdScreen->setObjectName(QStringLiteral("lcdScreen")); vboxLayout->addWidget(lcdScreen); @@ -327,7 +327,7 @@ public: vboxLayout->addItem(spacerItem); TextLabel1 = new QLabel(Config); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); + TextLabel1->setObjectName(QStringLiteral("TextLabel1")); sizePolicy.setHeightForWidth(TextLabel1->sizePolicy().hasHeightForWidth()); TextLabel1->setSizePolicy(sizePolicy); TextLabel1->setWordWrap(true); @@ -335,21 +335,21 @@ public: vboxLayout->addWidget(TextLabel1); GroupBox1 = new QGroupBox(Config); - GroupBox1->setObjectName(QString::fromUtf8("GroupBox1")); + GroupBox1->setObjectName(QStringLiteral("GroupBox1")); gridLayout = new QGridLayout(GroupBox1); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); gridLayout->setHorizontalSpacing(6); gridLayout->setVerticalSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); TextLabel3 = new QLabel(GroupBox1); - TextLabel3->setObjectName(QString::fromUtf8("TextLabel3")); + TextLabel3->setObjectName(QStringLiteral("TextLabel3")); gridLayout->addWidget(TextLabel3, 6, 0, 1, 1); bslider = new QSlider(GroupBox1); - bslider->setObjectName(QString::fromUtf8("bslider")); + bslider->setObjectName(QStringLiteral("bslider")); QPalette palette; QBrush brush(QColor(128, 128, 128, 255)); brush.setStyle(Qt::SolidPattern); @@ -432,17 +432,17 @@ public: gridLayout->addWidget(bslider, 6, 1, 1, 1); blabel = new QLabel(GroupBox1); - blabel->setObjectName(QString::fromUtf8("blabel")); + blabel->setObjectName(QStringLiteral("blabel")); gridLayout->addWidget(blabel, 6, 2, 1, 1); TextLabel2 = new QLabel(GroupBox1); - TextLabel2->setObjectName(QString::fromUtf8("TextLabel2")); + TextLabel2->setObjectName(QStringLiteral("TextLabel2")); gridLayout->addWidget(TextLabel2, 4, 0, 1, 1); gslider = new QSlider(GroupBox1); - gslider->setObjectName(QString::fromUtf8("gslider")); + gslider->setObjectName(QStringLiteral("gslider")); QPalette palette1; palette1.setBrush(QPalette::Active, QPalette::WindowText, brush); QBrush brush11(QColor(0, 255, 0, 255)); @@ -513,22 +513,22 @@ public: gridLayout->addWidget(gslider, 4, 1, 1, 1); glabel = new QLabel(GroupBox1); - glabel->setObjectName(QString::fromUtf8("glabel")); + glabel->setObjectName(QStringLiteral("glabel")); gridLayout->addWidget(glabel, 4, 2, 1, 1); TextLabel7 = new QLabel(GroupBox1); - TextLabel7->setObjectName(QString::fromUtf8("TextLabel7")); + TextLabel7->setObjectName(QStringLiteral("TextLabel7")); gridLayout->addWidget(TextLabel7, 0, 0, 1, 1); TextLabel8 = new QLabel(GroupBox1); - TextLabel8->setObjectName(QString::fromUtf8("TextLabel8")); + TextLabel8->setObjectName(QStringLiteral("TextLabel8")); gridLayout->addWidget(TextLabel8, 0, 2, 1, 1); gammaslider = new QSlider(GroupBox1); - gammaslider->setObjectName(QString::fromUtf8("gammaslider")); + gammaslider->setObjectName(QStringLiteral("gammaslider")); QPalette palette2; palette2.setBrush(QPalette::Active, QPalette::WindowText, brush); palette2.setBrush(QPalette::Active, QPalette::Button, brush7); @@ -593,17 +593,17 @@ public: gridLayout->addWidget(gammaslider, 0, 1, 1, 1); TextLabel1_2 = new QLabel(GroupBox1); - TextLabel1_2->setObjectName(QString::fromUtf8("TextLabel1_2")); + TextLabel1_2->setObjectName(QStringLiteral("TextLabel1_2")); gridLayout->addWidget(TextLabel1_2, 2, 0, 1, 1); rlabel = new QLabel(GroupBox1); - rlabel->setObjectName(QString::fromUtf8("rlabel")); + rlabel->setObjectName(QStringLiteral("rlabel")); gridLayout->addWidget(rlabel, 2, 2, 1, 1); rslider = new QSlider(GroupBox1); - rslider->setObjectName(QString::fromUtf8("rslider")); + rslider->setObjectName(QStringLiteral("rslider")); QPalette palette3; palette3.setBrush(QPalette::Active, QPalette::WindowText, brush); QBrush brush18(QColor(255, 0, 0, 255)); @@ -674,12 +674,12 @@ public: gridLayout->addWidget(rslider, 2, 1, 1, 1); PushButton3 = new QPushButton(GroupBox1); - PushButton3->setObjectName(QString::fromUtf8("PushButton3")); + PushButton3->setObjectName(QStringLiteral("PushButton3")); gridLayout->addWidget(PushButton3, 8, 0, 1, 3); MyCustomWidget1 = new GammaView(GroupBox1); - MyCustomWidget1->setObjectName(QString::fromUtf8("MyCustomWidget1")); + MyCustomWidget1->setObjectName(QStringLiteral("MyCustomWidget1")); gridLayout->addWidget(MyCustomWidget1, 0, 3, 9, 1); @@ -688,21 +688,21 @@ public: hboxLayout3 = new QHBoxLayout(); hboxLayout3->setSpacing(6); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); hboxLayout3->setContentsMargins(0, 0, 0, 0); spacerItem1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout3->addItem(spacerItem1); buttonOk = new QPushButton(Config); - buttonOk->setObjectName(QString::fromUtf8("buttonOk")); + buttonOk->setObjectName(QStringLiteral("buttonOk")); buttonOk->setAutoDefault(true); buttonOk->setDefault(true); hboxLayout3->addWidget(buttonOk); buttonCancel = new QPushButton(Config); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); buttonCancel->setAutoDefault(true); hboxLayout3->addWidget(buttonCancel); diff --git a/tests/auto/tools/uic/baseline/connectdialog.ui.h b/tests/auto/tools/uic/baseline/connectdialog.ui.h index 71ed1bb87f..9c46bb851d 100644 --- a/tests/auto/tools/uic/baseline/connectdialog.ui.h +++ b/tests/auto/tools/uic/baseline/connectdialog.ui.h @@ -50,24 +50,24 @@ public: void setupUi(QDialog *ConnectDialog) { if (ConnectDialog->objectName().isEmpty()) - ConnectDialog->setObjectName(QString::fromUtf8("ConnectDialog")); + ConnectDialog->setObjectName(QStringLiteral("ConnectDialog")); ConnectDialog->resize(585, 361); gridLayout = new QGridLayout(ConnectDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); signalGroupBox = new QGroupBox(ConnectDialog); - signalGroupBox->setObjectName(QString::fromUtf8("signalGroupBox")); + signalGroupBox->setObjectName(QStringLiteral("signalGroupBox")); vboxLayout = new QVBoxLayout(signalGroupBox); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); signalList = new QListWidget(signalGroupBox); - signalList->setObjectName(QString::fromUtf8("signalList")); + signalList->setObjectName(QStringLiteral("signalList")); signalList->setTextElideMode(Qt::ElideMiddle); vboxLayout->addWidget(signalList); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); editSignalsButton = new QToolButton(signalGroupBox); - editSignalsButton->setObjectName(QString::fromUtf8("editSignalsButton")); + editSignalsButton->setObjectName(QStringLiteral("editSignalsButton")); hboxLayout->addWidget(editSignalsButton); @@ -82,19 +82,19 @@ public: gridLayout->addWidget(signalGroupBox, 0, 0, 1, 2); slotGroupBox = new QGroupBox(ConnectDialog); - slotGroupBox->setObjectName(QString::fromUtf8("slotGroupBox")); + slotGroupBox->setObjectName(QStringLiteral("slotGroupBox")); vboxLayout1 = new QVBoxLayout(slotGroupBox); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); slotList = new QListWidget(slotGroupBox); - slotList->setObjectName(QString::fromUtf8("slotList")); + slotList->setObjectName(QStringLiteral("slotList")); slotList->setTextElideMode(Qt::ElideMiddle); vboxLayout1->addWidget(slotList); hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); editSlotsButton = new QToolButton(slotGroupBox); - editSlotsButton->setObjectName(QString::fromUtf8("editSlotsButton")); + editSlotsButton->setObjectName(QStringLiteral("editSlotsButton")); hboxLayout1->addWidget(editSlotsButton); @@ -109,12 +109,12 @@ public: gridLayout->addWidget(slotGroupBox, 0, 2, 1, 1); showAllCheckBox = new QCheckBox(ConnectDialog); - showAllCheckBox->setObjectName(QString::fromUtf8("showAllCheckBox")); + showAllCheckBox->setObjectName(QStringLiteral("showAllCheckBox")); gridLayout->addWidget(showAllCheckBox, 1, 0, 1, 1); buttonBox = new QDialogButtonBox(ConnectDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/controller.ui.h b/tests/auto/tools/uic/baseline/controller.ui.h index 1c79f03f56..2758f1a7de 100644 --- a/tests/auto/tools/uic/baseline/controller.ui.h +++ b/tests/auto/tools/uic/baseline/controller.ui.h @@ -35,7 +35,7 @@ public: void setupUi(QWidget *Controller) { if (Controller->objectName().isEmpty()) - Controller->setObjectName(QString::fromUtf8("Controller")); + Controller->setObjectName(QStringLiteral("Controller")); Controller->resize(255, 111); gridLayout = new QGridLayout(Controller); #ifndef Q_OS_MAC @@ -44,30 +44,30 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(Controller); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setAlignment(Qt::AlignCenter); gridLayout->addWidget(label, 1, 1, 1, 1); decelerate = new QPushButton(Controller); - decelerate->setObjectName(QString::fromUtf8("decelerate")); + decelerate->setObjectName(QStringLiteral("decelerate")); gridLayout->addWidget(decelerate, 2, 1, 1, 1); accelerate = new QPushButton(Controller); - accelerate->setObjectName(QString::fromUtf8("accelerate")); + accelerate->setObjectName(QStringLiteral("accelerate")); gridLayout->addWidget(accelerate, 0, 1, 1, 1); right = new QPushButton(Controller); - right->setObjectName(QString::fromUtf8("right")); + right->setObjectName(QStringLiteral("right")); gridLayout->addWidget(right, 1, 2, 1, 1); left = new QPushButton(Controller); - left->setObjectName(QString::fromUtf8("left")); + left->setObjectName(QStringLiteral("left")); gridLayout->addWidget(left, 1, 0, 1, 1); diff --git a/tests/auto/tools/uic/baseline/cookies.ui.h b/tests/auto/tools/uic/baseline/cookies.ui.h index f866645dd8..201687c210 100644 --- a/tests/auto/tools/uic/baseline/cookies.ui.h +++ b/tests/auto/tools/uic/baseline/cookies.ui.h @@ -42,33 +42,33 @@ public: void setupUi(QDialog *CookiesDialog) { if (CookiesDialog->objectName().isEmpty()) - CookiesDialog->setObjectName(QString::fromUtf8("CookiesDialog")); + CookiesDialog->setObjectName(QStringLiteral("CookiesDialog")); CookiesDialog->resize(550, 370); gridLayout = new QGridLayout(CookiesDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem = new QSpacerItem(252, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout->addItem(spacerItem, 0, 0, 1, 1); search = new SearchLineEdit(CookiesDialog); - search->setObjectName(QString::fromUtf8("search")); + search->setObjectName(QStringLiteral("search")); gridLayout->addWidget(search, 0, 1, 1, 1); cookiesTable = new EditTableView(CookiesDialog); - cookiesTable->setObjectName(QString::fromUtf8("cookiesTable")); + cookiesTable->setObjectName(QStringLiteral("cookiesTable")); gridLayout->addWidget(cookiesTable, 1, 0, 1, 2); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); removeButton = new QPushButton(CookiesDialog); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); hboxLayout->addWidget(removeButton); removeAllButton = new QPushButton(CookiesDialog); - removeAllButton->setObjectName(QString::fromUtf8("removeAllButton")); + removeAllButton->setObjectName(QStringLiteral("removeAllButton")); hboxLayout->addWidget(removeAllButton); @@ -77,7 +77,7 @@ public: hboxLayout->addItem(spacerItem1); buttonBox = new QDialogButtonBox(CookiesDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setStandardButtons(QDialogButtonBox::Ok); hboxLayout->addWidget(buttonBox); diff --git a/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h b/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h index 776afc51c8..ca4ac682ce 100644 --- a/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h +++ b/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h @@ -57,23 +57,23 @@ public: void setupUi(QDialog *CookiesExceptionsDialog) { if (CookiesExceptionsDialog->objectName().isEmpty()) - CookiesExceptionsDialog->setObjectName(QString::fromUtf8("CookiesExceptionsDialog")); + CookiesExceptionsDialog->setObjectName(QStringLiteral("CookiesExceptionsDialog")); CookiesExceptionsDialog->resize(466, 446); vboxLayout = new QVBoxLayout(CookiesExceptionsDialog); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); newExceptionGroupBox = new QGroupBox(CookiesExceptionsDialog); - newExceptionGroupBox->setObjectName(QString::fromUtf8("newExceptionGroupBox")); + newExceptionGroupBox->setObjectName(QStringLiteral("newExceptionGroupBox")); gridLayout = new QGridLayout(newExceptionGroupBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); label = new QLabel(newExceptionGroupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout->addWidget(label); domainLineEdit = new QLineEdit(newExceptionGroupBox); - domainLineEdit->setObjectName(QString::fromUtf8("domainLineEdit")); + domainLineEdit->setObjectName(QStringLiteral("domainLineEdit")); hboxLayout->addWidget(domainLineEdit); @@ -81,25 +81,25 @@ public: gridLayout->addLayout(hboxLayout, 0, 0, 1, 1); hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); spacerItem = new QSpacerItem(81, 25, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacerItem); blockButton = new QPushButton(newExceptionGroupBox); - blockButton->setObjectName(QString::fromUtf8("blockButton")); + blockButton->setObjectName(QStringLiteral("blockButton")); blockButton->setEnabled(false); hboxLayout1->addWidget(blockButton); allowForSessionButton = new QPushButton(newExceptionGroupBox); - allowForSessionButton->setObjectName(QString::fromUtf8("allowForSessionButton")); + allowForSessionButton->setObjectName(QStringLiteral("allowForSessionButton")); allowForSessionButton->setEnabled(false); hboxLayout1->addWidget(allowForSessionButton); allowButton = new QPushButton(newExceptionGroupBox); - allowButton->setObjectName(QString::fromUtf8("allowButton")); + allowButton->setObjectName(QStringLiteral("allowButton")); allowButton->setEnabled(false); hboxLayout1->addWidget(allowButton); @@ -111,30 +111,30 @@ public: vboxLayout->addWidget(newExceptionGroupBox); ExceptionsGroupBox = new QGroupBox(CookiesExceptionsDialog); - ExceptionsGroupBox->setObjectName(QString::fromUtf8("ExceptionsGroupBox")); + ExceptionsGroupBox->setObjectName(QStringLiteral("ExceptionsGroupBox")); gridLayout1 = new QGridLayout(ExceptionsGroupBox); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); spacerItem1 = new QSpacerItem(252, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout1->addItem(spacerItem1, 0, 0, 1, 3); search = new SearchLineEdit(ExceptionsGroupBox); - search->setObjectName(QString::fromUtf8("search")); + search->setObjectName(QStringLiteral("search")); gridLayout1->addWidget(search, 0, 3, 1, 1); exceptionTable = new EditTableView(ExceptionsGroupBox); - exceptionTable->setObjectName(QString::fromUtf8("exceptionTable")); + exceptionTable->setObjectName(QStringLiteral("exceptionTable")); gridLayout1->addWidget(exceptionTable, 1, 0, 1, 4); removeButton = new QPushButton(ExceptionsGroupBox); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); gridLayout1->addWidget(removeButton, 2, 0, 1, 1); removeAllButton = new QPushButton(ExceptionsGroupBox); - removeAllButton->setObjectName(QString::fromUtf8("removeAllButton")); + removeAllButton->setObjectName(QStringLiteral("removeAllButton")); gridLayout1->addWidget(removeAllButton, 2, 1, 1, 1); @@ -146,7 +146,7 @@ public: vboxLayout->addWidget(ExceptionsGroupBox); buttonBox = new QDialogButtonBox(CookiesExceptionsDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h index 685fa0b476..0bde249375 100644 --- a/tests/auto/tools/uic/baseline/default.ui.h +++ b/tests/auto/tools/uic/baseline/default.ui.h @@ -66,18 +66,18 @@ public: void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(388, 413); exitAction = new QAction(MainWindow); - exitAction->setObjectName(QString::fromUtf8("exitAction")); + exitAction->setObjectName(QStringLiteral("exitAction")); aboutQtAction = new QAction(MainWindow); - aboutQtAction->setObjectName(QString::fromUtf8("aboutQtAction")); + aboutQtAction->setObjectName(QStringLiteral("aboutQtAction")); editStyleAction = new QAction(MainWindow); - editStyleAction->setObjectName(QString::fromUtf8("editStyleAction")); + editStyleAction->setObjectName(QStringLiteral("editStyleAction")); aboutAction = new QAction(MainWindow); - aboutAction->setObjectName(QString::fromUtf8("aboutAction")); + aboutAction->setObjectName(QStringLiteral("aboutAction")); centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); gridLayout = new QGridLayout(centralwidget); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -85,14 +85,14 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); nameLabel = new QLabel(centralwidget); - nameLabel->setObjectName(QString::fromUtf8("nameLabel")); + nameLabel->setObjectName(QStringLiteral("nameLabel")); gridLayout->addWidget(nameLabel, 0, 0, 1, 1); nameCombo = new QComboBox(centralwidget); - nameCombo->setObjectName(QString::fromUtf8("nameCombo")); + nameCombo->setObjectName(QStringLiteral("nameCombo")); nameCombo->setEditable(true); gridLayout->addWidget(nameCombo, 0, 1, 1, 3); @@ -102,62 +102,62 @@ public: gridLayout->addItem(spacerItem, 1, 3, 1, 1); femaleRadioButton = new QRadioButton(centralwidget); - femaleRadioButton->setObjectName(QString::fromUtf8("femaleRadioButton")); + femaleRadioButton->setObjectName(QStringLiteral("femaleRadioButton")); gridLayout->addWidget(femaleRadioButton, 1, 2, 1, 1); agreeCheckBox = new QCheckBox(centralwidget); - agreeCheckBox->setObjectName(QString::fromUtf8("agreeCheckBox")); + agreeCheckBox->setObjectName(QStringLiteral("agreeCheckBox")); gridLayout->addWidget(agreeCheckBox, 6, 0, 1, 4); maleRadioButton = new QRadioButton(centralwidget); - maleRadioButton->setObjectName(QString::fromUtf8("maleRadioButton")); + maleRadioButton->setObjectName(QStringLiteral("maleRadioButton")); gridLayout->addWidget(maleRadioButton, 1, 1, 1, 1); genderLabel = new QLabel(centralwidget); - genderLabel->setObjectName(QString::fromUtf8("genderLabel")); + genderLabel->setObjectName(QStringLiteral("genderLabel")); gridLayout->addWidget(genderLabel, 1, 0, 1, 1); ageSpinBox = new QSpinBox(centralwidget); - ageSpinBox->setObjectName(QString::fromUtf8("ageSpinBox")); + ageSpinBox->setObjectName(QStringLiteral("ageSpinBox")); ageSpinBox->setMinimum(12); ageSpinBox->setValue(22); gridLayout->addWidget(ageSpinBox, 2, 1, 1, 3); buttonBox = new QDialogButtonBox(centralwidget); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 7, 2, 1, 2); ageLabel = new QLabel(centralwidget); - ageLabel->setObjectName(QString::fromUtf8("ageLabel")); + ageLabel->setObjectName(QStringLiteral("ageLabel")); gridLayout->addWidget(ageLabel, 2, 0, 1, 1); passwordLabel = new QLabel(centralwidget); - passwordLabel->setObjectName(QString::fromUtf8("passwordLabel")); + passwordLabel->setObjectName(QStringLiteral("passwordLabel")); gridLayout->addWidget(passwordLabel, 3, 0, 1, 1); passwordEdit = new QLineEdit(centralwidget); - passwordEdit->setObjectName(QString::fromUtf8("passwordEdit")); + passwordEdit->setObjectName(QStringLiteral("passwordEdit")); passwordEdit->setEchoMode(QLineEdit::Password); gridLayout->addWidget(passwordEdit, 3, 1, 1, 3); label = new QLabel(centralwidget); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 5, 0, 1, 1); countryLabel = new QLabel(centralwidget); - countryLabel->setObjectName(QString::fromUtf8("countryLabel")); + countryLabel->setObjectName(QStringLiteral("countryLabel")); gridLayout->addWidget(countryLabel, 4, 0, 1, 1); @@ -165,26 +165,26 @@ public: new QListWidgetItem(professionList); new QListWidgetItem(professionList); new QListWidgetItem(professionList); - professionList->setObjectName(QString::fromUtf8("professionList")); + professionList->setObjectName(QStringLiteral("professionList")); gridLayout->addWidget(professionList, 5, 1, 1, 3); countryCombo = new QComboBox(centralwidget); - countryCombo->setObjectName(QString::fromUtf8("countryCombo")); + countryCombo->setObjectName(QStringLiteral("countryCombo")); gridLayout->addWidget(countryCombo, 4, 1, 1, 3); MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 388, 21)); menu_File = new QMenu(menubar); - menu_File->setObjectName(QString::fromUtf8("menu_File")); + menu_File->setObjectName(QStringLiteral("menu_File")); menu_Help = new QMenu(menubar); - menu_Help->setObjectName(QString::fromUtf8("menu_Help")); + menu_Help->setObjectName(QStringLiteral("menu_Help")); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); MainWindow->setStatusBar(statusbar); #ifndef QT_NO_SHORTCUT nameLabel->setBuddy(nameCombo); diff --git a/tests/auto/tools/uic/baseline/dialog.ui.h b/tests/auto/tools/uic/baseline/dialog.ui.h index d4860bf071..6e3e3fdc36 100644 --- a/tests/auto/tools/uic/baseline/dialog.ui.h +++ b/tests/auto/tools/uic/baseline/dialog.ui.h @@ -33,24 +33,24 @@ public: void setupUi(QDialog *Dialog) { if (Dialog->objectName().isEmpty()) - Dialog->setObjectName(QString::fromUtf8("Dialog")); + Dialog->setObjectName(QStringLiteral("Dialog")); Dialog->resize(451, 322); gridLayout = new QGridLayout(Dialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); loadFromFileButton = new QPushButton(Dialog); - loadFromFileButton->setObjectName(QString::fromUtf8("loadFromFileButton")); + loadFromFileButton->setObjectName(QStringLiteral("loadFromFileButton")); gridLayout->addWidget(loadFromFileButton, 0, 0, 1, 1); label = new QLabel(Dialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setAlignment(Qt::AlignCenter); label->setWordWrap(true); gridLayout->addWidget(label, 1, 0, 1, 1); loadFromSharedMemoryButton = new QPushButton(Dialog); - loadFromSharedMemoryButton->setObjectName(QString::fromUtf8("loadFromSharedMemoryButton")); + loadFromSharedMemoryButton->setObjectName(QStringLiteral("loadFromSharedMemoryButton")); gridLayout->addWidget(loadFromSharedMemoryButton, 2, 0, 1, 1); diff --git a/tests/auto/tools/uic/baseline/downloaditem.ui.h b/tests/auto/tools/uic/baseline/downloaditem.ui.h index 33442342b5..9aac86eb87 100644 --- a/tests/auto/tools/uic/baseline/downloaditem.ui.h +++ b/tests/auto/tools/uic/baseline/downloaditem.ui.h @@ -45,13 +45,13 @@ public: void setupUi(QWidget *DownloadItem) { if (DownloadItem->objectName().isEmpty()) - DownloadItem->setObjectName(QString::fromUtf8("DownloadItem")); + DownloadItem->setObjectName(QStringLiteral("DownloadItem")); DownloadItem->resize(423, 110); horizontalLayout = new QHBoxLayout(DownloadItem); horizontalLayout->setContentsMargins(0, 0, 0, 0); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); fileIcon = new QLabel(DownloadItem); - fileIcon->setObjectName(QString::fromUtf8("fileIcon")); + fileIcon->setObjectName(QStringLiteral("fileIcon")); QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -61,9 +61,9 @@ public: horizontalLayout->addWidget(fileIcon); verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); + verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2")); fileNameLabel = new SqueezeLabel(DownloadItem); - fileNameLabel->setObjectName(QString::fromUtf8("fileNameLabel")); + fileNameLabel->setObjectName(QStringLiteral("fileNameLabel")); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -73,13 +73,13 @@ public: verticalLayout_2->addWidget(fileNameLabel); progressBar = new QProgressBar(DownloadItem); - progressBar->setObjectName(QString::fromUtf8("progressBar")); + progressBar->setObjectName(QStringLiteral("progressBar")); progressBar->setValue(0); verticalLayout_2->addWidget(progressBar); downloadInfoLabel = new SqueezeLabel(DownloadItem); - downloadInfoLabel->setObjectName(QString::fromUtf8("downloadInfoLabel")); + downloadInfoLabel->setObjectName(QStringLiteral("downloadInfoLabel")); QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -92,24 +92,24 @@ public: horizontalLayout->addLayout(verticalLayout_2); verticalLayout = new QVBoxLayout(); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); verticalSpacer = new QSpacerItem(17, 1, QSizePolicy::Minimum, QSizePolicy::Expanding); verticalLayout->addItem(verticalSpacer); tryAgainButton = new QPushButton(DownloadItem); - tryAgainButton->setObjectName(QString::fromUtf8("tryAgainButton")); + tryAgainButton->setObjectName(QStringLiteral("tryAgainButton")); tryAgainButton->setEnabled(false); verticalLayout->addWidget(tryAgainButton); stopButton = new QPushButton(DownloadItem); - stopButton->setObjectName(QString::fromUtf8("stopButton")); + stopButton->setObjectName(QStringLiteral("stopButton")); verticalLayout->addWidget(stopButton); openButton = new QPushButton(DownloadItem); - openButton->setObjectName(QString::fromUtf8("openButton")); + openButton->setObjectName(QStringLiteral("openButton")); verticalLayout->addWidget(openButton); diff --git a/tests/auto/tools/uic/baseline/downloads.ui.h b/tests/auto/tools/uic/baseline/downloads.ui.h index 32b534393a..f88b6d75e7 100644 --- a/tests/auto/tools/uic/baseline/downloads.ui.h +++ b/tests/auto/tools/uic/baseline/downloads.ui.h @@ -39,21 +39,21 @@ public: void setupUi(QDialog *DownloadDialog) { if (DownloadDialog->objectName().isEmpty()) - DownloadDialog->setObjectName(QString::fromUtf8("DownloadDialog")); + DownloadDialog->setObjectName(QStringLiteral("DownloadDialog")); DownloadDialog->resize(332, 252); gridLayout = new QGridLayout(DownloadDialog); gridLayout->setSpacing(0); gridLayout->setContentsMargins(0, 0, 0, 0); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); downloadsView = new EditTableView(DownloadDialog); - downloadsView->setObjectName(QString::fromUtf8("downloadsView")); + downloadsView->setObjectName(QStringLiteral("downloadsView")); gridLayout->addWidget(downloadsView, 0, 0, 1, 3); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); cleanupButton = new QPushButton(DownloadDialog); - cleanupButton->setObjectName(QString::fromUtf8("cleanupButton")); + cleanupButton->setObjectName(QStringLiteral("cleanupButton")); cleanupButton->setEnabled(false); horizontalLayout->addWidget(cleanupButton); @@ -66,7 +66,7 @@ public: gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1); itemCount = new QLabel(DownloadDialog); - itemCount->setObjectName(QString::fromUtf8("itemCount")); + itemCount->setObjectName(QStringLiteral("itemCount")); gridLayout->addWidget(itemCount, 1, 1, 1, 1); diff --git a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h index 3728e764a3..40634692fa 100644 --- a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h +++ b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h @@ -40,47 +40,47 @@ public: void setupUi(QDialog *embeddedDialog) { if (embeddedDialog->objectName().isEmpty()) - embeddedDialog->setObjectName(QString::fromUtf8("embeddedDialog")); + embeddedDialog->setObjectName(QStringLiteral("embeddedDialog")); embeddedDialog->resize(407, 134); formLayout = new QFormLayout(embeddedDialog); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); label = new QLabel(embeddedDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); formLayout->setWidget(0, QFormLayout::LabelRole, label); layoutDirection = new QComboBox(embeddedDialog); - layoutDirection->setObjectName(QString::fromUtf8("layoutDirection")); + layoutDirection->setObjectName(QStringLiteral("layoutDirection")); formLayout->setWidget(0, QFormLayout::FieldRole, layoutDirection); label_2 = new QLabel(embeddedDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); formLayout->setWidget(1, QFormLayout::LabelRole, label_2); fontComboBox = new QFontComboBox(embeddedDialog); - fontComboBox->setObjectName(QString::fromUtf8("fontComboBox")); + fontComboBox->setObjectName(QStringLiteral("fontComboBox")); formLayout->setWidget(1, QFormLayout::FieldRole, fontComboBox); label_3 = new QLabel(embeddedDialog); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); formLayout->setWidget(2, QFormLayout::LabelRole, label_3); style = new QComboBox(embeddedDialog); - style->setObjectName(QString::fromUtf8("style")); + style->setObjectName(QStringLiteral("style")); formLayout->setWidget(2, QFormLayout::FieldRole, style); label_4 = new QLabel(embeddedDialog); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); formLayout->setWidget(3, QFormLayout::LabelRole, label_4); spacing = new QSlider(embeddedDialog); - spacing->setObjectName(QString::fromUtf8("spacing")); + spacing->setObjectName(QStringLiteral("spacing")); spacing->setOrientation(Qt::Horizontal); formLayout->setWidget(3, QFormLayout::FieldRole, spacing); diff --git a/tests/auto/tools/uic/baseline/filespage.ui.h b/tests/auto/tools/uic/baseline/filespage.ui.h index f8dd925df8..430e5350c8 100644 --- a/tests/auto/tools/uic/baseline/filespage.ui.h +++ b/tests/auto/tools/uic/baseline/filespage.ui.h @@ -38,23 +38,23 @@ public: void setupUi(QWidget *FilesPage) { if (FilesPage->objectName().isEmpty()) - FilesPage->setObjectName(QString::fromUtf8("FilesPage")); + FilesPage->setObjectName(QStringLiteral("FilesPage")); FilesPage->resize(417, 242); gridLayout = new QGridLayout(FilesPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); fileLabel = new QLabel(FilesPage); - fileLabel->setObjectName(QString::fromUtf8("fileLabel")); + fileLabel->setObjectName(QStringLiteral("fileLabel")); fileLabel->setWordWrap(true); gridLayout->addWidget(fileLabel, 0, 0, 1, 2); fileListWidget = new QListWidget(FilesPage); - fileListWidget->setObjectName(QString::fromUtf8("fileListWidget")); + fileListWidget->setObjectName(QStringLiteral("fileListWidget")); gridLayout->addWidget(fileListWidget, 1, 0, 3, 1); removeButton = new QPushButton(FilesPage); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -64,7 +64,7 @@ public: gridLayout->addWidget(removeButton, 1, 1, 1, 1); removeAllButton = new QPushButton(FilesPage); - removeAllButton->setObjectName(QString::fromUtf8("removeAllButton")); + removeAllButton->setObjectName(QStringLiteral("removeAllButton")); gridLayout->addWidget(removeAllButton, 2, 1, 1, 1); diff --git a/tests/auto/tools/uic/baseline/filternamedialog.ui.h b/tests/auto/tools/uic/baseline/filternamedialog.ui.h index 703c552b4a..dd84725e0d 100644 --- a/tests/auto/tools/uic/baseline/filternamedialog.ui.h +++ b/tests/auto/tools/uic/baseline/filternamedialog.ui.h @@ -38,24 +38,24 @@ public: void setupUi(QDialog *FilterNameDialogClass) { if (FilterNameDialogClass->objectName().isEmpty()) - FilterNameDialogClass->setObjectName(QString::fromUtf8("FilterNameDialogClass")); + FilterNameDialogClass->setObjectName(QStringLiteral("FilterNameDialogClass")); FilterNameDialogClass->resize(312, 95); gridLayout = new QGridLayout(FilterNameDialogClass); gridLayout->setSpacing(6); gridLayout->setContentsMargins(9, 9, 9, 9); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(FilterNameDialogClass); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); lineEdit = new QLineEdit(FilterNameDialogClass); - lineEdit->setObjectName(QString::fromUtf8("lineEdit")); + lineEdit->setObjectName(QStringLiteral("lineEdit")); gridLayout->addWidget(lineEdit, 0, 1, 1, 2); line = new QFrame(FilterNameDialogClass); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); @@ -66,7 +66,7 @@ public: gridLayout->addItem(spacerItem, 2, 0, 1, 2); buttonBox = new QDialogButtonBox(FilterNameDialogClass); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/filterpage.ui.h b/tests/auto/tools/uic/baseline/filterpage.ui.h index ab1fcf12a1..23a9c38140 100644 --- a/tests/auto/tools/uic/baseline/filterpage.ui.h +++ b/tests/auto/tools/uic/baseline/filterpage.ui.h @@ -45,37 +45,37 @@ public: void setupUi(QWidget *FilterPage) { if (FilterPage->objectName().isEmpty()) - FilterPage->setObjectName(QString::fromUtf8("FilterPage")); + FilterPage->setObjectName(QStringLiteral("FilterPage")); FilterPage->resize(419, 243); gridLayout = new QGridLayout(FilterPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(FilterPage); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 1, 0, 1, 1); filterLineEdit = new QLineEdit(FilterPage); - filterLineEdit->setObjectName(QString::fromUtf8("filterLineEdit")); + filterLineEdit->setObjectName(QStringLiteral("filterLineEdit")); gridLayout->addWidget(filterLineEdit, 2, 0, 1, 1); groupBox = new QGroupBox(FilterPage); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout1 = new QGridLayout(groupBox); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); customFilterWidget = new QTreeWidget(groupBox); - customFilterWidget->setObjectName(QString::fromUtf8("customFilterWidget")); + customFilterWidget->setObjectName(QStringLiteral("customFilterWidget")); customFilterWidget->setColumnCount(2); gridLayout1->addWidget(customFilterWidget, 0, 0, 3, 1); addButton = new QPushButton(groupBox); - addButton->setObjectName(QString::fromUtf8("addButton")); + addButton->setObjectName(QStringLiteral("addButton")); gridLayout1->addWidget(addButton, 0, 1, 1, 1); removeButton = new QPushButton(groupBox); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); gridLayout1->addWidget(removeButton, 1, 1, 1, 1); diff --git a/tests/auto/tools/uic/baseline/finddialog.ui.h b/tests/auto/tools/uic/baseline/finddialog.ui.h index 12f5514d41..fdf2cd4e1f 100644 --- a/tests/auto/tools/uic/baseline/finddialog.ui.h +++ b/tests/auto/tools/uic/baseline/finddialog.ui.h @@ -94,7 +94,7 @@ public: void setupUi(QDialog *FindDialog) { if (FindDialog->objectName().isEmpty()) - FindDialog->setObjectName(QString::fromUtf8("FindDialog")); + FindDialog->setObjectName(QStringLiteral("FindDialog")); FindDialog->resize(414, 170); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); sizePolicy.setHorizontalStretch(0); @@ -104,22 +104,22 @@ public: hboxLayout = new QHBoxLayout(FindDialog); hboxLayout->setSpacing(6); hboxLayout->setContentsMargins(11, 11, 11, 11); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(0, 0, 0, 0); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); findWhat = new QLabel(FindDialog); - findWhat->setObjectName(QString::fromUtf8("findWhat")); + findWhat->setObjectName(QStringLiteral("findWhat")); hboxLayout1->addWidget(findWhat); led = new QLineEdit(FindDialog); - led->setObjectName(QString::fromUtf8("led")); + led->setObjectName(QStringLiteral("led")); hboxLayout1->addWidget(led); @@ -127,36 +127,36 @@ public: vboxLayout->addLayout(hboxLayout1); groupBox = new QGroupBox(FindDialog); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); gridLayout->setSpacing(6); gridLayout->setContentsMargins(9, 9, 9, 9); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); sourceText = new QCheckBox(groupBox); - sourceText->setObjectName(QString::fromUtf8("sourceText")); + sourceText->setObjectName(QStringLiteral("sourceText")); sourceText->setChecked(true); gridLayout->addWidget(sourceText, 1, 0, 1, 1); translations = new QCheckBox(groupBox); - translations->setObjectName(QString::fromUtf8("translations")); + translations->setObjectName(QStringLiteral("translations")); translations->setChecked(true); gridLayout->addWidget(translations, 2, 0, 1, 1); matchCase = new QCheckBox(groupBox); - matchCase->setObjectName(QString::fromUtf8("matchCase")); + matchCase->setObjectName(QStringLiteral("matchCase")); gridLayout->addWidget(matchCase, 0, 1, 1, 1); comments = new QCheckBox(groupBox); - comments->setObjectName(QString::fromUtf8("comments")); + comments->setObjectName(QStringLiteral("comments")); comments->setChecked(true); gridLayout->addWidget(comments, 0, 0, 1, 1); ignoreAccelerators = new QCheckBox(groupBox); - ignoreAccelerators->setObjectName(QString::fromUtf8("ignoreAccelerators")); + ignoreAccelerators->setObjectName(QStringLiteral("ignoreAccelerators")); ignoreAccelerators->setChecked(true); gridLayout->addWidget(ignoreAccelerators, 1, 1, 1, 1); @@ -170,16 +170,16 @@ public: vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); vboxLayout1->setContentsMargins(0, 0, 0, 0); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); findNxt = new QPushButton(FindDialog); - findNxt->setObjectName(QString::fromUtf8("findNxt")); + findNxt->setObjectName(QStringLiteral("findNxt")); findNxt->setDefault(true); findNxt->setFlat(false); vboxLayout1->addWidget(findNxt); cancel = new QPushButton(FindDialog); - cancel->setObjectName(QString::fromUtf8("cancel")); + cancel->setObjectName(QStringLiteral("cancel")); vboxLayout1->addWidget(cancel); diff --git a/tests/auto/tools/uic/baseline/form.ui.h b/tests/auto/tools/uic/baseline/form.ui.h index 6aca98a1e9..cbae1567e9 100644 --- a/tests/auto/tools/uic/baseline/form.ui.h +++ b/tests/auto/tools/uic/baseline/form.ui.h @@ -44,7 +44,7 @@ public: void setupUi(QWidget *WorldTimeForm) { if (WorldTimeForm->objectName().isEmpty()) - WorldTimeForm->setObjectName(QString::fromUtf8("WorldTimeForm")); + WorldTimeForm->setObjectName(QStringLiteral("WorldTimeForm")); WorldTimeForm->resize(400, 300); hboxLayout = new QHBoxLayout(WorldTimeForm); #ifndef Q_OS_MAC @@ -53,9 +53,9 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); worldTimeClock = new WorldTimeClock(WorldTimeForm); - worldTimeClock->setObjectName(QString::fromUtf8("worldTimeClock")); + worldTimeClock->setObjectName(QStringLiteral("worldTimeClock")); hboxLayout->addWidget(worldTimeClock); @@ -64,7 +64,7 @@ public: vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(1, 1, 1, 1); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout->addItem(spacerItem); @@ -74,14 +74,14 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(1, 1, 1, 1); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); label = new QLabel(WorldTimeForm); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout1->addWidget(label); timeEdit = new QTimeEdit(WorldTimeForm); - timeEdit->setObjectName(QString::fromUtf8("timeEdit")); + timeEdit->setObjectName(QStringLiteral("timeEdit")); timeEdit->setReadOnly(true); hboxLayout1->addWidget(timeEdit); @@ -94,14 +94,14 @@ public: hboxLayout2->setSpacing(6); #endif hboxLayout2->setContentsMargins(1, 1, 1, 1); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); label_2 = new QLabel(WorldTimeForm); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); hboxLayout2->addWidget(label_2); spinBox = new QSpinBox(WorldTimeForm); - spinBox->setObjectName(QString::fromUtf8("spinBox")); + spinBox->setObjectName(QStringLiteral("spinBox")); spinBox->setMaximum(12); spinBox->setMinimum(-12); diff --git a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h index ffc1e1ad39..75d4d437bb 100644 --- a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h +++ b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h @@ -109,19 +109,19 @@ public: void setupUi(QDialog *FormWindowSettings) { if (FormWindowSettings->objectName().isEmpty()) - FormWindowSettings->setObjectName(QString::fromUtf8("FormWindowSettings")); + FormWindowSettings->setObjectName(QStringLiteral("FormWindowSettings")); FormWindowSettings->resize(433, 465); gridLayout = new QGridLayout(FormWindowSettings); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); buttonBox = new QDialogButtonBox(FormWindowSettings); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 6, 0, 1, 2); line = new QFrame(FormWindowSettings); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); @@ -132,33 +132,33 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); layoutDefaultGroupBox = new QGroupBox(FormWindowSettings); - layoutDefaultGroupBox->setObjectName(QString::fromUtf8("layoutDefaultGroupBox")); + layoutDefaultGroupBox->setObjectName(QStringLiteral("layoutDefaultGroupBox")); layoutDefaultGroupBox->setCheckable(true); gridLayout1 = new QGridLayout(layoutDefaultGroupBox); #ifndef Q_OS_MAC gridLayout1->setSpacing(6); #endif gridLayout1->setContentsMargins(8, 8, 8, 8); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); label_2 = new QLabel(layoutDefaultGroupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout1->addWidget(label_2, 1, 0, 1, 1); label = new QLabel(layoutDefaultGroupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout1->addWidget(label, 0, 0, 1, 1); defaultSpacingSpinBox = new QSpinBox(layoutDefaultGroupBox); - defaultSpacingSpinBox->setObjectName(QString::fromUtf8("defaultSpacingSpinBox")); + defaultSpacingSpinBox->setObjectName(QStringLiteral("defaultSpacingSpinBox")); gridLayout1->addWidget(defaultSpacingSpinBox, 1, 1, 1, 1); defaultMarginSpinBox = new QSpinBox(layoutDefaultGroupBox); - defaultMarginSpinBox->setObjectName(QString::fromUtf8("defaultMarginSpinBox")); + defaultMarginSpinBox->setObjectName(QStringLiteral("defaultMarginSpinBox")); gridLayout1->addWidget(defaultMarginSpinBox, 0, 1, 1, 1); @@ -166,31 +166,31 @@ public: hboxLayout->addWidget(layoutDefaultGroupBox); layoutFunctionGroupBox = new QGroupBox(FormWindowSettings); - layoutFunctionGroupBox->setObjectName(QString::fromUtf8("layoutFunctionGroupBox")); + layoutFunctionGroupBox->setObjectName(QStringLiteral("layoutFunctionGroupBox")); layoutFunctionGroupBox->setCheckable(true); gridLayout2 = new QGridLayout(layoutFunctionGroupBox); #ifndef Q_OS_MAC gridLayout2->setSpacing(6); #endif gridLayout2->setContentsMargins(8, 8, 8, 8); - gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); + gridLayout2->setObjectName(QStringLiteral("gridLayout2")); spacingFunctionLineEdit = new QLineEdit(layoutFunctionGroupBox); - spacingFunctionLineEdit->setObjectName(QString::fromUtf8("spacingFunctionLineEdit")); + spacingFunctionLineEdit->setObjectName(QStringLiteral("spacingFunctionLineEdit")); gridLayout2->addWidget(spacingFunctionLineEdit, 1, 1, 1, 1); marginFunctionLineEdit = new QLineEdit(layoutFunctionGroupBox); - marginFunctionLineEdit->setObjectName(QString::fromUtf8("marginFunctionLineEdit")); + marginFunctionLineEdit->setObjectName(QStringLiteral("marginFunctionLineEdit")); gridLayout2->addWidget(marginFunctionLineEdit, 0, 1, 1, 1); label_3 = new QLabel(layoutFunctionGroupBox); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout2->addWidget(label_3, 0, 0, 1, 1); label_3_2 = new QLabel(layoutFunctionGroupBox); - label_3_2->setObjectName(QString::fromUtf8("label_3_2")); + label_3_2->setObjectName(QStringLiteral("label_3_2")); gridLayout2->addWidget(label_3_2, 1, 0, 1, 1); @@ -201,15 +201,15 @@ public: gridLayout->addLayout(hboxLayout, 2, 0, 1, 2); pixmapFunctionGroupBox_2 = new QGroupBox(FormWindowSettings); - pixmapFunctionGroupBox_2->setObjectName(QString::fromUtf8("pixmapFunctionGroupBox_2")); + pixmapFunctionGroupBox_2->setObjectName(QStringLiteral("pixmapFunctionGroupBox_2")); vboxLayout = new QVBoxLayout(pixmapFunctionGroupBox_2); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(8, 8, 8, 8); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); authorLineEdit = new QLineEdit(pixmapFunctionGroupBox_2); - authorLineEdit->setObjectName(QString::fromUtf8("authorLineEdit")); + authorLineEdit->setObjectName(QStringLiteral("authorLineEdit")); vboxLayout->addWidget(authorLineEdit); @@ -217,15 +217,15 @@ public: gridLayout->addWidget(pixmapFunctionGroupBox_2, 0, 0, 1, 2); includeHintsGroupBox = new QGroupBox(FormWindowSettings); - includeHintsGroupBox->setObjectName(QString::fromUtf8("includeHintsGroupBox")); + includeHintsGroupBox->setObjectName(QStringLiteral("includeHintsGroupBox")); vboxLayout1 = new QVBoxLayout(includeHintsGroupBox); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); #endif vboxLayout1->setContentsMargins(8, 8, 8, 8); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); includeHintsTextEdit = new QTextEdit(includeHintsGroupBox); - includeHintsTextEdit->setObjectName(QString::fromUtf8("includeHintsTextEdit")); + includeHintsTextEdit->setObjectName(QStringLiteral("includeHintsTextEdit")); vboxLayout1->addWidget(includeHintsTextEdit); @@ -237,18 +237,18 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); pixmapFunctionGroupBox = new QGroupBox(FormWindowSettings); - pixmapFunctionGroupBox->setObjectName(QString::fromUtf8("pixmapFunctionGroupBox")); + pixmapFunctionGroupBox->setObjectName(QStringLiteral("pixmapFunctionGroupBox")); pixmapFunctionGroupBox->setCheckable(true); vboxLayout2 = new QVBoxLayout(pixmapFunctionGroupBox); #ifndef Q_OS_MAC vboxLayout2->setSpacing(6); #endif vboxLayout2->setContentsMargins(8, 8, 8, 8); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); pixmapFunctionLineEdit = new QLineEdit(pixmapFunctionGroupBox); - pixmapFunctionLineEdit->setObjectName(QString::fromUtf8("pixmapFunctionLineEdit")); + pixmapFunctionLineEdit->setObjectName(QStringLiteral("pixmapFunctionLineEdit")); vboxLayout2->addWidget(pixmapFunctionLineEdit); @@ -263,7 +263,7 @@ public: gridLayout->addItem(spacerItem, 4, 1, 1, 1); gridPanel = new qdesigner_internal::GridPanel(FormWindowSettings); - gridPanel->setObjectName(QString::fromUtf8("gridPanel")); + gridPanel->setObjectName(QStringLiteral("gridPanel")); gridLayout->addWidget(gridPanel, 1, 0, 1, 2); diff --git a/tests/auto/tools/uic/baseline/generalpage.ui.h b/tests/auto/tools/uic/baseline/generalpage.ui.h index a4d72117eb..f496cb834c 100644 --- a/tests/auto/tools/uic/baseline/generalpage.ui.h +++ b/tests/auto/tools/uic/baseline/generalpage.ui.h @@ -37,27 +37,27 @@ public: void setupUi(QWidget *GeneralPage) { if (GeneralPage->objectName().isEmpty()) - GeneralPage->setObjectName(QString::fromUtf8("GeneralPage")); + GeneralPage->setObjectName(QStringLiteral("GeneralPage")); GeneralPage->resize(417, 243); gridLayout = new QGridLayout(GeneralPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(GeneralPage); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 1, 0, 1, 1); namespaceLineEdit = new QLineEdit(GeneralPage); - namespaceLineEdit->setObjectName(QString::fromUtf8("namespaceLineEdit")); + namespaceLineEdit->setObjectName(QStringLiteral("namespaceLineEdit")); gridLayout->addWidget(namespaceLineEdit, 1, 1, 1, 1); label_2 = new QLabel(GeneralPage); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 2, 0, 1, 1); folderLineEdit = new QLineEdit(GeneralPage); - folderLineEdit->setObjectName(QString::fromUtf8("folderLineEdit")); + folderLineEdit->setObjectName(QStringLiteral("folderLineEdit")); gridLayout->addWidget(folderLineEdit, 2, 1, 1, 1); diff --git a/tests/auto/tools/uic/baseline/gridalignment.ui.h b/tests/auto/tools/uic/baseline/gridalignment.ui.h index 7a3291dc8c..8d9a556164 100644 --- a/tests/auto/tools/uic/baseline/gridalignment.ui.h +++ b/tests/auto/tools/uic/baseline/gridalignment.ui.h @@ -33,27 +33,27 @@ public: void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) - Form->setObjectName(QString::fromUtf8("Form")); + Form->setObjectName(QStringLiteral("Form")); Form->resize(279, 163); gridLayout = new QGridLayout(Form); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); pushButton = new QPushButton(Form); - pushButton->setObjectName(QString::fromUtf8("pushButton")); + pushButton->setObjectName(QStringLiteral("pushButton")); gridLayout->addWidget(pushButton, 0, 0, 1, 1, Qt::AlignLeft); pushButton_3 = new QPushButton(Form); - pushButton_3->setObjectName(QString::fromUtf8("pushButton_3")); + pushButton_3->setObjectName(QStringLiteral("pushButton_3")); gridLayout->addWidget(pushButton_3, 0, 1, 1, 1, Qt::AlignTop); pushButton_2 = new QPushButton(Form); - pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); + pushButton_2->setObjectName(QStringLiteral("pushButton_2")); gridLayout->addWidget(pushButton_2, 1, 0, 1, 1, Qt::AlignRight); pushButton_4 = new QPushButton(Form); - pushButton_4->setObjectName(QString::fromUtf8("pushButton_4")); + pushButton_4->setObjectName(QStringLiteral("pushButton_4")); gridLayout->addWidget(pushButton_4, 1, 1, 1, 1, Qt::AlignBottom); diff --git a/tests/auto/tools/uic/baseline/gridpanel.ui.h b/tests/auto/tools/uic/baseline/gridpanel.ui.h index 21e703b95b..abe260e601 100644 --- a/tests/auto/tools/uic/baseline/gridpanel.ui.h +++ b/tests/auto/tools/uic/baseline/gridpanel.ui.h @@ -50,17 +50,17 @@ public: void setupUi(QWidget *qdesigner_internal__GridPanel) { if (qdesigner_internal__GridPanel->objectName().isEmpty()) - qdesigner_internal__GridPanel->setObjectName(QString::fromUtf8("qdesigner_internal__GridPanel")); + qdesigner_internal__GridPanel->setObjectName(QStringLiteral("qdesigner_internal__GridPanel")); qdesigner_internal__GridPanel->resize(393, 110); vboxLayout = new QVBoxLayout(qdesigner_internal__GridPanel); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); m_gridGroupBox = new QGroupBox(qdesigner_internal__GridPanel); - m_gridGroupBox->setObjectName(QString::fromUtf8("m_gridGroupBox")); + m_gridGroupBox->setObjectName(QStringLiteral("m_gridGroupBox")); gridLayout = new QGridLayout(m_gridGroupBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); m_visibleCheckBox = new QCheckBox(m_gridGroupBox); - m_visibleCheckBox->setObjectName(QString::fromUtf8("m_visibleCheckBox")); + m_visibleCheckBox->setObjectName(QStringLiteral("m_visibleCheckBox")); QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -70,28 +70,28 @@ public: gridLayout->addWidget(m_visibleCheckBox, 0, 0, 1, 1); label = new QLabel(m_gridGroupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 1, 1, 1); m_deltaXSpinBox = new QSpinBox(m_gridGroupBox); - m_deltaXSpinBox->setObjectName(QString::fromUtf8("m_deltaXSpinBox")); + m_deltaXSpinBox->setObjectName(QStringLiteral("m_deltaXSpinBox")); m_deltaXSpinBox->setMinimum(2); m_deltaXSpinBox->setMaximum(100); gridLayout->addWidget(m_deltaXSpinBox, 0, 2, 1, 1); m_snapXCheckBox = new QCheckBox(m_gridGroupBox); - m_snapXCheckBox->setObjectName(QString::fromUtf8("m_snapXCheckBox")); + m_snapXCheckBox->setObjectName(QStringLiteral("m_snapXCheckBox")); sizePolicy.setHeightForWidth(m_snapXCheckBox->sizePolicy().hasHeightForWidth()); m_snapXCheckBox->setSizePolicy(sizePolicy); gridLayout->addWidget(m_snapXCheckBox, 0, 3, 1, 1); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); m_resetButton = new QPushButton(m_gridGroupBox); - m_resetButton->setObjectName(QString::fromUtf8("m_resetButton")); + m_resetButton->setObjectName(QStringLiteral("m_resetButton")); hboxLayout->addWidget(m_resetButton); @@ -103,19 +103,19 @@ public: gridLayout->addLayout(hboxLayout, 1, 0, 1, 1); label_2 = new QLabel(m_gridGroupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 1, 1, 1, 1); m_deltaYSpinBox = new QSpinBox(m_gridGroupBox); - m_deltaYSpinBox->setObjectName(QString::fromUtf8("m_deltaYSpinBox")); + m_deltaYSpinBox->setObjectName(QStringLiteral("m_deltaYSpinBox")); m_deltaYSpinBox->setMinimum(2); m_deltaYSpinBox->setMaximum(100); gridLayout->addWidget(m_deltaYSpinBox, 1, 2, 1, 1); m_snapYCheckBox = new QCheckBox(m_gridGroupBox); - m_snapYCheckBox->setObjectName(QString::fromUtf8("m_snapYCheckBox")); + m_snapYCheckBox->setObjectName(QStringLiteral("m_snapYCheckBox")); sizePolicy.setHeightForWidth(m_snapYCheckBox->sizePolicy().hasHeightForWidth()); m_snapYCheckBox->setSizePolicy(sizePolicy); diff --git a/tests/auto/tools/uic/baseline/helpdialog.ui.h b/tests/auto/tools/uic/baseline/helpdialog.ui.h index b16632fe00..ac482ba139 100644 --- a/tests/auto/tools/uic/baseline/helpdialog.ui.h +++ b/tests/auto/tools/uic/baseline/helpdialog.ui.h @@ -114,26 +114,26 @@ public: void setupUi(QWidget *HelpDialog) { if (HelpDialog->objectName().isEmpty()) - HelpDialog->setObjectName(QString::fromUtf8("HelpDialog")); + HelpDialog->setObjectName(QStringLiteral("HelpDialog")); HelpDialog->resize(274, 417); vboxLayout = new QVBoxLayout(HelpDialog); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(0, 0, 0, 0); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); tabWidget = new QTabWidget(HelpDialog); - tabWidget->setObjectName(QString::fromUtf8("tabWidget")); + tabWidget->setObjectName(QStringLiteral("tabWidget")); contentPage = new QWidget(); - contentPage->setObjectName(QString::fromUtf8("contentPage")); + contentPage->setObjectName(QStringLiteral("contentPage")); vboxLayout1 = new QVBoxLayout(contentPage); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); #endif vboxLayout1->setContentsMargins(5, 5, 5, 5); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); listContents = new QTreeWidget(contentPage); - listContents->setObjectName(QString::fromUtf8("listContents")); + listContents->setObjectName(QStringLiteral("listContents")); listContents->setContextMenuPolicy(Qt::CustomContextMenu); listContents->setRootIsDecorated(true); listContents->setUniformRowHeights(true); @@ -142,40 +142,40 @@ public: tabWidget->addTab(contentPage, QString()); indexPage = new QWidget(); - indexPage->setObjectName(QString::fromUtf8("indexPage")); + indexPage->setObjectName(QStringLiteral("indexPage")); vboxLayout2 = new QVBoxLayout(indexPage); #ifndef Q_OS_MAC vboxLayout2->setSpacing(6); #endif vboxLayout2->setContentsMargins(5, 5, 5, 5); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); TextLabel1 = new QLabel(indexPage); - TextLabel1->setObjectName(QString::fromUtf8("TextLabel1")); + TextLabel1->setObjectName(QStringLiteral("TextLabel1")); vboxLayout2->addWidget(TextLabel1); editIndex = new QLineEdit(indexPage); - editIndex->setObjectName(QString::fromUtf8("editIndex")); + editIndex->setObjectName(QStringLiteral("editIndex")); vboxLayout2->addWidget(editIndex); listIndex = new QListView(indexPage); - listIndex->setObjectName(QString::fromUtf8("listIndex")); + listIndex->setObjectName(QStringLiteral("listIndex")); listIndex->setContextMenuPolicy(Qt::CustomContextMenu); vboxLayout2->addWidget(listIndex); tabWidget->addTab(indexPage, QString()); bookmarkPage = new QWidget(); - bookmarkPage->setObjectName(QString::fromUtf8("bookmarkPage")); + bookmarkPage->setObjectName(QStringLiteral("bookmarkPage")); vboxLayout3 = new QVBoxLayout(bookmarkPage); #ifndef Q_OS_MAC vboxLayout3->setSpacing(6); #endif vboxLayout3->setContentsMargins(5, 5, 5, 5); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); + vboxLayout3->setObjectName(QStringLiteral("vboxLayout3")); listBookmarks = new QTreeWidget(bookmarkPage); - listBookmarks->setObjectName(QString::fromUtf8("listBookmarks")); + listBookmarks->setObjectName(QStringLiteral("listBookmarks")); listBookmarks->setContextMenuPolicy(Qt::CustomContextMenu); listBookmarks->setUniformRowHeights(true); @@ -186,18 +186,18 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); buttonAdd = new QPushButton(bookmarkPage); - buttonAdd->setObjectName(QString::fromUtf8("buttonAdd")); + buttonAdd->setObjectName(QStringLiteral("buttonAdd")); hboxLayout->addWidget(buttonAdd); buttonRemove = new QPushButton(bookmarkPage); - buttonRemove->setObjectName(QString::fromUtf8("buttonRemove")); + buttonRemove->setObjectName(QStringLiteral("buttonRemove")); hboxLayout->addWidget(buttonRemove); @@ -206,35 +206,35 @@ public: tabWidget->addTab(bookmarkPage, QString()); searchPage = new QWidget(); - searchPage->setObjectName(QString::fromUtf8("searchPage")); + searchPage->setObjectName(QStringLiteral("searchPage")); gridLayout = new QGridLayout(searchPage); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(5, 5, 5, 5); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem1 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed); gridLayout->addItem(spacerItem1, 3, 0, 1, 1); TextLabel1_2 = new QLabel(searchPage); - TextLabel1_2->setObjectName(QString::fromUtf8("TextLabel1_2")); + TextLabel1_2->setObjectName(QStringLiteral("TextLabel1_2")); gridLayout->addWidget(TextLabel1_2, 0, 0, 1, 1); termsEdit = new QLineEdit(searchPage); - termsEdit->setObjectName(QString::fromUtf8("termsEdit")); + termsEdit->setObjectName(QStringLiteral("termsEdit")); gridLayout->addWidget(termsEdit, 1, 0, 1, 1); resultBox = new QListWidget(searchPage); - resultBox->setObjectName(QString::fromUtf8("resultBox")); + resultBox->setObjectName(QStringLiteral("resultBox")); resultBox->setContextMenuPolicy(Qt::CustomContextMenu); gridLayout->addWidget(resultBox, 5, 0, 1, 1); TextLabel2 = new QLabel(searchPage); - TextLabel2->setObjectName(QString::fromUtf8("TextLabel2")); + TextLabel2->setObjectName(QStringLiteral("TextLabel2")); gridLayout->addWidget(TextLabel2, 4, 0, 1, 1); @@ -243,9 +243,9 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(1, 1, 1, 1); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); helpButton = new QPushButton(searchPage); - helpButton->setObjectName(QString::fromUtf8("helpButton")); + helpButton->setObjectName(QStringLiteral("helpButton")); hboxLayout1->addWidget(helpButton); @@ -254,7 +254,7 @@ public: hboxLayout1->addItem(spacerItem2); searchButton = new QPushButton(searchPage); - searchButton->setObjectName(QString::fromUtf8("searchButton")); + searchButton->setObjectName(QStringLiteral("searchButton")); searchButton->setEnabled(false); hboxLayout1->addWidget(searchButton); @@ -267,7 +267,7 @@ public: vboxLayout->addWidget(tabWidget); framePrepare = new QFrame(HelpDialog); - framePrepare->setObjectName(QString::fromUtf8("framePrepare")); + framePrepare->setObjectName(QStringLiteral("framePrepare")); framePrepare->setFrameShape(QFrame::StyledPanel); framePrepare->setFrameShadow(QFrame::Raised); hboxLayout2 = new QHBoxLayout(framePrepare); @@ -275,14 +275,14 @@ public: hboxLayout2->setSpacing(6); #endif hboxLayout2->setContentsMargins(3, 3, 3, 3); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); labelPrepare = new QLabel(framePrepare); - labelPrepare->setObjectName(QString::fromUtf8("labelPrepare")); + labelPrepare->setObjectName(QStringLiteral("labelPrepare")); hboxLayout2->addWidget(labelPrepare); progressPrepare = new QProgressBar(framePrepare); - progressPrepare->setObjectName(QString::fromUtf8("progressPrepare")); + progressPrepare->setObjectName(QStringLiteral("progressPrepare")); hboxLayout2->addWidget(progressPrepare); diff --git a/tests/auto/tools/uic/baseline/history.ui.h b/tests/auto/tools/uic/baseline/history.ui.h index 1784b216e3..57007e5280 100644 --- a/tests/auto/tools/uic/baseline/history.ui.h +++ b/tests/auto/tools/uic/baseline/history.ui.h @@ -42,33 +42,33 @@ public: void setupUi(QDialog *HistoryDialog) { if (HistoryDialog->objectName().isEmpty()) - HistoryDialog->setObjectName(QString::fromUtf8("HistoryDialog")); + HistoryDialog->setObjectName(QStringLiteral("HistoryDialog")); HistoryDialog->resize(758, 450); gridLayout = new QGridLayout(HistoryDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem = new QSpacerItem(252, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout->addItem(spacerItem, 0, 0, 1, 1); search = new SearchLineEdit(HistoryDialog); - search->setObjectName(QString::fromUtf8("search")); + search->setObjectName(QStringLiteral("search")); gridLayout->addWidget(search, 0, 1, 1, 1); tree = new EditTreeView(HistoryDialog); - tree->setObjectName(QString::fromUtf8("tree")); + tree->setObjectName(QStringLiteral("tree")); gridLayout->addWidget(tree, 1, 0, 1, 2); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); removeButton = new QPushButton(HistoryDialog); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); hboxLayout->addWidget(removeButton); removeAllButton = new QPushButton(HistoryDialog); - removeAllButton->setObjectName(QString::fromUtf8("removeAllButton")); + removeAllButton->setObjectName(QStringLiteral("removeAllButton")); hboxLayout->addWidget(removeAllButton); @@ -77,7 +77,7 @@ public: hboxLayout->addItem(spacerItem1); buttonBox = new QDialogButtonBox(HistoryDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setStandardButtons(QDialogButtonBox::Ok); hboxLayout->addWidget(buttonBox); diff --git a/tests/auto/tools/uic/baseline/icontheme.ui.h b/tests/auto/tools/uic/baseline/icontheme.ui.h index 78c90838ab..f3f8f634f9 100644 --- a/tests/auto/tools/uic/baseline/icontheme.ui.h +++ b/tests/auto/tools/uic/baseline/icontheme.ui.h @@ -32,39 +32,39 @@ public: void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) - Form->setObjectName(QString::fromUtf8("Form")); + Form->setObjectName(QStringLiteral("Form")); Form->resize(122, 117); verticalLayout = new QVBoxLayout(Form); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); fileicon = new QPushButton(Form); - fileicon->setObjectName(QString::fromUtf8("fileicon")); + fileicon->setObjectName(QStringLiteral("fileicon")); QIcon icon; - icon.addFile(QString::fromUtf8("image1.png"), QSize(), QIcon::Normal, QIcon::Off); + icon.addFile(QStringLiteral("image1.png"), QSize(), QIcon::Normal, QIcon::Off); fileicon->setIcon(icon); verticalLayout->addWidget(fileicon); fileandthemeicon = new QPushButton(Form); - fileandthemeicon->setObjectName(QString::fromUtf8("fileandthemeicon")); + fileandthemeicon->setObjectName(QStringLiteral("fileandthemeicon")); QIcon icon1; - QString iconThemeName = QString::fromUtf8("edit-copy"); + QString iconThemeName = QStringLiteral("edit-copy"); if (QIcon::hasThemeIcon(iconThemeName)) { icon1 = QIcon::fromTheme(iconThemeName); } else { - icon1.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off); + icon1.addFile(QStringLiteral("image7.png"), QSize(), QIcon::Normal, QIcon::Off); } fileandthemeicon->setIcon(icon1); verticalLayout->addWidget(fileandthemeicon); themeicon = new QPushButton(Form); - themeicon->setObjectName(QString::fromUtf8("themeicon")); + themeicon->setObjectName(QStringLiteral("themeicon")); QIcon icon2; - iconThemeName = QString::fromUtf8("edit-copy"); + iconThemeName = QStringLiteral("edit-copy"); if (QIcon::hasThemeIcon(iconThemeName)) { icon2 = QIcon::fromTheme(iconThemeName); } else { - icon2.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::Off); + icon2.addFile(QStringLiteral(""), QSize(), QIcon::Normal, QIcon::Off); } themeicon->setIcon(icon2); diff --git a/tests/auto/tools/uic/baseline/identifierpage.ui.h b/tests/auto/tools/uic/baseline/identifierpage.ui.h index 1088ee33da..3f0cd1a4f5 100644 --- a/tests/auto/tools/uic/baseline/identifierpage.ui.h +++ b/tests/auto/tools/uic/baseline/identifierpage.ui.h @@ -40,16 +40,16 @@ public: void setupUi(QWidget *IdentifierPage) { if (IdentifierPage->objectName().isEmpty()) - IdentifierPage->setObjectName(QString::fromUtf8("IdentifierPage")); + IdentifierPage->setObjectName(QStringLiteral("IdentifierPage")); IdentifierPage->resize(417, 242); gridLayout = new QGridLayout(IdentifierPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed); gridLayout->addItem(spacerItem, 0, 1, 1, 1); identifierCheckBox = new QCheckBox(IdentifierPage); - identifierCheckBox->setObjectName(QString::fromUtf8("identifierCheckBox")); + identifierCheckBox->setObjectName(QStringLiteral("identifierCheckBox")); gridLayout->addWidget(identifierCheckBox, 1, 0, 1, 3); @@ -62,20 +62,20 @@ public: gridLayout->addItem(spacerItem2, 2, 0, 1, 1); globalButton = new QRadioButton(IdentifierPage); - globalButton->setObjectName(QString::fromUtf8("globalButton")); + globalButton->setObjectName(QStringLiteral("globalButton")); globalButton->setEnabled(false); globalButton->setChecked(true); gridLayout->addWidget(globalButton, 2, 1, 1, 1); prefixLineEdit = new QLineEdit(IdentifierPage); - prefixLineEdit->setObjectName(QString::fromUtf8("prefixLineEdit")); + prefixLineEdit->setObjectName(QStringLiteral("prefixLineEdit")); prefixLineEdit->setEnabled(false); gridLayout->addWidget(prefixLineEdit, 2, 2, 1, 1); fileNameButton = new QRadioButton(IdentifierPage); - fileNameButton->setObjectName(QString::fromUtf8("fileNameButton")); + fileNameButton->setObjectName(QStringLiteral("fileNameButton")); fileNameButton->setEnabled(false); gridLayout->addWidget(fileNameButton, 3, 1, 1, 2); diff --git a/tests/auto/tools/uic/baseline/imagedialog.ui.h b/tests/auto/tools/uic/baseline/imagedialog.ui.h index 1728cac952..c09363d3ec 100644 --- a/tests/auto/tools/uic/baseline/imagedialog.ui.h +++ b/tests/auto/tools/uic/baseline/imagedialog.ui.h @@ -50,8 +50,8 @@ public: void setupUi(QDialog *dialog) { if (dialog->objectName().isEmpty()) - dialog->setObjectName(QString::fromUtf8("dialog")); - dialog->setObjectName(QString::fromUtf8("ImageDialog")); + dialog->setObjectName(QStringLiteral("dialog")); + dialog->setObjectName(QStringLiteral("ImageDialog")); dialog->resize(320, 180); vboxLayout = new QVBoxLayout(dialog); #ifndef Q_OS_MAC @@ -60,17 +60,17 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("")); gridLayout = new QGridLayout(); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(1, 1, 1, 1); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - gridLayout->setObjectName(QString::fromUtf8("")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + gridLayout->setObjectName(QStringLiteral("")); widthLabel = new QLabel(dialog); - widthLabel->setObjectName(QString::fromUtf8("widthLabel")); + widthLabel->setObjectName(QStringLiteral("widthLabel")); widthLabel->setGeometry(QRect(1, 27, 67, 22)); widthLabel->setFrameShape(QFrame::NoFrame); widthLabel->setFrameShadow(QFrame::Plain); @@ -79,7 +79,7 @@ public: gridLayout->addWidget(widthLabel, 1, 0, 1, 1); heightLabel = new QLabel(dialog); - heightLabel->setObjectName(QString::fromUtf8("heightLabel")); + heightLabel->setObjectName(QStringLiteral("heightLabel")); heightLabel->setGeometry(QRect(1, 55, 67, 22)); heightLabel->setFrameShape(QFrame::NoFrame); heightLabel->setFrameShadow(QFrame::Plain); @@ -88,7 +88,7 @@ public: gridLayout->addWidget(heightLabel, 2, 0, 1, 1); colorDepthCombo = new QComboBox(dialog); - colorDepthCombo->setObjectName(QString::fromUtf8("colorDepthCombo")); + colorDepthCombo->setObjectName(QStringLiteral("colorDepthCombo")); colorDepthCombo->setGeometry(QRect(74, 83, 227, 22)); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(0)); sizePolicy.setHorizontalStretch(0); @@ -100,7 +100,7 @@ public: gridLayout->addWidget(colorDepthCombo, 3, 1, 1, 1); nameLineEdit = new QLineEdit(dialog); - nameLineEdit->setObjectName(QString::fromUtf8("nameLineEdit")); + nameLineEdit->setObjectName(QStringLiteral("nameLineEdit")); nameLineEdit->setGeometry(QRect(74, 83, 227, 22)); QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(0)); sizePolicy1.setHorizontalStretch(1); @@ -112,7 +112,7 @@ public: gridLayout->addWidget(nameLineEdit, 0, 1, 1, 1); spinBox = new QSpinBox(dialog); - spinBox->setObjectName(QString::fromUtf8("spinBox")); + spinBox->setObjectName(QStringLiteral("spinBox")); spinBox->setGeometry(QRect(74, 1, 227, 20)); sizePolicy.setHeightForWidth(spinBox->sizePolicy().hasHeightForWidth()); spinBox->setSizePolicy(sizePolicy); @@ -124,7 +124,7 @@ public: gridLayout->addWidget(spinBox, 1, 1, 1, 1); spinBox_2 = new QSpinBox(dialog); - spinBox_2->setObjectName(QString::fromUtf8("spinBox_2")); + spinBox_2->setObjectName(QStringLiteral("spinBox_2")); spinBox_2->setGeometry(QRect(74, 27, 227, 22)); sizePolicy.setHeightForWidth(spinBox_2->sizePolicy().hasHeightForWidth()); spinBox_2->setSizePolicy(sizePolicy); @@ -136,7 +136,7 @@ public: gridLayout->addWidget(spinBox_2, 2, 1, 1, 1); nameLabel = new QLabel(dialog); - nameLabel->setObjectName(QString::fromUtf8("nameLabel")); + nameLabel->setObjectName(QStringLiteral("nameLabel")); nameLabel->setGeometry(QRect(1, 1, 67, 20)); nameLabel->setFrameShape(QFrame::NoFrame); nameLabel->setFrameShadow(QFrame::Plain); @@ -145,7 +145,7 @@ public: gridLayout->addWidget(nameLabel, 0, 0, 1, 1); colorDepthLabel = new QLabel(dialog); - colorDepthLabel->setObjectName(QString::fromUtf8("colorDepthLabel")); + colorDepthLabel->setObjectName(QStringLiteral("colorDepthLabel")); colorDepthLabel->setGeometry(QRect(1, 83, 67, 22)); colorDepthLabel->setFrameShape(QFrame::NoFrame); colorDepthLabel->setFrameShadow(QFrame::Plain); @@ -165,20 +165,20 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(1, 1, 1, 1); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("")); spacerItem1 = new QSpacerItem(QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem1); okButton = new QPushButton(dialog); - okButton->setObjectName(QString::fromUtf8("okButton")); + okButton->setObjectName(QStringLiteral("okButton")); okButton->setGeometry(QRect(135, 1, 80, 24)); hboxLayout->addWidget(okButton); cancelButton = new QPushButton(dialog); - cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setObjectName(QStringLiteral("cancelButton")); cancelButton->setGeometry(QRect(221, 1, 80, 24)); hboxLayout->addWidget(cancelButton); diff --git a/tests/auto/tools/uic/baseline/inputpage.ui.h b/tests/auto/tools/uic/baseline/inputpage.ui.h index 90ff131d1d..d52d1ae93b 100644 --- a/tests/auto/tools/uic/baseline/inputpage.ui.h +++ b/tests/auto/tools/uic/baseline/inputpage.ui.h @@ -39,16 +39,16 @@ public: void setupUi(QWidget *InputPage) { if (InputPage->objectName().isEmpty()) - InputPage->setObjectName(QString::fromUtf8("InputPage")); + InputPage->setObjectName(QStringLiteral("InputPage")); InputPage->resize(417, 242); gridLayout = new QGridLayout(InputPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed); gridLayout->addItem(spacerItem, 0, 2, 1, 1); label = new QLabel(InputPage); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -59,14 +59,14 @@ public: hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); fileLineEdit = new QLineEdit(InputPage); - fileLineEdit->setObjectName(QString::fromUtf8("fileLineEdit")); + fileLineEdit->setObjectName(QStringLiteral("fileLineEdit")); hboxLayout->addWidget(fileLineEdit); browseButton = new QToolButton(InputPage); - browseButton->setObjectName(QString::fromUtf8("browseButton")); + browseButton->setObjectName(QStringLiteral("browseButton")); hboxLayout->addWidget(browseButton); diff --git a/tests/auto/tools/uic/baseline/installdialog.ui.h b/tests/auto/tools/uic/baseline/installdialog.ui.h index d58986f98a..519a71005e 100644 --- a/tests/auto/tools/uic/baseline/installdialog.ui.h +++ b/tests/auto/tools/uic/baseline/installdialog.ui.h @@ -48,32 +48,32 @@ public: void setupUi(QDialog *InstallDialog) { if (InstallDialog->objectName().isEmpty()) - InstallDialog->setObjectName(QString::fromUtf8("InstallDialog")); + InstallDialog->setObjectName(QStringLiteral("InstallDialog")); InstallDialog->resize(436, 245); gridLayout = new QGridLayout(InstallDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(InstallDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 4); listWidget = new QListWidget(InstallDialog); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); gridLayout->addWidget(listWidget, 1, 0, 4, 4); installButton = new QPushButton(InstallDialog); - installButton->setObjectName(QString::fromUtf8("installButton")); + installButton->setObjectName(QStringLiteral("installButton")); gridLayout->addWidget(installButton, 1, 4, 1, 1); cancelButton = new QPushButton(InstallDialog); - cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setObjectName(QStringLiteral("cancelButton")); gridLayout->addWidget(cancelButton, 2, 4, 1, 1); closeButton = new QPushButton(InstallDialog); - closeButton->setObjectName(QString::fromUtf8("closeButton")); + closeButton->setObjectName(QStringLiteral("closeButton")); gridLayout->addWidget(closeButton, 3, 4, 1, 1); @@ -82,34 +82,34 @@ public: gridLayout->addItem(spacerItem, 4, 4, 1, 1); label_4 = new QLabel(InstallDialog); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); gridLayout->addWidget(label_4, 5, 0, 1, 1); pathLineEdit = new QLineEdit(InstallDialog); - pathLineEdit->setObjectName(QString::fromUtf8("pathLineEdit")); + pathLineEdit->setObjectName(QStringLiteral("pathLineEdit")); gridLayout->addWidget(pathLineEdit, 5, 1, 1, 2); browseButton = new QToolButton(InstallDialog); - browseButton->setObjectName(QString::fromUtf8("browseButton")); + browseButton->setObjectName(QStringLiteral("browseButton")); gridLayout->addWidget(browseButton, 5, 3, 1, 1); line = new QFrame(InstallDialog); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); gridLayout->addWidget(line, 6, 0, 1, 5); statusLabel = new QLabel(InstallDialog); - statusLabel->setObjectName(QString::fromUtf8("statusLabel")); + statusLabel->setObjectName(QStringLiteral("statusLabel")); gridLayout->addWidget(statusLabel, 7, 0, 1, 2); progressBar = new QProgressBar(InstallDialog); - progressBar->setObjectName(QString::fromUtf8("progressBar")); + progressBar->setObjectName(QStringLiteral("progressBar")); progressBar->setValue(0); progressBar->setOrientation(Qt::Horizontal); diff --git a/tests/auto/tools/uic/baseline/languagesdialog.ui.h b/tests/auto/tools/uic/baseline/languagesdialog.ui.h index 58d299096a..0419f18ecf 100644 --- a/tests/auto/tools/uic/baseline/languagesdialog.ui.h +++ b/tests/auto/tools/uic/baseline/languagesdialog.ui.h @@ -41,50 +41,50 @@ public: void setupUi(QDialog *LanguagesDialog) { if (LanguagesDialog->objectName().isEmpty()) - LanguagesDialog->setObjectName(QString::fromUtf8("LanguagesDialog")); + LanguagesDialog->setObjectName(QStringLiteral("LanguagesDialog")); LanguagesDialog->resize(400, 300); verticalLayout = new QVBoxLayout(LanguagesDialog); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); languagesList = new QTreeWidget(LanguagesDialog); - languagesList->setObjectName(QString::fromUtf8("languagesList")); + languagesList->setObjectName(QStringLiteral("languagesList")); languagesList->setIndentation(0); verticalLayout->addWidget(languagesList); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); upButton = new QToolButton(LanguagesDialog); - upButton->setObjectName(QString::fromUtf8("upButton")); + upButton->setObjectName(QStringLiteral("upButton")); upButton->setEnabled(false); QIcon icon; - icon.addFile(QString::fromUtf8(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off); + icon.addFile(QStringLiteral(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off); upButton->setIcon(icon); hboxLayout->addWidget(upButton); downButton = new QToolButton(LanguagesDialog); - downButton->setObjectName(QString::fromUtf8("downButton")); + downButton->setObjectName(QStringLiteral("downButton")); downButton->setEnabled(false); QIcon icon1; - icon1.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off); + icon1.addFile(QStringLiteral(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off); downButton->setIcon(icon1); hboxLayout->addWidget(downButton); removeButton = new QToolButton(LanguagesDialog); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); removeButton->setEnabled(false); QIcon icon2; - icon2.addFile(QString::fromUtf8(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off); + icon2.addFile(QStringLiteral(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off); removeButton->setIcon(icon2); hboxLayout->addWidget(removeButton); openFileButton = new QToolButton(LanguagesDialog); - openFileButton->setObjectName(QString::fromUtf8("openFileButton")); + openFileButton->setObjectName(QStringLiteral("openFileButton")); openFileButton->setEnabled(true); QIcon icon3; - icon3.addFile(QString::fromUtf8(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off); + icon3.addFile(QStringLiteral(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off); openFileButton->setIcon(icon3); hboxLayout->addWidget(openFileButton); @@ -94,7 +94,7 @@ public: hboxLayout->addItem(spacerItem); okButton = new QPushButton(LanguagesDialog); - okButton->setObjectName(QString::fromUtf8("okButton")); + okButton->setObjectName(QStringLiteral("okButton")); hboxLayout->addWidget(okButton); diff --git a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h index 1cca34b1fa..5ea1c43458 100644 --- a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h @@ -96,7 +96,7 @@ public: void setupUi(QDialog *qdesigner_internal__ListWidgetEditor) { if (qdesigner_internal__ListWidgetEditor->objectName().isEmpty()) - qdesigner_internal__ListWidgetEditor->setObjectName(QString::fromUtf8("qdesigner_internal__ListWidgetEditor")); + qdesigner_internal__ListWidgetEditor->setObjectName(QStringLiteral("qdesigner_internal__ListWidgetEditor")); qdesigner_internal__ListWidgetEditor->resize(223, 245); vboxLayout = new QVBoxLayout(qdesigner_internal__ListWidgetEditor); #ifndef Q_OS_MAC @@ -105,25 +105,25 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(qdesigner_internal__ListWidgetEditor); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); listWidget = new QListWidget(groupBox); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); gridLayout->addWidget(listWidget, 0, 0, 1, 1); horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); newItemButton = new QToolButton(groupBox); - newItemButton->setObjectName(QString::fromUtf8("newItemButton")); + newItemButton->setObjectName(QStringLiteral("newItemButton")); horizontalLayout_2->addWidget(newItemButton); deleteItemButton = new QToolButton(groupBox); - deleteItemButton->setObjectName(QString::fromUtf8("deleteItemButton")); + deleteItemButton->setObjectName(QStringLiteral("deleteItemButton")); horizontalLayout_2->addWidget(deleteItemButton); @@ -132,12 +132,12 @@ public: horizontalLayout_2->addItem(spacerItem); moveItemUpButton = new QToolButton(groupBox); - moveItemUpButton->setObjectName(QString::fromUtf8("moveItemUpButton")); + moveItemUpButton->setObjectName(QStringLiteral("moveItemUpButton")); horizontalLayout_2->addWidget(moveItemUpButton); moveItemDownButton = new QToolButton(groupBox); - moveItemDownButton->setObjectName(QString::fromUtf8("moveItemDownButton")); + moveItemDownButton->setObjectName(QStringLiteral("moveItemDownButton")); horizontalLayout_2->addWidget(moveItemDownButton); @@ -145,14 +145,14 @@ public: gridLayout->addLayout(horizontalLayout_2, 1, 0, 1, 1); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); horizontalLayout->addWidget(label); itemIconSelector = new qdesigner_internal::IconSelector(groupBox); - itemIconSelector->setObjectName(QString::fromUtf8("itemIconSelector")); + itemIconSelector->setObjectName(QStringLiteral("itemIconSelector")); horizontalLayout->addWidget(itemIconSelector); @@ -167,7 +167,7 @@ public: vboxLayout->addWidget(groupBox); buttonBox = new QDialogButtonBox(qdesigner_internal__ListWidgetEditor); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/mainwindow.ui.h b/tests/auto/tools/uic/baseline/mainwindow.ui.h index ef6f4cfe9c..4e336a4262 100644 --- a/tests/auto/tools/uic/baseline/mainwindow.ui.h +++ b/tests/auto/tools/uic/baseline/mainwindow.ui.h @@ -89,14 +89,14 @@ public: void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(829, 813); actionAdd_Custom_Font = new QAction(MainWindow); - actionAdd_Custom_Font->setObjectName(QString::fromUtf8("actionAdd_Custom_Font")); + actionAdd_Custom_Font->setObjectName(QStringLiteral("actionAdd_Custom_Font")); action_Exit = new QAction(MainWindow); - action_Exit->setObjectName(QString::fromUtf8("action_Exit")); + action_Exit->setObjectName(QStringLiteral("action_Exit")); centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); vboxLayout = new QVBoxLayout(centralwidget); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -104,9 +104,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(centralwidget); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); hboxLayout = new QHBoxLayout(groupBox); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -114,40 +114,40 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout->addWidget(label); fontComboBox = new QFontComboBox(groupBox); - fontComboBox->setObjectName(QString::fromUtf8("fontComboBox")); + fontComboBox->setObjectName(QStringLiteral("fontComboBox")); hboxLayout->addWidget(fontComboBox); label_2 = new QLabel(groupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); hboxLayout->addWidget(label_2); pixelSize = new QSpinBox(groupBox); - pixelSize->setObjectName(QString::fromUtf8("pixelSize")); + pixelSize->setObjectName(QStringLiteral("pixelSize")); pixelSize->setMinimum(1); hboxLayout->addWidget(pixelSize); label_7 = new QLabel(groupBox); - label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setObjectName(QStringLiteral("label_7")); hboxLayout->addWidget(label_7); weightCombo = new QComboBox(groupBox); - weightCombo->setObjectName(QString::fromUtf8("weightCombo")); + weightCombo->setObjectName(QStringLiteral("weightCombo")); hboxLayout->addWidget(weightCombo); italic = new QCheckBox(groupBox); - italic->setObjectName(QString::fromUtf8("italic")); + italic->setObjectName(QStringLiteral("italic")); hboxLayout->addWidget(italic); @@ -159,7 +159,7 @@ public: vboxLayout->addWidget(groupBox); groupBox_2 = new QGroupBox(centralwidget); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); vboxLayout1 = new QVBoxLayout(groupBox_2); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -167,9 +167,9 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); chooseFromCodePoints = new QRadioButton(groupBox_2); - chooseFromCodePoints->setObjectName(QString::fromUtf8("chooseFromCodePoints")); + chooseFromCodePoints->setObjectName(QStringLiteral("chooseFromCodePoints")); chooseFromCodePoints->setChecked(true); vboxLayout1->addWidget(chooseFromCodePoints); @@ -179,9 +179,9 @@ public: vboxLayout2->setSpacing(6); #endif vboxLayout2->setContentsMargins(0, 0, 0, 0); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); characterRangeView = new QListWidget(groupBox_2); - characterRangeView->setObjectName(QString::fromUtf8("characterRangeView")); + characterRangeView->setObjectName(QStringLiteral("characterRangeView")); vboxLayout2->addWidget(characterRangeView); @@ -190,19 +190,19 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); selectAll = new QPushButton(groupBox_2); - selectAll->setObjectName(QString::fromUtf8("selectAll")); + selectAll->setObjectName(QStringLiteral("selectAll")); hboxLayout1->addWidget(selectAll); deselectAll = new QPushButton(groupBox_2); - deselectAll->setObjectName(QString::fromUtf8("deselectAll")); + deselectAll->setObjectName(QStringLiteral("deselectAll")); hboxLayout1->addWidget(deselectAll); invertSelection = new QPushButton(groupBox_2); - invertSelection->setObjectName(QString::fromUtf8("invertSelection")); + invertSelection->setObjectName(QStringLiteral("invertSelection")); hboxLayout1->addWidget(invertSelection); @@ -217,7 +217,7 @@ public: vboxLayout1->addLayout(vboxLayout2); chooseFromSampleFile = new QRadioButton(groupBox_2); - chooseFromSampleFile->setObjectName(QString::fromUtf8("chooseFromSampleFile")); + chooseFromSampleFile->setObjectName(QStringLiteral("chooseFromSampleFile")); vboxLayout1->addWidget(chooseFromSampleFile); @@ -226,27 +226,27 @@ public: hboxLayout2->setSpacing(6); #endif hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); label_5 = new QLabel(groupBox_2); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); label_5->setEnabled(false); hboxLayout2->addWidget(label_5); sampleFile = new QLineEdit(groupBox_2); - sampleFile->setObjectName(QString::fromUtf8("sampleFile")); + sampleFile->setObjectName(QStringLiteral("sampleFile")); sampleFile->setEnabled(false); hboxLayout2->addWidget(sampleFile); browseSampleFile = new QPushButton(groupBox_2); - browseSampleFile->setObjectName(QString::fromUtf8("browseSampleFile")); + browseSampleFile->setObjectName(QStringLiteral("browseSampleFile")); browseSampleFile->setEnabled(false); hboxLayout2->addWidget(browseSampleFile); charCount = new QLabel(groupBox_2); - charCount->setObjectName(QString::fromUtf8("charCount")); + charCount->setObjectName(QStringLiteral("charCount")); charCount->setEnabled(false); hboxLayout2->addWidget(charCount); @@ -258,7 +258,7 @@ public: vboxLayout->addWidget(groupBox_2); groupBox_3 = new QGroupBox(centralwidget); - groupBox_3->setObjectName(QString::fromUtf8("groupBox_3")); + groupBox_3->setObjectName(QStringLiteral("groupBox_3")); hboxLayout3 = new QHBoxLayout(groupBox_3); #ifndef Q_OS_MAC hboxLayout3->setSpacing(6); @@ -266,9 +266,9 @@ public: #ifndef Q_OS_MAC hboxLayout3->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); preview = new QLineEdit(groupBox_3); - preview->setObjectName(QString::fromUtf8("preview")); + preview->setObjectName(QStringLiteral("preview")); hboxLayout3->addWidget(preview); @@ -276,7 +276,7 @@ public: vboxLayout->addWidget(groupBox_3); groupBox_4 = new QGroupBox(centralwidget); - groupBox_4->setObjectName(QString::fromUtf8("groupBox_4")); + groupBox_4->setObjectName(QStringLiteral("groupBox_4")); hboxLayout4 = new QHBoxLayout(groupBox_4); #ifndef Q_OS_MAC hboxLayout4->setSpacing(6); @@ -284,29 +284,29 @@ public: #ifndef Q_OS_MAC hboxLayout4->setContentsMargins(9, 9, 9, 9); #endif - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); + hboxLayout4->setObjectName(QStringLiteral("hboxLayout4")); label_3 = new QLabel(groupBox_4); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); hboxLayout4->addWidget(label_3); path = new QLineEdit(groupBox_4); - path->setObjectName(QString::fromUtf8("path")); + path->setObjectName(QStringLiteral("path")); hboxLayout4->addWidget(path); browsePath = new QPushButton(groupBox_4); - browsePath->setObjectName(QString::fromUtf8("browsePath")); + browsePath->setObjectName(QStringLiteral("browsePath")); hboxLayout4->addWidget(browsePath); label_4 = new QLabel(groupBox_4); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); hboxLayout4->addWidget(label_4); fileName = new QLineEdit(groupBox_4); - fileName->setObjectName(QString::fromUtf8("fileName")); + fileName->setObjectName(QStringLiteral("fileName")); fileName->setEnabled(false); hboxLayout4->addWidget(fileName); @@ -319,9 +319,9 @@ public: hboxLayout5->setSpacing(6); #endif hboxLayout5->setContentsMargins(0, 0, 0, 0); - hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); + hboxLayout5->setObjectName(QStringLiteral("hboxLayout5")); generate = new QPushButton(centralwidget); - generate->setObjectName(QString::fromUtf8("generate")); + generate->setObjectName(QStringLiteral("generate")); hboxLayout5->addWidget(generate); @@ -334,13 +334,13 @@ public: MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 829, 29)); menuFile = new QMenu(menubar); - menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuFile->setObjectName(QStringLiteral("menuFile")); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); MainWindow->setStatusBar(statusbar); menubar->addAction(menuFile->menuAction()); diff --git a/tests/auto/tools/uic/baseline/mydialog.ui.h b/tests/auto/tools/uic/baseline/mydialog.ui.h index a8750d4514..ffb49e5d97 100644 --- a/tests/auto/tools/uic/baseline/mydialog.ui.h +++ b/tests/auto/tools/uic/baseline/mydialog.ui.h @@ -32,7 +32,7 @@ public: void setupUi(QDialog *MyDialog) { if (MyDialog->objectName().isEmpty()) - MyDialog->setObjectName(QString::fromUtf8("MyDialog")); + MyDialog->setObjectName(QStringLiteral("MyDialog")); MyDialog->resize(401, 70); vboxLayout = new QVBoxLayout(MyDialog); #ifndef Q_OS_MAC @@ -41,14 +41,14 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); aLabel = new QLabel(MyDialog); - aLabel->setObjectName(QString::fromUtf8("aLabel")); + aLabel->setObjectName(QStringLiteral("aLabel")); vboxLayout->addWidget(aLabel); aButton = new QPushButton(MyDialog); - aButton->setObjectName(QString::fromUtf8("aButton")); + aButton->setObjectName(QStringLiteral("aButton")); vboxLayout->addWidget(aButton); diff --git a/tests/auto/tools/uic/baseline/myform.ui.h b/tests/auto/tools/uic/baseline/myform.ui.h index a5ff7bcc11..140225abbe 100644 --- a/tests/auto/tools/uic/baseline/myform.ui.h +++ b/tests/auto/tools/uic/baseline/myform.ui.h @@ -45,35 +45,35 @@ public: void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) - Form->setObjectName(QString::fromUtf8("Form")); + Form->setObjectName(QStringLiteral("Form")); Form->resize(258, 224); vboxLayout = new QVBoxLayout(Form); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(8, 8, 8, 8); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(Form); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); radioButton_2 = new QRadioButton(groupBox); - radioButton_2->setObjectName(QString::fromUtf8("radioButton_2")); + radioButton_2->setObjectName(QStringLiteral("radioButton_2")); gridLayout->addWidget(radioButton_2, 1, 0, 1, 1); radioButton = new QRadioButton(groupBox); - radioButton->setObjectName(QString::fromUtf8("radioButton")); + radioButton->setObjectName(QStringLiteral("radioButton")); radioButton->setChecked(true); gridLayout->addWidget(radioButton, 0, 0, 1, 1); checkBox_2 = new QCheckBox(groupBox); - checkBox_2->setObjectName(QString::fromUtf8("checkBox_2")); + checkBox_2->setObjectName(QStringLiteral("checkBox_2")); checkBox_2->setChecked(true); gridLayout->addWidget(checkBox_2, 1, 1, 1, 1); @@ -83,32 +83,32 @@ public: gridLayout->addItem(spacerItem, 5, 0, 1, 1); checkBox = new QCheckBox(groupBox); - checkBox->setObjectName(QString::fromUtf8("checkBox")); + checkBox->setObjectName(QStringLiteral("checkBox")); gridLayout->addWidget(checkBox, 0, 1, 1, 1); radioButton_2_2 = new QRadioButton(groupBox); - radioButton_2_2->setObjectName(QString::fromUtf8("radioButton_2_2")); + radioButton_2_2->setObjectName(QStringLiteral("radioButton_2_2")); gridLayout->addWidget(radioButton_2_2, 2, 0, 1, 1); radioButton_3 = new QRadioButton(groupBox); - radioButton_3->setObjectName(QString::fromUtf8("radioButton_3")); + radioButton_3->setObjectName(QStringLiteral("radioButton_3")); gridLayout->addWidget(radioButton_3, 3, 0, 1, 1); radioButton_4 = new QRadioButton(groupBox); - radioButton_4->setObjectName(QString::fromUtf8("radioButton_4")); + radioButton_4->setObjectName(QStringLiteral("radioButton_4")); gridLayout->addWidget(radioButton_4, 4, 0, 1, 1); checkBox_3 = new QCheckBox(groupBox); - checkBox_3->setObjectName(QString::fromUtf8("checkBox_3")); + checkBox_3->setObjectName(QStringLiteral("checkBox_3")); gridLayout->addWidget(checkBox_3, 2, 1, 1, 1); checkBox_4 = new QCheckBox(groupBox); - checkBox_4->setObjectName(QString::fromUtf8("checkBox_4")); + checkBox_4->setObjectName(QStringLiteral("checkBox_4")); checkBox_4->setChecked(true); gridLayout->addWidget(checkBox_4, 3, 1, 1, 1); diff --git a/tests/auto/tools/uic/baseline/newactiondialog.ui.h b/tests/auto/tools/uic/baseline/newactiondialog.ui.h index b69e1581f9..5b9fef13f8 100644 --- a/tests/auto/tools/uic/baseline/newactiondialog.ui.h +++ b/tests/auto/tools/uic/baseline/newactiondialog.ui.h @@ -93,42 +93,42 @@ public: void setupUi(QDialog *qdesigner_internal__NewActionDialog) { if (qdesigner_internal__NewActionDialog->objectName().isEmpty()) - qdesigner_internal__NewActionDialog->setObjectName(QString::fromUtf8("qdesigner_internal__NewActionDialog")); + qdesigner_internal__NewActionDialog->setObjectName(QStringLiteral("qdesigner_internal__NewActionDialog")); qdesigner_internal__NewActionDialog->resize(363, 156); verticalLayout = new QVBoxLayout(qdesigner_internal__NewActionDialog); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); formLayout = new QFormLayout(); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); label = new QLabel(qdesigner_internal__NewActionDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); formLayout->setWidget(0, QFormLayout::LabelRole, label); editActionText = new QLineEdit(qdesigner_internal__NewActionDialog); - editActionText->setObjectName(QString::fromUtf8("editActionText")); + editActionText->setObjectName(QStringLiteral("editActionText")); editActionText->setMinimumSize(QSize(255, 0)); formLayout->setWidget(0, QFormLayout::FieldRole, editActionText); label_3 = new QLabel(qdesigner_internal__NewActionDialog); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); formLayout->setWidget(1, QFormLayout::LabelRole, label_3); editObjectName = new QLineEdit(qdesigner_internal__NewActionDialog); - editObjectName->setObjectName(QString::fromUtf8("editObjectName")); + editObjectName->setObjectName(QStringLiteral("editObjectName")); formLayout->setWidget(1, QFormLayout::FieldRole, editObjectName); label_2 = new QLabel(qdesigner_internal__NewActionDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); formLayout->setWidget(2, QFormLayout::LabelRole, label_2); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); iconSelector = new qdesigner_internal::IconSelector(qdesigner_internal__NewActionDialog); - iconSelector->setObjectName(QString::fromUtf8("iconSelector")); + iconSelector->setObjectName(QStringLiteral("iconSelector")); horizontalLayout->addWidget(iconSelector); @@ -147,14 +147,14 @@ public: verticalLayout->addItem(verticalSpacer); line = new QFrame(qdesigner_internal__NewActionDialog); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); verticalLayout->addWidget(line); buttonBox = new QDialogButtonBox(qdesigner_internal__NewActionDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h index f3296421b2..ba9ba5dcfd 100644 --- a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h +++ b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h @@ -46,20 +46,20 @@ public: void setupUi(QDialog *qdesigner_internal__NewDynamicPropertyDialog) { if (qdesigner_internal__NewDynamicPropertyDialog->objectName().isEmpty()) - qdesigner_internal__NewDynamicPropertyDialog->setObjectName(QString::fromUtf8("qdesigner_internal__NewDynamicPropertyDialog")); + qdesigner_internal__NewDynamicPropertyDialog->setObjectName(QStringLiteral("qdesigner_internal__NewDynamicPropertyDialog")); qdesigner_internal__NewDynamicPropertyDialog->resize(340, 118); verticalLayout = new QVBoxLayout(qdesigner_internal__NewDynamicPropertyDialog); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); formLayout = new QFormLayout(); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); m_lineEdit = new QLineEdit(qdesigner_internal__NewDynamicPropertyDialog); - m_lineEdit->setObjectName(QString::fromUtf8("m_lineEdit")); + m_lineEdit->setObjectName(QStringLiteral("m_lineEdit")); m_lineEdit->setMinimumSize(QSize(220, 0)); formLayout->setWidget(0, QFormLayout::FieldRole, m_lineEdit); label = new QLabel(qdesigner_internal__NewDynamicPropertyDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -69,9 +69,9 @@ public: formLayout->setWidget(0, QFormLayout::LabelRole, label); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); m_comboBox = new QComboBox(qdesigner_internal__NewDynamicPropertyDialog); - m_comboBox->setObjectName(QString::fromUtf8("m_comboBox")); + m_comboBox->setObjectName(QStringLiteral("m_comboBox")); horizontalLayout->addWidget(m_comboBox); @@ -83,7 +83,7 @@ public: formLayout->setLayout(1, QFormLayout::FieldRole, horizontalLayout); label_2 = new QLabel(qdesigner_internal__NewDynamicPropertyDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); sizePolicy.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth()); label_2->setSizePolicy(sizePolicy); @@ -97,7 +97,7 @@ public: verticalLayout->addItem(spacerItem); m_buttonBox = new QDialogButtonBox(qdesigner_internal__NewDynamicPropertyDialog); - m_buttonBox->setObjectName(QString::fromUtf8("m_buttonBox")); + m_buttonBox->setObjectName(QStringLiteral("m_buttonBox")); m_buttonBox->setOrientation(Qt::Horizontal); m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); m_buttonBox->setCenterButtons(false); diff --git a/tests/auto/tools/uic/baseline/newform.ui.h b/tests/auto/tools/uic/baseline/newform.ui.h index e985c3bf26..007b2680aa 100644 --- a/tests/auto/tools/uic/baseline/newform.ui.h +++ b/tests/auto/tools/uic/baseline/newform.ui.h @@ -83,7 +83,7 @@ public: void setupUi(QDialog *NewForm) { if (NewForm->objectName().isEmpty()) - NewForm->setObjectName(QString::fromUtf8("NewForm")); + NewForm->setObjectName(QStringLiteral("NewForm")); NewForm->resize(495, 319); vboxLayout = new QVBoxLayout(NewForm); #ifndef Q_OS_MAC @@ -92,15 +92,15 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(1, 1, 1, 1); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); treeWidget = new QTreeWidget(NewForm); - treeWidget->setObjectName(QString::fromUtf8("treeWidget")); + treeWidget->setObjectName(QStringLiteral("treeWidget")); treeWidget->setIconSize(QSize(128, 128)); treeWidget->setRootIsDecorated(false); treeWidget->setColumnCount(1); @@ -108,7 +108,7 @@ public: hboxLayout->addWidget(treeWidget); lblPreview = new QLabel(NewForm); - lblPreview->setObjectName(QString::fromUtf8("lblPreview")); + lblPreview->setObjectName(QStringLiteral("lblPreview")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(5)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -124,19 +124,19 @@ public: vboxLayout->addLayout(hboxLayout); horizontalLine = new QFrame(NewForm); - horizontalLine->setObjectName(QString::fromUtf8("horizontalLine")); + horizontalLine->setObjectName(QStringLiteral("horizontalLine")); horizontalLine->setFrameShape(QFrame::HLine); horizontalLine->setFrameShadow(QFrame::Sunken); vboxLayout->addWidget(horizontalLine); chkShowOnStartup = new QCheckBox(NewForm); - chkShowOnStartup->setObjectName(QString::fromUtf8("chkShowOnStartup")); + chkShowOnStartup->setObjectName(QStringLiteral("chkShowOnStartup")); vboxLayout->addWidget(chkShowOnStartup); buttonBox = new QDialogButtonBox(NewForm); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); vboxLayout->addWidget(buttonBox); diff --git a/tests/auto/tools/uic/baseline/orderdialog.ui.h b/tests/auto/tools/uic/baseline/orderdialog.ui.h index 017222da50..494f3e6894 100644 --- a/tests/auto/tools/uic/baseline/orderdialog.ui.h +++ b/tests/auto/tools/uic/baseline/orderdialog.ui.h @@ -87,18 +87,18 @@ public: void setupUi(QDialog *qdesigner_internal__OrderDialog) { if (qdesigner_internal__OrderDialog->objectName().isEmpty()) - qdesigner_internal__OrderDialog->setObjectName(QString::fromUtf8("qdesigner_internal__OrderDialog")); + qdesigner_internal__OrderDialog->setObjectName(QStringLiteral("qdesigner_internal__OrderDialog")); qdesigner_internal__OrderDialog->resize(467, 310); vboxLayout = new QVBoxLayout(qdesigner_internal__OrderDialog); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(qdesigner_internal__OrderDialog); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); hboxLayout = new QHBoxLayout(groupBox); hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); hboxLayout->setContentsMargins(9, 9, 9, 9); pageList = new QListWidget(groupBox); - pageList->setObjectName(QString::fromUtf8("pageList")); + pageList->setObjectName(QStringLiteral("pageList")); pageList->setMinimumSize(QSize(344, 0)); pageList->setDragDropMode(QAbstractItemView::InternalMove); pageList->setSelectionMode(QAbstractItemView::ContiguousSelection); @@ -108,15 +108,15 @@ public: vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(6); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); vboxLayout1->setContentsMargins(0, 0, 0, 0); upButton = new QToolButton(groupBox); - upButton->setObjectName(QString::fromUtf8("upButton")); + upButton->setObjectName(QStringLiteral("upButton")); vboxLayout1->addWidget(upButton); downButton = new QToolButton(groupBox); - downButton->setObjectName(QString::fromUtf8("downButton")); + downButton->setObjectName(QStringLiteral("downButton")); vboxLayout1->addWidget(downButton); @@ -131,7 +131,7 @@ public: vboxLayout->addWidget(groupBox); buttonBox = new QDialogButtonBox(qdesigner_internal__OrderDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset); diff --git a/tests/auto/tools/uic/baseline/outputpage.ui.h b/tests/auto/tools/uic/baseline/outputpage.ui.h index 5e8332ea93..20fbf93b17 100644 --- a/tests/auto/tools/uic/baseline/outputpage.ui.h +++ b/tests/auto/tools/uic/baseline/outputpage.ui.h @@ -37,16 +37,16 @@ public: void setupUi(QWidget *OutputPage) { if (OutputPage->objectName().isEmpty()) - OutputPage->setObjectName(QString::fromUtf8("OutputPage")); + OutputPage->setObjectName(QStringLiteral("OutputPage")); OutputPage->resize(417, 242); gridLayout = new QGridLayout(OutputPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed); gridLayout->addItem(spacerItem, 0, 1, 1, 1); label = new QLabel(OutputPage); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -56,7 +56,7 @@ public: gridLayout->addWidget(label, 1, 0, 1, 1); projectLineEdit = new QLineEdit(OutputPage); - projectLineEdit->setObjectName(QString::fromUtf8("projectLineEdit")); + projectLineEdit->setObjectName(QStringLiteral("projectLineEdit")); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -66,14 +66,14 @@ public: gridLayout->addWidget(projectLineEdit, 1, 1, 1, 1); label_2 = new QLabel(OutputPage); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); sizePolicy.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth()); label_2->setSizePolicy(sizePolicy); gridLayout->addWidget(label_2, 2, 0, 1, 1); collectionLineEdit = new QLineEdit(OutputPage); - collectionLineEdit->setObjectName(QString::fromUtf8("collectionLineEdit")); + collectionLineEdit->setObjectName(QStringLiteral("collectionLineEdit")); sizePolicy1.setHeightForWidth(collectionLineEdit->sizePolicy().hasHeightForWidth()); collectionLineEdit->setSizePolicy(sizePolicy1); diff --git a/tests/auto/tools/uic/baseline/pagefold.ui.h b/tests/auto/tools/uic/baseline/pagefold.ui.h index a58c4f4976..ede9a51d7c 100644 --- a/tests/auto/tools/uic/baseline/pagefold.ui.h +++ b/tests/auto/tools/uic/baseline/pagefold.ui.h @@ -70,18 +70,18 @@ public: void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(392, 412); exitAction = new QAction(MainWindow); - exitAction->setObjectName(QString::fromUtf8("exitAction")); + exitAction->setObjectName(QStringLiteral("exitAction")); aboutQtAction = new QAction(MainWindow); - aboutQtAction->setObjectName(QString::fromUtf8("aboutQtAction")); + aboutQtAction->setObjectName(QStringLiteral("aboutQtAction")); editStyleAction = new QAction(MainWindow); - editStyleAction->setObjectName(QString::fromUtf8("editStyleAction")); + editStyleAction->setObjectName(QStringLiteral("editStyleAction")); aboutAction = new QAction(MainWindow); - aboutAction->setObjectName(QString::fromUtf8("aboutAction")); + aboutAction->setObjectName(QStringLiteral("aboutAction")); centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); vboxLayout = new QVBoxLayout(centralwidget); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -89,9 +89,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); mainFrame = new QFrame(centralwidget); - mainFrame->setObjectName(QString::fromUtf8("mainFrame")); + mainFrame->setObjectName(QStringLiteral("mainFrame")); mainFrame->setFrameShape(QFrame::StyledPanel); mainFrame->setFrameShadow(QFrame::Raised); gridLayout = new QGridLayout(mainFrame); @@ -101,9 +101,9 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); nameCombo = new QComboBox(mainFrame); - nameCombo->setObjectName(QString::fromUtf8("nameCombo")); + nameCombo->setObjectName(QStringLiteral("nameCombo")); nameCombo->setEditable(true); gridLayout->addWidget(nameCombo, 0, 1, 1, 3); @@ -113,56 +113,56 @@ public: gridLayout->addItem(spacerItem, 1, 3, 1, 1); femaleRadioButton = new QRadioButton(mainFrame); - femaleRadioButton->setObjectName(QString::fromUtf8("femaleRadioButton")); + femaleRadioButton->setObjectName(QStringLiteral("femaleRadioButton")); gridLayout->addWidget(femaleRadioButton, 1, 2, 1, 1); genderLabel = new QLabel(mainFrame); - genderLabel->setObjectName(QString::fromUtf8("genderLabel")); + genderLabel->setObjectName(QStringLiteral("genderLabel")); gridLayout->addWidget(genderLabel, 1, 0, 1, 1); ageLabel = new QLabel(mainFrame); - ageLabel->setObjectName(QString::fromUtf8("ageLabel")); + ageLabel->setObjectName(QStringLiteral("ageLabel")); gridLayout->addWidget(ageLabel, 2, 0, 1, 1); maleRadioButton = new QRadioButton(mainFrame); - maleRadioButton->setObjectName(QString::fromUtf8("maleRadioButton")); + maleRadioButton->setObjectName(QStringLiteral("maleRadioButton")); gridLayout->addWidget(maleRadioButton, 1, 1, 1, 1); nameLabel = new QLabel(mainFrame); - nameLabel->setObjectName(QString::fromUtf8("nameLabel")); + nameLabel->setObjectName(QStringLiteral("nameLabel")); gridLayout->addWidget(nameLabel, 0, 0, 1, 1); passwordLabel = new QLabel(mainFrame); - passwordLabel->setObjectName(QString::fromUtf8("passwordLabel")); + passwordLabel->setObjectName(QStringLiteral("passwordLabel")); gridLayout->addWidget(passwordLabel, 3, 0, 1, 1); ageSpinBox = new QSpinBox(mainFrame); - ageSpinBox->setObjectName(QString::fromUtf8("ageSpinBox")); + ageSpinBox->setObjectName(QStringLiteral("ageSpinBox")); ageSpinBox->setMinimum(12); ageSpinBox->setValue(22); gridLayout->addWidget(ageSpinBox, 2, 1, 1, 3); buttonBox = new QDialogButtonBox(mainFrame); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 7, 2, 1, 2); agreeCheckBox = new QCheckBox(mainFrame); - agreeCheckBox->setObjectName(QString::fromUtf8("agreeCheckBox")); + agreeCheckBox->setObjectName(QStringLiteral("agreeCheckBox")); gridLayout->addWidget(agreeCheckBox, 6, 0, 1, 4); passwordEdit = new QLineEdit(mainFrame); - passwordEdit->setObjectName(QString::fromUtf8("passwordEdit")); + passwordEdit->setObjectName(QStringLiteral("passwordEdit")); passwordEdit->setEchoMode(QLineEdit::Password); gridLayout->addWidget(passwordEdit, 3, 1, 1, 3); @@ -171,22 +171,22 @@ public: new QListWidgetItem(professionList); new QListWidgetItem(professionList); new QListWidgetItem(professionList); - professionList->setObjectName(QString::fromUtf8("professionList")); + professionList->setObjectName(QStringLiteral("professionList")); gridLayout->addWidget(professionList, 5, 1, 1, 3); label = new QLabel(mainFrame); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 5, 0, 1, 1); countryCombo = new QComboBox(mainFrame); - countryCombo->setObjectName(QString::fromUtf8("countryCombo")); + countryCombo->setObjectName(QStringLiteral("countryCombo")); gridLayout->addWidget(countryCombo, 4, 1, 1, 3); countryLabel = new QLabel(mainFrame); - countryLabel->setObjectName(QString::fromUtf8("countryLabel")); + countryLabel->setObjectName(QStringLiteral("countryLabel")); gridLayout->addWidget(countryLabel, 4, 0, 1, 1); @@ -195,15 +195,15 @@ public: MainWindow->setCentralWidget(centralwidget); menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 392, 25)); menu_File = new QMenu(menubar); - menu_File->setObjectName(QString::fromUtf8("menu_File")); + menu_File->setObjectName(QStringLiteral("menu_File")); menu_Help = new QMenu(menubar); - menu_Help->setObjectName(QString::fromUtf8("menu_Help")); + menu_Help->setObjectName(QStringLiteral("menu_Help")); MainWindow->setMenuBar(menubar); statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); MainWindow->setStatusBar(statusbar); #ifndef QT_NO_SHORTCUT ageLabel->setBuddy(ageSpinBox); diff --git a/tests/auto/tools/uic/baseline/paletteeditor.ui.h b/tests/auto/tools/uic/baseline/paletteeditor.ui.h index de57468b9d..67f74c1546 100644 --- a/tests/auto/tools/uic/baseline/paletteeditor.ui.h +++ b/tests/auto/tools/uic/baseline/paletteeditor.ui.h @@ -95,7 +95,7 @@ public: void setupUi(QDialog *qdesigner_internal__PaletteEditor) { if (qdesigner_internal__PaletteEditor->objectName().isEmpty()) - qdesigner_internal__PaletteEditor->setObjectName(QString::fromUtf8("qdesigner_internal__PaletteEditor")); + qdesigner_internal__PaletteEditor->setObjectName(QStringLiteral("qdesigner_internal__PaletteEditor")); qdesigner_internal__PaletteEditor->resize(365, 409); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7)); sizePolicy.setHorizontalStretch(0); @@ -109,9 +109,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); advancedBox = new QGroupBox(qdesigner_internal__PaletteEditor); - advancedBox->setObjectName(QString::fromUtf8("advancedBox")); + advancedBox->setObjectName(QStringLiteral("advancedBox")); advancedBox->setMinimumSize(QSize(0, 0)); advancedBox->setMaximumSize(QSize(16777215, 16777215)); gridLayout = new QGridLayout(advancedBox); @@ -121,9 +121,9 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); buildButton = new QtColorButton(advancedBox); - buildButton->setObjectName(QString::fromUtf8("buildButton")); + buildButton->setObjectName(QStringLiteral("buildButton")); QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(13)); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -133,24 +133,24 @@ public: gridLayout->addWidget(buildButton, 0, 1, 1, 1); paletteView = new QTreeView(advancedBox); - paletteView->setObjectName(QString::fromUtf8("paletteView")); + paletteView->setObjectName(QStringLiteral("paletteView")); paletteView->setMinimumSize(QSize(0, 200)); gridLayout->addWidget(paletteView, 1, 0, 1, 4); detailsRadio = new QRadioButton(advancedBox); - detailsRadio->setObjectName(QString::fromUtf8("detailsRadio")); + detailsRadio->setObjectName(QStringLiteral("detailsRadio")); gridLayout->addWidget(detailsRadio, 0, 3, 1, 1); computeRadio = new QRadioButton(advancedBox); - computeRadio->setObjectName(QString::fromUtf8("computeRadio")); + computeRadio->setObjectName(QStringLiteral("computeRadio")); computeRadio->setChecked(true); gridLayout->addWidget(computeRadio, 0, 2, 1, 1); label = new QLabel(advancedBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); @@ -158,7 +158,7 @@ public: vboxLayout->addWidget(advancedBox); GroupBox126 = new QGroupBox(qdesigner_internal__PaletteEditor); - GroupBox126->setObjectName(QString::fromUtf8("GroupBox126")); + GroupBox126->setObjectName(QStringLiteral("GroupBox126")); QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(7)); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -169,25 +169,25 @@ public: gridLayout1->setSpacing(6); #endif gridLayout1->setContentsMargins(8, 8, 8, 8); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); disabledRadio = new QRadioButton(GroupBox126); - disabledRadio->setObjectName(QString::fromUtf8("disabledRadio")); + disabledRadio->setObjectName(QStringLiteral("disabledRadio")); gridLayout1->addWidget(disabledRadio, 0, 2, 1, 1); inactiveRadio = new QRadioButton(GroupBox126); - inactiveRadio->setObjectName(QString::fromUtf8("inactiveRadio")); + inactiveRadio->setObjectName(QStringLiteral("inactiveRadio")); gridLayout1->addWidget(inactiveRadio, 0, 1, 1, 1); activeRadio = new QRadioButton(GroupBox126); - activeRadio->setObjectName(QString::fromUtf8("activeRadio")); + activeRadio->setObjectName(QStringLiteral("activeRadio")); activeRadio->setChecked(true); gridLayout1->addWidget(activeRadio, 0, 0, 1, 1); previewFrame = new qdesigner_internal::PreviewFrame(GroupBox126); - previewFrame->setObjectName(QString::fromUtf8("previewFrame")); + previewFrame->setObjectName(QStringLiteral("previewFrame")); sizePolicy.setHeightForWidth(previewFrame->sizePolicy().hasHeightForWidth()); previewFrame->setSizePolicy(sizePolicy); @@ -197,7 +197,7 @@ public: vboxLayout->addWidget(GroupBox126); buttonBox = new QDialogButtonBox(qdesigner_internal__PaletteEditor); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/passworddialog.ui.h b/tests/auto/tools/uic/baseline/passworddialog.ui.h index f6579dac7b..be763cf040 100644 --- a/tests/auto/tools/uic/baseline/passworddialog.ui.h +++ b/tests/auto/tools/uic/baseline/passworddialog.ui.h @@ -40,19 +40,19 @@ public: void setupUi(QDialog *PasswordDialog) { if (PasswordDialog->objectName().isEmpty()) - PasswordDialog->setObjectName(QString::fromUtf8("PasswordDialog")); + PasswordDialog->setObjectName(QStringLiteral("PasswordDialog")); PasswordDialog->resize(399, 148); gridLayout = new QGridLayout(PasswordDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); iconLabel = new QLabel(PasswordDialog); - iconLabel->setObjectName(QString::fromUtf8("iconLabel")); + iconLabel->setObjectName(QStringLiteral("iconLabel")); hboxLayout->addWidget(iconLabel); introLabel = new QLabel(PasswordDialog); - introLabel->setObjectName(QString::fromUtf8("introLabel")); + introLabel->setObjectName(QStringLiteral("introLabel")); QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -65,28 +65,28 @@ public: gridLayout->addLayout(hboxLayout, 0, 0, 1, 2); label = new QLabel(PasswordDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 1, 0, 1, 1); userNameLineEdit = new QLineEdit(PasswordDialog); - userNameLineEdit->setObjectName(QString::fromUtf8("userNameLineEdit")); + userNameLineEdit->setObjectName(QStringLiteral("userNameLineEdit")); gridLayout->addWidget(userNameLineEdit, 1, 1, 1, 1); lblPassword = new QLabel(PasswordDialog); - lblPassword->setObjectName(QString::fromUtf8("lblPassword")); + lblPassword->setObjectName(QStringLiteral("lblPassword")); gridLayout->addWidget(lblPassword, 2, 0, 1, 1); passwordLineEdit = new QLineEdit(PasswordDialog); - passwordLineEdit->setObjectName(QString::fromUtf8("passwordLineEdit")); + passwordLineEdit->setObjectName(QStringLiteral("passwordLineEdit")); passwordLineEdit->setEchoMode(QLineEdit::Password); gridLayout->addWidget(passwordLineEdit, 2, 1, 1, 1); buttonBox = new QDialogButtonBox(PasswordDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/pathpage.ui.h b/tests/auto/tools/uic/baseline/pathpage.ui.h index 5edca08fac..8d75297ff4 100644 --- a/tests/auto/tools/uic/baseline/pathpage.ui.h +++ b/tests/auto/tools/uic/baseline/pathpage.ui.h @@ -42,12 +42,12 @@ public: void setupUi(QWidget *PathPage) { if (PathPage->objectName().isEmpty()) - PathPage->setObjectName(QString::fromUtf8("PathPage")); + PathPage->setObjectName(QStringLiteral("PathPage")); PathPage->resize(417, 243); gridLayout = new QGridLayout(PathPage); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label_2 = new QLabel(PathPage); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -57,7 +57,7 @@ public: gridLayout->addWidget(label_2, 0, 0, 1, 1); filterLineEdit = new QLineEdit(PathPage); - filterLineEdit->setObjectName(QString::fromUtf8("filterLineEdit")); + filterLineEdit->setObjectName(QStringLiteral("filterLineEdit")); gridLayout->addWidget(filterLineEdit, 0, 1, 1, 2); @@ -66,17 +66,17 @@ public: gridLayout->addItem(spacerItem, 1, 1, 1, 1); label = new QLabel(PathPage); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 2, 0, 1, 3); pathListWidget = new QListWidget(PathPage); - pathListWidget->setObjectName(QString::fromUtf8("pathListWidget")); + pathListWidget->setObjectName(QStringLiteral("pathListWidget")); gridLayout->addWidget(pathListWidget, 3, 0, 3, 3); addButton = new QPushButton(PathPage); - addButton->setObjectName(QString::fromUtf8("addButton")); + addButton->setObjectName(QStringLiteral("addButton")); QSizePolicy sizePolicy1(QSizePolicy::Maximum, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -86,7 +86,7 @@ public: gridLayout->addWidget(addButton, 3, 3, 1, 1); removeButton = new QPushButton(PathPage); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); sizePolicy1.setHeightForWidth(removeButton->sizePolicy().hasHeightForWidth()); removeButton->setSizePolicy(sizePolicy1); diff --git a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h index ad7f916f56..ecc7190ff1 100644 --- a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h +++ b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h @@ -93,45 +93,45 @@ public: void setupUi(QDialog *PhraseBookBox) { if (PhraseBookBox->objectName().isEmpty()) - PhraseBookBox->setObjectName(QString::fromUtf8("PhraseBookBox")); + PhraseBookBox->setObjectName(QStringLiteral("PhraseBookBox")); PhraseBookBox->resize(596, 454); unnamed = new QHBoxLayout(PhraseBookBox); unnamed->setSpacing(6); unnamed->setContentsMargins(11, 11, 11, 11); - unnamed->setObjectName(QString::fromUtf8("unnamed")); + unnamed->setObjectName(QStringLiteral("unnamed")); inputsLayout = new QVBoxLayout(); inputsLayout->setSpacing(6); - inputsLayout->setObjectName(QString::fromUtf8("inputsLayout")); + inputsLayout->setObjectName(QStringLiteral("inputsLayout")); gridLayout = new QGridLayout(); gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); target = new QLabel(PhraseBookBox); - target->setObjectName(QString::fromUtf8("target")); + target->setObjectName(QStringLiteral("target")); gridLayout->addWidget(target, 1, 0, 1, 1); targetLed = new QLineEdit(PhraseBookBox); - targetLed->setObjectName(QString::fromUtf8("targetLed")); + targetLed->setObjectName(QStringLiteral("targetLed")); gridLayout->addWidget(targetLed, 1, 1, 1, 1); source = new QLabel(PhraseBookBox); - source->setObjectName(QString::fromUtf8("source")); + source->setObjectName(QStringLiteral("source")); gridLayout->addWidget(source, 0, 0, 1, 1); definitionLed = new QLineEdit(PhraseBookBox); - definitionLed->setObjectName(QString::fromUtf8("definitionLed")); + definitionLed->setObjectName(QStringLiteral("definitionLed")); gridLayout->addWidget(definitionLed, 2, 1, 1, 1); sourceLed = new QLineEdit(PhraseBookBox); - sourceLed->setObjectName(QString::fromUtf8("sourceLed")); + sourceLed->setObjectName(QStringLiteral("sourceLed")); gridLayout->addWidget(sourceLed, 0, 1, 1, 1); definition = new QLabel(PhraseBookBox); - definition->setObjectName(QString::fromUtf8("definition")); + definition->setObjectName(QStringLiteral("definition")); gridLayout->addWidget(definition, 2, 0, 1, 1); @@ -139,7 +139,7 @@ public: inputsLayout->addLayout(gridLayout); phraseList = new QTreeView(PhraseBookBox); - phraseList->setObjectName(QString::fromUtf8("phraseList")); + phraseList->setObjectName(QStringLiteral("phraseList")); phraseList->setRootIsDecorated(false); phraseList->setUniformRowHeights(true); phraseList->setItemsExpandable(false); @@ -153,24 +153,24 @@ public: buttonLayout = new QVBoxLayout(); buttonLayout->setSpacing(6); - buttonLayout->setObjectName(QString::fromUtf8("buttonLayout")); + buttonLayout->setObjectName(QStringLiteral("buttonLayout")); newBut = new QPushButton(PhraseBookBox); - newBut->setObjectName(QString::fromUtf8("newBut")); + newBut->setObjectName(QStringLiteral("newBut")); buttonLayout->addWidget(newBut); removeBut = new QPushButton(PhraseBookBox); - removeBut->setObjectName(QString::fromUtf8("removeBut")); + removeBut->setObjectName(QStringLiteral("removeBut")); buttonLayout->addWidget(removeBut); saveBut = new QPushButton(PhraseBookBox); - saveBut->setObjectName(QString::fromUtf8("saveBut")); + saveBut->setObjectName(QStringLiteral("saveBut")); buttonLayout->addWidget(saveBut); closeBut = new QPushButton(PhraseBookBox); - closeBut->setObjectName(QString::fromUtf8("closeBut")); + closeBut->setObjectName(QStringLiteral("closeBut")); buttonLayout->addWidget(closeBut); diff --git a/tests/auto/tools/uic/baseline/plugindialog.ui.h b/tests/auto/tools/uic/baseline/plugindialog.ui.h index 24453cb47c..770bb82b55 100644 --- a/tests/auto/tools/uic/baseline/plugindialog.ui.h +++ b/tests/auto/tools/uic/baseline/plugindialog.ui.h @@ -80,39 +80,39 @@ public: void setupUi(QDialog *PluginDialog) { if (PluginDialog->objectName().isEmpty()) - PluginDialog->setObjectName(QString::fromUtf8("PluginDialog")); + PluginDialog->setObjectName(QStringLiteral("PluginDialog")); PluginDialog->resize(401, 331); vboxLayout = new QVBoxLayout(PluginDialog); vboxLayout->setSpacing(6); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(8, 8, 8, 8); label = new QLabel(PluginDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setWordWrap(true); vboxLayout->addWidget(label); treeWidget = new QTreeWidget(PluginDialog); - treeWidget->setObjectName(QString::fromUtf8("treeWidget")); + treeWidget->setObjectName(QStringLiteral("treeWidget")); treeWidget->setTextElideMode(Qt::ElideNone); vboxLayout->addWidget(treeWidget); message = new QLabel(PluginDialog); - message->setObjectName(QString::fromUtf8("message")); + message->setObjectName(QStringLiteral("message")); message->setWordWrap(true); vboxLayout->addWidget(message); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); hboxLayout->setContentsMargins(0, 0, 0, 0); vboxLayout->addLayout(hboxLayout); buttonBox = new QDialogButtonBox(PluginDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Close); diff --git a/tests/auto/tools/uic/baseline/preferencesdialog.ui.h b/tests/auto/tools/uic/baseline/preferencesdialog.ui.h index 65ecc359b4..287ccd730d 100644 --- a/tests/auto/tools/uic/baseline/preferencesdialog.ui.h +++ b/tests/auto/tools/uic/baseline/preferencesdialog.ui.h @@ -57,21 +57,21 @@ public: void setupUi(QDialog *PreferencesDialog) { if (PreferencesDialog->objectName().isEmpty()) - PreferencesDialog->setObjectName(QString::fromUtf8("PreferencesDialog")); + PreferencesDialog->setObjectName(QStringLiteral("PreferencesDialog")); PreferencesDialog->resize(455, 359); PreferencesDialog->setModal(true); vboxLayout = new QVBoxLayout(PreferencesDialog); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); vboxLayout1 = new QVBoxLayout(); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); m_uiModeGroupBox = new QGroupBox(PreferencesDialog); - m_uiModeGroupBox->setObjectName(QString::fromUtf8("m_uiModeGroupBox")); + m_uiModeGroupBox->setObjectName(QStringLiteral("m_uiModeGroupBox")); vboxLayout2 = new QVBoxLayout(m_uiModeGroupBox); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); m_uiModeCombo = new QComboBox(m_uiModeGroupBox); - m_uiModeCombo->setObjectName(QString::fromUtf8("m_uiModeCombo")); + m_uiModeCombo->setObjectName(QStringLiteral("m_uiModeCombo")); vboxLayout2->addWidget(m_uiModeCombo); @@ -79,12 +79,12 @@ public: vboxLayout1->addWidget(m_uiModeGroupBox); m_fontPanel = new FontPanel(PreferencesDialog); - m_fontPanel->setObjectName(QString::fromUtf8("m_fontPanel")); + m_fontPanel->setObjectName(QStringLiteral("m_fontPanel")); vboxLayout1->addWidget(m_fontPanel); m_previewConfigurationWidget = new qdesigner_internal::PreviewConfigurationWidget(PreferencesDialog); - m_previewConfigurationWidget->setObjectName(QString::fromUtf8("m_previewConfigurationWidget")); + m_previewConfigurationWidget->setObjectName(QStringLiteral("m_previewConfigurationWidget")); vboxLayout1->addWidget(m_previewConfigurationWidget); @@ -92,23 +92,23 @@ public: hboxLayout->addLayout(vboxLayout1); vboxLayout3 = new QVBoxLayout(); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); + vboxLayout3->setObjectName(QStringLiteral("vboxLayout3")); m_templatePathGroupBox = new QGroupBox(PreferencesDialog); - m_templatePathGroupBox->setObjectName(QString::fromUtf8("m_templatePathGroupBox")); + m_templatePathGroupBox->setObjectName(QStringLiteral("m_templatePathGroupBox")); gridLayout = new QGridLayout(m_templatePathGroupBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); m_templatePathListWidget = new QListWidget(m_templatePathGroupBox); - m_templatePathListWidget->setObjectName(QString::fromUtf8("m_templatePathListWidget")); + m_templatePathListWidget->setObjectName(QStringLiteral("m_templatePathListWidget")); gridLayout->addWidget(m_templatePathListWidget, 0, 0, 1, 3); m_addTemplatePathButton = new QToolButton(m_templatePathGroupBox); - m_addTemplatePathButton->setObjectName(QString::fromUtf8("m_addTemplatePathButton")); + m_addTemplatePathButton->setObjectName(QStringLiteral("m_addTemplatePathButton")); gridLayout->addWidget(m_addTemplatePathButton, 1, 0, 1, 1); m_removeTemplatePathButton = new QToolButton(m_templatePathGroupBox); - m_removeTemplatePathButton->setObjectName(QString::fromUtf8("m_removeTemplatePathButton")); + m_removeTemplatePathButton->setObjectName(QStringLiteral("m_removeTemplatePathButton")); gridLayout->addWidget(m_removeTemplatePathButton, 1, 1, 1, 1); @@ -120,7 +120,7 @@ public: vboxLayout3->addWidget(m_templatePathGroupBox); m_gridPanel = new qdesigner_internal::GridPanel(PreferencesDialog); - m_gridPanel->setObjectName(QString::fromUtf8("m_gridPanel")); + m_gridPanel->setObjectName(QStringLiteral("m_gridPanel")); vboxLayout3->addWidget(m_gridPanel); @@ -131,14 +131,14 @@ public: vboxLayout->addLayout(hboxLayout); line = new QFrame(PreferencesDialog); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); vboxLayout->addWidget(line); m_dialogButtonBox = new QDialogButtonBox(PreferencesDialog); - m_dialogButtonBox->setObjectName(QString::fromUtf8("m_dialogButtonBox")); + m_dialogButtonBox->setObjectName(QStringLiteral("m_dialogButtonBox")); m_dialogButtonBox->setOrientation(Qt::Horizontal); m_dialogButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h b/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h index 3392d6f220..1bdf1a049b 100644 --- a/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h +++ b/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h @@ -44,40 +44,40 @@ public: void setupUi(QGroupBox *PreviewConfigurationWidget) { if (PreviewConfigurationWidget->objectName().isEmpty()) - PreviewConfigurationWidget->setObjectName(QString::fromUtf8("PreviewConfigurationWidget")); + PreviewConfigurationWidget->setObjectName(QStringLiteral("PreviewConfigurationWidget")); PreviewConfigurationWidget->setCheckable(true); formLayout = new QFormLayout(PreviewConfigurationWidget); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); m_styleLabel = new QLabel(PreviewConfigurationWidget); - m_styleLabel->setObjectName(QString::fromUtf8("m_styleLabel")); + m_styleLabel->setObjectName(QStringLiteral("m_styleLabel")); formLayout->setWidget(0, QFormLayout::LabelRole, m_styleLabel); m_styleCombo = new QComboBox(PreviewConfigurationWidget); - m_styleCombo->setObjectName(QString::fromUtf8("m_styleCombo")); + m_styleCombo->setObjectName(QStringLiteral("m_styleCombo")); formLayout->setWidget(0, QFormLayout::FieldRole, m_styleCombo); m_appStyleSheetLabel = new QLabel(PreviewConfigurationWidget); - m_appStyleSheetLabel->setObjectName(QString::fromUtf8("m_appStyleSheetLabel")); + m_appStyleSheetLabel->setObjectName(QStringLiteral("m_appStyleSheetLabel")); formLayout->setWidget(1, QFormLayout::LabelRole, m_appStyleSheetLabel); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); m_appStyleSheetLineEdit = new qdesigner_internal::TextPropertyEditor(PreviewConfigurationWidget); - m_appStyleSheetLineEdit->setObjectName(QString::fromUtf8("m_appStyleSheetLineEdit")); + m_appStyleSheetLineEdit->setObjectName(QStringLiteral("m_appStyleSheetLineEdit")); m_appStyleSheetLineEdit->setMinimumSize(QSize(149, 0)); hboxLayout->addWidget(m_appStyleSheetLineEdit); m_appStyleSheetChangeButton = new QToolButton(PreviewConfigurationWidget); - m_appStyleSheetChangeButton->setObjectName(QString::fromUtf8("m_appStyleSheetChangeButton")); + m_appStyleSheetChangeButton->setObjectName(QStringLiteral("m_appStyleSheetChangeButton")); hboxLayout->addWidget(m_appStyleSheetChangeButton); m_appStyleSheetClearButton = new QToolButton(PreviewConfigurationWidget); - m_appStyleSheetClearButton->setObjectName(QString::fromUtf8("m_appStyleSheetClearButton")); + m_appStyleSheetClearButton->setObjectName(QStringLiteral("m_appStyleSheetClearButton")); hboxLayout->addWidget(m_appStyleSheetClearButton); @@ -85,19 +85,19 @@ public: formLayout->setLayout(1, QFormLayout::FieldRole, hboxLayout); m_skinLabel = new QLabel(PreviewConfigurationWidget); - m_skinLabel->setObjectName(QString::fromUtf8("m_skinLabel")); + m_skinLabel->setObjectName(QStringLiteral("m_skinLabel")); formLayout->setWidget(2, QFormLayout::LabelRole, m_skinLabel); hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); m_skinCombo = new QComboBox(PreviewConfigurationWidget); - m_skinCombo->setObjectName(QString::fromUtf8("m_skinCombo")); + m_skinCombo->setObjectName(QStringLiteral("m_skinCombo")); hboxLayout1->addWidget(m_skinCombo); m_skinRemoveButton = new QToolButton(PreviewConfigurationWidget); - m_skinRemoveButton->setObjectName(QString::fromUtf8("m_skinRemoveButton")); + m_skinRemoveButton->setObjectName(QStringLiteral("m_skinRemoveButton")); hboxLayout1->addWidget(m_skinRemoveButton); diff --git a/tests/auto/tools/uic/baseline/previewdialogbase.ui.h b/tests/auto/tools/uic/baseline/previewdialogbase.ui.h index 43cd278d55..c577324b5e 100644 --- a/tests/auto/tools/uic/baseline/previewdialogbase.ui.h +++ b/tests/auto/tools/uic/baseline/previewdialogbase.ui.h @@ -48,7 +48,7 @@ public: void setupUi(QDialog *PreviewDialogBase) { if (PreviewDialogBase->objectName().isEmpty()) - PreviewDialogBase->setObjectName(QString::fromUtf8("PreviewDialogBase")); + PreviewDialogBase->setObjectName(QStringLiteral("PreviewDialogBase")); PreviewDialogBase->resize(733, 479); vboxLayout = new QVBoxLayout(PreviewDialogBase); #ifndef Q_OS_MAC @@ -57,7 +57,7 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -65,14 +65,14 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); label = new QLabel(PreviewDialogBase); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout->addWidget(label); paperSizeCombo = new QComboBox(PreviewDialogBase); - paperSizeCombo->setObjectName(QString::fromUtf8("paperSizeCombo")); + paperSizeCombo->setObjectName(QStringLiteral("paperSizeCombo")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -82,12 +82,12 @@ public: hboxLayout->addWidget(paperSizeCombo); label_2 = new QLabel(PreviewDialogBase); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); hboxLayout->addWidget(label_2); paperOrientationCombo = new QComboBox(PreviewDialogBase); - paperOrientationCombo->setObjectName(QString::fromUtf8("paperOrientationCombo")); + paperOrientationCombo->setObjectName(QStringLiteral("paperOrientationCombo")); sizePolicy.setHeightForWidth(paperOrientationCombo->sizePolicy().hasHeightForWidth()); paperOrientationCombo->setSizePolicy(sizePolicy); @@ -105,9 +105,9 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); pageList = new QTreeWidget(PreviewDialogBase); - pageList->setObjectName(QString::fromUtf8("pageList")); + pageList->setObjectName(QStringLiteral("pageList")); pageList->setIndentation(0); pageList->setRootIsDecorated(false); pageList->setUniformRowHeights(true); @@ -117,7 +117,7 @@ public: hboxLayout1->addWidget(pageList); previewArea = new QScrollArea(PreviewDialogBase); - previewArea->setObjectName(QString::fromUtf8("previewArea")); + previewArea->setObjectName(QStringLiteral("previewArea")); QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5)); sizePolicy1.setHorizontalStretch(1); sizePolicy1.setVerticalStretch(0); @@ -134,9 +134,9 @@ public: hboxLayout2->setSpacing(6); #endif hboxLayout2->setContentsMargins(0, 0, 0, 0); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); progressBar = new QProgressBar(PreviewDialogBase); - progressBar->setObjectName(QString::fromUtf8("progressBar")); + progressBar->setObjectName(QStringLiteral("progressBar")); progressBar->setEnabled(false); QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(0)); sizePolicy2.setHorizontalStretch(1); @@ -150,7 +150,7 @@ public: hboxLayout2->addWidget(progressBar); buttonBox = new QDialogButtonBox(PreviewDialogBase); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/previewwidget.ui.h b/tests/auto/tools/uic/baseline/previewwidget.ui.h index 9fd79688f2..9997353ac8 100644 --- a/tests/auto/tools/uic/baseline/previewwidget.ui.h +++ b/tests/auto/tools/uic/baseline/previewwidget.ui.h @@ -107,7 +107,7 @@ public: void setupUi(QWidget *qdesigner_internal__PreviewWidget) { if (qdesigner_internal__PreviewWidget->objectName().isEmpty()) - qdesigner_internal__PreviewWidget->setObjectName(QString::fromUtf8("qdesigner_internal__PreviewWidget")); + qdesigner_internal__PreviewWidget->setObjectName(QStringLiteral("qdesigner_internal__PreviewWidget")); qdesigner_internal__PreviewWidget->resize(471, 251); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(1)); sizePolicy.setHorizontalStretch(0); @@ -121,7 +121,7 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); vboxLayout = new QVBoxLayout(); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -129,14 +129,14 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(0, 0, 0, 0); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); LineEdit1 = new QLineEdit(qdesigner_internal__PreviewWidget); - LineEdit1->setObjectName(QString::fromUtf8("LineEdit1")); + LineEdit1->setObjectName(QStringLiteral("LineEdit1")); vboxLayout->addWidget(LineEdit1); ComboBox1 = new QComboBox(qdesigner_internal__PreviewWidget); - ComboBox1->setObjectName(QString::fromUtf8("ComboBox1")); + ComboBox1->setObjectName(QStringLiteral("ComboBox1")); vboxLayout->addWidget(ComboBox1); @@ -145,14 +145,14 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); SpinBox1 = new QSpinBox(qdesigner_internal__PreviewWidget); - SpinBox1->setObjectName(QString::fromUtf8("SpinBox1")); + SpinBox1->setObjectName(QStringLiteral("SpinBox1")); hboxLayout->addWidget(SpinBox1); PushButton1 = new QPushButton(qdesigner_internal__PreviewWidget); - PushButton1->setObjectName(QString::fromUtf8("PushButton1")); + PushButton1->setObjectName(QStringLiteral("PushButton1")); hboxLayout->addWidget(PushButton1); @@ -160,19 +160,19 @@ public: vboxLayout->addLayout(hboxLayout); ScrollBar1 = new QScrollBar(qdesigner_internal__PreviewWidget); - ScrollBar1->setObjectName(QString::fromUtf8("ScrollBar1")); + ScrollBar1->setObjectName(QStringLiteral("ScrollBar1")); ScrollBar1->setOrientation(Qt::Horizontal); vboxLayout->addWidget(ScrollBar1); Slider1 = new QSlider(qdesigner_internal__PreviewWidget); - Slider1->setObjectName(QString::fromUtf8("Slider1")); + Slider1->setObjectName(QStringLiteral("Slider1")); Slider1->setOrientation(Qt::Horizontal); vboxLayout->addWidget(Slider1); listWidget = new QListWidget(qdesigner_internal__PreviewWidget); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); listWidget->setMaximumSize(QSize(32767, 50)); vboxLayout->addWidget(listWidget); @@ -185,13 +185,13 @@ public: gridLayout->addItem(spacerItem, 3, 0, 1, 2); ProgressBar1 = new QProgressBar(qdesigner_internal__PreviewWidget); - ProgressBar1->setObjectName(QString::fromUtf8("ProgressBar1")); + ProgressBar1->setObjectName(QStringLiteral("ProgressBar1")); ProgressBar1->setOrientation(Qt::Horizontal); gridLayout->addWidget(ProgressBar1, 2, 0, 1, 1); ButtonGroup2 = new QGroupBox(qdesigner_internal__PreviewWidget); - ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2")); + ButtonGroup2->setObjectName(QStringLiteral("ButtonGroup2")); vboxLayout1 = new QVBoxLayout(ButtonGroup2); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -199,15 +199,15 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); CheckBox1 = new QCheckBox(ButtonGroup2); - CheckBox1->setObjectName(QString::fromUtf8("CheckBox1")); + CheckBox1->setObjectName(QStringLiteral("CheckBox1")); CheckBox1->setChecked(true); vboxLayout1->addWidget(CheckBox1); CheckBox2 = new QCheckBox(ButtonGroup2); - CheckBox2->setObjectName(QString::fromUtf8("CheckBox2")); + CheckBox2->setObjectName(QStringLiteral("CheckBox2")); vboxLayout1->addWidget(CheckBox2); @@ -215,7 +215,7 @@ public: gridLayout->addWidget(ButtonGroup2, 1, 0, 1, 1); ButtonGroup1 = new QGroupBox(qdesigner_internal__PreviewWidget); - ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1")); + ButtonGroup1->setObjectName(QStringLiteral("ButtonGroup1")); vboxLayout2 = new QVBoxLayout(ButtonGroup1); #ifndef Q_OS_MAC vboxLayout2->setSpacing(6); @@ -223,20 +223,20 @@ public: #ifndef Q_OS_MAC vboxLayout2->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); RadioButton1 = new QRadioButton(ButtonGroup1); - RadioButton1->setObjectName(QString::fromUtf8("RadioButton1")); + RadioButton1->setObjectName(QStringLiteral("RadioButton1")); RadioButton1->setChecked(true); vboxLayout2->addWidget(RadioButton1); RadioButton2 = new QRadioButton(ButtonGroup1); - RadioButton2->setObjectName(QString::fromUtf8("RadioButton2")); + RadioButton2->setObjectName(QStringLiteral("RadioButton2")); vboxLayout2->addWidget(RadioButton2); RadioButton3 = new QRadioButton(ButtonGroup1); - RadioButton3->setObjectName(QString::fromUtf8("RadioButton3")); + RadioButton3->setObjectName(QStringLiteral("RadioButton3")); vboxLayout2->addWidget(RadioButton3); diff --git a/tests/auto/tools/uic/baseline/proxy.ui.h b/tests/auto/tools/uic/baseline/proxy.ui.h index 592f1a91e3..9be6b97b81 100644 --- a/tests/auto/tools/uic/baseline/proxy.ui.h +++ b/tests/auto/tools/uic/baseline/proxy.ui.h @@ -38,44 +38,44 @@ public: void setupUi(QDialog *ProxyDialog) { if (ProxyDialog->objectName().isEmpty()) - ProxyDialog->setObjectName(QString::fromUtf8("ProxyDialog")); + ProxyDialog->setObjectName(QStringLiteral("ProxyDialog")); ProxyDialog->resize(369, 144); gridLayout = new QGridLayout(ProxyDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); iconLabel = new QLabel(ProxyDialog); - iconLabel->setObjectName(QString::fromUtf8("iconLabel")); + iconLabel->setObjectName(QStringLiteral("iconLabel")); gridLayout->addWidget(iconLabel, 0, 0, 1, 1); introLabel = new QLabel(ProxyDialog); - introLabel->setObjectName(QString::fromUtf8("introLabel")); + introLabel->setObjectName(QStringLiteral("introLabel")); introLabel->setWordWrap(true); gridLayout->addWidget(introLabel, 0, 1, 1, 2); usernameLabel = new QLabel(ProxyDialog); - usernameLabel->setObjectName(QString::fromUtf8("usernameLabel")); + usernameLabel->setObjectName(QStringLiteral("usernameLabel")); gridLayout->addWidget(usernameLabel, 1, 0, 1, 2); userNameLineEdit = new QLineEdit(ProxyDialog); - userNameLineEdit->setObjectName(QString::fromUtf8("userNameLineEdit")); + userNameLineEdit->setObjectName(QStringLiteral("userNameLineEdit")); gridLayout->addWidget(userNameLineEdit, 1, 2, 1, 1); passwordLabel = new QLabel(ProxyDialog); - passwordLabel->setObjectName(QString::fromUtf8("passwordLabel")); + passwordLabel->setObjectName(QStringLiteral("passwordLabel")); gridLayout->addWidget(passwordLabel, 2, 0, 1, 2); passwordLineEdit = new QLineEdit(ProxyDialog); - passwordLineEdit->setObjectName(QString::fromUtf8("passwordLineEdit")); + passwordLineEdit->setObjectName(QStringLiteral("passwordLineEdit")); passwordLineEdit->setEchoMode(QLineEdit::Password); gridLayout->addWidget(passwordLineEdit, 2, 2, 1, 1); buttonBox = new QDialogButtonBox(ProxyDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/qfiledialog.ui.h b/tests/auto/tools/uic/baseline/qfiledialog.ui.h index 62030018cb..848e07db97 100644 --- a/tests/auto/tools/uic/baseline/qfiledialog.ui.h +++ b/tests/auto/tools/uic/baseline/qfiledialog.ui.h @@ -108,20 +108,20 @@ public: void setupUi(QDialog *QFileDialog) { if (QFileDialog->objectName().isEmpty()) - QFileDialog->setObjectName(QString::fromUtf8("QFileDialog")); + QFileDialog->setObjectName(QStringLiteral("QFileDialog")); QFileDialog->resize(521, 316); QFileDialog->setSizeGripEnabled(true); gridLayout = new QGridLayout(QFileDialog); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); lookInLabel = new QLabel(QFileDialog); - lookInLabel->setObjectName(QString::fromUtf8("lookInLabel")); + lookInLabel->setObjectName(QStringLiteral("lookInLabel")); gridLayout->addWidget(lookInLabel, 0, 0, 1, 1); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); lookInCombo = new QFileDialogComboBox(QFileDialog); - lookInCombo->setObjectName(QString::fromUtf8("lookInCombo")); + lookInCombo->setObjectName(QStringLiteral("lookInCombo")); QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(1); sizePolicy.setVerticalStretch(0); @@ -132,32 +132,32 @@ public: hboxLayout->addWidget(lookInCombo); backButton = new QToolButton(QFileDialog); - backButton->setObjectName(QString::fromUtf8("backButton")); + backButton->setObjectName(QStringLiteral("backButton")); hboxLayout->addWidget(backButton); forwardButton = new QToolButton(QFileDialog); - forwardButton->setObjectName(QString::fromUtf8("forwardButton")); + forwardButton->setObjectName(QStringLiteral("forwardButton")); hboxLayout->addWidget(forwardButton); toParentButton = new QToolButton(QFileDialog); - toParentButton->setObjectName(QString::fromUtf8("toParentButton")); + toParentButton->setObjectName(QStringLiteral("toParentButton")); hboxLayout->addWidget(toParentButton); newFolderButton = new QToolButton(QFileDialog); - newFolderButton->setObjectName(QString::fromUtf8("newFolderButton")); + newFolderButton->setObjectName(QStringLiteral("newFolderButton")); hboxLayout->addWidget(newFolderButton); listModeButton = new QToolButton(QFileDialog); - listModeButton->setObjectName(QString::fromUtf8("listModeButton")); + listModeButton->setObjectName(QStringLiteral("listModeButton")); hboxLayout->addWidget(listModeButton); detailModeButton = new QToolButton(QFileDialog); - detailModeButton->setObjectName(QString::fromUtf8("detailModeButton")); + detailModeButton->setObjectName(QStringLiteral("detailModeButton")); hboxLayout->addWidget(detailModeButton); @@ -165,7 +165,7 @@ public: gridLayout->addLayout(hboxLayout, 0, 1, 1, 2); splitter = new QSplitter(QFileDialog); - splitter->setObjectName(QString::fromUtf8("splitter")); + splitter->setObjectName(QStringLiteral("splitter")); QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -173,38 +173,38 @@ public: splitter->setSizePolicy(sizePolicy1); splitter->setOrientation(Qt::Horizontal); sidebar = new QSidebar(splitter); - sidebar->setObjectName(QString::fromUtf8("sidebar")); + sidebar->setObjectName(QStringLiteral("sidebar")); splitter->addWidget(sidebar); frame = new QFrame(splitter); - frame->setObjectName(QString::fromUtf8("frame")); + frame->setObjectName(QStringLiteral("frame")); frame->setFrameShape(QFrame::NoFrame); frame->setFrameShadow(QFrame::Raised); vboxLayout = new QVBoxLayout(frame); vboxLayout->setSpacing(0); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); stackedWidget = new QStackedWidget(frame); - stackedWidget->setObjectName(QString::fromUtf8("stackedWidget")); + stackedWidget->setObjectName(QStringLiteral("stackedWidget")); page = new QWidget(); - page->setObjectName(QString::fromUtf8("page")); + page->setObjectName(QStringLiteral("page")); vboxLayout1 = new QVBoxLayout(page); vboxLayout1->setSpacing(0); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); vboxLayout1->setContentsMargins(0, 0, 0, 0); listView = new QFileDialogListView(page); - listView->setObjectName(QString::fromUtf8("listView")); + listView->setObjectName(QStringLiteral("listView")); vboxLayout1->addWidget(listView); stackedWidget->addWidget(page); page_2 = new QWidget(); - page_2->setObjectName(QString::fromUtf8("page_2")); + page_2->setObjectName(QStringLiteral("page_2")); vboxLayout2 = new QVBoxLayout(page_2); vboxLayout2->setSpacing(0); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); vboxLayout2->setContentsMargins(0, 0, 0, 0); treeView = new QFileDialogTreeView(page_2); - treeView->setObjectName(QString::fromUtf8("treeView")); + treeView->setObjectName(QStringLiteral("treeView")); vboxLayout2->addWidget(treeView); @@ -217,7 +217,7 @@ public: gridLayout->addWidget(splitter, 1, 0, 1, 3); fileNameLabel = new QLabel(QFileDialog); - fileNameLabel->setObjectName(QString::fromUtf8("fileNameLabel")); + fileNameLabel->setObjectName(QStringLiteral("fileNameLabel")); QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); @@ -228,7 +228,7 @@ public: gridLayout->addWidget(fileNameLabel, 2, 0, 1, 1); fileNameEdit = new QFileDialogLineEdit(QFileDialog); - fileNameEdit->setObjectName(QString::fromUtf8("fileNameEdit")); + fileNameEdit->setObjectName(QStringLiteral("fileNameEdit")); QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy3.setHorizontalStretch(1); sizePolicy3.setVerticalStretch(0); @@ -238,14 +238,14 @@ public: gridLayout->addWidget(fileNameEdit, 2, 1, 1, 1); buttonBox = new QDialogButtonBox(QFileDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Vertical); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); gridLayout->addWidget(buttonBox, 2, 2, 2, 1); fileTypeLabel = new QLabel(QFileDialog); - fileTypeLabel->setObjectName(QString::fromUtf8("fileTypeLabel")); + fileTypeLabel->setObjectName(QStringLiteral("fileTypeLabel")); QSizePolicy sizePolicy4(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy4.setHorizontalStretch(0); sizePolicy4.setVerticalStretch(0); @@ -255,7 +255,7 @@ public: gridLayout->addWidget(fileTypeLabel, 3, 0, 1, 1); fileTypeCombo = new QComboBox(QFileDialog); - fileTypeCombo->setObjectName(QString::fromUtf8("fileTypeCombo")); + fileTypeCombo->setObjectName(QStringLiteral("fileTypeCombo")); QSizePolicy sizePolicy5(QSizePolicy::Expanding, QSizePolicy::Fixed); sizePolicy5.setHorizontalStretch(0); sizePolicy5.setVerticalStretch(0); diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h index 8e0cc0a82a..5a14eafc90 100644 --- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h +++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h @@ -73,15 +73,15 @@ public: void setupUi(QWidget *QPageSetupWidget) { if (QPageSetupWidget->objectName().isEmpty()) - QPageSetupWidget->setObjectName(QString::fromUtf8("QPageSetupWidget")); + QPageSetupWidget->setObjectName(QStringLiteral("QPageSetupWidget")); QPageSetupWidget->resize(416, 488); gridLayout_3 = new QGridLayout(QPageSetupWidget); gridLayout_3->setContentsMargins(0, 0, 0, 0); - gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); + horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); unit = new QComboBox(QPageSetupWidget); - unit->setObjectName(QString::fromUtf8("unit")); + unit->setObjectName(QStringLiteral("unit")); horizontalLayout_4->addWidget(unit); @@ -93,39 +93,39 @@ public: gridLayout_3->addLayout(horizontalLayout_4, 0, 0, 1, 2); groupBox_2 = new QGroupBox(QPageSetupWidget); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); gridLayout_2 = new QGridLayout(groupBox_2); - gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); pageSizeLabel = new QLabel(groupBox_2); - pageSizeLabel->setObjectName(QString::fromUtf8("pageSizeLabel")); + pageSizeLabel->setObjectName(QStringLiteral("pageSizeLabel")); gridLayout_2->addWidget(pageSizeLabel, 0, 0, 1, 1); paperSize = new QComboBox(groupBox_2); - paperSize->setObjectName(QString::fromUtf8("paperSize")); + paperSize->setObjectName(QStringLiteral("paperSize")); gridLayout_2->addWidget(paperSize, 0, 1, 1, 1); widthLabel = new QLabel(groupBox_2); - widthLabel->setObjectName(QString::fromUtf8("widthLabel")); + widthLabel->setObjectName(QStringLiteral("widthLabel")); gridLayout_2->addWidget(widthLabel, 1, 0, 1, 1); horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); + horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); paperWidth = new QDoubleSpinBox(groupBox_2); - paperWidth->setObjectName(QString::fromUtf8("paperWidth")); + paperWidth->setObjectName(QStringLiteral("paperWidth")); paperWidth->setMaximum(9999.99); horizontalLayout_3->addWidget(paperWidth); heightLabel = new QLabel(groupBox_2); - heightLabel->setObjectName(QString::fromUtf8("heightLabel")); + heightLabel->setObjectName(QStringLiteral("heightLabel")); horizontalLayout_3->addWidget(heightLabel); paperHeight = new QDoubleSpinBox(groupBox_2); - paperHeight->setObjectName(QString::fromUtf8("paperHeight")); + paperHeight->setObjectName(QStringLiteral("paperHeight")); paperHeight->setMaximum(9999.99); horizontalLayout_3->addWidget(paperHeight); @@ -134,12 +134,12 @@ public: gridLayout_2->addLayout(horizontalLayout_3, 1, 1, 1, 1); paperSourceLabel = new QLabel(groupBox_2); - paperSourceLabel->setObjectName(QString::fromUtf8("paperSourceLabel")); + paperSourceLabel->setObjectName(QStringLiteral("paperSourceLabel")); gridLayout_2->addWidget(paperSourceLabel, 2, 0, 1, 1); paperSource = new QComboBox(groupBox_2); - paperSource->setObjectName(QString::fromUtf8("paperSource")); + paperSource->setObjectName(QStringLiteral("paperSource")); gridLayout_2->addWidget(paperSource, 2, 1, 1, 1); @@ -151,27 +151,27 @@ public: gridLayout_3->addWidget(groupBox_2, 1, 0, 1, 2); groupBox_3 = new QGroupBox(QPageSetupWidget); - groupBox_3->setObjectName(QString::fromUtf8("groupBox_3")); + groupBox_3->setObjectName(QStringLiteral("groupBox_3")); verticalLayout = new QVBoxLayout(groupBox_3); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); portrait = new QRadioButton(groupBox_3); - portrait->setObjectName(QString::fromUtf8("portrait")); + portrait->setObjectName(QStringLiteral("portrait")); portrait->setChecked(true); verticalLayout->addWidget(portrait); landscape = new QRadioButton(groupBox_3); - landscape->setObjectName(QString::fromUtf8("landscape")); + landscape->setObjectName(QStringLiteral("landscape")); verticalLayout->addWidget(landscape); reverseLandscape = new QRadioButton(groupBox_3); - reverseLandscape->setObjectName(QString::fromUtf8("reverseLandscape")); + reverseLandscape->setObjectName(QStringLiteral("reverseLandscape")); verticalLayout->addWidget(reverseLandscape); reversePortrait = new QRadioButton(groupBox_3); - reversePortrait->setObjectName(QString::fromUtf8("reversePortrait")); + reversePortrait->setObjectName(QStringLiteral("reversePortrait")); verticalLayout->addWidget(reversePortrait); @@ -183,31 +183,31 @@ public: gridLayout_3->addWidget(groupBox_3, 2, 0, 1, 1); preview = new QWidget(QPageSetupWidget); - preview->setObjectName(QString::fromUtf8("preview")); + preview->setObjectName(QStringLiteral("preview")); gridLayout_3->addWidget(preview, 2, 1, 2, 1); groupBox = new QGroupBox(QPageSetupWidget); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); horizontalLayout_2 = new QHBoxLayout(groupBox); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); gridLayout = new QGridLayout(); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); topMargin = new QDoubleSpinBox(groupBox); - topMargin->setObjectName(QString::fromUtf8("topMargin")); + topMargin->setObjectName(QStringLiteral("topMargin")); topMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); topMargin->setMaximum(999.99); gridLayout->addWidget(topMargin, 0, 1, 1, 1); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); horizontalSpacer_7 = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addItem(horizontalSpacer_7); leftMargin = new QDoubleSpinBox(groupBox); - leftMargin->setObjectName(QString::fromUtf8("leftMargin")); + leftMargin->setObjectName(QStringLiteral("leftMargin")); leftMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); leftMargin->setMaximum(999.99); @@ -218,7 +218,7 @@ public: horizontalLayout->addItem(horizontalSpacer); rightMargin = new QDoubleSpinBox(groupBox); - rightMargin->setObjectName(QString::fromUtf8("rightMargin")); + rightMargin->setObjectName(QStringLiteral("rightMargin")); rightMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); rightMargin->setMaximum(999.99); @@ -232,7 +232,7 @@ public: gridLayout->addLayout(horizontalLayout, 1, 0, 1, 3); bottomMargin = new QDoubleSpinBox(groupBox); - bottomMargin->setObjectName(QString::fromUtf8("bottomMargin")); + bottomMargin->setObjectName(QStringLiteral("bottomMargin")); bottomMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); bottomMargin->setMaximum(999.99); diff --git a/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h b/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h index dd9b68f1c4..5cf337e75e 100644 --- a/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h +++ b/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h @@ -39,30 +39,30 @@ public: void setupUi(QWidget *QPrintPropertiesWidget) { if (QPrintPropertiesWidget->objectName().isEmpty()) - QPrintPropertiesWidget->setObjectName(QString::fromUtf8("QPrintPropertiesWidget")); + QPrintPropertiesWidget->setObjectName(QStringLiteral("QPrintPropertiesWidget")); QPrintPropertiesWidget->resize(396, 288); verticalLayout_4 = new QVBoxLayout(QPrintPropertiesWidget); verticalLayout_4->setContentsMargins(0, 0, 0, 0); - verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4")); + verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4")); tabs = new QTabWidget(QPrintPropertiesWidget); - tabs->setObjectName(QString::fromUtf8("tabs")); + tabs->setObjectName(QStringLiteral("tabs")); tabPage = new QWidget(); - tabPage->setObjectName(QString::fromUtf8("tabPage")); + tabPage->setObjectName(QStringLiteral("tabPage")); tabPage->setGeometry(QRect(0, 0, 392, 261)); horizontalLayout = new QHBoxLayout(tabPage); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); pageSetup = new QPageSetupWidget(tabPage); - pageSetup->setObjectName(QString::fromUtf8("pageSetup")); + pageSetup->setObjectName(QStringLiteral("pageSetup")); horizontalLayout->addWidget(pageSetup); tabs->addTab(tabPage, QString()); cupsPropertiesPage = new QWidget(); - cupsPropertiesPage->setObjectName(QString::fromUtf8("cupsPropertiesPage")); + cupsPropertiesPage->setObjectName(QStringLiteral("cupsPropertiesPage")); horizontalLayout_2 = new QHBoxLayout(cupsPropertiesPage); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); treeView = new QTreeView(cupsPropertiesPage); - treeView->setObjectName(QString::fromUtf8("treeView")); + treeView->setObjectName(QStringLiteral("treeView")); treeView->setAlternatingRowColors(true); horizontalLayout_2->addWidget(treeView); diff --git a/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h b/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h index 2051c8b04d..b10e44725b 100644 --- a/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h +++ b/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h @@ -74,20 +74,20 @@ public: void setupUi(QWidget *QPrintSettingsOutput) { if (QPrintSettingsOutput->objectName().isEmpty()) - QPrintSettingsOutput->setObjectName(QString::fromUtf8("QPrintSettingsOutput")); + QPrintSettingsOutput->setObjectName(QStringLiteral("QPrintSettingsOutput")); QPrintSettingsOutput->resize(416, 166); horizontalLayout_2 = new QHBoxLayout(QPrintSettingsOutput); horizontalLayout_2->setContentsMargins(0, 0, 0, 0); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); tabs = new QTabWidget(QPrintSettingsOutput); - tabs->setObjectName(QString::fromUtf8("tabs")); + tabs->setObjectName(QStringLiteral("tabs")); copiesTab = new QWidget(); - copiesTab->setObjectName(QString::fromUtf8("copiesTab")); + copiesTab->setObjectName(QStringLiteral("copiesTab")); copiesTab->setGeometry(QRect(0, 0, 412, 139)); horizontalLayout = new QHBoxLayout(copiesTab); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); gbPrintRange = new QGroupBox(copiesTab); - gbPrintRange->setObjectName(QString::fromUtf8("gbPrintRange")); + gbPrintRange->setObjectName(QStringLiteral("gbPrintRange")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -96,9 +96,9 @@ public: _3 = new QVBoxLayout(gbPrintRange); _3->setSpacing(4); _3->setContentsMargins(6, 6, 6, 6); - _3->setObjectName(QString::fromUtf8("_3")); + _3->setObjectName(QStringLiteral("_3")); printAll = new QRadioButton(gbPrintRange); - printAll->setObjectName(QString::fromUtf8("printAll")); + printAll->setObjectName(QStringLiteral("printAll")); printAll->setChecked(true); _3->addWidget(printAll); @@ -108,14 +108,14 @@ public: _4->setSpacing(6); #endif _4->setContentsMargins(0, 0, 0, 0); - _4->setObjectName(QString::fromUtf8("_4")); + _4->setObjectName(QStringLiteral("_4")); printRange = new QRadioButton(gbPrintRange); - printRange->setObjectName(QString::fromUtf8("printRange")); + printRange->setObjectName(QStringLiteral("printRange")); _4->addWidget(printRange); from = new QSpinBox(gbPrintRange); - from->setObjectName(QString::fromUtf8("from")); + from->setObjectName(QStringLiteral("from")); from->setEnabled(false); from->setMinimum(1); from->setMaximum(999); @@ -123,12 +123,12 @@ public: _4->addWidget(from); label_3 = new QLabel(gbPrintRange); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); _4->addWidget(label_3); to = new QSpinBox(gbPrintRange); - to->setObjectName(QString::fromUtf8("to")); + to->setObjectName(QStringLiteral("to")); to->setEnabled(false); to->setMinimum(1); to->setMaximum(999); @@ -143,7 +143,7 @@ public: _3->addLayout(_4); printSelection = new QRadioButton(gbPrintRange); - printSelection->setObjectName(QString::fromUtf8("printSelection")); + printSelection->setObjectName(QStringLiteral("printSelection")); _3->addWidget(printSelection); @@ -155,16 +155,16 @@ public: horizontalLayout->addWidget(gbPrintRange); groupBox = new QGroupBox(copiesTab); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); copies = new QSpinBox(groupBox); - copies->setObjectName(QString::fromUtf8("copies")); + copies->setObjectName(QStringLiteral("copies")); copies->setMinimum(1); copies->setMaximum(999); @@ -175,12 +175,12 @@ public: gridLayout->addItem(horizontalSpacer, 0, 3, 1, 1); collate = new QCheckBox(groupBox); - collate->setObjectName(QString::fromUtf8("collate")); + collate->setObjectName(QStringLiteral("collate")); gridLayout->addWidget(collate, 1, 0, 1, 2); outputIcon = new QLabel(groupBox); - outputIcon->setObjectName(QString::fromUtf8("outputIcon")); + outputIcon->setObjectName(QStringLiteral("outputIcon")); QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Ignored); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -190,7 +190,7 @@ public: gridLayout->addWidget(outputIcon, 1, 2, 2, 2); reverse = new QCheckBox(groupBox); - reverse->setObjectName(QString::fromUtf8("reverse")); + reverse->setObjectName(QStringLiteral("reverse")); gridLayout->addWidget(reverse, 2, 0, 1, 2); @@ -203,30 +203,30 @@ public: tabs->addTab(copiesTab, QString()); optionsTab = new QWidget(); - optionsTab->setObjectName(QString::fromUtf8("optionsTab")); + optionsTab->setObjectName(QStringLiteral("optionsTab")); optionsTab->setGeometry(QRect(0, 0, 412, 139)); gridLayout_2 = new QGridLayout(optionsTab); - gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); colorMode = new QGroupBox(optionsTab); - colorMode->setObjectName(QString::fromUtf8("colorMode")); + colorMode->setObjectName(QStringLiteral("colorMode")); gridLayout_4 = new QGridLayout(colorMode); - gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); verticalSpacer_6 = new QSpacerItem(1, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); gridLayout_4->addItem(verticalSpacer_6, 2, 0, 1, 1); color = new QRadioButton(colorMode); - color->setObjectName(QString::fromUtf8("color")); + color->setObjectName(QStringLiteral("color")); gridLayout_4->addWidget(color, 0, 0, 1, 1); colorIcon = new QLabel(colorMode); - colorIcon->setObjectName(QString::fromUtf8("colorIcon")); + colorIcon->setObjectName(QStringLiteral("colorIcon")); gridLayout_4->addWidget(colorIcon, 0, 1, 3, 1); grayscale = new QRadioButton(colorMode); - grayscale->setObjectName(QString::fromUtf8("grayscale")); + grayscale->setObjectName(QStringLiteral("grayscale")); gridLayout_4->addWidget(grayscale, 1, 0, 1, 1); @@ -234,22 +234,22 @@ public: gridLayout_2->addWidget(colorMode, 0, 1, 1, 1); duplex = new QGroupBox(optionsTab); - duplex->setObjectName(QString::fromUtf8("duplex")); + duplex->setObjectName(QStringLiteral("duplex")); verticalLayout = new QVBoxLayout(duplex); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); noDuplex = new QRadioButton(duplex); - noDuplex->setObjectName(QString::fromUtf8("noDuplex")); + noDuplex->setObjectName(QStringLiteral("noDuplex")); noDuplex->setChecked(true); verticalLayout->addWidget(noDuplex); duplexLong = new QRadioButton(duplex); - duplexLong->setObjectName(QString::fromUtf8("duplexLong")); + duplexLong->setObjectName(QStringLiteral("duplexLong")); verticalLayout->addWidget(duplexLong); duplexShort = new QRadioButton(duplex); - duplexShort->setObjectName(QString::fromUtf8("duplexShort")); + duplexShort->setObjectName(QStringLiteral("duplexShort")); verticalLayout->addWidget(duplexShort); diff --git a/tests/auto/tools/uic/baseline/qprintwidget.ui.h b/tests/auto/tools/uic/baseline/qprintwidget.ui.h index 6389b61fc2..206556cb1b 100644 --- a/tests/auto/tools/uic/baseline/qprintwidget.ui.h +++ b/tests/auto/tools/uic/baseline/qprintwidget.ui.h @@ -50,22 +50,22 @@ public: void setupUi(QWidget *QPrintWidget) { if (QPrintWidget->objectName().isEmpty()) - QPrintWidget->setObjectName(QString::fromUtf8("QPrintWidget")); + QPrintWidget->setObjectName(QStringLiteral("QPrintWidget")); QPrintWidget->resize(443, 175); horizontalLayout_2 = new QHBoxLayout(QPrintWidget); horizontalLayout_2->setContentsMargins(0, 0, 0, 0); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); printerGroup = new QGroupBox(QPrintWidget); - printerGroup->setObjectName(QString::fromUtf8("printerGroup")); + printerGroup->setObjectName(QStringLiteral("printerGroup")); gridLayout = new QGridLayout(printerGroup); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(printerGroup); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); printers = new QComboBox(printerGroup); - printers->setObjectName(QString::fromUtf8("printers")); + printers->setObjectName(QStringLiteral("printers")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(3); sizePolicy.setVerticalStretch(0); @@ -75,7 +75,7 @@ public: gridLayout->addWidget(printers, 0, 1, 1, 1); properties = new QPushButton(printerGroup); - properties->setObjectName(QString::fromUtf8("properties")); + properties->setObjectName(QStringLiteral("properties")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(1); sizePolicy1.setVerticalStretch(0); @@ -85,44 +85,44 @@ public: gridLayout->addWidget(properties, 0, 2, 1, 1); label_2 = new QLabel(printerGroup); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 1, 0, 1, 1); location = new QLabel(printerGroup); - location->setObjectName(QString::fromUtf8("location")); + location->setObjectName(QStringLiteral("location")); gridLayout->addWidget(location, 1, 1, 1, 1); preview = new QCheckBox(printerGroup); - preview->setObjectName(QString::fromUtf8("preview")); + preview->setObjectName(QStringLiteral("preview")); gridLayout->addWidget(preview, 1, 2, 1, 1); label_3 = new QLabel(printerGroup); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout->addWidget(label_3, 2, 0, 1, 1); type = new QLabel(printerGroup); - type->setObjectName(QString::fromUtf8("type")); + type->setObjectName(QStringLiteral("type")); gridLayout->addWidget(type, 2, 1, 1, 1); lOutput = new QLabel(printerGroup); - lOutput->setObjectName(QString::fromUtf8("lOutput")); + lOutput->setObjectName(QStringLiteral("lOutput")); gridLayout->addWidget(lOutput, 3, 0, 1, 1); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); filename = new QLineEdit(printerGroup); - filename->setObjectName(QString::fromUtf8("filename")); + filename->setObjectName(QStringLiteral("filename")); horizontalLayout->addWidget(filename); fileBrowser = new QToolButton(printerGroup); - fileBrowser->setObjectName(QString::fromUtf8("fileBrowser")); + fileBrowser->setObjectName(QStringLiteral("fileBrowser")); horizontalLayout->addWidget(fileBrowser); diff --git a/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h b/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h index f784785ce0..ea957f16c8 100644 --- a/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h +++ b/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h @@ -59,44 +59,44 @@ public: void setupUi(QDialog *QSqlConnectionDialogUi) { if (QSqlConnectionDialogUi->objectName().isEmpty()) - QSqlConnectionDialogUi->setObjectName(QString::fromUtf8("QSqlConnectionDialogUi")); + QSqlConnectionDialogUi->setObjectName(QStringLiteral("QSqlConnectionDialogUi")); QSqlConnectionDialogUi->resize(315, 302); vboxLayout = new QVBoxLayout(QSqlConnectionDialogUi); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(8, 8, 8, 8); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); connGroupBox = new QGroupBox(QSqlConnectionDialogUi); - connGroupBox->setObjectName(QString::fromUtf8("connGroupBox")); + connGroupBox->setObjectName(QStringLiteral("connGroupBox")); gridLayout = new QGridLayout(connGroupBox); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); comboDriver = new QComboBox(connGroupBox); - comboDriver->setObjectName(QString::fromUtf8("comboDriver")); + comboDriver->setObjectName(QStringLiteral("comboDriver")); gridLayout->addWidget(comboDriver, 0, 1, 1, 1); textLabel4 = new QLabel(connGroupBox); - textLabel4->setObjectName(QString::fromUtf8("textLabel4")); + textLabel4->setObjectName(QStringLiteral("textLabel4")); gridLayout->addWidget(textLabel4, 2, 0, 1, 1); textLabel2 = new QLabel(connGroupBox); - textLabel2->setObjectName(QString::fromUtf8("textLabel2")); + textLabel2->setObjectName(QStringLiteral("textLabel2")); gridLayout->addWidget(textLabel2, 0, 0, 1, 1); editDatabase = new QLineEdit(connGroupBox); - editDatabase->setObjectName(QString::fromUtf8("editDatabase")); + editDatabase->setObjectName(QStringLiteral("editDatabase")); gridLayout->addWidget(editDatabase, 1, 1, 1, 1); portSpinBox = new QSpinBox(connGroupBox); - portSpinBox->setObjectName(QString::fromUtf8("portSpinBox")); + portSpinBox->setObjectName(QStringLiteral("portSpinBox")); portSpinBox->setMaximum(65535); portSpinBox->setMinimum(-1); portSpinBox->setValue(-1); @@ -104,38 +104,38 @@ public: gridLayout->addWidget(portSpinBox, 5, 1, 1, 1); textLabel3 = new QLabel(connGroupBox); - textLabel3->setObjectName(QString::fromUtf8("textLabel3")); + textLabel3->setObjectName(QStringLiteral("textLabel3")); gridLayout->addWidget(textLabel3, 1, 0, 1, 1); editPassword = new QLineEdit(connGroupBox); - editPassword->setObjectName(QString::fromUtf8("editPassword")); + editPassword->setObjectName(QStringLiteral("editPassword")); editPassword->setEchoMode(QLineEdit::Password); gridLayout->addWidget(editPassword, 3, 1, 1, 1); editUsername = new QLineEdit(connGroupBox); - editUsername->setObjectName(QString::fromUtf8("editUsername")); + editUsername->setObjectName(QStringLiteral("editUsername")); gridLayout->addWidget(editUsername, 2, 1, 1, 1); editHostname = new QLineEdit(connGroupBox); - editHostname->setObjectName(QString::fromUtf8("editHostname")); + editHostname->setObjectName(QStringLiteral("editHostname")); gridLayout->addWidget(editHostname, 4, 1, 1, 1); textLabel5 = new QLabel(connGroupBox); - textLabel5->setObjectName(QString::fromUtf8("textLabel5")); + textLabel5->setObjectName(QStringLiteral("textLabel5")); gridLayout->addWidget(textLabel5, 4, 0, 1, 1); textLabel5_2 = new QLabel(connGroupBox); - textLabel5_2->setObjectName(QString::fromUtf8("textLabel5_2")); + textLabel5_2->setObjectName(QStringLiteral("textLabel5_2")); gridLayout->addWidget(textLabel5_2, 5, 0, 1, 1); textLabel4_2 = new QLabel(connGroupBox); - textLabel4_2->setObjectName(QString::fromUtf8("textLabel4_2")); + textLabel4_2->setObjectName(QStringLiteral("textLabel4_2")); gridLayout->addWidget(textLabel4_2, 3, 0, 1, 1); @@ -147,13 +147,13 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); dbCheckBox = new QCheckBox(QSqlConnectionDialogUi); - dbCheckBox->setObjectName(QString::fromUtf8("dbCheckBox")); + dbCheckBox->setObjectName(QStringLiteral("dbCheckBox")); hboxLayout->addWidget(dbCheckBox); @@ -165,19 +165,19 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); spacerItem1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacerItem1); okButton = new QPushButton(QSqlConnectionDialogUi); - okButton->setObjectName(QString::fromUtf8("okButton")); + okButton->setObjectName(QStringLiteral("okButton")); okButton->setDefault(true); hboxLayout1->addWidget(okButton); cancelButton = new QPushButton(QSqlConnectionDialogUi); - cancelButton->setObjectName(QString::fromUtf8("cancelButton")); + cancelButton->setObjectName(QStringLiteral("cancelButton")); hboxLayout1->addWidget(cancelButton); diff --git a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h index d9c27a769e..45660d9224 100644 --- a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h @@ -75,12 +75,12 @@ public: void setupUi(QDialog *QtGradientDialog) { if (QtGradientDialog->objectName().isEmpty()) - QtGradientDialog->setObjectName(QString::fromUtf8("QtGradientDialog")); + QtGradientDialog->setObjectName(QStringLiteral("QtGradientDialog")); QtGradientDialog->resize(178, 81); vboxLayout = new QVBoxLayout(QtGradientDialog); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); gradientEditor = new QtGradientEditor(QtGradientDialog); - gradientEditor->setObjectName(QString::fromUtf8("gradientEditor")); + gradientEditor->setObjectName(QStringLiteral("gradientEditor")); QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -90,7 +90,7 @@ public: vboxLayout->addWidget(gradientEditor); buttonBox = new QDialogButtonBox(QtGradientDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h index c344d006b5..d94670d2ff 100644 --- a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h @@ -162,10 +162,10 @@ public: void setupUi(QWidget *QtGradientEditor) { if (QtGradientEditor->objectName().isEmpty()) - QtGradientEditor->setObjectName(QString::fromUtf8("QtGradientEditor")); + QtGradientEditor->setObjectName(QStringLiteral("QtGradientEditor")); QtGradientEditor->resize(364, 518); frame = new QFrame(QtGradientEditor); - frame->setObjectName(QString::fromUtf8("frame")); + frame->setObjectName(QStringLiteral("frame")); frame->setGeometry(QRect(10, 69, 193, 150)); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); @@ -176,73 +176,73 @@ public: frame->setFrameShadow(QFrame::Raised); vboxLayout = new QVBoxLayout(frame); vboxLayout->setSpacing(6); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); gradientWidget = new QtGradientWidget(frame); - gradientWidget->setObjectName(QString::fromUtf8("gradientWidget")); + gradientWidget->setObjectName(QStringLiteral("gradientWidget")); sizePolicy.setHeightForWidth(gradientWidget->sizePolicy().hasHeightForWidth()); gradientWidget->setSizePolicy(sizePolicy); vboxLayout->addWidget(gradientWidget); label1 = new QLabel(QtGradientEditor); - label1->setObjectName(QString::fromUtf8("label1")); + label1->setObjectName(QStringLiteral("label1")); label1->setGeometry(QRect(209, 69, 64, 23)); spinBox1 = new QDoubleSpinBox(QtGradientEditor); - spinBox1->setObjectName(QString::fromUtf8("spinBox1")); + spinBox1->setObjectName(QStringLiteral("spinBox1")); spinBox1->setGeometry(QRect(279, 69, 73, 23)); spinBox1->setKeyboardTracking(false); spinBox1->setDecimals(3); spinBox1->setMaximum(1); spinBox1->setSingleStep(0.01); label2 = new QLabel(QtGradientEditor); - label2->setObjectName(QString::fromUtf8("label2")); + label2->setObjectName(QStringLiteral("label2")); label2->setGeometry(QRect(209, 99, 64, 23)); spinBox2 = new QDoubleSpinBox(QtGradientEditor); - spinBox2->setObjectName(QString::fromUtf8("spinBox2")); + spinBox2->setObjectName(QStringLiteral("spinBox2")); spinBox2->setGeometry(QRect(279, 99, 73, 23)); spinBox2->setKeyboardTracking(false); spinBox2->setDecimals(3); spinBox2->setMaximum(1); spinBox2->setSingleStep(0.01); label3 = new QLabel(QtGradientEditor); - label3->setObjectName(QString::fromUtf8("label3")); + label3->setObjectName(QStringLiteral("label3")); label3->setGeometry(QRect(209, 129, 64, 23)); spinBox3 = new QDoubleSpinBox(QtGradientEditor); - spinBox3->setObjectName(QString::fromUtf8("spinBox3")); + spinBox3->setObjectName(QStringLiteral("spinBox3")); spinBox3->setGeometry(QRect(279, 129, 73, 23)); spinBox3->setKeyboardTracking(false); spinBox3->setDecimals(3); spinBox3->setMaximum(1); spinBox3->setSingleStep(0.01); label4 = new QLabel(QtGradientEditor); - label4->setObjectName(QString::fromUtf8("label4")); + label4->setObjectName(QStringLiteral("label4")); label4->setGeometry(QRect(209, 159, 64, 23)); spinBox4 = new QDoubleSpinBox(QtGradientEditor); - spinBox4->setObjectName(QString::fromUtf8("spinBox4")); + spinBox4->setObjectName(QStringLiteral("spinBox4")); spinBox4->setGeometry(QRect(279, 159, 73, 23)); spinBox4->setKeyboardTracking(false); spinBox4->setDecimals(3); spinBox4->setMaximum(1); spinBox4->setSingleStep(0.01); label5 = new QLabel(QtGradientEditor); - label5->setObjectName(QString::fromUtf8("label5")); + label5->setObjectName(QStringLiteral("label5")); label5->setGeometry(QRect(209, 189, 64, 23)); spinBox5 = new QDoubleSpinBox(QtGradientEditor); - spinBox5->setObjectName(QString::fromUtf8("spinBox5")); + spinBox5->setObjectName(QStringLiteral("spinBox5")); spinBox5->setGeometry(QRect(279, 189, 73, 23)); spinBox5->setKeyboardTracking(false); spinBox5->setDecimals(3); spinBox5->setMaximum(1); spinBox5->setSingleStep(0.01); gradientStopsWidget = new QtGradientStopsWidget(QtGradientEditor); - gradientStopsWidget->setObjectName(QString::fromUtf8("gradientStopsWidget")); + gradientStopsWidget->setObjectName(QStringLiteral("gradientStopsWidget")); gradientStopsWidget->setGeometry(QRect(10, 225, 193, 67)); zoomLabel = new QLabel(QtGradientEditor); - zoomLabel->setObjectName(QString::fromUtf8("zoomLabel")); + zoomLabel->setObjectName(QStringLiteral("zoomLabel")); zoomLabel->setGeometry(QRect(209, 231, 64, 23)); zoomAllButton = new QToolButton(QtGradientEditor); - zoomAllButton->setObjectName(QString::fromUtf8("zoomAllButton")); + zoomAllButton->setObjectName(QStringLiteral("zoomAllButton")); zoomAllButton->setGeometry(QRect(279, 260, 72, 26)); QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(0); @@ -250,15 +250,15 @@ public: sizePolicy1.setHeightForWidth(zoomAllButton->sizePolicy().hasHeightForWidth()); zoomAllButton->setSizePolicy(sizePolicy1); positionLabel = new QLabel(QtGradientEditor); - positionLabel->setObjectName(QString::fromUtf8("positionLabel")); + positionLabel->setObjectName(QStringLiteral("positionLabel")); positionLabel->setGeometry(QRect(209, 304, 64, 23)); hLabel = new QLabel(QtGradientEditor); - hLabel->setObjectName(QString::fromUtf8("hLabel")); + hLabel->setObjectName(QStringLiteral("hLabel")); hLabel->setGeometry(QRect(10, 335, 32, 18)); sizePolicy1.setHeightForWidth(hLabel->sizePolicy().hasHeightForWidth()); hLabel->setSizePolicy(sizePolicy1); frame_2 = new QFrame(QtGradientEditor); - frame_2->setObjectName(QString::fromUtf8("frame_2")); + frame_2->setObjectName(QStringLiteral("frame_2")); frame_2->setGeometry(QRect(48, 333, 155, 23)); QSizePolicy sizePolicy2(QSizePolicy::Ignored, QSizePolicy::Preferred); sizePolicy2.setHorizontalStretch(0); @@ -268,10 +268,10 @@ public: frame_2->setFrameShape(QFrame::StyledPanel); frame_2->setFrameShadow(QFrame::Raised); hboxLayout = new QHBoxLayout(frame_2); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); hboxLayout->setContentsMargins(0, 0, 0, 0); hueColorLine = new QtColorLine(frame_2); - hueColorLine->setObjectName(QString::fromUtf8("hueColorLine")); + hueColorLine->setObjectName(QStringLiteral("hueColorLine")); QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Preferred); sizePolicy3.setHorizontalStretch(0); sizePolicy3.setVerticalStretch(0); @@ -281,99 +281,99 @@ public: hboxLayout->addWidget(hueColorLine); hueLabel = new QLabel(QtGradientEditor); - hueLabel->setObjectName(QString::fromUtf8("hueLabel")); + hueLabel->setObjectName(QStringLiteral("hueLabel")); hueLabel->setGeometry(QRect(209, 335, 64, 18)); sizePolicy1.setHeightForWidth(hueLabel->sizePolicy().hasHeightForWidth()); hueLabel->setSizePolicy(sizePolicy1); sLabel = new QLabel(QtGradientEditor); - sLabel->setObjectName(QString::fromUtf8("sLabel")); + sLabel->setObjectName(QStringLiteral("sLabel")); sLabel->setGeometry(QRect(10, 364, 32, 18)); sizePolicy1.setHeightForWidth(sLabel->sizePolicy().hasHeightForWidth()); sLabel->setSizePolicy(sizePolicy1); frame_5 = new QFrame(QtGradientEditor); - frame_5->setObjectName(QString::fromUtf8("frame_5")); + frame_5->setObjectName(QStringLiteral("frame_5")); frame_5->setGeometry(QRect(48, 362, 155, 23)); sizePolicy2.setHeightForWidth(frame_5->sizePolicy().hasHeightForWidth()); frame_5->setSizePolicy(sizePolicy2); frame_5->setFrameShape(QFrame::StyledPanel); frame_5->setFrameShadow(QFrame::Raised); hboxLayout1 = new QHBoxLayout(frame_5); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); hboxLayout1->setContentsMargins(0, 0, 0, 0); saturationColorLine = new QtColorLine(frame_5); - saturationColorLine->setObjectName(QString::fromUtf8("saturationColorLine")); + saturationColorLine->setObjectName(QStringLiteral("saturationColorLine")); sizePolicy3.setHeightForWidth(saturationColorLine->sizePolicy().hasHeightForWidth()); saturationColorLine->setSizePolicy(sizePolicy3); hboxLayout1->addWidget(saturationColorLine); saturationLabel = new QLabel(QtGradientEditor); - saturationLabel->setObjectName(QString::fromUtf8("saturationLabel")); + saturationLabel->setObjectName(QStringLiteral("saturationLabel")); saturationLabel->setGeometry(QRect(209, 364, 64, 18)); sizePolicy1.setHeightForWidth(saturationLabel->sizePolicy().hasHeightForWidth()); saturationLabel->setSizePolicy(sizePolicy1); vLabel = new QLabel(QtGradientEditor); - vLabel->setObjectName(QString::fromUtf8("vLabel")); + vLabel->setObjectName(QStringLiteral("vLabel")); vLabel->setGeometry(QRect(10, 393, 32, 18)); sizePolicy1.setHeightForWidth(vLabel->sizePolicy().hasHeightForWidth()); vLabel->setSizePolicy(sizePolicy1); frame_3 = new QFrame(QtGradientEditor); - frame_3->setObjectName(QString::fromUtf8("frame_3")); + frame_3->setObjectName(QStringLiteral("frame_3")); frame_3->setGeometry(QRect(48, 391, 155, 23)); sizePolicy2.setHeightForWidth(frame_3->sizePolicy().hasHeightForWidth()); frame_3->setSizePolicy(sizePolicy2); frame_3->setFrameShape(QFrame::StyledPanel); frame_3->setFrameShadow(QFrame::Raised); hboxLayout2 = new QHBoxLayout(frame_3); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); hboxLayout2->setContentsMargins(0, 0, 0, 0); valueColorLine = new QtColorLine(frame_3); - valueColorLine->setObjectName(QString::fromUtf8("valueColorLine")); + valueColorLine->setObjectName(QStringLiteral("valueColorLine")); sizePolicy3.setHeightForWidth(valueColorLine->sizePolicy().hasHeightForWidth()); valueColorLine->setSizePolicy(sizePolicy3); hboxLayout2->addWidget(valueColorLine); valueLabel = new QLabel(QtGradientEditor); - valueLabel->setObjectName(QString::fromUtf8("valueLabel")); + valueLabel->setObjectName(QStringLiteral("valueLabel")); valueLabel->setGeometry(QRect(209, 393, 64, 18)); sizePolicy1.setHeightForWidth(valueLabel->sizePolicy().hasHeightForWidth()); valueLabel->setSizePolicy(sizePolicy1); aLabel = new QLabel(QtGradientEditor); - aLabel->setObjectName(QString::fromUtf8("aLabel")); + aLabel->setObjectName(QStringLiteral("aLabel")); aLabel->setGeometry(QRect(10, 422, 32, 18)); sizePolicy1.setHeightForWidth(aLabel->sizePolicy().hasHeightForWidth()); aLabel->setSizePolicy(sizePolicy1); frame_4 = new QFrame(QtGradientEditor); - frame_4->setObjectName(QString::fromUtf8("frame_4")); + frame_4->setObjectName(QStringLiteral("frame_4")); frame_4->setGeometry(QRect(48, 420, 155, 23)); sizePolicy2.setHeightForWidth(frame_4->sizePolicy().hasHeightForWidth()); frame_4->setSizePolicy(sizePolicy2); frame_4->setFrameShape(QFrame::StyledPanel); frame_4->setFrameShadow(QFrame::Raised); hboxLayout3 = new QHBoxLayout(frame_4); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); hboxLayout3->setContentsMargins(0, 0, 0, 0); alphaColorLine = new QtColorLine(frame_4); - alphaColorLine->setObjectName(QString::fromUtf8("alphaColorLine")); + alphaColorLine->setObjectName(QStringLiteral("alphaColorLine")); sizePolicy3.setHeightForWidth(alphaColorLine->sizePolicy().hasHeightForWidth()); alphaColorLine->setSizePolicy(sizePolicy3); hboxLayout3->addWidget(alphaColorLine); alphaLabel = new QLabel(QtGradientEditor); - alphaLabel->setObjectName(QString::fromUtf8("alphaLabel")); + alphaLabel->setObjectName(QStringLiteral("alphaLabel")); alphaLabel->setGeometry(QRect(209, 422, 64, 18)); sizePolicy1.setHeightForWidth(alphaLabel->sizePolicy().hasHeightForWidth()); alphaLabel->setSizePolicy(sizePolicy1); typeComboBox = new QComboBox(QtGradientEditor); - typeComboBox->setObjectName(QString::fromUtf8("typeComboBox")); + typeComboBox->setObjectName(QStringLiteral("typeComboBox")); typeComboBox->setGeometry(QRect(10, 40, 79, 22)); spreadComboBox = new QComboBox(QtGradientEditor); - spreadComboBox->setObjectName(QString::fromUtf8("spreadComboBox")); + spreadComboBox->setObjectName(QStringLiteral("spreadComboBox")); spreadComboBox->setGeometry(QRect(96, 40, 72, 22)); colorLabel = new QLabel(QtGradientEditor); - colorLabel->setObjectName(QString::fromUtf8("colorLabel")); + colorLabel->setObjectName(QStringLiteral("colorLabel")); colorLabel->setGeometry(QRect(10, 298, 32, 29)); QSizePolicy sizePolicy4(QSizePolicy::Fixed, QSizePolicy::Preferred); sizePolicy4.setHorizontalStretch(0); @@ -381,10 +381,10 @@ public: sizePolicy4.setHeightForWidth(colorLabel->sizePolicy().hasHeightForWidth()); colorLabel->setSizePolicy(sizePolicy4); colorButton = new QtColorButton(QtGradientEditor); - colorButton->setObjectName(QString::fromUtf8("colorButton")); + colorButton->setObjectName(QStringLiteral("colorButton")); colorButton->setGeometry(QRect(48, 300, 26, 25)); hsvRadioButton = new QRadioButton(QtGradientEditor); - hsvRadioButton->setObjectName(QString::fromUtf8("hsvRadioButton")); + hsvRadioButton->setObjectName(QStringLiteral("hsvRadioButton")); hsvRadioButton->setGeometry(QRect(80, 301, 49, 23)); QSizePolicy sizePolicy5(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy5.setHorizontalStretch(0); @@ -393,18 +393,18 @@ public: hsvRadioButton->setSizePolicy(sizePolicy5); hsvRadioButton->setChecked(true); rgbRadioButton = new QRadioButton(QtGradientEditor); - rgbRadioButton->setObjectName(QString::fromUtf8("rgbRadioButton")); + rgbRadioButton->setObjectName(QStringLiteral("rgbRadioButton")); rgbRadioButton->setGeometry(QRect(135, 301, 49, 23)); sizePolicy5.setHeightForWidth(rgbRadioButton->sizePolicy().hasHeightForWidth()); rgbRadioButton->setSizePolicy(sizePolicy5); positionWidget = new QWidget(QtGradientEditor); - positionWidget->setObjectName(QString::fromUtf8("positionWidget")); + positionWidget->setObjectName(QStringLiteral("positionWidget")); positionWidget->setGeometry(QRect(279, 304, 73, 23)); vboxLayout1 = new QVBoxLayout(positionWidget); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); vboxLayout1->setContentsMargins(0, 0, 0, 0); positionSpinBox = new QDoubleSpinBox(positionWidget); - positionSpinBox->setObjectName(QString::fromUtf8("positionSpinBox")); + positionSpinBox->setObjectName(QStringLiteral("positionSpinBox")); positionSpinBox->setKeyboardTracking(false); positionSpinBox->setDecimals(3); positionSpinBox->setMinimum(0); @@ -415,65 +415,65 @@ public: vboxLayout1->addWidget(positionSpinBox); hueWidget = new QWidget(QtGradientEditor); - hueWidget->setObjectName(QString::fromUtf8("hueWidget")); + hueWidget->setObjectName(QStringLiteral("hueWidget")); hueWidget->setGeometry(QRect(279, 333, 73, 23)); vboxLayout2 = new QVBoxLayout(hueWidget); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); vboxLayout2->setContentsMargins(0, 0, 0, 0); hueSpinBox = new QSpinBox(hueWidget); - hueSpinBox->setObjectName(QString::fromUtf8("hueSpinBox")); + hueSpinBox->setObjectName(QStringLiteral("hueSpinBox")); hueSpinBox->setKeyboardTracking(false); hueSpinBox->setMaximum(359); vboxLayout2->addWidget(hueSpinBox); saturationWidget = new QWidget(QtGradientEditor); - saturationWidget->setObjectName(QString::fromUtf8("saturationWidget")); + saturationWidget->setObjectName(QStringLiteral("saturationWidget")); saturationWidget->setGeometry(QRect(279, 362, 73, 23)); vboxLayout3 = new QVBoxLayout(saturationWidget); - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); + vboxLayout3->setObjectName(QStringLiteral("vboxLayout3")); vboxLayout3->setContentsMargins(0, 0, 0, 0); saturationSpinBox = new QSpinBox(saturationWidget); - saturationSpinBox->setObjectName(QString::fromUtf8("saturationSpinBox")); + saturationSpinBox->setObjectName(QStringLiteral("saturationSpinBox")); saturationSpinBox->setKeyboardTracking(false); saturationSpinBox->setMaximum(255); vboxLayout3->addWidget(saturationSpinBox); valueWidget = new QWidget(QtGradientEditor); - valueWidget->setObjectName(QString::fromUtf8("valueWidget")); + valueWidget->setObjectName(QStringLiteral("valueWidget")); valueWidget->setGeometry(QRect(279, 391, 73, 23)); vboxLayout4 = new QVBoxLayout(valueWidget); - vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4")); + vboxLayout4->setObjectName(QStringLiteral("vboxLayout4")); vboxLayout4->setContentsMargins(0, 0, 0, 0); valueSpinBox = new QSpinBox(valueWidget); - valueSpinBox->setObjectName(QString::fromUtf8("valueSpinBox")); + valueSpinBox->setObjectName(QStringLiteral("valueSpinBox")); valueSpinBox->setKeyboardTracking(false); valueSpinBox->setMaximum(255); vboxLayout4->addWidget(valueSpinBox); alphaWidget = new QWidget(QtGradientEditor); - alphaWidget->setObjectName(QString::fromUtf8("alphaWidget")); + alphaWidget->setObjectName(QStringLiteral("alphaWidget")); alphaWidget->setGeometry(QRect(279, 420, 73, 23)); vboxLayout5 = new QVBoxLayout(alphaWidget); - vboxLayout5->setObjectName(QString::fromUtf8("vboxLayout5")); + vboxLayout5->setObjectName(QStringLiteral("vboxLayout5")); vboxLayout5->setContentsMargins(0, 0, 0, 0); alphaSpinBox = new QSpinBox(alphaWidget); - alphaSpinBox->setObjectName(QString::fromUtf8("alphaSpinBox")); + alphaSpinBox->setObjectName(QStringLiteral("alphaSpinBox")); alphaSpinBox->setKeyboardTracking(false); alphaSpinBox->setMaximum(255); vboxLayout5->addWidget(alphaSpinBox); zoomWidget = new QWidget(QtGradientEditor); - zoomWidget->setObjectName(QString::fromUtf8("zoomWidget")); + zoomWidget->setObjectName(QStringLiteral("zoomWidget")); zoomWidget->setGeometry(QRect(279, 231, 73, 23)); vboxLayout6 = new QVBoxLayout(zoomWidget); - vboxLayout6->setObjectName(QString::fromUtf8("vboxLayout6")); + vboxLayout6->setObjectName(QStringLiteral("vboxLayout6")); vboxLayout6->setContentsMargins(0, 0, 0, 0); zoomSpinBox = new QSpinBox(zoomWidget); - zoomSpinBox->setObjectName(QString::fromUtf8("zoomSpinBox")); + zoomSpinBox->setObjectName(QStringLiteral("zoomSpinBox")); zoomSpinBox->setKeyboardTracking(false); zoomSpinBox->setMinimum(100); zoomSpinBox->setMaximum(10000); @@ -483,33 +483,33 @@ public: vboxLayout6->addWidget(zoomSpinBox); line1Widget = new QWidget(QtGradientEditor); - line1Widget->setObjectName(QString::fromUtf8("line1Widget")); + line1Widget->setObjectName(QStringLiteral("line1Widget")); line1Widget->setGeometry(QRect(209, 219, 143, 16)); vboxLayout7 = new QVBoxLayout(line1Widget); - vboxLayout7->setObjectName(QString::fromUtf8("vboxLayout7")); + vboxLayout7->setObjectName(QStringLiteral("vboxLayout7")); vboxLayout7->setContentsMargins(0, 0, 0, 0); line1 = new QFrame(line1Widget); - line1->setObjectName(QString::fromUtf8("line1")); + line1->setObjectName(QStringLiteral("line1")); line1->setFrameShape(QFrame::HLine); line1->setFrameShadow(QFrame::Sunken); vboxLayout7->addWidget(line1); line2Widget = new QWidget(QtGradientEditor); - line2Widget->setObjectName(QString::fromUtf8("line2Widget")); + line2Widget->setObjectName(QStringLiteral("line2Widget")); line2Widget->setGeometry(QRect(209, 292, 143, 16)); vboxLayout8 = new QVBoxLayout(line2Widget); - vboxLayout8->setObjectName(QString::fromUtf8("vboxLayout8")); + vboxLayout8->setObjectName(QStringLiteral("vboxLayout8")); vboxLayout8->setContentsMargins(0, 0, 0, 0); line2 = new QFrame(line2Widget); - line2->setObjectName(QString::fromUtf8("line2")); + line2->setObjectName(QStringLiteral("line2")); line2->setFrameShape(QFrame::HLine); line2->setFrameShadow(QFrame::Sunken); vboxLayout8->addWidget(line2); zoomButtonsWidget = new QWidget(QtGradientEditor); - zoomButtonsWidget->setObjectName(QString::fromUtf8("zoomButtonsWidget")); + zoomButtonsWidget->setObjectName(QStringLiteral("zoomButtonsWidget")); zoomButtonsWidget->setGeometry(QRect(209, 260, 64, 26)); QSizePolicy sizePolicy6(QSizePolicy::Maximum, QSizePolicy::Preferred); sizePolicy6.setHorizontalStretch(0); @@ -517,15 +517,15 @@ public: sizePolicy6.setHeightForWidth(zoomButtonsWidget->sizePolicy().hasHeightForWidth()); zoomButtonsWidget->setSizePolicy(sizePolicy6); hboxLayout4 = new QHBoxLayout(zoomButtonsWidget); - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); + hboxLayout4->setObjectName(QStringLiteral("hboxLayout4")); hboxLayout4->setContentsMargins(0, 0, 0, 0); zoomInButton = new QToolButton(zoomButtonsWidget); - zoomInButton->setObjectName(QString::fromUtf8("zoomInButton")); + zoomInButton->setObjectName(QStringLiteral("zoomInButton")); hboxLayout4->addWidget(zoomInButton); zoomOutButton = new QToolButton(zoomButtonsWidget); - zoomOutButton->setObjectName(QString::fromUtf8("zoomOutButton")); + zoomOutButton->setObjectName(QStringLiteral("zoomOutButton")); hboxLayout4->addWidget(zoomOutButton); @@ -534,7 +534,7 @@ public: hboxLayout4->addItem(spacerItem); detailsButton = new QToolButton(QtGradientEditor); - detailsButton->setObjectName(QString::fromUtf8("detailsButton")); + detailsButton->setObjectName(QStringLiteral("detailsButton")); detailsButton->setGeometry(QRect(176, 40, 25, 22)); QSizePolicy sizePolicy7(QSizePolicy::Fixed, QSizePolicy::Ignored); sizePolicy7.setHorizontalStretch(0); @@ -544,32 +544,32 @@ public: detailsButton->setCheckable(true); detailsButton->setAutoRaise(true); linearButton = new QToolButton(QtGradientEditor); - linearButton->setObjectName(QString::fromUtf8("linearButton")); + linearButton->setObjectName(QStringLiteral("linearButton")); linearButton->setGeometry(QRect(10, 10, 30, 26)); linearButton->setCheckable(true); linearButton->setAutoRaise(true); radialButton = new QToolButton(QtGradientEditor); - radialButton->setObjectName(QString::fromUtf8("radialButton")); + radialButton->setObjectName(QStringLiteral("radialButton")); radialButton->setGeometry(QRect(40, 10, 30, 26)); radialButton->setCheckable(true); radialButton->setAutoRaise(true); conicalButton = new QToolButton(QtGradientEditor); - conicalButton->setObjectName(QString::fromUtf8("conicalButton")); + conicalButton->setObjectName(QStringLiteral("conicalButton")); conicalButton->setGeometry(QRect(70, 10, 30, 26)); conicalButton->setCheckable(true); conicalButton->setAutoRaise(true); padButton = new QToolButton(QtGradientEditor); - padButton->setObjectName(QString::fromUtf8("padButton")); + padButton->setObjectName(QStringLiteral("padButton")); padButton->setGeometry(QRect(110, 10, 30, 26)); padButton->setCheckable(true); padButton->setAutoRaise(true); repeatButton = new QToolButton(QtGradientEditor); - repeatButton->setObjectName(QString::fromUtf8("repeatButton")); + repeatButton->setObjectName(QStringLiteral("repeatButton")); repeatButton->setGeometry(QRect(140, 10, 30, 26)); repeatButton->setCheckable(true); repeatButton->setAutoRaise(true); reflectButton = new QToolButton(QtGradientEditor); - reflectButton->setObjectName(QString::fromUtf8("reflectButton")); + reflectButton->setObjectName(QStringLiteral("reflectButton")); reflectButton->setGeometry(QRect(170, 10, 30, 26)); reflectButton->setCheckable(true); reflectButton->setAutoRaise(true); diff --git a/tests/auto/tools/uic/baseline/qtgradientview.ui.h b/tests/auto/tools/uic/baseline/qtgradientview.ui.h index 52512c4a5b..62136c3890 100644 --- a/tests/auto/tools/uic/baseline/qtgradientview.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradientview.ui.h @@ -39,15 +39,15 @@ public: void setupUi(QWidget *QtGradientView) { if (QtGradientView->objectName().isEmpty()) - QtGradientView->setObjectName(QString::fromUtf8("QtGradientView")); + QtGradientView->setObjectName(QStringLiteral("QtGradientView")); QtGradientView->resize(484, 228); vboxLayout = new QVBoxLayout(QtGradientView); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); newButton = new QToolButton(QtGradientView); - newButton->setObjectName(QString::fromUtf8("newButton")); + newButton->setObjectName(QStringLiteral("newButton")); QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -59,7 +59,7 @@ public: hboxLayout->addWidget(newButton); editButton = new QToolButton(QtGradientView); - editButton->setObjectName(QString::fromUtf8("editButton")); + editButton->setObjectName(QStringLiteral("editButton")); sizePolicy.setHeightForWidth(editButton->sizePolicy().hasHeightForWidth()); editButton->setSizePolicy(sizePolicy); editButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -68,7 +68,7 @@ public: hboxLayout->addWidget(editButton); renameButton = new QToolButton(QtGradientView); - renameButton->setObjectName(QString::fromUtf8("renameButton")); + renameButton->setObjectName(QStringLiteral("renameButton")); sizePolicy.setHeightForWidth(renameButton->sizePolicy().hasHeightForWidth()); renameButton->setSizePolicy(sizePolicy); renameButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -77,7 +77,7 @@ public: hboxLayout->addWidget(renameButton); removeButton = new QToolButton(QtGradientView); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); sizePolicy.setHeightForWidth(removeButton->sizePolicy().hasHeightForWidth()); removeButton->setSizePolicy(sizePolicy); removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -93,7 +93,7 @@ public: vboxLayout->addLayout(hboxLayout); listWidget = new QListWidget(QtGradientView); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); vboxLayout->addWidget(listWidget); diff --git a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h index d93dfd605c..cc7912d4c2 100644 --- a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h +++ b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h @@ -75,12 +75,12 @@ public: void setupUi(QDialog *QtGradientViewDialog) { if (QtGradientViewDialog->objectName().isEmpty()) - QtGradientViewDialog->setObjectName(QString::fromUtf8("QtGradientViewDialog")); + QtGradientViewDialog->setObjectName(QStringLiteral("QtGradientViewDialog")); QtGradientViewDialog->resize(178, 72); vboxLayout = new QVBoxLayout(QtGradientViewDialog); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); gradientView = new QtGradientView(QtGradientViewDialog); - gradientView->setObjectName(QString::fromUtf8("gradientView")); + gradientView->setObjectName(QStringLiteral("gradientView")); QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -90,7 +90,7 @@ public: vboxLayout->addWidget(gradientView); buttonBox = new QDialogButtonBox(QtGradientViewDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h b/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h index b34f246c34..72cef5353a 100644 --- a/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h +++ b/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h @@ -52,20 +52,20 @@ public: void setupUi(QDialog *QtResourceEditorDialog) { if (QtResourceEditorDialog->objectName().isEmpty()) - QtResourceEditorDialog->setObjectName(QString::fromUtf8("QtResourceEditorDialog")); + QtResourceEditorDialog->setObjectName(QStringLiteral("QtResourceEditorDialog")); QtResourceEditorDialog->resize(469, 317); verticalLayout = new QVBoxLayout(QtResourceEditorDialog); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); splitter = new QSplitter(QtResourceEditorDialog); - splitter->setObjectName(QString::fromUtf8("splitter")); + splitter->setObjectName(QStringLiteral("splitter")); splitter->setOrientation(Qt::Horizontal); layoutWidget = new QWidget(splitter); - layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setObjectName(QStringLiteral("layoutWidget")); gridLayout = new QGridLayout(layoutWidget); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); gridLayout->setContentsMargins(0, 0, 0, 0); qrcFileList = new QListWidget(layoutWidget); - qrcFileList->setObjectName(QString::fromUtf8("qrcFileList")); + qrcFileList->setObjectName(QStringLiteral("qrcFileList")); QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -75,12 +75,12 @@ public: gridLayout->addWidget(qrcFileList, 0, 0, 1, 4); newQrcButton = new QToolButton(layoutWidget); - newQrcButton->setObjectName(QString::fromUtf8("newQrcButton")); + newQrcButton->setObjectName(QStringLiteral("newQrcButton")); gridLayout->addWidget(newQrcButton, 1, 0, 1, 1); removeQrcButton = new QToolButton(layoutWidget); - removeQrcButton->setObjectName(QString::fromUtf8("removeQrcButton")); + removeQrcButton->setObjectName(QStringLiteral("removeQrcButton")); gridLayout->addWidget(removeQrcButton, 1, 2, 1, 1); @@ -89,33 +89,33 @@ public: gridLayout->addItem(spacerItem, 1, 3, 1, 1); importQrcButton = new QToolButton(layoutWidget); - importQrcButton->setObjectName(QString::fromUtf8("importQrcButton")); + importQrcButton->setObjectName(QStringLiteral("importQrcButton")); gridLayout->addWidget(importQrcButton, 1, 1, 1, 1); splitter->addWidget(layoutWidget); widget = new QWidget(splitter); - widget->setObjectName(QString::fromUtf8("widget")); + widget->setObjectName(QStringLiteral("widget")); gridLayout1 = new QGridLayout(widget); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); gridLayout1->setContentsMargins(0, 0, 0, 0); resourceTreeView = new QTreeView(widget); - resourceTreeView->setObjectName(QString::fromUtf8("resourceTreeView")); + resourceTreeView->setObjectName(QStringLiteral("resourceTreeView")); gridLayout1->addWidget(resourceTreeView, 0, 0, 1, 4); newResourceButton = new QToolButton(widget); - newResourceButton->setObjectName(QString::fromUtf8("newResourceButton")); + newResourceButton->setObjectName(QStringLiteral("newResourceButton")); gridLayout1->addWidget(newResourceButton, 1, 0, 1, 1); addResourceButton = new QToolButton(widget); - addResourceButton->setObjectName(QString::fromUtf8("addResourceButton")); + addResourceButton->setObjectName(QStringLiteral("addResourceButton")); gridLayout1->addWidget(addResourceButton, 1, 1, 1, 1); removeResourceButton = new QToolButton(widget); - removeResourceButton->setObjectName(QString::fromUtf8("removeResourceButton")); + removeResourceButton->setObjectName(QStringLiteral("removeResourceButton")); gridLayout1->addWidget(removeResourceButton, 1, 2, 1, 1); @@ -128,7 +128,7 @@ public: verticalLayout->addWidget(splitter); buttonBox = new QDialogButtonBox(QtResourceEditorDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h b/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h index 463961452f..5b6ec991b9 100644 --- a/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h +++ b/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h @@ -53,21 +53,21 @@ public: void setupUi(QDialog *QtToolBarDialog) { if (QtToolBarDialog->objectName().isEmpty()) - QtToolBarDialog->setObjectName(QString::fromUtf8("QtToolBarDialog")); + QtToolBarDialog->setObjectName(QStringLiteral("QtToolBarDialog")); QtToolBarDialog->resize(583, 508); gridLayout = new QGridLayout(QtToolBarDialog); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); actionTree = new QTreeWidget(QtToolBarDialog); - actionTree->setObjectName(QString::fromUtf8("actionTree")); + actionTree->setObjectName(QStringLiteral("actionTree")); gridLayout->addWidget(actionTree, 1, 0, 3, 1); label = new QLabel(QtToolBarDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); @@ -76,24 +76,24 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); label_2 = new QLabel(QtToolBarDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); hboxLayout->addWidget(label_2); newButton = new QToolButton(QtToolBarDialog); - newButton->setObjectName(QString::fromUtf8("newButton")); + newButton->setObjectName(QStringLiteral("newButton")); hboxLayout->addWidget(newButton); removeButton = new QToolButton(QtToolBarDialog); - removeButton->setObjectName(QString::fromUtf8("removeButton")); + removeButton->setObjectName(QStringLiteral("removeButton")); hboxLayout->addWidget(removeButton); renameButton = new QToolButton(QtToolBarDialog); - renameButton->setObjectName(QString::fromUtf8("renameButton")); + renameButton->setObjectName(QStringLiteral("renameButton")); hboxLayout->addWidget(renameButton); @@ -105,9 +105,9 @@ public: vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(0, 0, 0, 0); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); upButton = new QToolButton(QtToolBarDialog); - upButton->setObjectName(QString::fromUtf8("upButton")); + upButton->setObjectName(QStringLiteral("upButton")); QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -117,21 +117,21 @@ public: vboxLayout->addWidget(upButton); leftButton = new QToolButton(QtToolBarDialog); - leftButton->setObjectName(QString::fromUtf8("leftButton")); + leftButton->setObjectName(QStringLiteral("leftButton")); sizePolicy.setHeightForWidth(leftButton->sizePolicy().hasHeightForWidth()); leftButton->setSizePolicy(sizePolicy); vboxLayout->addWidget(leftButton); rightButton = new QToolButton(QtToolBarDialog); - rightButton->setObjectName(QString::fromUtf8("rightButton")); + rightButton->setObjectName(QStringLiteral("rightButton")); sizePolicy.setHeightForWidth(rightButton->sizePolicy().hasHeightForWidth()); rightButton->setSizePolicy(sizePolicy); vboxLayout->addWidget(rightButton); downButton = new QToolButton(QtToolBarDialog); - downButton->setObjectName(QString::fromUtf8("downButton")); + downButton->setObjectName(QStringLiteral("downButton")); sizePolicy.setHeightForWidth(downButton->sizePolicy().hasHeightForWidth()); downButton->setSizePolicy(sizePolicy); @@ -145,22 +145,22 @@ public: gridLayout->addLayout(vboxLayout, 3, 1, 1, 1); currentToolBarList = new QListWidget(QtToolBarDialog); - currentToolBarList->setObjectName(QString::fromUtf8("currentToolBarList")); + currentToolBarList->setObjectName(QStringLiteral("currentToolBarList")); gridLayout->addWidget(currentToolBarList, 3, 2, 1, 1); label_3 = new QLabel(QtToolBarDialog); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout->addWidget(label_3, 2, 1, 1, 2); toolBarList = new QListWidget(QtToolBarDialog); - toolBarList->setObjectName(QString::fromUtf8("toolBarList")); + toolBarList->setObjectName(QStringLiteral("toolBarList")); gridLayout->addWidget(toolBarList, 1, 1, 1, 2); buttonBox = new QDialogButtonBox(QtToolBarDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setStandardButtons(QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults); gridLayout->addWidget(buttonBox, 5, 0, 1, 3); diff --git a/tests/auto/tools/uic/baseline/querywidget.ui.h b/tests/auto/tools/uic/baseline/querywidget.ui.h index c355f7c4f1..5a2eef793b 100644 --- a/tests/auto/tools/uic/baseline/querywidget.ui.h +++ b/tests/auto/tools/uic/baseline/querywidget.ui.h @@ -50,13 +50,13 @@ public: void setupUi(QMainWindow *QueryWidget) { if (QueryWidget->objectName().isEmpty()) - QueryWidget->setObjectName(QString::fromUtf8("QueryWidget")); + QueryWidget->setObjectName(QStringLiteral("QueryWidget")); QueryWidget->resize(545, 531); centralwidget = new QWidget(QueryWidget); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + centralwidget->setObjectName(QStringLiteral("centralwidget")); centralwidget->setGeometry(QRect(0, 29, 545, 480)); verticalLayout = new QVBoxLayout(centralwidget); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); vboxLayout = new QVBoxLayout(); #ifndef Q_OS_MAC vboxLayout->setSpacing(6); @@ -64,12 +64,12 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(0, 0, 0, 0); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); inputGroupBox = new QGroupBox(centralwidget); - inputGroupBox->setObjectName(QString::fromUtf8("inputGroupBox")); + inputGroupBox->setObjectName(QStringLiteral("inputGroupBox")); inputGroupBox->setMinimumSize(QSize(550, 120)); verticalLayout_4 = new QVBoxLayout(inputGroupBox); - verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4")); + verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4")); _2 = new QVBoxLayout(); #ifndef Q_OS_MAC _2->setSpacing(6); @@ -77,9 +77,9 @@ public: #ifndef Q_OS_MAC _2->setContentsMargins(0, 0, 0, 0); #endif - _2->setObjectName(QString::fromUtf8("_2")); + _2->setObjectName(QStringLiteral("_2")); inputTextEdit = new QTextEdit(inputGroupBox); - inputTextEdit->setObjectName(QString::fromUtf8("inputTextEdit")); + inputTextEdit->setObjectName(QStringLiteral("inputTextEdit")); _2->addWidget(inputTextEdit); @@ -90,17 +90,17 @@ public: vboxLayout->addWidget(inputGroupBox); queryGroupBox = new QGroupBox(centralwidget); - queryGroupBox->setObjectName(QString::fromUtf8("queryGroupBox")); + queryGroupBox->setObjectName(QStringLiteral("queryGroupBox")); queryGroupBox->setMinimumSize(QSize(550, 120)); verticalLayout_5 = new QVBoxLayout(queryGroupBox); - verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5")); + verticalLayout_5->setObjectName(QStringLiteral("verticalLayout_5")); defaultQueries = new QComboBox(queryGroupBox); - defaultQueries->setObjectName(QString::fromUtf8("defaultQueries")); + defaultQueries->setObjectName(QStringLiteral("defaultQueries")); verticalLayout_5->addWidget(defaultQueries); queryTextEdit = new QTextEdit(queryGroupBox); - queryTextEdit->setObjectName(QString::fromUtf8("queryTextEdit")); + queryTextEdit->setObjectName(QStringLiteral("queryTextEdit")); queryTextEdit->setMinimumSize(QSize(400, 60)); queryTextEdit->setReadOnly(true); queryTextEdit->setAcceptRichText(false); @@ -111,10 +111,10 @@ public: vboxLayout->addWidget(queryGroupBox); outputGroupBox = new QGroupBox(centralwidget); - outputGroupBox->setObjectName(QString::fromUtf8("outputGroupBox")); + outputGroupBox->setObjectName(QStringLiteral("outputGroupBox")); outputGroupBox->setMinimumSize(QSize(550, 120)); verticalLayout_6 = new QVBoxLayout(outputGroupBox); - verticalLayout_6->setObjectName(QString::fromUtf8("verticalLayout_6")); + verticalLayout_6->setObjectName(QStringLiteral("verticalLayout_6")); _3 = new QVBoxLayout(); #ifndef Q_OS_MAC _3->setSpacing(6); @@ -122,9 +122,9 @@ public: #ifndef Q_OS_MAC _3->setContentsMargins(0, 0, 0, 0); #endif - _3->setObjectName(QString::fromUtf8("_3")); + _3->setObjectName(QStringLiteral("_3")); outputTextEdit = new QTextEdit(outputGroupBox); - outputTextEdit->setObjectName(QString::fromUtf8("outputTextEdit")); + outputTextEdit->setObjectName(QStringLiteral("outputTextEdit")); outputTextEdit->setMinimumSize(QSize(500, 80)); outputTextEdit->setReadOnly(true); outputTextEdit->setAcceptRichText(false); @@ -142,11 +142,11 @@ public: QueryWidget->setCentralWidget(centralwidget); menubar = new QMenuBar(QueryWidget); - menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setObjectName(QStringLiteral("menubar")); menubar->setGeometry(QRect(0, 0, 545, 29)); QueryWidget->setMenuBar(menubar); statusbar = new QStatusBar(QueryWidget); - statusbar->setObjectName(QString::fromUtf8("statusbar")); + statusbar->setObjectName(QStringLiteral("statusbar")); statusbar->setGeometry(QRect(0, 509, 545, 22)); QueryWidget->setStatusBar(statusbar); diff --git a/tests/auto/tools/uic/baseline/remotecontrol.ui.h b/tests/auto/tools/uic/baseline/remotecontrol.ui.h index 52ab1678cc..5a4910d635 100644 --- a/tests/auto/tools/uic/baseline/remotecontrol.ui.h +++ b/tests/auto/tools/uic/baseline/remotecontrol.ui.h @@ -69,28 +69,28 @@ public: void setupUi(QMainWindow *RemoteControlClass) { if (RemoteControlClass->objectName().isEmpty()) - RemoteControlClass->setObjectName(QString::fromUtf8("RemoteControlClass")); + RemoteControlClass->setObjectName(QStringLiteral("RemoteControlClass")); RemoteControlClass->resize(344, 364); actionQuit = new QAction(RemoteControlClass); - actionQuit->setObjectName(QString::fromUtf8("actionQuit")); + actionQuit->setObjectName(QStringLiteral("actionQuit")); centralWidget = new QWidget(RemoteControlClass); - centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + centralWidget->setObjectName(QStringLiteral("centralWidget")); gridLayout = new QGridLayout(centralWidget); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(centralWidget); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); startUrlLineEdit = new QLineEdit(centralWidget); - startUrlLineEdit->setObjectName(QString::fromUtf8("startUrlLineEdit")); + startUrlLineEdit->setObjectName(QStringLiteral("startUrlLineEdit")); gridLayout->addWidget(startUrlLineEdit, 0, 1, 1, 2); launchButton = new QPushButton(centralWidget); - launchButton->setObjectName(QString::fromUtf8("launchButton")); + launchButton->setObjectName(QStringLiteral("launchButton")); gridLayout->addWidget(launchButton, 1, 1, 1, 1); @@ -103,27 +103,27 @@ public: gridLayout->addItem(spacerItem1, 2, 1, 1, 1); actionGroupBox = new QGroupBox(centralWidget); - actionGroupBox->setObjectName(QString::fromUtf8("actionGroupBox")); + actionGroupBox->setObjectName(QStringLiteral("actionGroupBox")); actionGroupBox->setEnabled(false); gridLayout1 = new QGridLayout(actionGroupBox); gridLayout1->setSpacing(6); gridLayout1->setContentsMargins(11, 11, 11, 11); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); label_2 = new QLabel(actionGroupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout1->addWidget(label_2, 0, 0, 1, 1); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); indexLineEdit = new QLineEdit(actionGroupBox); - indexLineEdit->setObjectName(QString::fromUtf8("indexLineEdit")); + indexLineEdit->setObjectName(QStringLiteral("indexLineEdit")); hboxLayout->addWidget(indexLineEdit); indexButton = new QToolButton(actionGroupBox); - indexButton->setObjectName(QString::fromUtf8("indexButton")); + indexButton->setObjectName(QStringLiteral("indexButton")); const QIcon icon = QIcon(QString::fromUtf8(":/remotecontrol/enter.png")); indexButton->setIcon(icon); @@ -133,20 +133,20 @@ public: gridLayout1->addLayout(hboxLayout, 0, 1, 1, 2); label_4 = new QLabel(actionGroupBox); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); gridLayout1->addWidget(label_4, 1, 0, 1, 1); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); identifierLineEdit = new QLineEdit(actionGroupBox); - identifierLineEdit->setObjectName(QString::fromUtf8("identifierLineEdit")); + identifierLineEdit->setObjectName(QStringLiteral("identifierLineEdit")); hboxLayout1->addWidget(identifierLineEdit); identifierButton = new QToolButton(actionGroupBox); - identifierButton->setObjectName(QString::fromUtf8("identifierButton")); + identifierButton->setObjectName(QStringLiteral("identifierButton")); identifierButton->setIcon(icon); hboxLayout1->addWidget(identifierButton); @@ -155,20 +155,20 @@ public: gridLayout1->addLayout(hboxLayout1, 1, 1, 1, 2); label_3 = new QLabel(actionGroupBox); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout1->addWidget(label_3, 2, 0, 1, 1); hboxLayout2 = new QHBoxLayout(); hboxLayout2->setSpacing(0); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); urlLineEdit = new QLineEdit(actionGroupBox); - urlLineEdit->setObjectName(QString::fromUtf8("urlLineEdit")); + urlLineEdit->setObjectName(QStringLiteral("urlLineEdit")); hboxLayout2->addWidget(urlLineEdit); urlButton = new QToolButton(actionGroupBox); - urlButton->setObjectName(QString::fromUtf8("urlButton")); + urlButton->setObjectName(QStringLiteral("urlButton")); urlButton->setIcon(icon); hboxLayout2->addWidget(urlButton); @@ -177,7 +177,7 @@ public: gridLayout1->addLayout(hboxLayout2, 2, 1, 1, 2); syncContentsButton = new QPushButton(actionGroupBox); - syncContentsButton->setObjectName(QString::fromUtf8("syncContentsButton")); + syncContentsButton->setObjectName(QStringLiteral("syncContentsButton")); gridLayout1->addWidget(syncContentsButton, 3, 1, 1, 1); @@ -186,17 +186,17 @@ public: gridLayout1->addItem(spacerItem2, 3, 2, 1, 1); contentsCheckBox = new QCheckBox(actionGroupBox); - contentsCheckBox->setObjectName(QString::fromUtf8("contentsCheckBox")); + contentsCheckBox->setObjectName(QStringLiteral("contentsCheckBox")); gridLayout1->addWidget(contentsCheckBox, 4, 0, 1, 3); indexCheckBox = new QCheckBox(actionGroupBox); - indexCheckBox->setObjectName(QString::fromUtf8("indexCheckBox")); + indexCheckBox->setObjectName(QStringLiteral("indexCheckBox")); gridLayout1->addWidget(indexCheckBox, 5, 0, 1, 1); bookmarksCheckBox = new QCheckBox(actionGroupBox); - bookmarksCheckBox->setObjectName(QString::fromUtf8("bookmarksCheckBox")); + bookmarksCheckBox->setObjectName(QStringLiteral("bookmarksCheckBox")); gridLayout1->addWidget(bookmarksCheckBox, 6, 0, 1, 3); @@ -205,13 +205,13 @@ public: RemoteControlClass->setCentralWidget(centralWidget); menuBar = new QMenuBar(RemoteControlClass); - menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setObjectName(QStringLiteral("menuBar")); menuBar->setGeometry(QRect(0, 0, 344, 21)); menuFile = new QMenu(menuBar); - menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuFile->setObjectName(QStringLiteral("menuFile")); RemoteControlClass->setMenuBar(menuBar); statusBar = new QStatusBar(RemoteControlClass); - statusBar->setObjectName(QString::fromUtf8("statusBar")); + statusBar->setObjectName(QStringLiteral("statusBar")); RemoteControlClass->setStatusBar(statusBar); menuBar->addAction(menuFile->menuAction()); diff --git a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h index 32597cd6ff..dba7834c96 100644 --- a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h +++ b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h @@ -84,13 +84,13 @@ public: void setupUi(QDialog *SaveFormAsTemplate) { if (SaveFormAsTemplate->objectName().isEmpty()) - SaveFormAsTemplate->setObjectName(QString::fromUtf8("SaveFormAsTemplate")); + SaveFormAsTemplate->setObjectName(QStringLiteral("SaveFormAsTemplate")); vboxLayout = new QVBoxLayout(SaveFormAsTemplate); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); formLayout = new QFormLayout(); - formLayout->setObjectName(QString::fromUtf8("formLayout")); + formLayout->setObjectName(QStringLiteral("formLayout")); label = new QLabel(SaveFormAsTemplate); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setFrameShape(QFrame::NoFrame); label->setFrameShadow(QFrame::Plain); label->setTextFormat(Qt::AutoText); @@ -98,14 +98,14 @@ public: formLayout->setWidget(0, QFormLayout::LabelRole, label); templateNameEdit = new QLineEdit(SaveFormAsTemplate); - templateNameEdit->setObjectName(QString::fromUtf8("templateNameEdit")); + templateNameEdit->setObjectName(QStringLiteral("templateNameEdit")); templateNameEdit->setMinimumSize(QSize(222, 0)); templateNameEdit->setEchoMode(QLineEdit::Normal); formLayout->setWidget(0, QFormLayout::FieldRole, templateNameEdit); label_2 = new QLabel(SaveFormAsTemplate); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); label_2->setFrameShape(QFrame::NoFrame); label_2->setFrameShadow(QFrame::Plain); label_2->setTextFormat(Qt::AutoText); @@ -113,7 +113,7 @@ public: formLayout->setWidget(1, QFormLayout::LabelRole, label_2); categoryCombo = new QComboBox(SaveFormAsTemplate); - categoryCombo->setObjectName(QString::fromUtf8("categoryCombo")); + categoryCombo->setObjectName(QStringLiteral("categoryCombo")); formLayout->setWidget(1, QFormLayout::FieldRole, categoryCombo); @@ -121,14 +121,14 @@ public: vboxLayout->addLayout(formLayout); horizontalLine = new QFrame(SaveFormAsTemplate); - horizontalLine->setObjectName(QString::fromUtf8("horizontalLine")); + horizontalLine->setObjectName(QStringLiteral("horizontalLine")); horizontalLine->setFrameShape(QFrame::HLine); horizontalLine->setFrameShadow(QFrame::Sunken); vboxLayout->addWidget(horizontalLine); buttonBox = new QDialogButtonBox(SaveFormAsTemplate); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/settings.ui.h b/tests/auto/tools/uic/baseline/settings.ui.h index 0f87a29a65..3fc9bad710 100644 --- a/tests/auto/tools/uic/baseline/settings.ui.h +++ b/tests/auto/tools/uic/baseline/settings.ui.h @@ -51,14 +51,14 @@ public: void setupUi(QDialog *Dialog) { if (Dialog->objectName().isEmpty()) - Dialog->setObjectName(QString::fromUtf8("Dialog")); + Dialog->setObjectName(QStringLiteral("Dialog")); Dialog->resize(392, 176); verticalLayout = new QVBoxLayout(Dialog); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); label = new QLabel(Dialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -70,7 +70,7 @@ public: hboxLayout->addWidget(label); deviceCombo = new QComboBox(Dialog); - deviceCombo->setObjectName(QString::fromUtf8("deviceCombo")); + deviceCombo->setObjectName(QStringLiteral("deviceCombo")); QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -83,9 +83,9 @@ public: verticalLayout->addLayout(hboxLayout); hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); label_6 = new QLabel(Dialog); - label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setObjectName(QStringLiteral("label_6")); sizePolicy.setHeightForWidth(label_6->sizePolicy().hasHeightForWidth()); label_6->setSizePolicy(sizePolicy); label_6->setMinimumSize(QSize(90, 0)); @@ -94,7 +94,7 @@ public: hboxLayout1->addWidget(label_6); audioEffectsCombo = new QComboBox(Dialog); - audioEffectsCombo->setObjectName(QString::fromUtf8("audioEffectsCombo")); + audioEffectsCombo->setObjectName(QStringLiteral("audioEffectsCombo")); sizePolicy1.setHeightForWidth(audioEffectsCombo->sizePolicy().hasHeightForWidth()); audioEffectsCombo->setSizePolicy(sizePolicy1); @@ -104,9 +104,9 @@ public: verticalLayout->addLayout(hboxLayout1); hboxLayout2 = new QHBoxLayout(); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); crossFadeLabel = new QLabel(Dialog); - crossFadeLabel->setObjectName(QString::fromUtf8("crossFadeLabel")); + crossFadeLabel->setObjectName(QStringLiteral("crossFadeLabel")); sizePolicy.setHeightForWidth(crossFadeLabel->sizePolicy().hasHeightForWidth()); crossFadeLabel->setSizePolicy(sizePolicy); crossFadeLabel->setMinimumSize(QSize(90, 0)); @@ -115,9 +115,9 @@ public: hboxLayout2->addWidget(crossFadeLabel); vboxLayout = new QVBoxLayout(); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); crossFadeSlider = new QSlider(Dialog); - crossFadeSlider->setObjectName(QString::fromUtf8("crossFadeSlider")); + crossFadeSlider->setObjectName(QStringLiteral("crossFadeSlider")); sizePolicy1.setHeightForWidth(crossFadeSlider->sizePolicy().hasHeightForWidth()); crossFadeSlider->setSizePolicy(sizePolicy1); crossFadeSlider->setMinimum(-20); @@ -131,9 +131,9 @@ public: vboxLayout->addWidget(crossFadeSlider); hboxLayout3 = new QHBoxLayout(); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); label_3 = new QLabel(Dialog); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); QFont font; font.setPointSize(9); label_3->setFont(font); @@ -145,7 +145,7 @@ public: hboxLayout3->addItem(spacerItem); label_5 = new QLabel(Dialog); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); label_5->setFont(font); hboxLayout3->addWidget(label_5); @@ -155,7 +155,7 @@ public: hboxLayout3->addItem(spacerItem1); label_4 = new QLabel(Dialog); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); label_4->setFont(font); hboxLayout3->addWidget(label_4); @@ -170,7 +170,7 @@ public: verticalLayout->addLayout(hboxLayout2); buttonBox = new QDialogButtonBox(Dialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/signalslotdialog.ui.h b/tests/auto/tools/uic/baseline/signalslotdialog.ui.h index 3027ac93f2..ea253fa729 100644 --- a/tests/auto/tools/uic/baseline/signalslotdialog.ui.h +++ b/tests/auto/tools/uic/baseline/signalslotdialog.ui.h @@ -49,33 +49,33 @@ public: void setupUi(QDialog *SignalSlotDialogClass) { if (SignalSlotDialogClass->objectName().isEmpty()) - SignalSlotDialogClass->setObjectName(QString::fromUtf8("SignalSlotDialogClass")); + SignalSlotDialogClass->setObjectName(QStringLiteral("SignalSlotDialogClass")); SignalSlotDialogClass->resize(617, 535); vboxLayout = new QVBoxLayout(SignalSlotDialogClass); vboxLayout->setSpacing(6); vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); slotGroupBox = new QGroupBox(SignalSlotDialogClass); - slotGroupBox->setObjectName(QString::fromUtf8("slotGroupBox")); + slotGroupBox->setObjectName(QStringLiteral("slotGroupBox")); vboxLayout1 = new QVBoxLayout(slotGroupBox); vboxLayout1->setSpacing(6); vboxLayout1->setContentsMargins(11, 11, 11, 11); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); slotListView = new QListView(slotGroupBox); - slotListView->setObjectName(QString::fromUtf8("slotListView")); + slotListView->setObjectName(QStringLiteral("slotListView")); vboxLayout1->addWidget(slotListView); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); addSlotButton = new QToolButton(slotGroupBox); - addSlotButton->setObjectName(QString::fromUtf8("addSlotButton")); + addSlotButton->setObjectName(QStringLiteral("addSlotButton")); hboxLayout->addWidget(addSlotButton); removeSlotButton = new QToolButton(slotGroupBox); - removeSlotButton->setObjectName(QString::fromUtf8("removeSlotButton")); + removeSlotButton->setObjectName(QStringLiteral("removeSlotButton")); hboxLayout->addWidget(removeSlotButton); @@ -90,26 +90,26 @@ public: vboxLayout->addWidget(slotGroupBox); signalGroupBox = new QGroupBox(SignalSlotDialogClass); - signalGroupBox->setObjectName(QString::fromUtf8("signalGroupBox")); + signalGroupBox->setObjectName(QStringLiteral("signalGroupBox")); vboxLayout2 = new QVBoxLayout(signalGroupBox); vboxLayout2->setSpacing(6); vboxLayout2->setContentsMargins(11, 11, 11, 11); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); signalListView = new QListView(signalGroupBox); - signalListView->setObjectName(QString::fromUtf8("signalListView")); + signalListView->setObjectName(QStringLiteral("signalListView")); vboxLayout2->addWidget(signalListView); hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(6); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); addSignalButton = new QToolButton(signalGroupBox); - addSignalButton->setObjectName(QString::fromUtf8("addSignalButton")); + addSignalButton->setObjectName(QStringLiteral("addSignalButton")); hboxLayout1->addWidget(addSignalButton); removeSignalButton = new QToolButton(signalGroupBox); - removeSignalButton->setObjectName(QString::fromUtf8("removeSignalButton")); + removeSignalButton->setObjectName(QStringLiteral("removeSignalButton")); hboxLayout1->addWidget(removeSignalButton); @@ -124,7 +124,7 @@ public: vboxLayout->addWidget(signalGroupBox); buttonBox = new QDialogButtonBox(SignalSlotDialogClass); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); vboxLayout->addWidget(buttonBox); diff --git a/tests/auto/tools/uic/baseline/sslclient.ui.h b/tests/auto/tools/uic/baseline/sslclient.ui.h index 4dce9be2c3..7d5b83b5db 100644 --- a/tests/auto/tools/uic/baseline/sslclient.ui.h +++ b/tests/auto/tools/uic/baseline/sslclient.ui.h @@ -52,29 +52,29 @@ public: void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) - Form->setObjectName(QString::fromUtf8("Form")); + Form->setObjectName(QStringLiteral("Form")); Form->resize(343, 320); vboxLayout = new QVBoxLayout(Form); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); gridLayout = new QGridLayout(); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); hostNameLabel = new QLabel(Form); - hostNameLabel->setObjectName(QString::fromUtf8("hostNameLabel")); + hostNameLabel->setObjectName(QStringLiteral("hostNameLabel")); gridLayout->addWidget(hostNameLabel, 0, 0, 1, 1); hostNameEdit = new QLineEdit(Form); - hostNameEdit->setObjectName(QString::fromUtf8("hostNameEdit")); + hostNameEdit->setObjectName(QStringLiteral("hostNameEdit")); gridLayout->addWidget(hostNameEdit, 0, 1, 1, 1); portLabel = new QLabel(Form); - portLabel->setObjectName(QString::fromUtf8("portLabel")); + portLabel->setObjectName(QStringLiteral("portLabel")); gridLayout->addWidget(portLabel, 1, 0, 1, 1); portBox = new QSpinBox(Form); - portBox->setObjectName(QString::fromUtf8("portBox")); + portBox->setObjectName(QStringLiteral("portBox")); portBox->setMinimum(1); portBox->setMaximum(65535); portBox->setValue(993); @@ -85,26 +85,26 @@ public: vboxLayout->addLayout(gridLayout); connectButton = new QPushButton(Form); - connectButton->setObjectName(QString::fromUtf8("connectButton")); + connectButton->setObjectName(QStringLiteral("connectButton")); connectButton->setEnabled(true); connectButton->setDefault(true); vboxLayout->addWidget(connectButton); sessionBox = new QGroupBox(Form); - sessionBox->setObjectName(QString::fromUtf8("sessionBox")); + sessionBox->setObjectName(QStringLiteral("sessionBox")); sessionBox->setEnabled(false); vboxLayout1 = new QVBoxLayout(sessionBox); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); cipherText = new QLabel(sessionBox); - cipherText->setObjectName(QString::fromUtf8("cipherText")); + cipherText->setObjectName(QStringLiteral("cipherText")); hboxLayout->addWidget(cipherText); cipherLabel = new QLabel(sessionBox); - cipherLabel->setObjectName(QString::fromUtf8("cipherLabel")); + cipherLabel->setObjectName(QStringLiteral("cipherLabel")); cipherLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); hboxLayout->addWidget(cipherLabel); @@ -113,7 +113,7 @@ public: vboxLayout1->addLayout(hboxLayout); sessionOutput = new QTextEdit(sessionBox); - sessionOutput->setObjectName(QString::fromUtf8("sessionOutput")); + sessionOutput->setObjectName(QStringLiteral("sessionOutput")); sessionOutput->setEnabled(false); sessionOutput->setFocusPolicy(Qt::NoFocus); sessionOutput->setReadOnly(true); @@ -121,20 +121,20 @@ public: vboxLayout1->addWidget(sessionOutput); hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); sessionInputLabel = new QLabel(sessionBox); - sessionInputLabel->setObjectName(QString::fromUtf8("sessionInputLabel")); + sessionInputLabel->setObjectName(QStringLiteral("sessionInputLabel")); hboxLayout1->addWidget(sessionInputLabel); sessionInput = new QLineEdit(sessionBox); - sessionInput->setObjectName(QString::fromUtf8("sessionInput")); + sessionInput->setObjectName(QStringLiteral("sessionInput")); sessionInput->setEnabled(false); hboxLayout1->addWidget(sessionInput); sendButton = new QPushButton(sessionBox); - sendButton->setObjectName(QString::fromUtf8("sendButton")); + sendButton->setObjectName(QStringLiteral("sendButton")); sendButton->setEnabled(false); sendButton->setFocusPolicy(Qt::TabFocus); sendButton->setDefault(true); diff --git a/tests/auto/tools/uic/baseline/sslerrors.ui.h b/tests/auto/tools/uic/baseline/sslerrors.ui.h index 2c3ade77bc..c542baab3c 100644 --- a/tests/auto/tools/uic/baseline/sslerrors.ui.h +++ b/tests/auto/tools/uic/baseline/sslerrors.ui.h @@ -40,25 +40,25 @@ public: void setupUi(QDialog *SslErrors) { if (SslErrors->objectName().isEmpty()) - SslErrors->setObjectName(QString::fromUtf8("SslErrors")); + SslErrors->setObjectName(QStringLiteral("SslErrors")); SslErrors->resize(371, 216); vboxLayout = new QVBoxLayout(SslErrors); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); label = new QLabel(SslErrors); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setWordWrap(true); vboxLayout->addWidget(label); sslErrorList = new QListWidget(SslErrors); - sslErrorList->setObjectName(QString::fromUtf8("sslErrorList")); + sslErrorList->setObjectName(QStringLiteral("sslErrorList")); vboxLayout->addWidget(sslErrorList); hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); certificateChainButton = new QPushButton(SslErrors); - certificateChainButton->setObjectName(QString::fromUtf8("certificateChainButton")); + certificateChainButton->setObjectName(QStringLiteral("certificateChainButton")); certificateChainButton->setAutoDefault(false); hboxLayout->addWidget(certificateChainButton); @@ -68,12 +68,12 @@ public: hboxLayout->addItem(spacerItem); pushButton = new QPushButton(SslErrors); - pushButton->setObjectName(QString::fromUtf8("pushButton")); + pushButton->setObjectName(QStringLiteral("pushButton")); hboxLayout->addWidget(pushButton); pushButton_2 = new QPushButton(SslErrors); - pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); + pushButton_2->setObjectName(QStringLiteral("pushButton_2")); hboxLayout->addWidget(pushButton_2); diff --git a/tests/auto/tools/uic/baseline/statistics.ui.h b/tests/auto/tools/uic/baseline/statistics.ui.h index b6e14b5dda..a812fb443f 100644 --- a/tests/auto/tools/uic/baseline/statistics.ui.h +++ b/tests/auto/tools/uic/baseline/statistics.ui.h @@ -93,24 +93,24 @@ public: void setupUi(QDialog *Statistics) { if (Statistics->objectName().isEmpty()) - Statistics->setObjectName(QString::fromUtf8("Statistics")); - Statistics->setObjectName(QString::fromUtf8("linguist_stats")); + Statistics->setObjectName(QStringLiteral("Statistics")); + Statistics->setObjectName(QStringLiteral("linguist_stats")); Statistics->resize(336, 164); gridLayout = new QGridLayout(Statistics); gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - gridLayout->setObjectName(QString::fromUtf8("unnamed")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); + gridLayout->setObjectName(QStringLiteral("unnamed")); hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(6); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("unnamed")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("unnamed")); spacer4_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacer4_2); closeBtn = new QPushButton(Statistics); - closeBtn->setObjectName(QString::fromUtf8("closeBtn")); + closeBtn->setObjectName(QStringLiteral("closeBtn")); hboxLayout->addWidget(closeBtn); @@ -122,66 +122,66 @@ public: gridLayout->addLayout(hboxLayout, 1, 0, 1, 1); frame4 = new QFrame(Statistics); - frame4->setObjectName(QString::fromUtf8("frame4")); + frame4->setObjectName(QStringLiteral("frame4")); frame4->setFrameShape(QFrame::StyledPanel); frame4->setFrameShadow(QFrame::Raised); gridLayout1 = new QGridLayout(frame4); gridLayout1->setSpacing(6); gridLayout1->setContentsMargins(11, 11, 11, 11); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); - gridLayout1->setObjectName(QString::fromUtf8("unnamed")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("unnamed")); textLabel4 = new QLabel(frame4); - textLabel4->setObjectName(QString::fromUtf8("textLabel4")); + textLabel4->setObjectName(QStringLiteral("textLabel4")); gridLayout1->addWidget(textLabel4, 0, 2, 1, 1); textLabel5 = new QLabel(frame4); - textLabel5->setObjectName(QString::fromUtf8("textLabel5")); + textLabel5->setObjectName(QStringLiteral("textLabel5")); gridLayout1->addWidget(textLabel5, 0, 1, 1, 1); untrWords = new QLabel(frame4); - untrWords->setObjectName(QString::fromUtf8("untrWords")); + untrWords->setObjectName(QStringLiteral("untrWords")); gridLayout1->addWidget(untrWords, 1, 1, 1, 1); trWords = new QLabel(frame4); - trWords->setObjectName(QString::fromUtf8("trWords")); + trWords->setObjectName(QStringLiteral("trWords")); gridLayout1->addWidget(trWords, 1, 2, 1, 1); textLabel1 = new QLabel(frame4); - textLabel1->setObjectName(QString::fromUtf8("textLabel1")); + textLabel1->setObjectName(QStringLiteral("textLabel1")); gridLayout1->addWidget(textLabel1, 1, 0, 1, 1); trChars = new QLabel(frame4); - trChars->setObjectName(QString::fromUtf8("trChars")); + trChars->setObjectName(QStringLiteral("trChars")); gridLayout1->addWidget(trChars, 2, 2, 1, 1); untrChars = new QLabel(frame4); - untrChars->setObjectName(QString::fromUtf8("untrChars")); + untrChars->setObjectName(QStringLiteral("untrChars")); gridLayout1->addWidget(untrChars, 2, 1, 1, 1); textLabel3 = new QLabel(frame4); - textLabel3->setObjectName(QString::fromUtf8("textLabel3")); + textLabel3->setObjectName(QStringLiteral("textLabel3")); gridLayout1->addWidget(textLabel3, 2, 0, 1, 1); textLabel6 = new QLabel(frame4); - textLabel6->setObjectName(QString::fromUtf8("textLabel6")); + textLabel6->setObjectName(QStringLiteral("textLabel6")); gridLayout1->addWidget(textLabel6, 3, 0, 1, 1); trCharsSpc = new QLabel(frame4); - trCharsSpc->setObjectName(QString::fromUtf8("trCharsSpc")); + trCharsSpc->setObjectName(QStringLiteral("trCharsSpc")); gridLayout1->addWidget(trCharsSpc, 3, 2, 1, 1); untrCharsSpc = new QLabel(frame4); - untrCharsSpc->setObjectName(QString::fromUtf8("untrCharsSpc")); + untrCharsSpc->setObjectName(QStringLiteral("untrCharsSpc")); gridLayout1->addWidget(untrCharsSpc, 3, 1, 1, 1); diff --git a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h index 7624eaec58..d3033dc594 100644 --- a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h +++ b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h @@ -99,7 +99,7 @@ public: void setupUi(QDialog *qdesigner_internal__Dialog) { if (qdesigner_internal__Dialog->objectName().isEmpty()) - qdesigner_internal__Dialog->setObjectName(QString::fromUtf8("qdesigner_internal__Dialog")); + qdesigner_internal__Dialog->setObjectName(QStringLiteral("qdesigner_internal__Dialog")); qdesigner_internal__Dialog->resize(400, 300); vboxLayout = new QVBoxLayout(qdesigner_internal__Dialog); #ifndef Q_OS_MAC @@ -108,9 +108,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(qdesigner_internal__Dialog); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -118,7 +118,7 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); vboxLayout1 = new QVBoxLayout(); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -126,7 +126,7 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(0, 0, 0, 0); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -134,15 +134,15 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); newButton = new QToolButton(groupBox); - newButton->setObjectName(QString::fromUtf8("newButton")); + newButton->setObjectName(QStringLiteral("newButton")); newButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); hboxLayout->addWidget(newButton); deleteButton = new QToolButton(groupBox); - deleteButton->setObjectName(QString::fromUtf8("deleteButton")); + deleteButton->setObjectName(QStringLiteral("deleteButton")); deleteButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); hboxLayout->addWidget(deleteButton); @@ -159,14 +159,14 @@ public: hboxLayout1->setSpacing(6); #endif hboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); hboxLayout1->addWidget(label); valueEdit = new QLineEdit(groupBox); - valueEdit->setObjectName(QString::fromUtf8("valueEdit")); + valueEdit->setObjectName(QStringLiteral("valueEdit")); hboxLayout1->addWidget(valueEdit); @@ -181,18 +181,18 @@ public: vboxLayout2->setSpacing(6); #endif vboxLayout2->setContentsMargins(0, 0, 0, 0); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); spacerItem1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout2->addItem(spacerItem1); upButton = new QToolButton(groupBox); - upButton->setObjectName(QString::fromUtf8("upButton")); + upButton->setObjectName(QStringLiteral("upButton")); vboxLayout2->addWidget(upButton); downButton = new QToolButton(groupBox); - downButton->setObjectName(QString::fromUtf8("downButton")); + downButton->setObjectName(QStringLiteral("downButton")); vboxLayout2->addWidget(downButton); @@ -204,7 +204,7 @@ public: gridLayout->addLayout(vboxLayout2, 0, 1, 1, 1); listView = new QListView(groupBox); - listView->setObjectName(QString::fromUtf8("listView")); + listView->setObjectName(QStringLiteral("listView")); gridLayout->addWidget(listView, 0, 0, 1, 1); @@ -212,7 +212,7 @@ public: vboxLayout->addWidget(groupBox); buttonBox = new QDialogButtonBox(qdesigner_internal__Dialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h index f5e8e2ea98..e4b2deb498 100644 --- a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h @@ -45,7 +45,7 @@ public: void setupUi(QWidget *StyleSheetEditor) { if (StyleSheetEditor->objectName().isEmpty()) - StyleSheetEditor->setObjectName(QString::fromUtf8("StyleSheetEditor")); + StyleSheetEditor->setObjectName(QStringLiteral("StyleSheetEditor")); StyleSheetEditor->resize(445, 289); gridLayout = new QGridLayout(StyleSheetEditor); #ifndef Q_OS_MAC @@ -54,7 +54,7 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); spacerItem = new QSpacerItem(32, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); gridLayout->addItem(spacerItem, 0, 6, 1, 1); @@ -64,7 +64,7 @@ public: gridLayout->addItem(spacerItem1, 0, 0, 1, 1); styleSheetCombo = new QComboBox(StyleSheetEditor); - styleSheetCombo->setObjectName(QString::fromUtf8("styleSheetCombo")); + styleSheetCombo->setObjectName(QStringLiteral("styleSheetCombo")); gridLayout->addWidget(styleSheetCombo, 0, 5, 1, 1); @@ -73,7 +73,7 @@ public: gridLayout->addItem(spacerItem2, 0, 3, 1, 1); styleCombo = new QComboBox(StyleSheetEditor); - styleCombo->setObjectName(QString::fromUtf8("styleCombo")); + styleCombo->setObjectName(QStringLiteral("styleCombo")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -83,7 +83,7 @@ public: gridLayout->addWidget(styleCombo, 0, 2, 1, 1); label_7 = new QLabel(StyleSheetEditor); - label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setObjectName(QStringLiteral("label_7")); QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(5)); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -97,13 +97,13 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); spacerItem3 = new QSpacerItem(321, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem3); applyButton = new QPushButton(StyleSheetEditor); - applyButton->setObjectName(QString::fromUtf8("applyButton")); + applyButton->setObjectName(QStringLiteral("applyButton")); applyButton->setEnabled(false); hboxLayout->addWidget(applyButton); @@ -112,12 +112,12 @@ public: gridLayout->addLayout(hboxLayout, 2, 0, 1, 7); styleTextEdit = new QTextEdit(StyleSheetEditor); - styleTextEdit->setObjectName(QString::fromUtf8("styleTextEdit")); + styleTextEdit->setObjectName(QStringLiteral("styleTextEdit")); gridLayout->addWidget(styleTextEdit, 1, 0, 1, 7); label_8 = new QLabel(StyleSheetEditor); - label_8->setObjectName(QString::fromUtf8("label_8")); + label_8->setObjectName(QStringLiteral("label_8")); sizePolicy1.setHeightForWidth(label_8->sizePolicy().hasHeightForWidth()); label_8->setSizePolicy(sizePolicy1); diff --git a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h index 424871f688..1e99c41312 100644 --- a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h +++ b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h @@ -93,28 +93,28 @@ public: void setupUi(QWidget *TabbedBrowser) { if (TabbedBrowser->objectName().isEmpty()) - TabbedBrowser->setObjectName(QString::fromUtf8("TabbedBrowser")); + TabbedBrowser->setObjectName(QStringLiteral("TabbedBrowser")); TabbedBrowser->resize(710, 664); vboxLayout = new QVBoxLayout(TabbedBrowser); vboxLayout->setSpacing(0); vboxLayout->setContentsMargins(0, 0, 0, 0); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); tab = new QTabWidget(TabbedBrowser); - tab->setObjectName(QString::fromUtf8("tab")); + tab->setObjectName(QStringLiteral("tab")); frontpage = new QWidget(); - frontpage->setObjectName(QString::fromUtf8("frontpage")); + frontpage->setObjectName(QStringLiteral("frontpage")); gridLayout = new QGridLayout(frontpage); #ifndef Q_OS_MAC gridLayout->setSpacing(6); #endif gridLayout->setContentsMargins(8, 8, 8, 8); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); tab->addTab(frontpage, QString()); vboxLayout->addWidget(tab); frameFind = new QFrame(TabbedBrowser); - frameFind->setObjectName(QString::fromUtf8("frameFind")); + frameFind->setObjectName(QStringLiteral("frameFind")); frameFind->setFrameShape(QFrame::StyledPanel); frameFind->setFrameShadow(QFrame::Raised); hboxLayout = new QHBoxLayout(frameFind); @@ -122,9 +122,9 @@ public: hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); toolClose = new QToolButton(frameFind); - toolClose->setObjectName(QString::fromUtf8("toolClose")); + toolClose->setObjectName(QStringLiteral("toolClose")); const QIcon icon = QIcon(QString::fromUtf8(":/trolltech/assistant/images/close.png")); toolClose->setIcon(icon); toolClose->setAutoRaise(true); @@ -132,7 +132,7 @@ public: hboxLayout->addWidget(toolClose); editFind = new QLineEdit(frameFind); - editFind->setObjectName(QString::fromUtf8("editFind")); + editFind->setObjectName(QStringLiteral("editFind")); QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(0)); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -143,7 +143,7 @@ public: hboxLayout->addWidget(editFind); toolPrevious = new QToolButton(frameFind); - toolPrevious->setObjectName(QString::fromUtf8("toolPrevious")); + toolPrevious->setObjectName(QStringLiteral("toolPrevious")); const QIcon icon1 = QIcon(QString::fromUtf8(":/trolltech/assistant/images/win/previous.png")); toolPrevious->setIcon(icon1); toolPrevious->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -152,7 +152,7 @@ public: hboxLayout->addWidget(toolPrevious); toolNext = new QToolButton(frameFind); - toolNext->setObjectName(QString::fromUtf8("toolNext")); + toolNext->setObjectName(QStringLiteral("toolNext")); toolNext->setMinimumSize(QSize(0, 0)); const QIcon icon2 = QIcon(QString::fromUtf8(":/trolltech/assistant/images/win/next.png")); toolNext->setIcon(icon2); @@ -163,17 +163,17 @@ public: hboxLayout->addWidget(toolNext); checkCase = new QCheckBox(frameFind); - checkCase->setObjectName(QString::fromUtf8("checkCase")); + checkCase->setObjectName(QStringLiteral("checkCase")); hboxLayout->addWidget(checkCase); checkWholeWords = new QCheckBox(frameFind); - checkWholeWords->setObjectName(QString::fromUtf8("checkWholeWords")); + checkWholeWords->setObjectName(QStringLiteral("checkWholeWords")); hboxLayout->addWidget(checkWholeWords); labelWrapped = new QLabel(frameFind); - labelWrapped->setObjectName(QString::fromUtf8("labelWrapped")); + labelWrapped->setObjectName(QStringLiteral("labelWrapped")); labelWrapped->setMinimumSize(QSize(0, 20)); labelWrapped->setMaximumSize(QSize(105, 20)); labelWrapped->setTextFormat(Qt::RichText); diff --git a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h index da5357d1fd..50542353c4 100644 --- a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h @@ -120,28 +120,28 @@ public: void setupUi(QDialog *qdesigner_internal__TableWidgetEditor) { if (qdesigner_internal__TableWidgetEditor->objectName().isEmpty()) - qdesigner_internal__TableWidgetEditor->setObjectName(QString::fromUtf8("qdesigner_internal__TableWidgetEditor")); + qdesigner_internal__TableWidgetEditor->setObjectName(QStringLiteral("qdesigner_internal__TableWidgetEditor")); qdesigner_internal__TableWidgetEditor->resize(591, 455); gridLayout_4 = new QGridLayout(qdesigner_internal__TableWidgetEditor); - gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); + gridLayout_4->setObjectName(QStringLiteral("gridLayout_4")); itemsBox = new QGroupBox(qdesigner_internal__TableWidgetEditor); - itemsBox->setObjectName(QString::fromUtf8("itemsBox")); + itemsBox->setObjectName(QStringLiteral("itemsBox")); gridLayout = new QGridLayout(itemsBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); tableWidget = new QTableWidget(itemsBox); - tableWidget->setObjectName(QString::fromUtf8("tableWidget")); + tableWidget->setObjectName(QStringLiteral("tableWidget")); gridLayout->addWidget(tableWidget, 0, 0, 1, 1); horizontalLayout_5 = new QHBoxLayout(); - horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5")); + horizontalLayout_5->setObjectName(QStringLiteral("horizontalLayout_5")); label_3 = new QLabel(itemsBox); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); horizontalLayout_5->addWidget(label_3); itemIconSelector = new qdesigner_internal::IconSelector(itemsBox); - itemIconSelector->setObjectName(QString::fromUtf8("itemIconSelector")); + itemIconSelector->setObjectName(QStringLiteral("itemIconSelector")); horizontalLayout_5->addWidget(itemIconSelector); @@ -156,14 +156,14 @@ public: gridLayout_4->addWidget(itemsBox, 0, 0, 1, 1); buttonBox = new QDialogButtonBox(qdesigner_internal__TableWidgetEditor); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); gridLayout_4->addWidget(buttonBox, 1, 0, 1, 2); widget = new QWidget(qdesigner_internal__TableWidgetEditor); - widget->setObjectName(QString::fromUtf8("widget")); + widget->setObjectName(QStringLiteral("widget")); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -171,13 +171,13 @@ public: widget->setSizePolicy(sizePolicy); verticalLayout = new QVBoxLayout(widget); verticalLayout->setContentsMargins(0, 0, 0, 0); - verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); columnsBox = new QGroupBox(widget); - columnsBox->setObjectName(QString::fromUtf8("columnsBox")); + columnsBox->setObjectName(QStringLiteral("columnsBox")); gridLayout_2 = new QGridLayout(columnsBox); - gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); columnsListWidget = new QListWidget(columnsBox); - columnsListWidget->setObjectName(QString::fromUtf8("columnsListWidget")); + columnsListWidget->setObjectName(QStringLiteral("columnsListWidget")); QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -188,14 +188,14 @@ public: gridLayout_2->addWidget(columnsListWidget, 0, 0, 1, 1); horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); + horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); newColumnButton = new QToolButton(columnsBox); - newColumnButton->setObjectName(QString::fromUtf8("newColumnButton")); + newColumnButton->setObjectName(QStringLiteral("newColumnButton")); horizontalLayout_3->addWidget(newColumnButton); deleteColumnButton = new QToolButton(columnsBox); - deleteColumnButton->setObjectName(QString::fromUtf8("deleteColumnButton")); + deleteColumnButton->setObjectName(QStringLiteral("deleteColumnButton")); horizontalLayout_3->addWidget(deleteColumnButton); @@ -204,12 +204,12 @@ public: horizontalLayout_3->addItem(spacerItem); moveColumnUpButton = new QToolButton(columnsBox); - moveColumnUpButton->setObjectName(QString::fromUtf8("moveColumnUpButton")); + moveColumnUpButton->setObjectName(QStringLiteral("moveColumnUpButton")); horizontalLayout_3->addWidget(moveColumnUpButton); moveColumnDownButton = new QToolButton(columnsBox); - moveColumnDownButton->setObjectName(QString::fromUtf8("moveColumnDownButton")); + moveColumnDownButton->setObjectName(QStringLiteral("moveColumnDownButton")); horizontalLayout_3->addWidget(moveColumnDownButton); @@ -217,14 +217,14 @@ public: gridLayout_2->addLayout(horizontalLayout_3, 1, 0, 1, 1); horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); label = new QLabel(columnsBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); horizontalLayout_2->addWidget(label); columnIconSelector = new qdesigner_internal::IconSelector(columnsBox); - columnIconSelector->setObjectName(QString::fromUtf8("columnIconSelector")); + columnIconSelector->setObjectName(QStringLiteral("columnIconSelector")); horizontalLayout_2->addWidget(columnIconSelector); @@ -239,11 +239,11 @@ public: verticalLayout->addWidget(columnsBox); rowsBox = new QGroupBox(widget); - rowsBox->setObjectName(QString::fromUtf8("rowsBox")); + rowsBox->setObjectName(QStringLiteral("rowsBox")); gridLayout_3 = new QGridLayout(rowsBox); - gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); rowsListWidget = new QListWidget(rowsBox); - rowsListWidget->setObjectName(QString::fromUtf8("rowsListWidget")); + rowsListWidget->setObjectName(QStringLiteral("rowsListWidget")); sizePolicy1.setHeightForWidth(rowsListWidget->sizePolicy().hasHeightForWidth()); rowsListWidget->setSizePolicy(sizePolicy1); rowsListWidget->setFocusPolicy(Qt::TabFocus); @@ -251,14 +251,14 @@ public: gridLayout_3->addWidget(rowsListWidget, 0, 0, 1, 1); horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); + horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); newRowButton = new QToolButton(rowsBox); - newRowButton->setObjectName(QString::fromUtf8("newRowButton")); + newRowButton->setObjectName(QStringLiteral("newRowButton")); horizontalLayout_4->addWidget(newRowButton); deleteRowButton = new QToolButton(rowsBox); - deleteRowButton->setObjectName(QString::fromUtf8("deleteRowButton")); + deleteRowButton->setObjectName(QStringLiteral("deleteRowButton")); horizontalLayout_4->addWidget(deleteRowButton); @@ -267,12 +267,12 @@ public: horizontalLayout_4->addItem(spacerItem2); moveRowUpButton = new QToolButton(rowsBox); - moveRowUpButton->setObjectName(QString::fromUtf8("moveRowUpButton")); + moveRowUpButton->setObjectName(QStringLiteral("moveRowUpButton")); horizontalLayout_4->addWidget(moveRowUpButton); moveRowDownButton = new QToolButton(rowsBox); - moveRowDownButton->setObjectName(QString::fromUtf8("moveRowDownButton")); + moveRowDownButton->setObjectName(QStringLiteral("moveRowDownButton")); horizontalLayout_4->addWidget(moveRowDownButton); @@ -280,14 +280,14 @@ public: gridLayout_3->addLayout(horizontalLayout_4, 1, 0, 1, 1); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); label_2 = new QLabel(rowsBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); horizontalLayout->addWidget(label_2); rowIconSelector = new qdesigner_internal::IconSelector(rowsBox); - rowIconSelector->setObjectName(QString::fromUtf8("rowIconSelector")); + rowIconSelector->setObjectName(QStringLiteral("rowIconSelector")); horizontalLayout->addWidget(rowIconSelector); diff --git a/tests/auto/tools/uic/baseline/tetrixwindow.ui.h b/tests/auto/tools/uic/baseline/tetrixwindow.ui.h index 7d29265ba3..48d6a4e6a3 100644 --- a/tests/auto/tools/uic/baseline/tetrixwindow.ui.h +++ b/tests/auto/tools/uic/baseline/tetrixwindow.ui.h @@ -46,7 +46,7 @@ public: void setupUi(QWidget *TetrixWindow) { if (TetrixWindow->objectName().isEmpty()) - TetrixWindow->setObjectName(QString::fromUtf8("TetrixWindow")); + TetrixWindow->setObjectName(QStringLiteral("TetrixWindow")); TetrixWindow->resize(537, 475); vboxLayout = new QVBoxLayout(TetrixWindow); #ifndef Q_OS_MAC @@ -55,7 +55,7 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); gridLayout = new QGridLayout(); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -63,39 +63,39 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(0, 0, 0, 0); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); startButton = new QPushButton(TetrixWindow); - startButton->setObjectName(QString::fromUtf8("startButton")); + startButton->setObjectName(QStringLiteral("startButton")); startButton->setFocusPolicy(Qt::NoFocus); gridLayout->addWidget(startButton, 4, 0, 1, 1); linesLcd = new QLCDNumber(TetrixWindow); - linesLcd->setObjectName(QString::fromUtf8("linesLcd")); + linesLcd->setObjectName(QStringLiteral("linesLcd")); linesLcd->setSegmentStyle(QLCDNumber::Filled); gridLayout->addWidget(linesLcd, 3, 2, 1, 1); linesRemovedLabel = new QLabel(TetrixWindow); - linesRemovedLabel->setObjectName(QString::fromUtf8("linesRemovedLabel")); + linesRemovedLabel->setObjectName(QStringLiteral("linesRemovedLabel")); linesRemovedLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter); gridLayout->addWidget(linesRemovedLabel, 2, 2, 1, 1); pauseButton = new QPushButton(TetrixWindow); - pauseButton->setObjectName(QString::fromUtf8("pauseButton")); + pauseButton->setObjectName(QStringLiteral("pauseButton")); pauseButton->setFocusPolicy(Qt::NoFocus); gridLayout->addWidget(pauseButton, 5, 2, 1, 1); scoreLcd = new QLCDNumber(TetrixWindow); - scoreLcd->setObjectName(QString::fromUtf8("scoreLcd")); + scoreLcd->setObjectName(QStringLiteral("scoreLcd")); scoreLcd->setSegmentStyle(QLCDNumber::Filled); gridLayout->addWidget(scoreLcd, 1, 2, 1, 1); board = new TetrixBoard(TetrixWindow); - board->setObjectName(QString::fromUtf8("board")); + board->setObjectName(QStringLiteral("board")); board->setFocusPolicy(Qt::StrongFocus); board->setFrameShape(QFrame::Panel); board->setFrameShadow(QFrame::Sunken); @@ -103,31 +103,31 @@ public: gridLayout->addWidget(board, 0, 1, 6, 1); levelLabel = new QLabel(TetrixWindow); - levelLabel->setObjectName(QString::fromUtf8("levelLabel")); + levelLabel->setObjectName(QStringLiteral("levelLabel")); levelLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter); gridLayout->addWidget(levelLabel, 2, 0, 1, 1); nextLabel = new QLabel(TetrixWindow); - nextLabel->setObjectName(QString::fromUtf8("nextLabel")); + nextLabel->setObjectName(QStringLiteral("nextLabel")); nextLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter); gridLayout->addWidget(nextLabel, 0, 0, 1, 1); levelLcd = new QLCDNumber(TetrixWindow); - levelLcd->setObjectName(QString::fromUtf8("levelLcd")); + levelLcd->setObjectName(QStringLiteral("levelLcd")); levelLcd->setSegmentStyle(QLCDNumber::Filled); gridLayout->addWidget(levelLcd, 3, 0, 1, 1); scoreLabel = new QLabel(TetrixWindow); - scoreLabel->setObjectName(QString::fromUtf8("scoreLabel")); + scoreLabel->setObjectName(QStringLiteral("scoreLabel")); scoreLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter); gridLayout->addWidget(scoreLabel, 0, 2, 1, 1); nextPieceLabel = new QLabel(TetrixWindow); - nextPieceLabel->setObjectName(QString::fromUtf8("nextPieceLabel")); + nextPieceLabel->setObjectName(QStringLiteral("nextPieceLabel")); nextPieceLabel->setFrameShape(QFrame::Box); nextPieceLabel->setFrameShadow(QFrame::Raised); nextPieceLabel->setAlignment(Qt::AlignCenter); @@ -135,7 +135,7 @@ public: gridLayout->addWidget(nextPieceLabel, 1, 0, 1, 1); quitButton = new QPushButton(TetrixWindow); - quitButton->setObjectName(QString::fromUtf8("quitButton")); + quitButton->setObjectName(QStringLiteral("quitButton")); quitButton->setFocusPolicy(Qt::NoFocus); gridLayout->addWidget(quitButton, 4, 2, 1, 1); diff --git a/tests/auto/tools/uic/baseline/textfinder.ui.h b/tests/auto/tools/uic/baseline/textfinder.ui.h index 4d6e57b3f9..9a5641c3de 100644 --- a/tests/auto/tools/uic/baseline/textfinder.ui.h +++ b/tests/auto/tools/uic/baseline/textfinder.ui.h @@ -40,7 +40,7 @@ public: void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) - Form->setObjectName(QString::fromUtf8("Form")); + Form->setObjectName(QStringLiteral("Form")); Form->resize(378, 158); vboxLayout = new QVBoxLayout(Form); #ifndef Q_OS_MAC @@ -49,7 +49,7 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); gridLayout = new QGridLayout(); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -57,19 +57,19 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(0, 0, 0, 0); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); lineEdit = new QLineEdit(Form); - lineEdit->setObjectName(QString::fromUtf8("lineEdit")); + lineEdit->setObjectName(QStringLiteral("lineEdit")); gridLayout->addWidget(lineEdit, 0, 1, 1, 1); searchLabel = new QLabel(Form); - searchLabel->setObjectName(QString::fromUtf8("searchLabel")); + searchLabel->setObjectName(QStringLiteral("searchLabel")); gridLayout->addWidget(searchLabel, 0, 0, 1, 1); findButton = new QPushButton(Form); - findButton->setObjectName(QString::fromUtf8("findButton")); + findButton->setObjectName(QStringLiteral("findButton")); gridLayout->addWidget(findButton, 0, 2, 1, 1); @@ -77,7 +77,7 @@ public: vboxLayout->addLayout(gridLayout); textEdit = new QTextEdit(Form); - textEdit->setObjectName(QString::fromUtf8("textEdit")); + textEdit->setObjectName(QStringLiteral("textEdit")); vboxLayout->addWidget(textEdit); diff --git a/tests/auto/tools/uic/baseline/topicchooser.ui.h b/tests/auto/tools/uic/baseline/topicchooser.ui.h index cf3186c1d9..3b16d5a627 100644 --- a/tests/auto/tools/uic/baseline/topicchooser.ui.h +++ b/tests/auto/tools/uic/baseline/topicchooser.ui.h @@ -41,7 +41,7 @@ public: void setupUi(QDialog *TopicChooser) { if (TopicChooser->objectName().isEmpty()) - TopicChooser->setObjectName(QString::fromUtf8("TopicChooser")); + TopicChooser->setObjectName(QStringLiteral("TopicChooser")); TopicChooser->resize(391, 223); TopicChooser->setSizeGripEnabled(true); vboxLayout = new QVBoxLayout(TopicChooser); @@ -49,41 +49,41 @@ public: vboxLayout->setSpacing(6); #endif vboxLayout->setContentsMargins(11, 11, 11, 11); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setObjectName(QString::fromUtf8("unnamed")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("unnamed")); label = new QLabel(TopicChooser); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); vboxLayout->addWidget(label); listWidget = new QListWidget(TopicChooser); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); vboxLayout->addWidget(listWidget); Layout16 = new QWidget(TopicChooser); - Layout16->setObjectName(QString::fromUtf8("Layout16")); + Layout16->setObjectName(QStringLiteral("Layout16")); hboxLayout = new QHBoxLayout(Layout16); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); #endif hboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - hboxLayout->setObjectName(QString::fromUtf8("unnamed")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("unnamed")); hboxLayout->setContentsMargins(0, 0, 0, 0); Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(Horizontal_Spacing2); buttonDisplay = new QPushButton(Layout16); - buttonDisplay->setObjectName(QString::fromUtf8("buttonDisplay")); + buttonDisplay->setObjectName(QStringLiteral("buttonDisplay")); buttonDisplay->setAutoDefault(true); buttonDisplay->setDefault(true); hboxLayout->addWidget(buttonDisplay); buttonCancel = new QPushButton(Layout16); - buttonCancel->setObjectName(QString::fromUtf8("buttonCancel")); + buttonCancel->setObjectName(QStringLiteral("buttonCancel")); buttonCancel->setAutoDefault(true); hboxLayout->addWidget(buttonCancel); diff --git a/tests/auto/tools/uic/baseline/translatedialog.ui.h b/tests/auto/tools/uic/baseline/translatedialog.ui.h index 8ff12becc9..d811b13720 100644 --- a/tests/auto/tools/uic/baseline/translatedialog.ui.h +++ b/tests/auto/tools/uic/baseline/translatedialog.ui.h @@ -96,7 +96,7 @@ public: void setupUi(QDialog *TranslateDialog) { if (TranslateDialog->objectName().isEmpty()) - TranslateDialog->setObjectName(QString::fromUtf8("TranslateDialog")); + TranslateDialog->setObjectName(QStringLiteral("TranslateDialog")); TranslateDialog->resize(407, 145); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); sizePolicy.setHorizontalStretch(0); @@ -106,35 +106,35 @@ public: hboxLayout = new QHBoxLayout(TranslateDialog); hboxLayout->setSpacing(6); hboxLayout->setContentsMargins(11, 11, 11, 11); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); hboxLayout->setContentsMargins(9, 9, 9, 9); vboxLayout = new QVBoxLayout(); vboxLayout->setSpacing(6); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); vboxLayout->setContentsMargins(0, 0, 0, 0); gridLayout = new QGridLayout(); gridLayout->setSpacing(6); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); gridLayout->setHorizontalSpacing(6); gridLayout->setVerticalSpacing(6); gridLayout->setContentsMargins(0, 0, 0, 0); ledTranslateTo = new QLineEdit(TranslateDialog); - ledTranslateTo->setObjectName(QString::fromUtf8("ledTranslateTo")); + ledTranslateTo->setObjectName(QStringLiteral("ledTranslateTo")); gridLayout->addWidget(ledTranslateTo, 1, 1, 1, 1); findWhat = new QLabel(TranslateDialog); - findWhat->setObjectName(QString::fromUtf8("findWhat")); + findWhat->setObjectName(QStringLiteral("findWhat")); gridLayout->addWidget(findWhat, 0, 0, 1, 1); translateTo = new QLabel(TranslateDialog); - translateTo->setObjectName(QString::fromUtf8("translateTo")); + translateTo->setObjectName(QStringLiteral("translateTo")); gridLayout->addWidget(translateTo, 1, 0, 1, 1); ledFindWhat = new QLineEdit(TranslateDialog); - ledFindWhat->setObjectName(QString::fromUtf8("ledFindWhat")); + ledFindWhat->setObjectName(QStringLiteral("ledFindWhat")); gridLayout->addWidget(ledFindWhat, 0, 1, 1, 1); @@ -142,18 +142,18 @@ public: vboxLayout->addLayout(gridLayout); groupBox = new QGroupBox(TranslateDialog); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); vboxLayout1 = new QVBoxLayout(groupBox); vboxLayout1->setSpacing(6); vboxLayout1->setContentsMargins(11, 11, 11, 11); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); ckMatchCase = new QCheckBox(groupBox); - ckMatchCase->setObjectName(QString::fromUtf8("ckMatchCase")); + ckMatchCase->setObjectName(QStringLiteral("ckMatchCase")); vboxLayout1->addWidget(ckMatchCase); ckMarkFinished = new QCheckBox(groupBox); - ckMarkFinished->setObjectName(QString::fromUtf8("ckMarkFinished")); + ckMarkFinished->setObjectName(QStringLiteral("ckMarkFinished")); vboxLayout1->addWidget(ckMarkFinished); @@ -169,27 +169,27 @@ public: vboxLayout2 = new QVBoxLayout(); vboxLayout2->setSpacing(6); - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); vboxLayout2->setContentsMargins(0, 0, 0, 0); findNxt = new QPushButton(TranslateDialog); - findNxt->setObjectName(QString::fromUtf8("findNxt")); + findNxt->setObjectName(QStringLiteral("findNxt")); findNxt->setDefault(true); findNxt->setFlat(false); vboxLayout2->addWidget(findNxt); translate = new QPushButton(TranslateDialog); - translate->setObjectName(QString::fromUtf8("translate")); + translate->setObjectName(QStringLiteral("translate")); vboxLayout2->addWidget(translate); translateAll = new QPushButton(TranslateDialog); - translateAll->setObjectName(QString::fromUtf8("translateAll")); + translateAll->setObjectName(QStringLiteral("translateAll")); vboxLayout2->addWidget(translateAll); cancel = new QPushButton(TranslateDialog); - cancel->setObjectName(QString::fromUtf8("cancel")); + cancel->setObjectName(QStringLiteral("cancel")); vboxLayout2->addWidget(cancel); diff --git a/tests/auto/tools/uic/baseline/translationsettings.ui.h b/tests/auto/tools/uic/baseline/translationsettings.ui.h index 770d43216b..22d764a67a 100644 --- a/tests/auto/tools/uic/baseline/translationsettings.ui.h +++ b/tests/auto/tools/uic/baseline/translationsettings.ui.h @@ -40,7 +40,7 @@ public: void setupUi(QDialog *TranslationSettings) { if (TranslationSettings->objectName().isEmpty()) - TranslationSettings->setObjectName(QString::fromUtf8("TranslationSettings")); + TranslationSettings->setObjectName(QStringLiteral("TranslationSettings")); TranslationSettings->resize(346, 125); vboxLayout = new QVBoxLayout(TranslationSettings); #ifndef Q_OS_MAC @@ -49,9 +49,9 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); groupBox = new QGroupBox(TranslationSettings); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); gridLayout = new QGridLayout(groupBox); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -59,24 +59,24 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(9, 9, 9, 9); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); cbLanguageList = new QComboBox(groupBox); - cbLanguageList->setObjectName(QString::fromUtf8("cbLanguageList")); + cbLanguageList->setObjectName(QStringLiteral("cbLanguageList")); gridLayout->addWidget(cbLanguageList, 0, 1, 1, 1); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 0, 0, 1, 1); cbCountryList = new QComboBox(groupBox); - cbCountryList->setObjectName(QString::fromUtf8("cbCountryList")); + cbCountryList->setObjectName(QStringLiteral("cbCountryList")); gridLayout->addWidget(cbCountryList, 1, 1, 1, 1); lblCountry = new QLabel(groupBox); - lblCountry->setObjectName(QString::fromUtf8("lblCountry")); + lblCountry->setObjectName(QStringLiteral("lblCountry")); gridLayout->addWidget(lblCountry, 1, 0, 1, 1); @@ -84,7 +84,7 @@ public: vboxLayout->addWidget(groupBox); buttonBox = new QDialogButtonBox(TranslationSettings); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h index 843737fe59..3f94c2117e 100644 --- a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h +++ b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h @@ -112,34 +112,34 @@ public: void setupUi(QDialog *qdesigner_internal__TreeWidgetEditor) { if (qdesigner_internal__TreeWidgetEditor->objectName().isEmpty()) - qdesigner_internal__TreeWidgetEditor->setObjectName(QString::fromUtf8("qdesigner_internal__TreeWidgetEditor")); + qdesigner_internal__TreeWidgetEditor->setObjectName(QStringLiteral("qdesigner_internal__TreeWidgetEditor")); qdesigner_internal__TreeWidgetEditor->resize(619, 321); gridLayout_3 = new QGridLayout(qdesigner_internal__TreeWidgetEditor); - gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); + gridLayout_3->setObjectName(QStringLiteral("gridLayout_3")); itemsBox = new QGroupBox(qdesigner_internal__TreeWidgetEditor); - itemsBox->setObjectName(QString::fromUtf8("itemsBox")); + itemsBox->setObjectName(QStringLiteral("itemsBox")); gridLayout = new QGridLayout(itemsBox); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); treeWidget = new QTreeWidget(itemsBox); - treeWidget->setObjectName(QString::fromUtf8("treeWidget")); + treeWidget->setObjectName(QStringLiteral("treeWidget")); treeWidget->setFocusPolicy(Qt::TabFocus); gridLayout->addWidget(treeWidget, 0, 0, 1, 1); horizontalLayout_4 = new QHBoxLayout(); - horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); + horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4")); newItemButton = new QToolButton(itemsBox); - newItemButton->setObjectName(QString::fromUtf8("newItemButton")); + newItemButton->setObjectName(QStringLiteral("newItemButton")); horizontalLayout_4->addWidget(newItemButton); newSubItemButton = new QToolButton(itemsBox); - newSubItemButton->setObjectName(QString::fromUtf8("newSubItemButton")); + newSubItemButton->setObjectName(QStringLiteral("newSubItemButton")); horizontalLayout_4->addWidget(newSubItemButton); deleteItemButton = new QToolButton(itemsBox); - deleteItemButton->setObjectName(QString::fromUtf8("deleteItemButton")); + deleteItemButton->setObjectName(QStringLiteral("deleteItemButton")); horizontalLayout_4->addWidget(deleteItemButton); @@ -148,22 +148,22 @@ public: horizontalLayout_4->addItem(spacerItem); moveItemLeftButton = new QToolButton(itemsBox); - moveItemLeftButton->setObjectName(QString::fromUtf8("moveItemLeftButton")); + moveItemLeftButton->setObjectName(QStringLiteral("moveItemLeftButton")); horizontalLayout_4->addWidget(moveItemLeftButton); moveItemRightButton = new QToolButton(itemsBox); - moveItemRightButton->setObjectName(QString::fromUtf8("moveItemRightButton")); + moveItemRightButton->setObjectName(QStringLiteral("moveItemRightButton")); horizontalLayout_4->addWidget(moveItemRightButton); moveItemUpButton = new QToolButton(itemsBox); - moveItemUpButton->setObjectName(QString::fromUtf8("moveItemUpButton")); + moveItemUpButton->setObjectName(QStringLiteral("moveItemUpButton")); horizontalLayout_4->addWidget(moveItemUpButton); moveItemDownButton = new QToolButton(itemsBox); - moveItemDownButton->setObjectName(QString::fromUtf8("moveItemDownButton")); + moveItemDownButton->setObjectName(QStringLiteral("moveItemDownButton")); horizontalLayout_4->addWidget(moveItemDownButton); @@ -171,14 +171,14 @@ public: gridLayout->addLayout(horizontalLayout_4, 1, 0, 1, 1); horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2")); + horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2")); label_2 = new QLabel(itemsBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); horizontalLayout_2->addWidget(label_2); itemIconSelector = new qdesigner_internal::IconSelector(itemsBox); - itemIconSelector->setObjectName(QString::fromUtf8("itemIconSelector")); + itemIconSelector->setObjectName(QStringLiteral("itemIconSelector")); horizontalLayout_2->addWidget(itemIconSelector); @@ -193,16 +193,16 @@ public: gridLayout_3->addWidget(itemsBox, 0, 0, 1, 1); columnsBox = new QGroupBox(qdesigner_internal__TreeWidgetEditor); - columnsBox->setObjectName(QString::fromUtf8("columnsBox")); + columnsBox->setObjectName(QStringLiteral("columnsBox")); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(columnsBox->sizePolicy().hasHeightForWidth()); columnsBox->setSizePolicy(sizePolicy); gridLayout_2 = new QGridLayout(columnsBox); - gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); listWidget = new QListWidget(columnsBox); - listWidget->setObjectName(QString::fromUtf8("listWidget")); + listWidget->setObjectName(QStringLiteral("listWidget")); QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -213,14 +213,14 @@ public: gridLayout_2->addWidget(listWidget, 0, 0, 1, 1); horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3")); + horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3")); newColumnButton = new QToolButton(columnsBox); - newColumnButton->setObjectName(QString::fromUtf8("newColumnButton")); + newColumnButton->setObjectName(QStringLiteral("newColumnButton")); horizontalLayout_3->addWidget(newColumnButton); deleteColumnButton = new QToolButton(columnsBox); - deleteColumnButton->setObjectName(QString::fromUtf8("deleteColumnButton")); + deleteColumnButton->setObjectName(QStringLiteral("deleteColumnButton")); horizontalLayout_3->addWidget(deleteColumnButton); @@ -229,12 +229,12 @@ public: horizontalLayout_3->addItem(spacerItem1); moveColumnUpButton = new QToolButton(columnsBox); - moveColumnUpButton->setObjectName(QString::fromUtf8("moveColumnUpButton")); + moveColumnUpButton->setObjectName(QStringLiteral("moveColumnUpButton")); horizontalLayout_3->addWidget(moveColumnUpButton); moveColumnDownButton = new QToolButton(columnsBox); - moveColumnDownButton->setObjectName(QString::fromUtf8("moveColumnDownButton")); + moveColumnDownButton->setObjectName(QStringLiteral("moveColumnDownButton")); horizontalLayout_3->addWidget(moveColumnDownButton); @@ -242,14 +242,14 @@ public: gridLayout_2->addLayout(horizontalLayout_3, 1, 0, 1, 1); horizontalLayout = new QHBoxLayout(); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setObjectName(QStringLiteral("horizontalLayout")); label = new QLabel(columnsBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); horizontalLayout->addWidget(label); columnIconSelector = new qdesigner_internal::IconSelector(columnsBox); - columnIconSelector->setObjectName(QString::fromUtf8("columnIconSelector")); + columnIconSelector->setObjectName(QStringLiteral("columnIconSelector")); horizontalLayout->addWidget(columnIconSelector); @@ -264,7 +264,7 @@ public: gridLayout_3->addWidget(columnsBox, 0, 1, 1, 1); buttonBox = new QDialogButtonBox(qdesigner_internal__TreeWidgetEditor); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h index a26ff1c828..6a705ad455 100644 --- a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h +++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h @@ -95,58 +95,58 @@ public: void setupUi(QMainWindow *TrPreviewToolClass) { if (TrPreviewToolClass->objectName().isEmpty()) - TrPreviewToolClass->setObjectName(QString::fromUtf8("TrPreviewToolClass")); + TrPreviewToolClass->setObjectName(QStringLiteral("TrPreviewToolClass")); TrPreviewToolClass->resize(593, 466); actionOpenForm = new QAction(TrPreviewToolClass); - actionOpenForm->setObjectName(QString::fromUtf8("actionOpenForm")); + actionOpenForm->setObjectName(QStringLiteral("actionOpenForm")); const QIcon icon = QIcon(QString::fromUtf8(":/images/open_form.png")); actionOpenForm->setIcon(icon); actionLoadTranslation = new QAction(TrPreviewToolClass); - actionLoadTranslation->setObjectName(QString::fromUtf8("actionLoadTranslation")); + actionLoadTranslation->setObjectName(QStringLiteral("actionLoadTranslation")); const QIcon icon1 = QIcon(QString::fromUtf8(":/images/load_translation.png")); actionLoadTranslation->setIcon(icon1); actionReloadTranslations = new QAction(TrPreviewToolClass); - actionReloadTranslations->setObjectName(QString::fromUtf8("actionReloadTranslations")); + actionReloadTranslations->setObjectName(QStringLiteral("actionReloadTranslations")); const QIcon icon2 = QIcon(QString::fromUtf8(":/images/reload_translations.png")); actionReloadTranslations->setIcon(icon2); actionClose = new QAction(TrPreviewToolClass); - actionClose->setObjectName(QString::fromUtf8("actionClose")); + actionClose->setObjectName(QStringLiteral("actionClose")); actionAbout = new QAction(TrPreviewToolClass); - actionAbout->setObjectName(QString::fromUtf8("actionAbout")); + actionAbout->setObjectName(QStringLiteral("actionAbout")); actionAbout_Qt = new QAction(TrPreviewToolClass); - actionAbout_Qt->setObjectName(QString::fromUtf8("actionAbout_Qt")); + actionAbout_Qt->setObjectName(QStringLiteral("actionAbout_Qt")); centralWidget = new QWidget(TrPreviewToolClass); - centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + centralWidget->setObjectName(QStringLiteral("centralWidget")); TrPreviewToolClass->setCentralWidget(centralWidget); menuBar = new QMenuBar(TrPreviewToolClass); - menuBar->setObjectName(QString::fromUtf8("menuBar")); + menuBar->setObjectName(QStringLiteral("menuBar")); menuBar->setGeometry(QRect(0, 0, 593, 21)); menuView = new QMenu(menuBar); - menuView->setObjectName(QString::fromUtf8("menuView")); + menuView->setObjectName(QStringLiteral("menuView")); menuViewViews = new QMenu(menuView); - menuViewViews->setObjectName(QString::fromUtf8("menuViewViews")); + menuViewViews->setObjectName(QStringLiteral("menuViewViews")); menuHelp = new QMenu(menuBar); - menuHelp->setObjectName(QString::fromUtf8("menuHelp")); + menuHelp->setObjectName(QStringLiteral("menuHelp")); menuFile = new QMenu(menuBar); - menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuFile->setObjectName(QStringLiteral("menuFile")); TrPreviewToolClass->setMenuBar(menuBar); mainToolBar = new QToolBar(TrPreviewToolClass); - mainToolBar->setObjectName(QString::fromUtf8("mainToolBar")); + mainToolBar->setObjectName(QStringLiteral("mainToolBar")); mainToolBar->setOrientation(Qt::Horizontal); TrPreviewToolClass->addToolBar(static_cast<Qt::ToolBarArea>(4), mainToolBar); statusBar = new QStatusBar(TrPreviewToolClass); - statusBar->setObjectName(QString::fromUtf8("statusBar")); + statusBar->setObjectName(QStringLiteral("statusBar")); TrPreviewToolClass->setStatusBar(statusBar); dwForms = new QDockWidget(TrPreviewToolClass); - dwForms->setObjectName(QString::fromUtf8("dwForms")); + dwForms->setObjectName(QStringLiteral("dwForms")); dockWidgetContents = new QWidget(); - dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents")); + dockWidgetContents->setObjectName(QStringLiteral("dockWidgetContents")); vboxLayout = new QVBoxLayout(dockWidgetContents); vboxLayout->setSpacing(0); vboxLayout->setContentsMargins(0, 0, 0, 0); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); viewForms = new QListView(dockWidgetContents); - viewForms->setObjectName(QString::fromUtf8("viewForms")); + viewForms->setObjectName(QStringLiteral("viewForms")); viewForms->setEditTriggers(QAbstractItemView::NoEditTriggers); viewForms->setAlternatingRowColors(true); viewForms->setUniformItemSizes(true); diff --git a/tests/auto/tools/uic/baseline/validators.ui.h b/tests/auto/tools/uic/baseline/validators.ui.h index 12b8ff09f3..374f547cc6 100644 --- a/tests/auto/tools/uic/baseline/validators.ui.h +++ b/tests/auto/tools/uic/baseline/validators.ui.h @@ -80,7 +80,7 @@ public: void setupUi(QWidget *ValidatorsForm) { if (ValidatorsForm->objectName().isEmpty()) - ValidatorsForm->setObjectName(QString::fromUtf8("ValidatorsForm")); + ValidatorsForm->setObjectName(QStringLiteral("ValidatorsForm")); ValidatorsForm->resize(526, 668); vboxLayout = new QVBoxLayout(ValidatorsForm); #ifndef Q_OS_MAC @@ -89,7 +89,7 @@ public: #ifndef Q_OS_MAC vboxLayout->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); hboxLayout = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout->setSpacing(6); @@ -97,9 +97,9 @@ public: #ifndef Q_OS_MAC hboxLayout->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + hboxLayout->setObjectName(QStringLiteral("hboxLayout")); localeSelector = new LocaleSelector(ValidatorsForm); - localeSelector->setObjectName(QString::fromUtf8("localeSelector")); + localeSelector->setObjectName(QStringLiteral("localeSelector")); hboxLayout->addWidget(localeSelector); @@ -111,7 +111,7 @@ public: vboxLayout->addLayout(hboxLayout); groupBox = new QGroupBox(ValidatorsForm); - groupBox->setObjectName(QString::fromUtf8("groupBox")); + groupBox->setObjectName(QStringLiteral("groupBox")); vboxLayout1 = new QVBoxLayout(groupBox); #ifndef Q_OS_MAC vboxLayout1->setSpacing(6); @@ -119,7 +119,7 @@ public: #ifndef Q_OS_MAC vboxLayout1->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); hboxLayout1 = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout1->setSpacing(6); @@ -127,7 +127,7 @@ public: #ifndef Q_OS_MAC hboxLayout1->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + hboxLayout1->setObjectName(QStringLiteral("hboxLayout1")); gridLayout = new QGridLayout(); #ifndef Q_OS_MAC gridLayout->setSpacing(6); @@ -135,15 +135,15 @@ public: #ifndef Q_OS_MAC gridLayout->setContentsMargins(0, 0, 0, 0); #endif - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label = new QLabel(groupBox); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout->addWidget(label, 0, 0, 1, 1); minVal = new QSpinBox(groupBox); - minVal->setObjectName(QString::fromUtf8("minVal")); + minVal->setObjectName(QStringLiteral("minVal")); QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(1); sizePolicy.setVerticalStretch(0); @@ -155,13 +155,13 @@ public: gridLayout->addWidget(minVal, 0, 1, 1, 1); label_2 = new QLabel(groupBox); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); label_2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout->addWidget(label_2, 1, 0, 1, 1); maxVal = new QSpinBox(groupBox); - maxVal->setObjectName(QString::fromUtf8("maxVal")); + maxVal->setObjectName(QStringLiteral("maxVal")); sizePolicy.setHeightForWidth(maxVal->sizePolicy().hasHeightForWidth()); maxVal->setSizePolicy(sizePolicy); maxVal->setMinimum(-1000000); @@ -174,7 +174,7 @@ public: hboxLayout1->addLayout(gridLayout); frame = new QFrame(groupBox); - frame->setObjectName(QString::fromUtf8("frame")); + frame->setObjectName(QStringLiteral("frame")); frame->setFrameShape(QFrame::StyledPanel); frame->setFrameShadow(QFrame::Sunken); vboxLayout2 = new QVBoxLayout(frame); @@ -184,9 +184,9 @@ public: #ifndef Q_OS_MAC vboxLayout2->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2")); + vboxLayout2->setObjectName(QStringLiteral("vboxLayout2")); ledWidget = new LEDWidget(frame); - ledWidget->setObjectName(QString::fromUtf8("ledWidget")); + ledWidget->setObjectName(QStringLiteral("ledWidget")); QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); @@ -198,7 +198,7 @@ public: vboxLayout2->addWidget(ledWidget); label_7 = new QLabel(frame); - label_7->setObjectName(QString::fromUtf8("label_7")); + label_7->setObjectName(QStringLiteral("label_7")); vboxLayout2->addWidget(label_7); @@ -213,7 +213,7 @@ public: vboxLayout1->addItem(spacerItem1); editor = new QLineEdit(groupBox); - editor->setObjectName(QString::fromUtf8("editor")); + editor->setObjectName(QStringLiteral("editor")); vboxLayout1->addWidget(editor); @@ -221,7 +221,7 @@ public: vboxLayout->addWidget(groupBox); groupBox_2 = new QGroupBox(ValidatorsForm); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); vboxLayout3 = new QVBoxLayout(groupBox_2); #ifndef Q_OS_MAC vboxLayout3->setSpacing(6); @@ -229,7 +229,7 @@ public: #ifndef Q_OS_MAC vboxLayout3->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3")); + vboxLayout3->setObjectName(QStringLiteral("vboxLayout3")); hboxLayout2 = new QHBoxLayout(); #ifndef Q_OS_MAC hboxLayout2->setSpacing(6); @@ -237,7 +237,7 @@ public: #ifndef Q_OS_MAC hboxLayout2->setContentsMargins(0, 0, 0, 0); #endif - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + hboxLayout2->setObjectName(QStringLiteral("hboxLayout2")); gridLayout1 = new QGridLayout(); #ifndef Q_OS_MAC gridLayout1->setSpacing(6); @@ -245,15 +245,15 @@ public: #ifndef Q_OS_MAC gridLayout1->setContentsMargins(0, 0, 0, 0); #endif - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); label_3 = new QLabel(groupBox_2); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout1->addWidget(label_3, 0, 0, 1, 1); doubleMinVal = new QDoubleSpinBox(groupBox_2); - doubleMinVal->setObjectName(QString::fromUtf8("doubleMinVal")); + doubleMinVal->setObjectName(QStringLiteral("doubleMinVal")); sizePolicy.setHeightForWidth(doubleMinVal->sizePolicy().hasHeightForWidth()); doubleMinVal->setSizePolicy(sizePolicy); doubleMinVal->setMinimum(-100000); @@ -263,24 +263,24 @@ public: gridLayout1->addWidget(doubleMinVal, 0, 1, 1, 1); label_5 = new QLabel(groupBox_2); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); label_5->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout1->addWidget(label_5, 0, 2, 1, 1); doubleFormat = new QComboBox(groupBox_2); - doubleFormat->setObjectName(QString::fromUtf8("doubleFormat")); + doubleFormat->setObjectName(QStringLiteral("doubleFormat")); gridLayout1->addWidget(doubleFormat, 0, 3, 1, 1); label_4 = new QLabel(groupBox_2); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); label_4->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout1->addWidget(label_4, 1, 0, 1, 1); doubleMaxVal = new QDoubleSpinBox(groupBox_2); - doubleMaxVal->setObjectName(QString::fromUtf8("doubleMaxVal")); + doubleMaxVal->setObjectName(QStringLiteral("doubleMaxVal")); sizePolicy.setHeightForWidth(doubleMaxVal->sizePolicy().hasHeightForWidth()); doubleMaxVal->setSizePolicy(sizePolicy); doubleMaxVal->setMinimum(-100000); @@ -290,13 +290,13 @@ public: gridLayout1->addWidget(doubleMaxVal, 1, 1, 1, 1); label_6 = new QLabel(groupBox_2); - label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setObjectName(QStringLiteral("label_6")); label_6->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); gridLayout1->addWidget(label_6, 1, 2, 1, 1); doubleDecimals = new QSpinBox(groupBox_2); - doubleDecimals->setObjectName(QString::fromUtf8("doubleDecimals")); + doubleDecimals->setObjectName(QStringLiteral("doubleDecimals")); doubleDecimals->setValue(2); gridLayout1->addWidget(doubleDecimals, 1, 3, 1, 1); @@ -305,7 +305,7 @@ public: hboxLayout2->addLayout(gridLayout1); frame_2 = new QFrame(groupBox_2); - frame_2->setObjectName(QString::fromUtf8("frame_2")); + frame_2->setObjectName(QStringLiteral("frame_2")); frame_2->setFrameShape(QFrame::StyledPanel); frame_2->setFrameShadow(QFrame::Sunken); vboxLayout4 = new QVBoxLayout(frame_2); @@ -315,16 +315,16 @@ public: #ifndef Q_OS_MAC vboxLayout4->setContentsMargins(9, 9, 9, 9); #endif - vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4")); + vboxLayout4->setObjectName(QStringLiteral("vboxLayout4")); doubleLedWidget = new LEDWidget(frame_2); - doubleLedWidget->setObjectName(QString::fromUtf8("doubleLedWidget")); + doubleLedWidget->setObjectName(QStringLiteral("doubleLedWidget")); doubleLedWidget->setPixmap(QPixmap(QString::fromUtf8(":/ledoff.png"))); doubleLedWidget->setAlignment(Qt::AlignCenter); vboxLayout4->addWidget(doubleLedWidget); label_8 = new QLabel(frame_2); - label_8->setObjectName(QString::fromUtf8("label_8")); + label_8->setObjectName(QStringLiteral("label_8")); vboxLayout4->addWidget(label_8); @@ -339,7 +339,7 @@ public: vboxLayout3->addItem(spacerItem2); doubleEditor = new QLineEdit(groupBox_2); - doubleEditor->setObjectName(QString::fromUtf8("doubleEditor")); + doubleEditor->setObjectName(QStringLiteral("doubleEditor")); vboxLayout3->addWidget(doubleEditor); @@ -355,13 +355,13 @@ public: hboxLayout3->setSpacing(6); #endif hboxLayout3->setContentsMargins(0, 0, 0, 0); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + hboxLayout3->setObjectName(QStringLiteral("hboxLayout3")); spacerItem4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout3->addItem(spacerItem4); pushButton = new QPushButton(ValidatorsForm); - pushButton->setObjectName(QString::fromUtf8("pushButton")); + pushButton->setObjectName(QStringLiteral("pushButton")); hboxLayout3->addWidget(pushButton); diff --git a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h index 1a17d16efe..f03ac32151 100644 --- a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h +++ b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h @@ -68,19 +68,19 @@ public: void setupUi(QDialog *WateringConfigDialog) { if (WateringConfigDialog->objectName().isEmpty()) - WateringConfigDialog->setObjectName(QString::fromUtf8("WateringConfigDialog")); + WateringConfigDialog->setObjectName(QStringLiteral("WateringConfigDialog")); WateringConfigDialog->resize(334, 550); vboxLayout = new QVBoxLayout(WateringConfigDialog); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); gridLayout = new QGridLayout(); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + gridLayout->setObjectName(QStringLiteral("gridLayout")); label_3 = new QLabel(WateringConfigDialog); - label_3->setObjectName(QString::fromUtf8("label_3")); + label_3->setObjectName(QStringLiteral("label_3")); gridLayout->addWidget(label_3, 0, 0, 1, 1); plantComboBox = new QComboBox(WateringConfigDialog); - plantComboBox->setObjectName(QString::fromUtf8("plantComboBox")); + plantComboBox->setObjectName(QStringLiteral("plantComboBox")); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -94,12 +94,12 @@ public: gridLayout->addItem(spacerItem, 1, 0, 1, 1); label_2 = new QLabel(WateringConfigDialog); - label_2->setObjectName(QString::fromUtf8("label_2")); + label_2->setObjectName(QStringLiteral("label_2")); gridLayout->addWidget(label_2, 2, 0, 1, 1); temperatureCheckBox = new QCheckBox(WateringConfigDialog); - temperatureCheckBox->setObjectName(QString::fromUtf8("temperatureCheckBox")); + temperatureCheckBox->setObjectName(QStringLiteral("temperatureCheckBox")); gridLayout->addWidget(temperatureCheckBox, 3, 1, 1, 3); @@ -108,7 +108,7 @@ public: gridLayout->addItem(spacerItem1, 4, 1, 1, 1); temperatureSpinBox = new QSpinBox(WateringConfigDialog); - temperatureSpinBox->setObjectName(QString::fromUtf8("temperatureSpinBox")); + temperatureSpinBox->setObjectName(QStringLiteral("temperatureSpinBox")); temperatureSpinBox->setEnabled(false); temperatureSpinBox->setMinimum(10); temperatureSpinBox->setMaximum(60); @@ -121,7 +121,7 @@ public: gridLayout->addItem(spacerItem2, 4, 3, 1, 1); rainCheckBox = new QCheckBox(WateringConfigDialog); - rainCheckBox->setObjectName(QString::fromUtf8("rainCheckBox")); + rainCheckBox->setObjectName(QStringLiteral("rainCheckBox")); gridLayout->addWidget(rainCheckBox, 5, 1, 1, 3); @@ -130,7 +130,7 @@ public: gridLayout->addItem(spacerItem3, 6, 1, 1, 1); rainSpinBox = new QSpinBox(WateringConfigDialog); - rainSpinBox->setObjectName(QString::fromUtf8("rainSpinBox")); + rainSpinBox->setObjectName(QStringLiteral("rainSpinBox")); rainSpinBox->setEnabled(false); rainSpinBox->setMinimum(1); @@ -145,22 +145,22 @@ public: gridLayout->addItem(spacerItem5, 7, 2, 1, 1); label = new QLabel(WateringConfigDialog); - label->setObjectName(QString::fromUtf8("label")); + label->setObjectName(QStringLiteral("label")); gridLayout->addWidget(label, 8, 0, 1, 1); startTimeEdit = new QTimeEdit(WateringConfigDialog); - startTimeEdit->setObjectName(QString::fromUtf8("startTimeEdit")); + startTimeEdit->setObjectName(QStringLiteral("startTimeEdit")); gridLayout->addWidget(startTimeEdit, 8, 1, 1, 3); label_4 = new QLabel(WateringConfigDialog); - label_4->setObjectName(QString::fromUtf8("label_4")); + label_4->setObjectName(QStringLiteral("label_4")); gridLayout->addWidget(label_4, 9, 0, 1, 1); amountSpinBox = new QSpinBox(WateringConfigDialog); - amountSpinBox->setObjectName(QString::fromUtf8("amountSpinBox")); + amountSpinBox->setObjectName(QStringLiteral("amountSpinBox")); amountSpinBox->setMinimum(100); amountSpinBox->setMaximum(10000); amountSpinBox->setSingleStep(100); @@ -169,22 +169,22 @@ public: gridLayout->addWidget(amountSpinBox, 9, 1, 1, 3); label_5 = new QLabel(WateringConfigDialog); - label_5->setObjectName(QString::fromUtf8("label_5")); + label_5->setObjectName(QStringLiteral("label_5")); gridLayout->addWidget(label_5, 10, 0, 1, 1); sourceComboBox = new QComboBox(WateringConfigDialog); - sourceComboBox->setObjectName(QString::fromUtf8("sourceComboBox")); + sourceComboBox->setObjectName(QStringLiteral("sourceComboBox")); gridLayout->addWidget(sourceComboBox, 10, 1, 1, 3); label_6 = new QLabel(WateringConfigDialog); - label_6->setObjectName(QString::fromUtf8("label_6")); + label_6->setObjectName(QStringLiteral("label_6")); gridLayout->addWidget(label_6, 11, 0, 1, 1); filterCheckBox = new QCheckBox(WateringConfigDialog); - filterCheckBox->setObjectName(QString::fromUtf8("filterCheckBox")); + filterCheckBox->setObjectName(QStringLiteral("filterCheckBox")); gridLayout->addWidget(filterCheckBox, 11, 1, 1, 2); @@ -200,18 +200,18 @@ public: vboxLayout->addLayout(gridLayout); gridLayout1 = new QGridLayout(); - gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); + gridLayout1->setObjectName(QStringLiteral("gridLayout1")); spacerItem8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); gridLayout1->addItem(spacerItem8, 0, 1, 1, 1); helpBrowser = new HelpBrowser(WateringConfigDialog); - helpBrowser->setObjectName(QString::fromUtf8("helpBrowser")); + helpBrowser->setObjectName(QStringLiteral("helpBrowser")); gridLayout1->addWidget(helpBrowser, 1, 0, 1, 2); helpLabel = new QLabel(WateringConfigDialog); - helpLabel->setObjectName(QString::fromUtf8("helpLabel")); + helpLabel->setObjectName(QStringLiteral("helpLabel")); gridLayout1->addWidget(helpLabel, 0, 0, 1, 1); @@ -219,14 +219,14 @@ public: vboxLayout->addLayout(gridLayout1); line = new QFrame(WateringConfigDialog); - line->setObjectName(QString::fromUtf8("line")); + line->setObjectName(QStringLiteral("line")); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); vboxLayout->addWidget(line); buttonBox = new QDialogButtonBox(WateringConfigDialog); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setObjectName(QStringLiteral("buttonBox")); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); diff --git a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp index 31fab971a0..ff34b009e9 100644 --- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp +++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp @@ -100,6 +100,9 @@ tst_QColorDialog::~tst_QColorDialog() void tst_QColorDialog::native_activeModalWidget() { +#ifdef Q_OS_MAC + QSKIP("Test hangs on Mac OS X, see QTBUG-24320"); +#endif // Check that QApplication::activeModalWidget retruns the // color dialog when it is executing, even when using a native // dialog: @@ -153,6 +156,9 @@ void tst_QColorDialog::task247349_alpha() dialog.setOption(QColorDialog::ShowAlphaChannel, true); int alpha = 0x17; dialog.setCurrentColor(QColor(0x01, 0x02, 0x03, alpha)); +#ifdef Q_OS_MAC + QEXPECT_FAIL("", "Fails on Mac OS X, see QTBUG-24320", Abort); +#endif QCOMPARE(alpha, dialog.currentColor().alpha()); QCOMPARE(alpha, qAlpha(dialog.currentColor().rgba())); } diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index b332fb40f8..e46d905022 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -440,7 +440,7 @@ public slots: void tst_QDialog::throwInExec() { -#if defined(Q_OS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_)) +#if defined(Q_OS_MAC) || (defined(Q_OS_WINCE) && defined(_ARM_)) QSKIP("Throwing exceptions in exec() is not supported on this platform."); #endif #if defined(Q_OS_LINUX) diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp index 472469e797..7ab3100cab 100644 --- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp @@ -559,9 +559,39 @@ void tst_QFileDialog2::completionOnLevelAfterRoot() { QNonNativeFileDialog fd; #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - fd.setDirectory("C:"); + fd.setDirectory("C:/"); QDir current = fd.directory(); - current.mkdir("completionOnLevelAfterRootTest"); + QStringList entryList = current.entryList(QStringList(), QDir::Dirs); + // Find a suitable test dir under c:-root: + // - At least 6 characters long + // - Ascii, letters only + // - No another dir with same start + QString testDir; + foreach (const QString &entry, entryList) { + if (entry.size() > 5 && QString(entry.toAscii()).compare(entry) == 0) { + bool invalid = false; + for (int i = 0; i < 5; i++) { + if (!entry.at(i).isLetter()) { + invalid = true; + break; + } + } + if (!invalid) { + foreach (const QString &check, entryList) { + if (check.startsWith(entry.left(5)) && check != entry) { + invalid = true; + break; + } + } + } + if (!invalid) { + testDir = entry; + break; + } + } + } + if (testDir.isEmpty()) + QSKIP("This test requires to have an unique directory of at least six ascii characters under c:/"); #else fd.setFilter(QDir::Hidden | QDir::AllDirs | QDir::Files | QDir::System); fd.setDirectory("/"); @@ -574,11 +604,8 @@ void tst_QFileDialog2::completionOnLevelAfterRoot() QTest::qWait(2000); #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) //I love testlib :D - QTest::keyClick(edit, Qt::Key_C); - QTest::keyClick(edit, Qt::Key_O); - QTest::keyClick(edit, Qt::Key_M); - QTest::keyClick(edit, Qt::Key_P); - QTest::keyClick(edit, Qt::Key_L); + for (int i = 0; i < 5; i++) + QTest::keyClick(edit, testDir.at(i).toLower().toAscii() - 'a' + Qt::Key_A); #else QTest::keyClick(edit, Qt::Key_E); QTest::keyClick(edit, Qt::Key_T); @@ -587,8 +614,7 @@ void tst_QFileDialog2::completionOnLevelAfterRoot() QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); QTest::qWait(200); #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - QCOMPARE(edit->text(), QString("completionOnLevelAfterRootTest")); - current.rmdir("completionOnLevelAfterRootTest"); + QCOMPARE(edit->text(), testDir); #else QTRY_COMPARE(edit->text(), QString("etc")); #endif diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro index 166306757c..6e08e2d02b 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro @@ -5,3 +5,5 @@ QT += core-private gui testlib SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel + +win32:CONFIG += insignificant_test # QTBUG-24291 diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index ea4eed54d2..8724bf63c8 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -240,6 +240,9 @@ void tst_QFileSystemModel::naturalCompare_data() QTest::addColumn<int>("caseSensitive"); QTest::addColumn<int>("result"); QTest::addColumn<int>("swap"); + +#define ROWNAME(name) (qPrintable(QString("prefix=%1, postfix=%2, num=%3, i=%4, test=%5").arg(prefix).arg(postfix).arg(num).arg(i).arg(name))) + for (int j = 0; j < 4; ++j) { // <- set a prefix and a postfix string (not numbers) QString prefix = (j == 0 || j == 1) ? "b" : ""; QString postfix = (j == 1 || j == 2) ? "y" : ""; @@ -248,32 +251,33 @@ void tst_QFileSystemModel::naturalCompare_data() QString num = QString("%1").arg(k); QString nump = QString("%1").arg(k + 1); for (int i = 10; i < 12; ++i) { // <- swap s1 and s2 and reverse the result - QTest::newRow("basic") << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0; + QTest::newRow(ROWNAME("basic")) << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0; // s1 should always be less then s2 - QTest::newRow("just text") << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("just numbers") << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("zero") << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("space b") << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("space a") << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("tab b") << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("tab a") << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("10 vs 2") << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("diff len") << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i; - QTest::newRow("01 before 1") << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums 2nd") << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums 2nd") << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums 2nd") << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums 2nd") << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums big") << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums big") << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul alphabet") << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul alphabet2")<< prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("mul nums w\\0")<< prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i; - QTest::newRow("num first") << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("just text")) << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("just numbers")) << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("zero")) << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("space b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("space a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("tab b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("tab a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("10 vs 2")) << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("diff len")) << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("01 before 1")) << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums 2nd 1")) << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums 2nd 2")) << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums 2nd 3")) << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums 2nd 4")) << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums big 1")) << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums big 2")) << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul alphabet 1")) << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul alphabet 2")) << prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("mul nums w\\0")) << prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i; + QTest::newRow(ROWNAME("num first")) << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i; } } } +#undef ROWNAME } void tst_QFileSystemModel::naturalCompare() diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp index f5c3e08217..6b2caf17d7 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp @@ -114,6 +114,9 @@ void tst_QFontDialog::postKeyReturn() { void tst_QFontDialog::defaultOkButton() { +#ifdef Q_OS_MAC + QSKIP("Test hangs on Mac OS X, see QTBUG-24321"); +#endif bool ok = false; QTimer::singleShot(2000, this, SLOT(postKeyReturn())); QFontDialog::getFont(&ok); @@ -123,6 +126,9 @@ void tst_QFontDialog::defaultOkButton() void tst_QFontDialog::setFont() { +#ifdef Q_OS_MAC + QSKIP("Test hangs on Mac OS X, see QTBUG-24321"); +#endif /* The font should be the same before as it is after if nothing changed while the font dialog was open. Task #27662 @@ -154,6 +160,10 @@ class FriendlyFontDialog : public QFontDialog void tst_QFontDialog::task256466_wrongStyle() { +#ifdef Q_OS_MAC + QSKIP("Test crashes on Mac OS X, see QTBUG-24321"); +#endif + QFontDatabase fdb; FriendlyFontDialog dialog; QListView *familyList = reinterpret_cast<QListView*>(dialog.d_func()->familyList); diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 9e965ff235..7fc752488d 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -411,8 +411,10 @@ void tst_QMessageBox::staticSourceCompat() if (qobject_cast<QMacStyle *>(qApp->style())) expectedButton = int(QMessageBox::No); #elif !defined(QT_NO_STYLE_CLEANLOOKS) - if (qobject_cast<QCleanlooksStyle *>(qApp->style())) + if (qobject_cast<QCleanlooksStyle *>(qApp->style())) { + QEXPECT_FAIL("", "Special handling of QMessageBox::information buttons for Cleanlooks not implemented yet, QTBUG-24315", Continue); expectedButton = int(QMessageBox::No); + } #endif QCOMPARE(ret, expectedButton); QCOMPARE(keyToSend, -1); diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp index 3a8e109d80..97feb642dc 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp @@ -1835,15 +1835,6 @@ void tst_QGraphicsAnchorLayout1::testCenterAnchors_data() theResult << BasicResult(0, QRectF(5, 5, 10, 10) ); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); QTest::newRow("center, basic with invalid") << QSizeF(20, 20) << theData << theResult; } @@ -1975,9 +1966,6 @@ void tst_QGraphicsAnchorLayout1::testCenterAnchors_data() << BasicResult(1, QRectF(20, 0, 30, 10)) << BasicResult(2, QRectF(60, 15, 40, 10)); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::newRow("center, three") << QSizeF(100, 50) << theData << theResult; } @@ -2062,6 +2050,21 @@ void tst_QGraphicsAnchorLayout1::testCenterAnchors_data() void tst_QGraphicsAnchorLayout1::testCenterAnchors() { + if (strcmp(QTest::currentDataTag(), "center, basic with invalid") == 0) { + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor edges of different orientations"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + } else if (strcmp(QTest::currentDataTag(), "center, three") == 0) { + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + } + // use the same frame testBasicLayout(); } @@ -2144,11 +2147,6 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data() << BasicResult(1, QRectF(20, 0, 30, 10)) << BasicResult(2, QRectF(60, 15, 40, 10)); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::newRow("remove, center, three") << QSizeF(100, 50) << theData << theRemoveData << theResult; } @@ -2183,8 +2181,6 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data() theResult << BasicResult(0, QRectF(5, 5, 10, 10) ); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); - QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); QTest::newRow("remove, center, basic 2") << QSizeF(20, 20) << theData << theRemoveData << theResult; } @@ -2193,6 +2189,16 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor_data() void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor() { + if (strcmp(QTest::currentDataTag(), "remove, center, three") == 0) { + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + } else if (strcmp(QTest::currentDataTag(), "remove, center, basic 2") == 0) { + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + QTest::ignoreMessage(QtWarningMsg, "QGraphicsAnchorLayout::addAnchor(): Cannot anchor the item to itself"); + } + QFETCH(QSizeF, size); QFETCH(BasicLayoutTestDataList, data); QFETCH(BasicLayoutTestDataList, removeData); diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index bbe7062507..51ce7f909c 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -454,7 +454,6 @@ void tst_QGraphicsGridLayout::addItem_data() for (int b = -1; b < 2; ++b) { for (int c = -1; c < 2; ++c) { for (int d = -1; d < 2; ++d) { - for (int e = 0; e < 9; ++e) { int row = a; int column = b; int rowSpan = c; @@ -462,7 +461,7 @@ void tst_QGraphicsGridLayout::addItem_data() QString name = QString::fromAscii("(%1,%2,%3,%4").arg(a).arg(b).arg(c).arg(d); Qt::Alignment alignment = Qt::AlignLeft; QTest::newRow(name.toLatin1()) << row << column << rowSpan << columnSpan << alignment; - }}}}} + }}}} } // public void addItem(QGraphicsLayoutItem* item, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0) diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp index c30701e0f9..35b67d4451 100644 --- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp @@ -152,7 +152,7 @@ void tst_QGraphicsLinearLayout::initTestCase() { // since the style will influence the results, we have to ensure // that the tests are run using the same style on all platforms -#if defined (Q_WS_WINCE) +#if defined (Q_OS_WINCE) QApplication::setStyle(new QWindowsStyle); #else QApplication::setStyle(new QPlastiqueStyle); diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro index 50f4f7ab74..f2bd7bde70 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro @@ -8,3 +8,5 @@ SOURCES += tst_qgraphicsproxywidget.cpp # ### fixme: QTBUG-20756 crashes on xcb contains(QT_CONFIG,xcb):CONFIG+=insignificant_test + +win32:CONFIG += insignificant_test # QTBUG-24294 diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 3ccc533086..ca5b992012 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1574,7 +1574,7 @@ void tst_QGraphicsProxyWidget::resize_simple_data() QTest::addColumn<QSizeF>("size"); QTest::newRow("200, 200") << QSizeF(200, 200); -#if !defined(QT_ARCH_ARM) && !defined(Q_OS_WINCE) +#if !defined(Q_PROCESSOR_ARM) && !defined(Q_OS_WINCE) QTest::newRow("1000, 1000") << QSizeF(1000, 1000); // Since 4.5, 10000x10000 runs out of memory. // QTest::newRow("10000, 10000") << QSizeF(10000, 10000); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro index 8a084472b8..c0a9075d10 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro @@ -17,3 +17,5 @@ wince* { DEPLOYMENT += rootFiles renderFiles DEFINES += SRCDIR=\\\".\\\" } + +win32:CONFIG += insignificant_test # QTBUG-24295 diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index f103d3d529..3257e7efea 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -365,7 +365,7 @@ void tst_QGraphicsScene::itemIndexMethod() QGraphicsScene scene; QCOMPARE(scene.itemIndexMethod(), QGraphicsScene::BspTreeIndex); -#ifdef QT_ARCH_ARM +#ifdef Q_PROCESSOR_ARM const int minY = -500; const int maxY = 500; const int minX = -500; @@ -426,7 +426,7 @@ void tst_QGraphicsScene::bspTreeDepth() void tst_QGraphicsScene::items() { -#ifdef QT_ARCH_ARM +#ifdef Q_PROCESSOR_ARM const int minY = -500; const int maxY = 500; const int minX = -500; diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro index e3a6edd682..439cf547ef 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro @@ -8,3 +8,5 @@ SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp DEFINES += QT_NO_CAST_TO_ASCII linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test + +win32:CONFIG += insignificant_test # QTBUG-24296 diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 7681b3c787..7ceeaaa0d3 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -1656,7 +1656,7 @@ void tst_QGraphicsView::mapToScene() QCOMPARE(view.size(), viewSize); // First once without setting the scene rect -#ifdef QT_ARCH_ARM +#ifdef Q_PROCESSOR_ARM const int step = 20; #else const int step = 1; diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index 0607d2ab30..0a2d0cd2f8 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1157,8 +1157,10 @@ void tst_QGraphicsWidget::initStyleOption() bool hasFocus = option.state & QStyle::State_HasFocus; QCOMPARE(hasFocus, focus); bool isUnderMouse = option.state & QStyle::State_MouseOver; -#if !defined(Q_OS_WINCE) && !defined(Q_OS_MAC) +#ifndef Q_OS_WINCE +# if !defined(Q_OS_MAC) && !defined(Q_OS_WIN) QEXPECT_FAIL("all", "QTBUG-22457", Abort); +# endif QCOMPARE(isUnderMouse, underMouse); #endif // if (layoutDirection != Qt::LeftToRight) diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 75a72a754f..4dd57e1b90 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -204,6 +204,7 @@ private slots: void QTBUG8650_crashOnInsertSections(); void QTBUG12268_hiddenMovedSectionSorting(); void QTBUG14242_hideSectionAutoSize(); + void ensureNoIndexAtLength(); void initialSortOrderRole(); @@ -2156,6 +2157,17 @@ void tst_QHeaderView::QTBUG14242_hideSectionAutoSize() QVERIFY(calced_length == afterlength); } +void tst_QHeaderView::ensureNoIndexAtLength() +{ + QTableView qtv; + QStandardItemModel amodel(4, 4); + qtv.setModel(&amodel); + QHeaderView *hv = qtv.verticalHeader(); + QVERIFY(hv->visualIndexAt(hv->length()) == -1); + hv->resizeSection(hv->count() - 1, 0); + QVERIFY(hv->visualIndexAt(hv->length()) == -1); +} + void tst_QHeaderView::initialSortOrderRole() { QTableView view; // ### Shadowing member view (of type QHeaderView) @@ -2341,8 +2353,8 @@ void tst_QHeaderView::calculateAndCheck(int cppline, const int precalced_compare QVERIFY2(chk_logical == x[1], verifytext); QVERIFY2(chk_sizes == x[2], verifytext); QVERIFY2(chk_hidden_size == x[3], verifytext); - QVERIFY2(chk_lookup_visual == x[4], verifytext); // Here the semantic can change. See final note (*). - QVERIFY2(chk_lookup_logical == x[5], verifytext); // Here the semantic can change. See final note (*). + QVERIFY2(chk_lookup_visual == x[4], verifytext); + QVERIFY2(chk_lookup_logical == x[5], verifytext); QVERIFY2(header_lenght == x[6], verifytext); } @@ -2353,16 +2365,16 @@ void tst_QHeaderView::setupTestData(bool also_use_reset_model) QTest::addColumn<bool>("reset_model"); if (also_use_reset_model) { - QTest::newRow("no_updates+normal") << false << false << true; - QTest::newRow("hasupdates+normal") << true << false << true; - QTest::newRow("no_updates+special") << false << true << true; - QTest::newRow("no_updates+special") << true << true << true; + QTest::newRow("no_updates+normal+reset") << false << false << true; + QTest::newRow("hasupdates+normal+reset") << true << false << true; + QTest::newRow("no_updates+special+reset") << false << true << true; + QTest::newRow("hasupdates+special+reset") << true << true << true; } QTest::newRow("no_updates+normal") << false << false << false; QTest::newRow("hasupdates+normal") << true << false << false; QTest::newRow("no_updates+special") << false << true << false; - QTest::newRow("no_updates+special") << true << true << false; + QTest::newRow("hasupdates+special") << true << true << false; } void tst_QHeaderView::additionalInit() @@ -2438,10 +2450,10 @@ void tst_QHeaderView::logicalIndexAtTest() //qDebug() << "logicalIndexAtTest" << check1 << check2; const int precalced_check1 = 106327; const int precalced_check2 = 29856418; - QVERIFY(precalced_check1 == check1); // Here the semantic can change. See final note (*) - QVERIFY(precalced_check2 == check2); // Here the semantic can change. See final note (*) + QVERIFY(precalced_check1 == check1); + QVERIFY(precalced_check2 == check2); - const int precalced_results[] = { 1145298384, -1710423344, -650981936, 372919464, 2139446944, 854793816, 12124 }; + const int precalced_results[] = { 1145298384, -1710423344, -650981936, 372919464, -1544372176, -426463328, 12124 }; calculateAndCheck(__LINE__, precalced_results); } @@ -2466,10 +2478,10 @@ void tst_QHeaderView::visualIndexAtTest() //qDebug() << "visualIndexAtTest" << check1 << check2; const int precalced_check1 = 72665; const int precalced_check2 = 14015890; - QVERIFY(precalced_check1 == check1); // Here the semantic can change. See final note (*) - QVERIFY(precalced_check2 == check2); // Here the semantic can change. See final note (*) + QVERIFY(precalced_check1 == check1); + QVERIFY(precalced_check2 == check2); - const int precalced_results[] = { 1145298384, -1710423344, -1457520212, 169223959, 726651072, -2105938696, 5453 }; + const int precalced_results[] = { 1145298384, -1710423344, -1457520212, 169223959, 557466160, -324939600, 5453 }; calculateAndCheck(__LINE__, precalced_results); } @@ -2598,7 +2610,7 @@ void tst_QHeaderView::mixedTests() model->setRowCount(model->rowCount() - 10); if (m_using_reset_model) { - const int precalced_results[] = { 898296472, 337096378, -543340640, 1, 703951756, 250831536, 9250 }; + const int precalced_results[] = { 898296472, 337096378, -543340640, 1, -1251526424, -568618976, 9250 }; calculateAndCheck(__LINE__, precalced_results); } else { const int precalced_results[] = { 1911338224, 1693514365, -613398968, -1912534953, 1582159424, -1851079000, 9300 }; @@ -2633,8 +2645,5 @@ void tst_QHeaderView::resizeToContentTest() calculateAndCheck(__LINE__, precalced_results); } -// (*) Currently qheaderview position lookup acts a bit strange. It can return sections with size 0. -// This could be changed in the future. - QTEST_MAIN(tst_QHeaderView) #include "tst_qheaderview.moc" diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp index 04b32d1e56..4e71bf964c 100644 --- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp +++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp @@ -286,7 +286,7 @@ void tst_QItemView::populate() { treeModel = new CheckerModel; QModelIndex parent; -#if defined(QT_ARCH_ARM) +#if defined(Q_PROCESSOR_ARM) const int baseInsert = 4; #else const int baseInsert = 26; diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index 523516a4b4..f139eac275 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -970,7 +970,7 @@ void tst_QListView::selection_data() << QRect(300, 10, 1, 1) // selection rectangle << IntList(); // expected items - QTest::newRow("select to the right, (on viewport)") + QTest::newRow("select to the right 2, (on viewport)") << 40 // itemCount << int(QListView::ListMode) << int(QListView::TopToBottom) diff --git a/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro b/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro index f397957609..8821ac7038 100644 --- a/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro +++ b/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro @@ -5,3 +5,5 @@ QT += core-private gui-private SOURCES += tst_qlistwidget.cpp contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-21098, fails unstably + +win32:CONFIG += insignificant_test # QTBUG-24299 diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index 586c2efd8f..9144a023d7 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -1204,7 +1204,7 @@ void tst_QTableView::moveCursorStrikesBack_data() << 0 << 5 << (IntList() << int(QtTestTableView::MoveNext)) << 1 << 0; - QTest::newRow("Last column disabled. Task QTBUG-3878") << -1 << -1 + QTest::newRow("Last column disabled 2. Task QTBUG-3878") << -1 << -1 << IntList() << (IntList() << 6) << QRect() diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp index 0e518b3e16..14c61c7932 100644 --- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp +++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp @@ -1014,13 +1014,13 @@ void tst_QTreeWidgetItemIterator::minus_eq_data() QTest::addColumn<int>("iteratorflags"); QTest::addColumn<QString>("expecteditem"); - QTest::newRow("-=0") << 0 << 0 << (int)QTreeWidgetItemIterator::All << QString("top0"); - QTest::newRow("-=1") << 2 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0"); - QTest::newRow("-=2") << 4 << 2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1"); - QTest::newRow("-=(-1)") << 0 << -1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0"); - QTest::newRow("-=(-2)") << 0 << -2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1"); - QTest::newRow("-=1)") << 18 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child16"); - QTest::newRow("-=1)") << 1 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0"); + QTest::newRow("0-=0") << 0 << 0 << (int)QTreeWidgetItemIterator::All << QString("top0"); + QTest::newRow("2-=1") << 2 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0"); + QTest::newRow("4-=2") << 4 << 2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1"); + QTest::newRow("0-=(-1)") << 0 << -1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0"); + QTest::newRow("0-=(-2)") << 0 << -2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1"); + QTest::newRow("18-=1") << 18 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child16"); + QTest::newRow("1-=1") << 1 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0"); } void tst_QTreeWidgetItemIterator::minus_eq() diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro index 9f6db3cd3e..61035cc24b 100644 --- a/tests/auto/widgets/kernel/qapplication/test/test.pro +++ b/tests/auto/widgets/kernel/qapplication/test/test.pro @@ -14,8 +14,6 @@ win32 { } } -mac*:CONFIG+=insignificant_test - TESTDATA = ../test/test.pro ../tmp/README SUBPROGRAMS = desktopsettingsaware modal diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index d9f4081ed3..98872cb2f6 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -69,6 +69,10 @@ #include <windows.h> #endif +QT_BEGIN_NAMESPACE +extern bool Q_GUI_EXPORT qt_tab_all_widgets; // from qapplication.cpp +QT_END_NAMESPACE + class tst_QApplication : public QObject { Q_OBJECT @@ -137,18 +141,11 @@ private slots: void touchEventPropagation(); void qtbug_12673(); - - void testQuitLockRef(); - void testQuitLock1(); - void testQuitLock2(); - void testQuitLock3(); - void testQuitLock4(); - void testQuitLock5(); - void testQuitLock6(); - void testQuitLock7(); - void testQuitLock8(); + void noQuitOnHide(); void globalStaticObjectDestruction(); // run this last + + void abortQuitOnShow(); }; class EventSpy : public QObject @@ -380,16 +377,16 @@ void tst_QApplication::setFont_data() ++cnt; } - QTest::newRow("nonexistingfont") << "nosuchfont_probably_quiteunlikely" + QTest::newRow("nonexistingfont after") << "nosuchfont_probably_quiteunlikely" << 0 << false; - QTest::newRow("nonexistingfont") << "nosuchfont_probably_quiteunlikely" + QTest::newRow("nonexistingfont before") << "nosuchfont_probably_quiteunlikely" << 0 << true; - QTest::newRow("largescaleable") << "smoothtimes" << 100 << false; - QTest::newRow("largescaleable") << "smoothtimes" << 100 << true; + QTest::newRow("largescaleable after") << "smoothtimes" << 100 << false; + QTest::newRow("largescaleable before") << "smoothtimes" << 100 << true; - QTest::newRow("largeunscaleale") << "helvetica" << 100 << false; - QTest::newRow("largeunscaleale") << "helvetica" << 100 << true; + QTest::newRow("largeunscaleale after") << "helvetica" << 100 << false; + QTest::newRow("largeunscaleale before") << "helvetica" << 100 << true; } void tst_QApplication::setFont() @@ -608,6 +605,11 @@ public slots: void tst_QApplication::quitOnLastWindowClosed() { +#ifdef Q_OS_WIN32 + QSKIP("This test crashes on Windows. Remove skip once the issue causing the crash is fixed (QTBUG-24300)."); +#endif +#ifndef Q_OS_MAC + // Test hangs on Mac OS X, see QTBUG-24319 { int argc = 0; QApplication app(argc, 0, QApplication::GuiServer); @@ -622,6 +624,7 @@ void tst_QApplication::quitOnLastWindowClosed() // lastWindowClosed() signal should only be sent after the last dialog is closed QCOMPARE(appSpy.count(), 2); } +#endif { int argc = 0; QApplication app(argc, 0, QApplication::GuiServer); @@ -1211,6 +1214,9 @@ void DeleteLaterWidget::checkDeleteLater() void tst_QApplication::testDeleteLater() { +#ifdef Q_OS_MAC + QSKIP("This test fails and then hangs on Mac OS X, see QTBUG-24318"); +#endif int argc = 0; QApplication app(argc, 0, QApplication::GuiServer); connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); @@ -1392,12 +1398,21 @@ void tst_QApplication::testDeleteLaterProcessEvents() void tst_QApplication::desktopSettingsAware() { #ifndef QT_NO_PROCESS - QProcess testProcess; - const QString path = QStringLiteral("desktopsettingsaware/desktopsettingsaware"); + QString path; + { + // We need an application object for QFINDTESTDATA to work + // properly in all cases. + int argc = 0; + QCoreApplication app(argc, 0); + path = QFINDTESTDATA("desktopsettingsaware/"); + } + QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application"); + path += "desktopsettingsaware"; #ifdef Q_OS_WINCE int argc = 0; QApplication tmpApp(argc, 0, QApplication::GuiServer); #endif + QProcess testProcess; testProcess.start(path); QVERIFY2(testProcess.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString()))); @@ -1523,8 +1538,15 @@ void tst_QApplication::focusChanged() QSettings appleSettings(QLatin1String("apple.com")); QVariant appleValue = appleSettings.value(QLatin1String("AppleKeyboardUIMode"), 0); tabAllControls = (appleValue.toInt() & 0x2); + if (!tabAllControls) { + QEXPECT_FAIL("", "QTBUG-24372 Mac tab key \"Text boxes and lists only\" vs " + "\"All controls\" setting is not respected in Qt5", Abort); + } #endif + // make sure Qt's idea of tabbing between widgets matches what we think it should + QCOMPARE(qt_tab_all_widgets, tabAllControls); + tab.simulate(now); if (!tabAllControls) { QVERIFY(spy.count() == 0); @@ -2048,9 +2070,19 @@ void tst_QApplication::touchEventPropagation() void tst_QApplication::qtbug_12673() { + QString path; + { + // We need an application object for QFINDTESTDATA to work + // properly in all cases. + int argc = 0; + QCoreApplication app(argc, 0); + path = QFINDTESTDATA("modal/"); + } + QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application"); + path += "modal"; + QProcess testProcess; QStringList arguments; - const QString path = QStringLiteral("modal/modal"); testProcess.start(path, arguments); QVERIFY2(testProcess.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString()))); @@ -2058,509 +2090,71 @@ void tst_QApplication::qtbug_12673() QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit); } -class JobObject : public QObject +class NoQuitOnHideWidget : public QWidget { Q_OBJECT public: - JobObject(int milliseconds, QObject *parent = 0) - : QObject(parent) - { - QTimer::singleShot(milliseconds, this, SLOT(timeout())); - } - - JobObject(QObject *parent = 0) - : QObject(parent) + explicit NoQuitOnHideWidget(QWidget *parent = 0) + : QWidget(parent) { - QTimer::singleShot(1000, this, SLOT(timeout())); + QTimer::singleShot(0, this, SLOT(hide())); + QTimer::singleShot(500, this, SLOT(exitApp())); } private slots: - void timeout() - { - emit done(); - deleteLater(); + void exitApp() { + qApp->exit(1); } - -signals: - void done(); - -private: - QEventLoopLocker locker; }; -class QuitLockRefTester : public QObject +void tst_QApplication::noQuitOnHide() { - Q_OBJECT -public: - QuitLockRefTester(QObject *parent = 0) - : QObject(parent) - { - QTimer::singleShot(0, this, SLOT(doTest())); - } - -private slots: - void doTest() - { - QApplicationPrivate *privateClass = static_cast<QApplicationPrivate*>(QObjectPrivate::get(qApp)); - - { - QDialog *win1 = new QDialog; - - // Test with a lock active so that the refcount doesn't drop to zero during these tests, causing a quit. - // (until we exit the scope) - QEventLoopLocker locker; - - QCOMPARE(privateClass->quitLockRef.load(), 1); - - win1->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QDialog *win2 = new QDialog; - - win2->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 3); - - delete win1; - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - delete win2; - - QCOMPARE(privateClass->quitLockRef.load(), 1); - - win1 = new QDialog; - - win1->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - JobObject *job1 = new JobObject(this); - - QCOMPARE(privateClass->quitLockRef.load(), 3); - - delete win1; - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - delete job1; - - QCOMPARE(privateClass->quitLockRef.load(), 1); - - QWidget *w1 = new QWidget; - - w1->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QWidget *w2 = new QMainWindow; - - w2->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 3); - - QWidget *w3 = new QWidget(0, Qt::Dialog); - - w3->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 4); - - delete w3; - - QCOMPARE(privateClass->quitLockRef.load(), 3); - - delete w2; - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QWidget *subWidget1 = new QWidget(w1, Qt::Window); - - // Even though We create a new widget and show it, - // the ref count does not go up because it is a child of - // w1, which is the top-level, and what we are actually - // refcounting. - subWidget1->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - // When we use setParent(0) and re-show, the - // ref count does increase: - QCOMPARE(subWidget1->isVisible(), true); - subWidget1->setParent(0); - QCOMPARE(subWidget1->isVisible(), false); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - subWidget1->show(); - QCOMPARE(subWidget1->isVisible(), true); - QCOMPARE(privateClass->quitLockRef.load(), 3); - - subWidget1->setParent(w1); - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QWidget *subWidget2 = new QWidget(w1); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - subWidget2->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - delete subWidget2; - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QWidget *subWidget3 = new QWidget(w1); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - subWidget3->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - subWidget3->hide(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - delete subWidget3; - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QWidget *subWidget4 = new QWidget(subWidget1); - QWidget *subWidget5 = new QWidget(subWidget1); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - QWidget *subWidget6 = new QWidget(subWidget4, Qt::Window); - - subWidget6->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - delete w1; - - QCOMPARE(privateClass->quitLockRef.load(), 1); - - w1 = new QWidget; - w2 = new QWidget; - w3 = new QWidget; - - QHBoxLayout *layout = new QHBoxLayout(w1); - - layout->addWidget(w2); - layout->addWidget(w3); - - QCOMPARE(privateClass->quitLockRef.load(), 1); - - w1->show(); - - QCOMPARE(privateClass->quitLockRef.load(), 2); - - w1->hide(); - QCOMPARE(privateClass->quitLockRef.load(), 1); - - delete w1; - - } - QCOMPARE(privateClass->quitLockRef.load(), 0); - } -}; - -void tst_QApplication::testQuitLockRef() -{ - int argc = 1; - char *argv[] = { "tst_qapplication" }; - QApplication app(argc, argv); - - QuitLockRefTester tester; - - app.exec(); -} - -void tst_QApplication::testQuitLock1() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - QWidget *w = new QWidget; - - w->show(); - - QMetaObject::invokeMethod(w, "close", Qt::QueuedConnection); - - app.exec(); - - // No hang = pass. -} - -void tst_QApplication::testQuitLock2() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - QWidget *w1 = new QWidget; - - w1->show(); - - QWidget *w2 = new QWidget; - - w2->show(); - - QMetaObject::invokeMethod(w1, "deleteLater", Qt::QueuedConnection); - QMetaObject::invokeMethod(w2, "hide", Qt::QueuedConnection); - - app.exec(); - - // No hang = pass. -} - -class Result : public QObject -{ - Q_OBJECT -public: - Result(QObject *parent = 0) - : QObject(parent), m_passes(false) - { - - } - - bool result() const - { - return m_passes; - } - -public slots: - - void setPasses() - { - setResult(true); - } - - void setFails() - { - setResult(false); - } - - void setResult(bool result) - { - m_passes = result; - } - -private: - bool m_passes; -}; - -void tst_QApplication::testQuitLock3() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - Result *result = new Result(&app); - - JobObject *job = new JobObject(&app); - - QObject::connect(job, SIGNAL(done()), result, SLOT(setPasses())); - - app.exec(); - - QVERIFY(result->result()); -} - -void tst_QApplication::testQuitLock4() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - QWidget *w = new QWidget; - - w->show(); - - Result *result = new Result(&app); - JobObject *job = new JobObject(1000, &app); - - QTimer::singleShot(500, w, SLOT(deleteLater())); - - QObject::connect(w, SIGNAL(destroyed()), result, SLOT(setFails())); - QObject::connect(job, SIGNAL(done()), result, SLOT(setPasses())); - - app.exec(); - - QVERIFY(result->result()); + int argc = 0; + QApplication app(argc, 0); + QWidget *window1 = new NoQuitOnHideWidget; + window1->show(); + QCOMPARE(app.exec(), 1); } -class JobBeforeWindowRunner : public QObject +class ShowCloseShowWidget : public QWidget { Q_OBJECT public: - JobBeforeWindowRunner(QObject *parent = 0) - : QObject(parent), m_result(new Result(this)) - { - - } - - void start() + ShowCloseShowWidget(bool showAgain, QWidget *parent = 0) + : QWidget(parent), showAgain(showAgain) { - JobObject *job = new JobObject(this); - connect(job, SIGNAL(done()), m_result, SLOT(setFails())); - connect(job, SIGNAL(destroyed()), SLOT(showWindowDelayed()), Qt::QueuedConnection); + QTimer::singleShot(0, this, SLOT(doClose())); + QTimer::singleShot(500, this, SLOT(exitApp())); } - bool result() const { return m_result->result(); } - private slots: - void showWindowDelayed() - { - qApp->setQuitLockEnabled(true); - QTimer::singleShot(500, this, SLOT(showWindow())); - } - - void showWindow() - { - QWidget *w = new QWidget; - w->show(); - w->deleteLater(); - connect(w, SIGNAL(destroyed()), m_result, SLOT(setPasses())); - } - -private: - Result * const m_result; -}; - -void tst_QApplication::testQuitLock5() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - app.setQuitLockEnabled(false); - // Run a job before showing a window, and only enable the refcounting - // after doing so. - // Although the job brings the refcount to zero, the app does not exit - // until setQuitLockEnabled is called and the feature re-enabled. - - JobBeforeWindowRunner *eventRunner = new JobBeforeWindowRunner(&app); - - eventRunner->start(); - - app.exec(); - - QVERIFY(eventRunner->result()); -} - -class JobDuringWindowRunner : public QObject -{ - Q_OBJECT -public: - JobDuringWindowRunner(QObject *parent = 0) - : QObject(parent), m_result(new Result(this)) - { - - } - - void start() - { - JobObject *job = new JobObject(this); - - QWidget *w = new QWidget; - w->show(); - w->deleteLater(); - - QObject::connect(w, SIGNAL(destroyed()), m_result, SLOT(setFails())); - QObject::connect(job, SIGNAL(done()), m_result, SLOT(setPasses())); - } - - bool result() const { return m_result->result(); } - -private: - Result * const m_result; -}; - -void tst_QApplication::testQuitLock6() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - // A job runs, and while it is running, a window is shown and closed, - // then the job ends, which causes the quit. - - JobDuringWindowRunner *eventRunner = new JobDuringWindowRunner(&app); - - eventRunner->start(); - - app.exec(); - - QVERIFY(eventRunner->result()); -} -class JobWindowJobWindowRunner : public QObject -{ - Q_OBJECT -public: - JobWindowJobWindowRunner(QObject *parent = 0) - : QObject(parent), m_result(new Result(this)) - { - + void doClose() { + close(); + if (showAgain) + show(); } - void start() - { - JobObject *job = new JobObject(500, this); - - QWidget *w = new QWidget; - w->show(); - QTimer::singleShot(1000, w, SLOT(deleteLater())); - - QObject::connect(w, SIGNAL(destroyed()), m_result, SLOT(setPasses())); - QObject::connect(job, SIGNAL(done()), m_result, SLOT(setFails())); + void exitApp() { + qApp->exit(1); } - bool result() const { return m_result->result(); } private: - Result * const m_result; + bool showAgain; }; -void tst_QApplication::testQuitLock7() +void tst_QApplication::abortQuitOnShow() { - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - // A job runs, and while it is running, a window is shown - // then the job ends, then the window is closed, which causes the quit. - - JobWindowJobWindowRunner *eventRunner = new JobWindowJobWindowRunner(&app); - - eventRunner->start(); - - app.exec(); - - QVERIFY(eventRunner->result()); -} - -void tst_QApplication::testQuitLock8() -{ - int argc = 1; - char *argv[] = { "tst_qcoreapplication" }; - QApplication app(argc, argv); - - QMainWindow *mw1 = new QMainWindow; - mw1->show(); - QMainWindow *mw2 = new QMainWindow; - mw2->show(); - - QMetaObject::invokeMethod(mw1, "close", Qt::QueuedConnection); - QMetaObject::invokeMethod(mw2, "close", Qt::QueuedConnection); - - app.exec(); - - // No hang = pass + int argc = 0; + QApplication app(argc, 0); + QWidget *window1 = new ShowCloseShowWidget(false); + window1->show(); + QCOMPARE(app.exec(), 0); + + QWidget *window2 = new ShowCloseShowWidget(true); + window2->show(); + QCOMPARE(app.exec(), 1); } - /* This test is meant to ensure that certain objects (public & commonly used) can safely be used in a Q_GLOBAL_STATIC such that their destructors are diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp index c8e5591f8b..c43ea065f3 100644 --- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp @@ -797,6 +797,16 @@ void tst_QGridLayout::minMaxSize_data() << SizeInfo(QPoint(10, 10), QSize( 90, 90), QSize(100,100)) << SizeInfo(QPoint(10 + 100 + 1, 10), QSize( 90, 90)) ); + QTest::newRow("2x1 grid, extend to minimumSize, motif") << QString::fromAscii("motif") << 2 << 1 + << int(QSizePolicy::Preferred) << QSize() << (SizeInfoList() + << SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100)) + << SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90)) + ); + QTest::newRow("2x1 grid, extend to minimumSize, windows") << QString::fromAscii("windows") << 2 << 1 + << int(QSizePolicy::Preferred) << QSize() << (SizeInfoList() + << SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100)) + << SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90)) + ); QTest::newRow("1x2 grid, extend to minimumSize") << QString() << 1 << 2 << int(QSizePolicy::Preferred) << QSize() << (SizeInfoList() << SizeInfo(QPoint(10, 10), QSize( 90, 90), QSize(100,100)) @@ -818,17 +828,6 @@ void tst_QGridLayout::minMaxSize_data() << SizeInfo(QPoint(10, 10 + 100 + 1), QSize(100,100), QSize(), QSize(), 100*100) << SizeInfo(QPoint(10, 10 + 100 + 1 + 50 + 1), QSize(100,100), QSize(), QSize(100, 100)) ); - QTest::newRow("2x1 grid, extend to minimumSize") << QString::fromAscii("motif") << 2 << 1 - << int(QSizePolicy::Preferred) << QSize() << (SizeInfoList() - << SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100)) - << SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90)) - ); - QTest::newRow("2x1 grid, extend to minimumSize") << QString::fromAscii("windows") << 2 << 1 - << int(QSizePolicy::Preferred) << QSize() << (SizeInfoList() - << SizeInfo(QPoint(11, 11), QSize( 90, 90), QSize(100,100)) - << SizeInfo(QPoint(11 + 100 + 6, 11), QSize( 90, 90)) - ); - } void tst_QGridLayout::minMaxSize() diff --git a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro index 137d6a2bc5..f908c3ab7d 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro +++ b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro @@ -6,3 +6,5 @@ QT += gui-private SOURCES += tst_qstylesheetstyle.cpp RESOURCES += resources.qrc requires(contains(QT_CONFIG,private_tests)) + +win32:CONFIG += insignificant_test # QTBUG-24323 diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index 2dc985439d..1201b0f1da 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -881,6 +881,11 @@ void tst_QStyleSheetStyle::hoverColors() QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) + " did not contain background color #e8ff66").toLocal8Bit().constData()); +#ifdef Q_OS_MAC + if (qobject_cast<QPushButton *>(widget) + || qobject_cast<QComboBox *>(widget)) + QEXPECT_FAIL("", "Failure only for QPushButton and QComboBox, see QTBUG-23686", Continue); +#endif QVERIFY2(testForColors(image, QColor(0xff, 0x00, 0x84)), (QString::fromLatin1(widget->metaObject()->className()) + " did not contain text color #ff0084").toLocal8Bit().constData()); diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp index 228ff40ee5..a257eb1798 100644 --- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp +++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp @@ -367,40 +367,42 @@ void tst_QCompleter::csMatchingOnCsSortedModel_data() QTest::addColumn<QString>("completion"); QTest::addColumn<QString>("completionText"); +#define ROWNAME(name) (qPrintable(QString("%1 %2").arg(name).arg(i))) + for (int i = 0; i < 2; i++) { if (i == 1) QTest::newRow("FILTERING_OFF") << "FILTERING_OFF" << "" << "" << ""; // Plain text filter - QTest::newRow("()") << "" << "" << "P0" << "P0"; - QTest::newRow("()F") << "" << "F" << "P0" << "P0"; - QTest::newRow("()L") << "" << "L" << "p4" << "p4"; - QTest::newRow("()L") << "" << "L" << "p4" << "p4"; - QTest::newRow("()N") << "" << "N" << "P1" << "P1"; - QTest::newRow("(P)") << "P" << "" << "P0" << "P0"; - QTest::newRow("(P)F") << "P" << "" << "P0" << "P0"; - QTest::newRow("(P)L") << "P" << "L" << "P4" << "P4"; - QTest::newRow("(p)") << "p" << "" << "p0" << "p0"; - QTest::newRow("(p)N") << "p" << "N" << "p1" << "p1"; - QTest::newRow("(p)NN") << "p" << "NN" << "p2" << "p2"; - QTest::newRow("(p)NNN") << "p" << "NNN" << "p3" << "p3"; - QTest::newRow("(p)NNNN") << "p" << "NNNN" << "p4" << "p4"; - QTest::newRow("(p1)") << "p1" << "" << "p1" << "p1"; - QTest::newRow("(p11)") << "p11" << "" << "" << ""; + QTest::newRow(ROWNAME("()")) << "" << "" << "P0" << "P0"; + QTest::newRow(ROWNAME("()F")) << "" << "F" << "P0" << "P0"; + QTest::newRow(ROWNAME("()L")) << "" << "L" << "p4" << "p4"; + QTest::newRow(ROWNAME("()N")) << "" << "N" << "P1" << "P1"; + QTest::newRow(ROWNAME("(P)")) << "P" << "" << "P0" << "P0"; + QTest::newRow(ROWNAME("(P)F")) << "P" << "" << "P0" << "P0"; + QTest::newRow(ROWNAME("(P)L")) << "P" << "L" << "P4" << "P4"; + QTest::newRow(ROWNAME("(p)")) << "p" << "" << "p0" << "p0"; + QTest::newRow(ROWNAME("(p)N")) << "p" << "N" << "p1" << "p1"; + QTest::newRow(ROWNAME("(p)NN")) << "p" << "NN" << "p2" << "p2"; + QTest::newRow(ROWNAME("(p)NNN")) << "p" << "NNN" << "p3" << "p3"; + QTest::newRow(ROWNAME("(p)NNNN")) << "p" << "NNNN" << "p4" << "p4"; + QTest::newRow(ROWNAME("(p1)")) << "p1" << "" << "p1" << "p1"; + QTest::newRow(ROWNAME("(p11)")) << "p11" << "" << "" << ""; // Tree filter - QTest::newRow("(P0,)") << "P0," << "" << "c0P0" << "P0,c0P0"; - QTest::newRow("(P0,c)") << "P0,c" << "" << "c0P0" << "P0,c0P0"; - QTest::newRow("(P0,c1)") << "P0,c1" << "" << "c1P0" << "P0,c1P0"; - QTest::newRow("(P0,c3P0)") << "P0,c3P0" << "" << "c3P0" << "P0,c3P0"; - QTest::newRow("(P3,c)F") << "P3,c" << "F" << "c0P3" << "P3,c0P3"; - QTest::newRow("(P3,c)L") << "P3,c" << "L" << "c4P3" << "P3,c4P3"; - QTest::newRow("(P3,c)N") << "P3,c" << "N" << "c1P3" << "P3,c1P3"; - QTest::newRow("(P3,c)NN") << "P3,c" << "NN" << "c2P3" << "P3,c2P3"; - QTest::newRow("(P3,,c)") << "P3,,c" << "" << "" << ""; - QTest::newRow("(P3,c0P3,)") << "P3,c0P3," << "" << "" << ""; - QTest::newRow("(P,)") << "P," << "" << "" << ""; + QTest::newRow(ROWNAME("(P0,)")) << "P0," << "" << "c0P0" << "P0,c0P0"; + QTest::newRow(ROWNAME("(P0,c)")) << "P0,c" << "" << "c0P0" << "P0,c0P0"; + QTest::newRow(ROWNAME("(P0,c1)")) << "P0,c1" << "" << "c1P0" << "P0,c1P0"; + QTest::newRow(ROWNAME("(P0,c3P0)")) << "P0,c3P0" << "" << "c3P0" << "P0,c3P0"; + QTest::newRow(ROWNAME("(P3,c)F")) << "P3,c" << "F" << "c0P3" << "P3,c0P3"; + QTest::newRow(ROWNAME("(P3,c)L")) << "P3,c" << "L" << "c4P3" << "P3,c4P3"; + QTest::newRow(ROWNAME("(P3,c)N")) << "P3,c" << "N" << "c1P3" << "P3,c1P3"; + QTest::newRow(ROWNAME("(P3,c)NN")) << "P3,c" << "NN" << "c2P3" << "P3,c2P3"; + QTest::newRow(ROWNAME("(P3,,c)")) << "P3,,c" << "" << "" << ""; + QTest::newRow(ROWNAME("(P3,c0P3,)")) << "P3,c0P3," << "" << "" << ""; + QTest::newRow(ROWNAME("(P,)")) << "P," << "" << "" << ""; } +#undef ROWNAME } void tst_QCompleter::csMatchingOnCsSortedModel() diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp index 5695834e61..85cd2a8d92 100644 --- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp +++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp @@ -229,13 +229,13 @@ void tst_QAbstractButton::onReleased() void tst_QAbstractButton::setAutoRepeat_data() { QTest::addColumn<int>("mode"); - QTest::newRow( "" ) << 0; - QTest::newRow( "" ) << 1; - QTest::newRow( "" ) << 2; - QTest::newRow( "" ) << 3; - QTest::newRow( "" ) << 4; - QTest::newRow( "" ) << 5; - QTest::newRow( "" ) << 6; + QTest::newRow("mode 0") << 0; + QTest::newRow("mode 1") << 1; + QTest::newRow("mode 2") << 2; + QTest::newRow("mode 3") << 3; + QTest::newRow("mode 4") << 4; + QTest::newRow("mode 5") << 5; + QTest::newRow("mode 6") << 6; } #define REPEAT_DELAY 1000 diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index 6ed5d59db0..6021f90ed4 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -482,7 +482,7 @@ void tst_QAbstractSlider::keyPressed_data() QList<Qt::Key> list; list << Qt::Key_Down; - QTest::newRow("Step down once") << 10 // initial position + QTest::newRow("Step down once 1") << 10 // initial position << 0 // minimum << 100 // maximum << 3 // single step size @@ -495,7 +495,7 @@ void tst_QAbstractSlider::keyPressed_data() list = QList<Qt::Key>(); list << Qt::Key_Up; - QTest::newRow("Step down once") << 10 // initial position + QTest::newRow("Step down once 2") << 10 // initial position << 0 // minimum << 100 // maximum << 3 // single step size diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 80285ded78..907a239912 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -765,7 +765,7 @@ void tst_QComboBox::virtualAutocompletion() // We need to set the keyboard input interval to a higher value // as the processEvent() call takes too much time, so it restarts // the keyboard search then -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) +#if defined(Q_PROCESSOR_ARM) || defined(Q_PROCESSOR_MIPS) int oldInterval = QApplication::keyboardInputInterval(); QApplication::setKeyboardInputInterval(1500); #endif @@ -797,7 +797,7 @@ void tst_QComboBox::virtualAutocompletion() QApplication::sendEvent(testWidget, &kr2); qApp->processEvents(); // Process events to trigger autocompletion QTRY_COMPARE(testWidget->currentIndex(), 3); -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) +#if defined(Q_PROCESSOR_ARM) || defined(Q_PROCESSOR_MIPS) QApplication::setKeyboardInputInterval(oldInterval); #endif } diff --git a/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp index deb8a3bb6f..474acc0a78 100644 --- a/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp +++ b/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp @@ -360,11 +360,11 @@ void tst_QDoubleValidator::validateIntEquiv_data() QTest::newRow("4.6") << 0.0 << 10.0 << QString(".1") << INV; QTest::newRow("4.7") << 0.0 << 10.0 << QString("-1.0") << INV; - QTest::newRow("5.1") << 6.0 << 8.0 << QString("5") << ITM; - QTest::newRow("5.1") << 6.0 << 8.0 << QString("56") << INV; + QTest::newRow("5.1a") << 6.0 << 8.0 << QString("5") << ITM; + QTest::newRow("5.1b") << 6.0 << 8.0 << QString("56") << INV; QTest::newRow("5.2") << 6.0 << 8.0 << QString("7") << ACC; - QTest::newRow("5.3") << 6.0 << 8.0 << QString("9") << ITM; - QTest::newRow("5.3") << 6.0 << 8.0 << QString("-") << INV; + QTest::newRow("5.3a") << 6.0 << 8.0 << QString("9") << ITM; + QTest::newRow("5.3b") << 6.0 << 8.0 << QString("-") << INV; QTest::newRow("5.4a") << -8.0 << -6.0 << QString("+") << INV; QTest::newRow("5.4b") << -8.0 << -6.0 << QString("+5") << INV; QTest::newRow("5.4c") << -8.0 << -6.0 << QString("-5") << ITM; diff --git a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp index e773607164..3832d39d6f 100644 --- a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp +++ b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp @@ -256,7 +256,7 @@ void tst_QFontComboBox::writingSystem_data() QTest::newRow("Runic") << QFontDatabase::Runic; for (int i = 0; i < 31; ++i) - QTest::newRow("enum") << (QFontDatabase::WritingSystem)i; + QTest::newRow(qPrintable(QString("enum %1").arg(i))) << (QFontDatabase::WritingSystem)i; } // public QFontDatabase::WritingSystem writingSystem() const diff --git a/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp b/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp index 6aec414ae6..99d8ded15c 100644 --- a/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp @@ -70,8 +70,8 @@ void tst_QIntValidator::validate_data() QTest::newRow("data1") << 0 << 100 << QString("500") << INV; QTest::newRow("data1a") << 0 << 100 << QString("5000") << INV; QTest::newRow("data1b") << -100 << 0 << QString("50") << INT; - QTest::newRow("data1b") << -100 << 0 << QString("500") << INV; - QTest::newRow("data1c") << -100 << 0 << QString("5000") << INV; + QTest::newRow("data1c") << -100 << 0 << QString("500") << INV; + QTest::newRow("data1d") << -100 << 0 << QString("5000") << INV; QTest::newRow("data2") << 0 << 100 << QString("-35") << INV; QTest::newRow("data3") << 0 << 100 << QString("a") << INV; QTest::newRow("data4") << 0 << 100 << QString("-") << INV; diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp index 6d6b9384b9..d8b2a800b9 100644 --- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp +++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp @@ -312,7 +312,7 @@ void tst_QLabel::eventPropagation_data() QTest::newRow("rich text2") << QString("<b>rich text</b>") << (int)Qt::TextSelectableByKeyboard << (int)Qt::ClickFocus << true; QTest::newRow("rich text3") << QString("<b>rich text</b>") << (int)Qt::TextSelectableByMouse << (int)Qt::ClickFocus << false; QTest::newRow("rich text4") << QString("<b>rich text</b>") << (int)Qt::NoTextInteraction << (int)Qt::NoFocus << true; - QTest::newRow("rich text4") << QString("<b>rich text</b>") << (int)Qt::LinksAccessibleByKeyboard << (int)Qt::StrongFocus << true; + QTest::newRow("rich text5") << QString("<b>rich text</b>") << (int)Qt::LinksAccessibleByKeyboard << (int)Qt::StrongFocus << true; if (!test_box) test_box = new Widget; diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index b004efd07c..645f47fc72 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -647,22 +647,21 @@ void tst_QLineEdit::inputMask_data() QTest::addColumn<QString>("expectedMask"); // if no mask is set a nul string should be returned - QTest::newRow("") << QString("") << QString(); - QTest::newRow("") << QString() << QString(); + QTest::newRow("nul 1") << QString("") << QString(); + QTest::newRow("nul 2") << QString() << QString(); // try different masks - QTest::newRow("") << QString("000.000.000.000") << QString("000.000.000.000; "); - QTest::newRow("") << QString("000.000.000.000;#") << QString("000.000.000.000;#"); - QTest::newRow("") << QString("AAA.aa.999.###;") << QString("AAA.aa.999.###; "); - QTest::newRow("") << QString(">abcdef<GHIJK") << QString(">abcdef<GHIJK; "); -// QTest::newRow("") << QString() << QString(); + QTest::newRow("mask 1") << QString("000.000.000.000") << QString("000.000.000.000; "); + QTest::newRow("mask 2") << QString("000.000.000.000;#") << QString("000.000.000.000;#"); + QTest::newRow("mask 3") << QString("AAA.aa.999.###;") << QString("AAA.aa.999.###; "); + QTest::newRow("mask 4") << QString(">abcdef<GHIJK") << QString(">abcdef<GHIJK; "); // set an invalid input mask... // the current behaviour is that this exact (faulty) string is returned. - QTest::newRow("") << QString("ABCDEFGHIKLMNOP;") << QString("ABCDEFGHIKLMNOP; "); + QTest::newRow("invalid") << QString("ABCDEFGHIKLMNOP;") << QString("ABCDEFGHIKLMNOP; "); // verify that we can unset the mask again - QTest::newRow("") << QString("") << QString(); + QTest::newRow("unset") << QString("") << QString(); } void tst_QLineEdit::inputMask() @@ -3441,32 +3440,32 @@ void tst_QLineEdit::task233101_cursorPosAfterInputMethod_data() QTest::addColumn<int>("replacementLength"); QTest::addColumn<QString>("commitString"); - QTest::newRow("") << 4 << 4 << 0 << 0 << QString(""); - QTest::newRow("") << 4 << 4 << 0 << 0 << QString("x"); - QTest::newRow("") << 4 << 4 << 0 << 0 << QString("xxxxxxxxxxxxxxxx"); - QTest::newRow("") << 4 << 3 << 0 << 0 << QString(""); - QTest::newRow("") << 4 << 3 << 0 << 0 << QString("x"); - QTest::newRow("") << 4 << 3 << 0 << 0 << QString("xxxxxxxxxxxxxxxx"); - QTest::newRow("") << 4 << 0 << 0 << 0 << QString(""); - QTest::newRow("") << 4 << 0 << 0 << 0 << QString("x"); - QTest::newRow("") << 4 << 0 << 0 << 0 << QString("xxxxxxxxxxxxxxxx"); - - QTest::newRow("") << 4 << 4 << -4 << 4 << QString(""); - QTest::newRow("") << 4 << 4 << -4 << 4 << QString("x"); - QTest::newRow("") << 4 << 4 << -4 << 4 << QString("xxxxxxxxxxxxxxxx"); - QTest::newRow("") << 4 << 3 << -3 << 4 << QString(""); - QTest::newRow("") << 4 << 3 << -3 << 4 << QString("x"); - QTest::newRow("") << 4 << 3 << -3 << 4 << QString("xxxxxxxxxxxxxxxx"); - QTest::newRow("") << 4 << 0 << 0 << 4 << QString(""); - QTest::newRow("") << 4 << 0 << 0 << 4 << QString("x"); - QTest::newRow("") << 4 << 0 << 0 << 4 << QString("xxxxxxxxxxxxxxxx"); - - QTest::newRow("") << 4 << 4 << -4 << 0 << QString(""); - QTest::newRow("") << 4 << 4 << -4 << 0 << QString("x"); - QTest::newRow("") << 4 << 4 << -4 << 0 << QString("xxxxxxxxxxxxxxxx"); - QTest::newRow("") << 4 << 3 << -3 << 0 << QString(""); - QTest::newRow("") << 4 << 3 << -3 << 0 << QString("x"); - QTest::newRow("") << 4 << 3 << -3 << 0 << QString("xxxxxxxxxxxxxxxx"); + QTest::newRow("data1") << 4 << 4 << 0 << 0 << QString(""); + QTest::newRow("data2") << 4 << 4 << 0 << 0 << QString("x"); + QTest::newRow("data3") << 4 << 4 << 0 << 0 << QString("xxxxxxxxxxxxxxxx"); + QTest::newRow("data4") << 4 << 3 << 0 << 0 << QString(""); + QTest::newRow("data5") << 4 << 3 << 0 << 0 << QString("x"); + QTest::newRow("data6") << 4 << 3 << 0 << 0 << QString("xxxxxxxxxxxxxxxx"); + QTest::newRow("data7") << 4 << 0 << 0 << 0 << QString(""); + QTest::newRow("data8") << 4 << 0 << 0 << 0 << QString("x"); + QTest::newRow("data9") << 4 << 0 << 0 << 0 << QString("xxxxxxxxxxxxxxxx"); + + QTest::newRow("data10") << 4 << 4 << -4 << 4 << QString(""); + QTest::newRow("data11") << 4 << 4 << -4 << 4 << QString("x"); + QTest::newRow("data12") << 4 << 4 << -4 << 4 << QString("xxxxxxxxxxxxxxxx"); + QTest::newRow("data13") << 4 << 3 << -3 << 4 << QString(""); + QTest::newRow("data14") << 4 << 3 << -3 << 4 << QString("x"); + QTest::newRow("data15") << 4 << 3 << -3 << 4 << QString("xxxxxxxxxxxxxxxx"); + QTest::newRow("data16") << 4 << 0 << 0 << 4 << QString(""); + QTest::newRow("data17") << 4 << 0 << 0 << 4 << QString("x"); + QTest::newRow("data18") << 4 << 0 << 0 << 4 << QString("xxxxxxxxxxxxxxxx"); + + QTest::newRow("data19") << 4 << 4 << -4 << 0 << QString(""); + QTest::newRow("data20") << 4 << 4 << -4 << 0 << QString("x"); + QTest::newRow("data21") << 4 << 4 << -4 << 0 << QString("xxxxxxxxxxxxxxxx"); + QTest::newRow("data22") << 4 << 3 << -3 << 0 << QString(""); + QTest::newRow("data23") << 4 << 3 << -3 << 0 << QString("x"); + QTest::newRow("data24") << 4 << 3 << -3 << 0 << QString("xxxxxxxxxxxxxxxx"); } void tst_QLineEdit::task233101_cursorPosAfterInputMethod() diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 33b7ade715..13540355c7 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -538,7 +538,7 @@ void tst_QMainWindow::menuBar() mw.setMenuBar(mb1); QVERIFY(mw.menuBar() != 0); QCOMPARE(mw.menuBar(), (QMenuBar *)mb1); -#ifdef Q_WS_WINCE_WM +#ifdef Q_OS_WINCE_WM QSKIP("With native menubar integration the menubar is not a child"); #endif QCOMPARE(mb1->parentWidget(), (QWidget *)&mw); diff --git a/tests/auto/widgets/widgets/qmenu/qmenu.pro b/tests/auto/widgets/widgets/qmenu/qmenu.pro index f919c12cb5..55099f1c54 100644 --- a/tests/auto/widgets/widgets/qmenu/qmenu.pro +++ b/tests/auto/widgets/widgets/qmenu/qmenu.pro @@ -2,3 +2,5 @@ CONFIG += testcase TARGET = tst_qmenu QT += widgets testlib SOURCES += tst_qmenu.cpp + +win32:CONFIG += insignificant_test # QTBUG-24325 diff --git a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro index 6bacaa0d37..6f35d4516f 100644 --- a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro +++ b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro @@ -5,3 +5,5 @@ SOURCES += tst_qmenubar.cpp # QTBUG-4965, QTBUG-11823 - unstable tests linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test + +win32:CONFIG += insignificant_test # QTBUG-24326 diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp index 1b483512e3..4019faf428 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp @@ -219,7 +219,7 @@ void tst_QPlainTextEdit::getSetCheck() QCOMPARE(0, obj1.tabStopWidth()); obj1.setTabStopWidth(INT_MIN); QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value -#if defined(QT_ARCH_WINDOWSCE) +#if defined(Q_OS_WINCE) // due to rounding error in qRound when qreal==float // we cannot use INT_MAX for this check obj1.setTabStopWidth(SHRT_MAX*2); @@ -1474,11 +1474,11 @@ void tst_QPlainTextEdit::selectionChanged() QCOMPARE(selectionChangedSpy.count(), 3); QTest::keyClick(ed, Qt::Key_Right); - QCOMPARE(ed->textCursor().position(), 5); + QCOMPARE(ed->textCursor().position(), 4); QCOMPARE(selectionChangedSpy.count(), 4); QTest::keyClick(ed, Qt::Key_Right); - QCOMPARE(ed->textCursor().position(), 6); + QCOMPARE(ed->textCursor().position(), 5); QCOMPARE(selectionChangedSpy.count(), 4); } diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index c3d982388d..07efb60b49 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -657,22 +657,22 @@ void tst_QSpinBox::valueFromTextAndValidate_data() QTest::newRow("data3") << QString("2") << Acceptable << 0 << 100 << QString(); QTest::newRow("data4") << QString() << Intermediate << 0 << 1 << QString(); QTest::newRow("data5") << QString() << Invalid << 0 << 0 << QString(); - QTest::newRow("data5") << QString("5") << Intermediate << 2004 << 2005 << QString(); - QTest::newRow("data6") << QString("50") << Intermediate << 2004 << 2005 << QString(); - QTest::newRow("data7") << QString("205") << Intermediate << 2004 << 2005 << QString(); - QTest::newRow("data8") << QString("2005") << Acceptable << 2004 << 2005 << QString(); - QTest::newRow("data9") << QString("3") << Intermediate << 2004 << 2005 << QString(); - QTest::newRow("data10") << QString("-") << Intermediate << -20 << -10 << QString(); - QTest::newRow("data11") << QString("-1") << Intermediate << -20 << -10 << QString(); - QTest::newRow("data12") << QString("-5") << Intermediate << -20 << -10 << QString(); - QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -16 << QString(); - QTest::newRow("data14") << QString("-2") << Intermediate << -20 << -16 << QString(); - QTest::newRow("data15") << QString("2") << Invalid << -20 << -16 << QString(); - QTest::newRow("data16") << QString() << Intermediate << -20 << -16 << QString(); - QTest::newRow("data17") << QString(" 22") << Acceptable << 0 << 1000 << QString("22"); - QTest::newRow("data18") << QString("22 ") << Acceptable << 0 << 1000 << QString("22"); - QTest::newRow("data19") << QString(" 22 ") << Acceptable << 0 << 1000 << QString("22"); - QTest::newRow("data20") << QString("2 2") << Invalid << 0 << 1000 << QString(); + QTest::newRow("data6") << QString("5") << Intermediate << 2004 << 2005 << QString(); + QTest::newRow("data7") << QString("50") << Intermediate << 2004 << 2005 << QString(); + QTest::newRow("data8") << QString("205") << Intermediate << 2004 << 2005 << QString(); + QTest::newRow("data9") << QString("2005") << Acceptable << 2004 << 2005 << QString(); + QTest::newRow("data10") << QString("3") << Intermediate << 2004 << 2005 << QString(); + QTest::newRow("data11") << QString("-") << Intermediate << -20 << -10 << QString(); + QTest::newRow("data12") << QString("-1") << Intermediate << -20 << -10 << QString(); + QTest::newRow("data13") << QString("-5") << Intermediate << -20 << -10 << QString(); + QTest::newRow("data14") << QString("-5") << Intermediate << -20 << -16 << QString(); + QTest::newRow("data15") << QString("-2") << Intermediate << -20 << -16 << QString(); + QTest::newRow("data16") << QString("2") << Invalid << -20 << -16 << QString(); + QTest::newRow("data17") << QString() << Intermediate << -20 << -16 << QString(); + QTest::newRow("data18") << QString(" 22") << Acceptable << 0 << 1000 << QString("22"); + QTest::newRow("data19") << QString("22 ") << Acceptable << 0 << 1000 << QString("22"); + QTest::newRow("data20") << QString(" 22 ") << Acceptable << 0 << 1000 << QString("22"); + QTest::newRow("data21") << QString("2 2") << Invalid << 0 << 1000 << QString(); } static QString stateName(int state) diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp index 048f1441a2..294a656482 100644 --- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp +++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp @@ -507,7 +507,7 @@ void tst_QSplitter::setStretchFactor_data() QTest::newRow("ok06") << int(Qt::Vertical) << 1 << 1 << 1 << 1; QTest::newRow("ok07") << int(Qt::Vertical) << 2 << 2 << 2 << 2; QTest::newRow("ok08") << int(Qt::Vertical) << 3 << 5 << 5 << 5; - QTest::newRow("ok08") << int(Qt::Vertical) << -1 << 5 << 0 << 0; + QTest::newRow("ok09") << int(Qt::Vertical) << -1 << 5 << 0 << 0; } void tst_QSplitter::setStretchFactor() diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro index 85658c222e..294f1d84e7 100644 --- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro +++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro @@ -17,3 +17,5 @@ wince* { } contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-20756 crashes on xcb + +win32:CONFIG += insignificant_test # QTBUG-24348 diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 47eb3a59a3..249e9d7fbe 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -288,7 +288,7 @@ void tst_QTextEdit::getSetCheck() QCOMPARE(0, obj1.tabStopWidth()); obj1.setTabStopWidth(INT_MIN); QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value -#if defined(QT_ARCH_WINDOWSCE) +#if defined(Q_OS_WINCE) // due to rounding error in qRound when qreal==float // we cannot use INT_MAX for this check obj1.setTabStopWidth(SHRT_MAX*2); @@ -1840,11 +1840,11 @@ void tst_QTextEdit::selectionChanged() QCOMPARE(selectionChangedSpy.count(), 3); QTest::keyClick(ed, Qt::Key_Right); - QCOMPARE(ed->textCursor().position(), 5); + QCOMPARE(ed->textCursor().position(), 4); QCOMPARE(selectionChangedSpy.count(), 4); QTest::keyClick(ed, Qt::Key_Right); - QCOMPARE(ed->textCursor().position(), 6); + QCOMPARE(ed->textCursor().position(), 5); QCOMPARE(selectionChangedSpy.count(), 4); } diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp index 48b68d1795..df4efd658a 100644 --- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp +++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp @@ -142,6 +142,10 @@ void tst_QToolButton::triggered() QCOMPARE(spy.count(),1); QCOMPARE(qvariant_cast<QAction *>(spy.at(0).at(0)), def); +#ifdef Q_OS_MAC + QSKIP("QTBUG-24374 - This test hangs here on Mac OSX"); +#endif + w = menu; QTimer::singleShot(30, this, SLOT(sendMouseClick())); tb.showMenu(); diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index f9570f7631..d79044157a 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -555,7 +555,6 @@ void tst_QDom::saveWithSerialization_data() const if (prefix.isEmpty()) QFAIL("Cannot find testdata!"); QTest::newRow("doc01.xml") << QString(prefix + "/doc01.xml"); - QTest::newRow("doc01.xml") << QString(prefix + "/doc01.xml"); QTest::newRow("doc02.xml") << QString(prefix + "/doc02.xml"); QTest::newRow("doc03.xml") << QString(prefix + "/doc03.xml"); QTest::newRow("doc04.xml") << QString(prefix + "/doc04.xml"); @@ -1868,34 +1867,34 @@ void tst_QDom::setContentWhitespace_data() const QTest::addColumn<QString>("doc"); QTest::addColumn<bool>("expectedValidity"); - QTest::newRow("") << QString::fromLatin1(" <e/>") << true; - QTest::newRow("") << QString::fromLatin1(" <e/>") << true; - QTest::newRow("") << QString::fromLatin1(" <e/>") << true; - QTest::newRow("") << QString::fromLatin1(" <e/>") << true; - QTest::newRow("") << QString::fromLatin1("\n<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\n\n<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\n\n\n<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\n\n\n\n<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\t<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\t\t<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\t\t\t<e/>") << true; - QTest::newRow("") << QString::fromLatin1("\t\t\t\t<e/>") << true; + QTest::newRow("data1") << QString::fromLatin1(" <e/>") << true; + QTest::newRow("data2") << QString::fromLatin1(" <e/>") << true; + QTest::newRow("data3") << QString::fromLatin1(" <e/>") << true; + QTest::newRow("data4") << QString::fromLatin1(" <e/>") << true; + QTest::newRow("data5") << QString::fromLatin1("\n<e/>") << true; + QTest::newRow("data6") << QString::fromLatin1("\n\n<e/>") << true; + QTest::newRow("data7") << QString::fromLatin1("\n\n\n<e/>") << true; + QTest::newRow("data8") << QString::fromLatin1("\n\n\n\n<e/>") << true; + QTest::newRow("data9") << QString::fromLatin1("\t<e/>") << true; + QTest::newRow("data10") << QString::fromLatin1("\t\t<e/>") << true; + QTest::newRow("data11") << QString::fromLatin1("\t\t\t<e/>") << true; + QTest::newRow("data12") << QString::fromLatin1("\t\t\t\t<e/>") << true; /* With XML prolog. */ - QTest::newRow("") << QString::fromLatin1("<?xml version='1.0' ?><e/>") << true; - - QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\n<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\n\n<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\n\n\n<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\n\n\n\n<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\t<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\t\t<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\t\t\t<?xml version='1.0' ?><e/>") << false; - QTest::newRow("") << QString::fromLatin1("\t\t\t\t<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data13") << QString::fromLatin1("<?xml version='1.0' ?><e/>") << true; + + QTest::newRow("data14") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; + QTest::newRow("data15") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; + QTest::newRow("data16") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; + QTest::newRow("data17") << QString::fromLatin1(" <?xml version='1.0' ?><e/>") << false; + QTest::newRow("data18") << QString::fromLatin1("\n<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data19") << QString::fromLatin1("\n\n<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data20") << QString::fromLatin1("\n\n\n<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data21") << QString::fromLatin1("\n\n\n\n<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data22") << QString::fromLatin1("\t<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data23") << QString::fromLatin1("\t\t<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data24") << QString::fromLatin1("\t\t\t<?xml version='1.0' ?><e/>") << false; + QTest::newRow("data25") << QString::fromLatin1("\t\t\t\t<?xml version='1.0' ?><e/>") << false; } void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 92edd43060..3d16921b7f 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -542,7 +542,7 @@ void tst_qfile::createSmallFiles() dir.cd("tst"); tmpDirName = dir.absolutePath(); -#if defined(Q_WS_WINCE) +#if defined(Q_OS_WINCE) for (int i = 0; i < 100; ++i) #else for (int i = 0; i < 1000; ++i) diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp index 14895863e4..a3cdd38e56 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -72,6 +72,8 @@ private slots: void constructCoreType_data(); void constructCoreType(); + void constructCoreTypeStaticLess_data(); + void constructCoreTypeStaticLess(); void constructCoreTypeCopy_data(); void constructCoreTypeCopy(); @@ -79,6 +81,8 @@ private slots: void constructInPlace(); void constructInPlaceCopy_data(); void constructInPlaceCopy(); + void constructInPlaceCopyStaticLess_data(); + void constructInPlaceCopyStaticLess(); }; tst_QMetaType::tst_QMetaType() @@ -89,6 +93,12 @@ tst_QMetaType::~tst_QMetaType() { } +struct BigClass +{ + double n,i,e,r,o,b; +}; +Q_DECLARE_METATYPE(BigClass); + void tst_QMetaType::typeBuiltin_data() { QTest::addColumn<QByteArray>("typeName"); @@ -240,7 +250,7 @@ void tst_QMetaType::isRegisteredNotRegistered() void tst_QMetaType::constructCoreType_data() { QTest::addColumn<int>("typeId"); - for (int i = 0; i <= QMetaType::LastCoreType; ++i) + for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) QTest::newRow(QMetaType::typeName(i)) << i; // GUI types are tested in tst_QGuiMetaType. } @@ -260,6 +270,23 @@ void tst_QMetaType::constructCoreType() } } +void tst_QMetaType::constructCoreTypeStaticLess_data() +{ + constructCoreType_data(); +} + +void tst_QMetaType::constructCoreTypeStaticLess() +{ + QFETCH(int, typeId); + QBENCHMARK { + QMetaType type(typeId); + for (int i = 0; i < 100000; ++i) { + void *data = type.create((void *)0); + type.destroy(data); + } + } +} + void tst_QMetaType::constructCoreTypeCopy_data() { constructCoreType_data(); @@ -285,6 +312,7 @@ void tst_QMetaType::constructCoreTypeCopy() void tst_QMetaType::constructInPlace_data() { constructCoreType_data(); + QTest::newRow("custom") << qMetaTypeId<BigClass>(); } void tst_QMetaType::constructInPlace() @@ -305,7 +333,7 @@ void tst_QMetaType::constructInPlace() void tst_QMetaType::constructInPlaceCopy_data() { - constructCoreType_data(); + constructInPlace_data(); } void tst_QMetaType::constructInPlaceCopy() @@ -326,5 +354,29 @@ void tst_QMetaType::constructInPlaceCopy() qFreeAligned(storage); } +void tst_QMetaType::constructInPlaceCopyStaticLess_data() +{ + constructInPlaceCopy_data(); +} + +void tst_QMetaType::constructInPlaceCopyStaticLess() +{ + QFETCH(int, typeId); + int size = QMetaType::sizeOf(typeId); + void *storage = qMallocAligned(size, 2 * sizeof(qlonglong)); + void *other = QMetaType::create(typeId); + QCOMPARE(QMetaType::construct(typeId, storage, other), storage); + QMetaType::destruct(typeId, storage); + QBENCHMARK { + QMetaType type(typeId); + for (int i = 0; i < 100000; ++i) { + type.construct(storage, other); + type.destruct(storage); + } + } + QMetaType::destroy(typeId, other); + qFreeAligned(storage); +} + QTEST_MAIN(tst_QMetaType) #include "tst_qmetatype.moc" diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp index 0c4af17376..f6b4d88311 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp @@ -90,6 +90,7 @@ struct BigClass double n,i,e,r,o,b; }; Q_STATIC_ASSERT(sizeof(BigClass) > sizeof(QVariant::Private::Data)); +Q_DECLARE_TYPEINFO(BigClass, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(BigClass); struct SmallClass @@ -97,6 +98,7 @@ struct SmallClass char s; }; Q_STATIC_ASSERT(sizeof(SmallClass) <= sizeof(QVariant::Private::Data)); +Q_DECLARE_TYPEINFO(SmallClass, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(SmallClass); void tst_qvariant::testBound() @@ -305,7 +307,7 @@ void tst_qvariant::stringVariantValue() void tst_qvariant::createCoreType_data() { QTest::addColumn<int>("typeId"); - for (int i = 0; i <= QMetaType::LastCoreType; ++i) + for (int i = QMetaType::FirstCoreType; i <= QMetaType::LastCoreType; ++i) QTest::newRow(QMetaType::typeName(i)) << i; } diff --git a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp index ee13a63a57..e42a40b110 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp +++ b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp @@ -133,7 +133,7 @@ struct Large { // A "large" item type }; // Embedded devices typically have limited memory -#if defined(Q_WS_WINCE) +#if defined(Q_OS_WINCE) # define LARGE_MAX_SIZE 2000 #else # define LARGE_MAX_SIZE 20000 diff --git a/tests/benchmarks/corelib/tools/qhash/main.cpp b/tests/benchmarks/corelib/tools/qhash/main.cpp index 6f3228d0eb..18138cbd47 100644 --- a/tests/benchmarks/corelib/tools/qhash/main.cpp +++ b/tests/benchmarks/corelib/tools/qhash/main.cpp @@ -45,7 +45,7 @@ #include <QHash> #include <QString> #include <QStringList> - +#include <QUuid> #include <QTest> @@ -69,12 +69,36 @@ private: void tst_QHash::data() { - QFile smallPathsData("paths_small_data.txt"); - smallPathsData.open(QIODevice::ReadOnly); - QTest::addColumn<QStringList>("items"); - QTest::newRow("paths-small") - << QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n')); + static QStringList smallFilePaths; + + { + // small list of file paths + if (smallFilePaths.isEmpty()) { + QFile smallPathsData("paths_small_data.txt"); + QVERIFY(smallPathsData.open(QIODevice::ReadOnly)); + smallFilePaths = QString::fromLatin1(smallPathsData.readAll()).split(QLatin1Char('\n')); + Q_ASSERT(!smallFilePaths.isEmpty()); + } + + QTest::newRow("paths-small") << smallFilePaths; + } + + { + // list of UUIDs + static QStringList uuids; + if (uuids.isEmpty()) { + // guaranteed to be completely random, generated by http://xkcd.com/221/ + QUuid ns = QUuid("{f43d2ef3-2fe9-4563-a6f5-5a0100c2d699}"); + uuids.reserve(smallFilePaths.size()); + + foreach (const QString &path, smallFilePaths) + uuids.append(QUuid::createUuidV5(ns, path).toString()); + } + + QTest::newRow("uuids-list") << uuids; + } + } void tst_QHash::qhash_qt4() diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index cc549f835d..8eef993c06 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -414,7 +414,7 @@ void tst_QGraphicsView::chipTester_data() void tst_QGraphicsView::chipTester() { -#ifdef Q_WS_WINCE_WM +#ifdef Q_OS_WINCE_WM QSKIP("WinCE WM: Fails on Windows Mobile w/o OpenGL"); #endif QFETCH(bool, antialias); diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index e48172da89..829bba5c5d 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -565,7 +565,7 @@ void tst_qnetworkreply::uploadPerformance() void tst_qnetworkreply::httpUploadPerformance() { -#if defined(Q_WS_WINCE_WM) +#if defined(Q_OS_WINCE_WM) // Show some mercy for non-desktop platform/s enum {UploadSize = 4*1024*1024}; // 4 MB #else @@ -636,7 +636,7 @@ void tst_qnetworkreply::httpDownloadPerformance() { QFETCH(bool, serverSendsContentLength); QFETCH(bool, chunkedEncoding); -#if defined(Q_WS_WINCE_WM) +#if defined(Q_OS_WINCE_WM) // Show some mercy to non-desktop platform/s enum {UploadSize = 4*1024*1024}; // 4 MB #else @@ -720,7 +720,7 @@ void tst_qnetworkreply::httpDownloadPerformanceDownloadBuffer() QFETCH(HttpDownloadPerformanceDownloadBufferTestType, testType); // On my Linux Desktop the results are already visible with 128 kB, however we use this to have good results. -#if defined(Q_WS_WINCE_WM) +#if defined(Q_OS_WINCE_WM) // Show some mercy to non-desktop platform/s enum {UploadSize = 4*1024*1024}; // 4 MB #else diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index ea923a7fd0..2bb23e5781 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -173,7 +173,7 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; -#if defined(Q_WS_WINCE_WM) +#if defined(Q_OS_WINCE_WM) QSKIP("WinCE WM: Not yet supported"); #endif diff --git a/tests/manual/cmake/CMakeLists.txt b/tests/manual/cmake/CMakeLists.txt index 91ead649ec..7ec3cebf4b 100644 --- a/tests/manual/cmake/CMakeLists.txt +++ b/tests/manual/cmake/CMakeLists.txt @@ -1,35 +1,88 @@ +# This is an automatic test for the CMake configuration files. +# To run it, +# 1) mkdir build # Create a build directory +# 2) cd build +# 3) cmake .. # Run cmake on this directory. +# 4) ctest # Run ctest +# +# The expected output is something like: +# +# Start 1: pass1 +# 1/7 Test #1: pass1 ............................ Passed 4.25 sec +# Start 2: pass2 +# 2/7 Test #2: pass2 ............................ Passed 2.00 sec +# Start 3: pass3 +# 3/7 Test #3: pass3 ............................ Passed 2.85 sec +# Start 4: fail4 +# 4/7 Test #4: fail4 ............................ Passed 1.88 sec +# Start 5: fail5 +# 5/7 Test #5: fail5 ............................ Passed 1.36 sec +# Start 6: pass_needsquoting_6 +# 6/7 Test #6: pass_needsquoting_6 .............. Passed 2.88 sec +# Start 7: pass7 +# 7/7 Test #7: pass7 ............................ Passed 0.93 sec +# +# Note that if Qt is not installed, or if it is installed to a +# non-standard prefix, the environment variable CMAKE_PREFIX_PATH +# needs to be set to the installation prefix or build prefix of Qt +# before running these tests. + cmake_minimum_required(VERSION 2.8) project(qmake_cmake_files) -macro(_do_build _dir) - try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/${_dir} - ${CMAKE_CURRENT_SOURCE_DIR}/${_dir} - ${_dir} - OUTPUT_VARIABLE Out - ) -endmacro() +enable_testing() macro(expect_pass _dir) - _do_build(${_dir}) - if (NOT Result) - message(SEND_ERROR "Build failed: ${Out}") - endif() + string(REPLACE "(" "_" testname "${_dir}") + string(REPLACE ")" "_" testname "${testname}") + add_test(${testname} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" + "${CMAKE_CURRENT_BINARY_DIR}/${_dir}" + --build-generator ${CMAKE_GENERATOR} + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + ) endmacro() macro(expect_fail _dir) - _do_build(${_dir}) - if (Result) - message(SEND_ERROR "Build should fail, but did not: ${Out}") - endif() + string(REPLACE "(" "_" testname "${_dir}") + string(REPLACE ")" "_" testname "${testname}") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}/CMakeLists.txt" + " + cmake_minimum_required(VERSION 2.8) + project(${_dir}_build) + + try_compile(Result \${CMAKE_CURRENT_BINARY_DIR}/${_dir} + \${CMAKE_CURRENT_SOURCE_DIR}/${_dir} + ${_dir} + ) + if (Result) + message(SEND_ERROR \"Succeeded build which should fail\") + endif() + " + ) + add_test(${testname} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}" + "${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}/build" + --build-generator ${CMAKE_GENERATOR} + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + ) endmacro() if(${CMAKE_VERSION} VERSION_GREATER 2.8.7) # Requires CMAKE_AUTOMOC function in CMake 2.8.7 expect_pass(pass1) +else() + message("CMake version older than 2.8.7. Not running test \"pass1\"") endif() expect_pass(pass2) expect_pass(pass3) expect_fail(fail4) expect_fail(fail5) +expect_pass("pass(needsquoting)6") +expect_pass(pass7) diff --git a/tests/manual/cmake/fail4/CMakeLists.txt b/tests/manual/cmake/fail4/CMakeLists.txt index dcd4b8bd65..2466e24d3a 100644 --- a/tests/manual/cmake/fail4/CMakeLists.txt +++ b/tests/manual/cmake/fail4/CMakeLists.txt @@ -7,6 +7,8 @@ find_package(Qt5Core REQUIRED) include_directories(${Qt5Core_INCLUDE_DIRS}) +add_definitions(${Qt5Core_DEFINITIONS}) + qt5_wrap_cpp(moc_files myobject.h) # Test options. The -binary option generates a binary to dlopen instead of diff --git a/tests/manual/cmake/fail5/CMakeLists.txt b/tests/manual/cmake/fail5/CMakeLists.txt index f82a62b626..9aedf4a008 100644 --- a/tests/manual/cmake/fail5/CMakeLists.txt +++ b/tests/manual/cmake/fail5/CMakeLists.txt @@ -7,6 +7,8 @@ find_package(Qt5Core REQUIRED) include_directories(${Qt5Core_INCLUDE_DIRS}) +add_definitions(${Qt5Core_DEFINITIONS}) + # Test options. The -i option removes the include "myobject.h" from the moc file # causing a compile failure. -> Options work qt5_wrap_cpp(moc_files myobject.h OPTIONS -i) diff --git a/tests/manual/cmake/pass(needsquoting)6/CMakeLists.txt b/tests/manual/cmake/pass(needsquoting)6/CMakeLists.txt index cc1a1bc588..fb971f9ebd 100644 --- a/tests/manual/cmake/pass(needsquoting)6/CMakeLists.txt +++ b/tests/manual/cmake/pass(needsquoting)6/CMakeLists.txt @@ -9,6 +9,8 @@ find_package(Qt5Widgets REQUIRED) include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +add_definitions(${Qt5Core_DEFINITIONS}) + set(CMAKE_INCLUDE_CURRENT_DIR ON) qt5_wrap_cpp(moc_files mywidget.h) diff --git a/tests/manual/cmake/pass1/CMakeLists.txt b/tests/manual/cmake/pass1/CMakeLists.txt index f11887e545..b1922c075b 100644 --- a/tests/manual/cmake/pass1/CMakeLists.txt +++ b/tests/manual/cmake/pass1/CMakeLists.txt @@ -18,6 +18,7 @@ macro(qt5_use_package _target _package) # set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_package}_INCLUDE_DIRS}) include_directories(${Qt5${_package}_INCLUDE_DIRS}) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_package}_COMPILE_DEFINITIONS}) + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_FLAGS ${Qt5${_package}_COMPILE_FLAGS}) else() message(FATAL_ERROR "NOT FOUND: Qt5${_package}") endif() diff --git a/tests/manual/cmake/pass2/CMakeLists.txt b/tests/manual/cmake/pass2/CMakeLists.txt index ac1bb15846..a52744623e 100644 --- a/tests/manual/cmake/pass2/CMakeLists.txt +++ b/tests/manual/cmake/pass2/CMakeLists.txt @@ -7,6 +7,8 @@ find_package(Qt5Core REQUIRED) include_directories(${Qt5Core_INCLUDE_DIRS}) +add_definitions(${Qt5Core_DEFINITIONS}) + qt5_wrap_cpp(moc_files myobject.h) qt5_add_resources(rcc_files "pass2.qrc") diff --git a/tests/manual/cmake/pass3/CMakeLists.txt b/tests/manual/cmake/pass3/CMakeLists.txt index 11402e2e18..b836161813 100644 --- a/tests/manual/cmake/pass3/CMakeLists.txt +++ b/tests/manual/cmake/pass3/CMakeLists.txt @@ -8,6 +8,8 @@ find_package(Qt5Widgets REQUIRED) include_directories(${Qt5Widgets_INCLUDE_DIRS}) +add_definitions(${Qt5Core_DEFINITIONS}) + set(CMAKE_INCLUDE_CURRENT_DIR ON) qt5_wrap_cpp(moc_files mywidget.h) diff --git a/tests/manual/cmake/pass7/CMakeLists.txt b/tests/manual/cmake/pass7/CMakeLists.txt new file mode 100644 index 0000000000..e7c9b46ead --- /dev/null +++ b/tests/manual/cmake/pass7/CMakeLists.txt @@ -0,0 +1,11 @@ + +cmake_minimum_required(VERSION 2.8) + +project(pass7) + +find_package(Qt5Core REQUIRED) + +include_directories(${Qt5Core_INCLUDE_DIRS}) +add_definitions(${Qt5Core_DEFINITIONS}) + +add_executable(myobject main.cpp) diff --git a/tests/manual/cmake/pass7/main.cpp b/tests/manual/cmake/pass7/main.cpp new file mode 100644 index 0000000000..0a6b09d877 --- /dev/null +++ b/tests/manual/cmake/pass7/main.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** 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 "qplatformdefs.h" + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/tests/manual/qnetworkconfigurationmanager/main.cpp b/tests/manual/qnetworkconfigurationmanager/main.cpp new file mode 100644 index 0000000000..2ac33d4fe1 --- /dev/null +++ b/tests/manual/qnetworkconfigurationmanager/main.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** 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 <QDebug> +#include <qtest.h> +#include <QtTest/QtTest> +#include <QtNetwork/qnetworkconfigmanager.h> + +class tst_qnetworkconfigurationmanager : public QObject +{ + Q_OBJECT + +private slots: + void isOnline(); +}; + +class SignalHandler : public QObject +{ + Q_OBJECT + +public slots: + void onOnlineStateChanged(bool isOnline) + { + qDebug() << "Online state changed to:" << isOnline; + } +}; + +void tst_qnetworkconfigurationmanager::isOnline() +{ + QNetworkConfigurationManager manager; + qDebug() << "Testing QNetworkConfigurationManager online status reporting functionality."; + qDebug() << "This should tell the current online state:" << manager.isOnline(); + qDebug() << "Now please plug / unplug the network cable, and check the state update signal."; + qDebug() << "Note that there might be some delays before you see the change, depending on the backend."; + + SignalHandler signalHandler; + connect(&manager, SIGNAL(onlineStateChanged(bool)), &signalHandler, SLOT(onOnlineStateChanged(bool))); + + // event loop + QTestEventLoop::instance().enterLoop(30); + QVERIFY(QTestEventLoop::instance().timeout()); +} + +QTEST_MAIN(tst_qnetworkconfigurationmanager) + +#include "main.moc" diff --git a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro new file mode 100644 index 0000000000..613fcd85e4 --- /dev/null +++ b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro @@ -0,0 +1,13 @@ +CONFIG += testcase +TEMPLATE = app +TARGET = tst_qnetworkconfigurationmanager +DEPENDPATH += . +INCLUDEPATH += . + +QT -= gui +QT += network testlib + +CONFIG += release + +# Input +SOURCES += main.cpp |