diff options
Diffstat (limited to 'tests')
37 files changed, 400 insertions, 202 deletions
diff --git a/tests/auto/compilerwarnings/data/test_cpp.txt b/tests/auto/compilerwarnings/data/test_cpp.txt index bab20b0227..242857da8e 100644 --- a/tests/auto/compilerwarnings/data/test_cpp.txt +++ b/tests/auto/compilerwarnings/data/test_cpp.txt @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index b93407f2e4..caa22db144 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -2176,7 +2176,11 @@ void tst_QDir::cdNonreadable() void tst_QDir::cdBelowRoot() { -#if defined (Q_OS_UNIX) +#if defined (Q_OS_ANDROID) +#define ROOT QString("/") +#define DIR QString("/system") +#define CD_INTO "system" +#elif defined (Q_OS_UNIX) #define ROOT QString("/") #define DIR QString("/tmp") #define CD_INTO "tmp" diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index 3fd58b4958..aa5a9d92f1 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -2,13 +2,8 @@ CONFIG += testcase TARGET = tst_qfileinfo QT = core-private testlib SOURCES = tst_qfileinfo.cpp -RESOURCES += qfileinfo.qrc - -TESTDATA += qfileinfo.qrc qfileinfo.pro tst_qfileinfo.cpp resources/file1 resources/file1.ext1 resources/file1.ext1.ext2 +RESOURCES += qfileinfo.qrc \ + testdata.qrc win32*:!wince*:!winrt:LIBS += -ladvapi32 -lnetapi32 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -android:!android-no-sdk: { - RESOURCES += android_testdata.qrc -} diff --git a/tests/auto/corelib/io/qfileinfo/android_testdata.qrc b/tests/auto/corelib/io/qfileinfo/testdata.qrc index ce545cc21c..d2974bae77 100644 --- a/tests/auto/corelib/io/qfileinfo/android_testdata.qrc +++ b/tests/auto/corelib/io/qfileinfo/testdata.qrc @@ -1,5 +1,5 @@ <RCC> - <qresource prefix="/android_testdata"> + <qresource prefix="/testdata"> <file>resources/file1</file> <file>resources/file1.ext1</file> <file>resources/file1.ext1.ext2</file> diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index f4c0affd92..05546eb2b7 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -265,40 +265,22 @@ private slots: private: const QString m_currentDir; + QString m_dataPath; QString m_sourceFile; + QString m_proFile; QString m_resourcesDir; QTemporaryDir m_dir; }; void tst_QFileInfo::initTestCase() { -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) - QString dataPath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); - QString resourceSourcePath = QStringLiteral(":/android_testdata"); - QDirIterator it(resourceSourcePath, QDirIterator::Subdirectories); - while (it.hasNext()) { - it.next(); - - QFileInfo fileInfo = it.fileInfo(); - if (!fileInfo.isDir()) { - QString destination = dataPath + QLatin1Char('/') + fileInfo.filePath().mid(resourceSourcePath.length()); - QFileInfo destinationFileInfo(destination); - if (!destinationFileInfo.exists()) { - QDir().mkpath(destinationFileInfo.path()); - if (!QFile::copy(fileInfo.filePath(), destination)) - qWarning("Failed to copy %s", qPrintable(fileInfo.filePath())); - } - } - } - m_sourceFile = dataPath + QStringLiteral("/tst_qfileinfo.cpp"); - m_resourcesDir = dataPath + QStringLiteral("/resources"); -#else - m_sourceFile = QFINDTESTDATA("tst_qfileinfo.cpp"); - m_resourcesDir = QFINDTESTDATA("resources"); -#endif + m_dataPath = QEXTRACTTESTDATA("/testdata"); + QVERIFY(!m_dataPath.isEmpty()); + + m_sourceFile = m_dataPath + QStringLiteral("/tst_qfileinfo.cpp"); + m_resourcesDir = m_dataPath + QStringLiteral("/resources"); + m_proFile = m_dataPath + QStringLiteral("/tst_qfileinfo.pro"); - QVERIFY(!m_sourceFile.isEmpty()); - QVERIFY(!m_resourcesDir.isEmpty()); QVERIFY(m_dir.isValid()); QVERIFY(QDir::setCurrent(m_dir.path())); } @@ -306,6 +288,7 @@ void tst_QFileInfo::initTestCase() void tst_QFileInfo::cleanupTestCase() { QDir::setCurrent(m_currentDir); // Release temporary directory so that it can be deleted on Windows + QDir(m_dataPath).removeRecursively(); } // Testing get/set functions @@ -1611,14 +1594,18 @@ void tst_QFileInfo::isWritable() void tst_QFileInfo::isExecutable() { QString appPath = QCoreApplication::applicationDirPath(); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + appPath += "/libtst_qfileinfo.so"; +#else appPath += "/tst_qfileinfo"; -#if defined(Q_OS_WIN) +# if defined(Q_OS_WIN) appPath += ".exe"; +# endif #endif QFileInfo fi(appPath); QCOMPARE(fi.isExecutable(), true); - QCOMPARE(QFileInfo(QFINDTESTDATA("qfileinfo.pro")).isExecutable(), false); + QCOMPARE(QFileInfo(m_proFile).isExecutable(), false); #ifdef Q_OS_UNIX QFile::remove("link.lnk"); @@ -1630,7 +1617,7 @@ void tst_QFileInfo::isExecutable() QFile::remove("link.lnk"); // Symlink to .pro file - QFile proFile(QFINDTESTDATA("qfileinfo.pro")); + QFile proFile(m_proFile); QVERIFY(proFile.link("link.lnk")); QCOMPARE(QFileInfo("link.lnk").isExecutable(), false); QFile::remove("link.lnk"); diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp index 12a67be213..5ece9190a5 100644 --- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp +++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp @@ -70,7 +70,7 @@ void tst_QNoDebug::streaming() const { QDateTime dt(QDate(1,2,3),QTime(4,5,6)); const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t")); - QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::asprintf("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString))); + QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(%1 Qt::TimeSpec(LocalTime))").arg(debugString))); qWarning() << dt; } diff --git a/tests/auto/corelib/io/qurl/tst_qurl_mac.mm b/tests/auto/corelib/io/qurl/tst_qurl_mac.mm index 5686d35729..45c1681b22 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl_mac.mm +++ b/tests/auto/corelib/io/qurl/tst_qurl_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm index 8b3de5feaa..c2b76cc41a 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 Samuel Gaist <samuel.gaist@edeltech.ch> -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm index 0ecc879e91..6bdaa94e49 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2014 Petroules Corporation. ** Contact: http://www.qt.io/licensing/ ** diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp index 1fdfc68d12..6961426f59 100644 --- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp +++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp index 1e7b3ee2d6..1207986dde 100644 --- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp +++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp @@ -35,6 +35,17 @@ #include <QtTest/QtTest> #include <QList> +template <typename T, class MemoryLayout> +class is_qlist_array_memory_layout { + struct No { char c; }; + struct Yes { No n[2]; }; + Q_STATIC_ASSERT(sizeof(No) != sizeof(Yes)); + static No check(...); + static Yes check(MemoryLayout); +public: + enum { value = sizeof(check(typename QList<T>::MemoryLayout())) == sizeof(Yes) }; +}; + struct Movable { Movable(char input = 'j') : i(input) @@ -79,14 +90,16 @@ private: static int liveCount; enum State { Constructed = 106, Destructed = 110 }; - State state; + uchar state; - static void check(const State state1, const State state2) + static void check(const uchar state1, const uchar state2) { QCOMPARE(state1, state2); } }; +Q_STATIC_ASSERT(sizeof(Movable) < sizeof(void*)); + int Movable::liveCount = 0; QT_BEGIN_NAMESPACE @@ -100,6 +113,75 @@ int qHash(const Movable& movable) return qHash(movable.i); } +struct Optimal +{ + Optimal(char input = 'j') + : i(input), + state(Constructed) + { + ++liveCount; + } + Optimal(const Optimal &other) + : i(other.i), + state(Constructed) + { + check(other.state, Constructed); + ++liveCount; + } + + ~Optimal() + { + check(state, Constructed); + i = 0; + --liveCount; + state = Destructed; + } + + bool operator ==(const Optimal &other) const + { + check(state, Constructed); + check(other.state, Constructed); + return i == other.i; + } + + Optimal &operator=(const Optimal &other) + { + check(state, Constructed); + check(other.state, Constructed); + i = other.i; + return *this; + } + char i; + + static int getLiveCount() { return liveCount; } +private: + static int liveCount; + + enum State { Constructed = 106, Destructed = 110 }; + uchar state; + char padding[sizeof(void*) - 2]; + + static void check(const uchar state1, const uchar state2) + { + QCOMPARE(state1, state2); + } +}; + +Q_STATIC_ASSERT(sizeof(Optimal) == sizeof(void*)); + +int Optimal::liveCount = 0; + +QT_BEGIN_NAMESPACE +Q_DECLARE_TYPEINFO(Optimal, Q_MOVABLE_TYPE); +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(Optimal); + +int qHash(const Optimal& key) +{ + return qHash(key.i); +} + struct Complex { Complex(int val = 0) @@ -160,108 +242,131 @@ Q_STATIC_ASSERT(!QTypeInfo<int>::isStatic); Q_STATIC_ASSERT(!QTypeInfo<int>::isComplex); Q_STATIC_ASSERT(!QTypeInfo<Movable>::isStatic); Q_STATIC_ASSERT(QTypeInfo<Movable>::isComplex); +Q_STATIC_ASSERT(!QTypeInfo<Optimal>::isStatic); +Q_STATIC_ASSERT(QTypeInfo<Optimal>::isComplex); Q_STATIC_ASSERT(QTypeInfo<Complex>::isStatic); Q_STATIC_ASSERT(QTypeInfo<Complex>::isComplex); +// iow: +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<int, QListData::NotIndirectLayout> ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<int, QListData::IndirectLayout> ::value)); + +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Optimal, QListData::InlineWithPaddingLayout> ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Optimal, QListData::NotArrayCompatibleLayout>::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Optimal, QListData::NotIndirectLayout> ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Optimal, QListData::ArrayCompatibleLayout> ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Optimal, QListData::IndirectLayout> ::value)); + +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Movable, QListData::InlineWithPaddingLayout> ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Movable, QListData::NotArrayCompatibleLayout>::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Movable, QListData::NotIndirectLayout> ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Movable, QListData::ArrayCompatibleLayout> ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Movable, QListData::IndirectLayout> ::value)); + +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Complex, QListData::InlineWithPaddingLayout> ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Complex, QListData::NotArrayCompatibleLayout>::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Complex, QListData::NotIndirectLayout> ::value)); +Q_STATIC_ASSERT((!is_qlist_array_memory_layout<Complex, QListData::ArrayCompatibleLayout> ::value)); +Q_STATIC_ASSERT(( is_qlist_array_memory_layout<Complex, QListData::IndirectLayout> ::value)); class tst_QList : public QObject { Q_OBJECT private slots: - void lengthInt() const; + void lengthOptimal() const; void lengthMovable() const; void lengthComplex() const; void lengthSignature() const; - void appendInt() const; + void appendOptimal() const; void appendMovable() const; void appendComplex() const; void prepend() const; - void midInt() const; + void midOptimal() const; void midMovable() const; void midComplex() const; - void atInt() const; + void atOptimal() const; void atMovable() const; void atComplex() const; - void firstInt() const; + void firstOptimal() const; void firstMovable() const; void firstComplex() const; - void lastInt() const; + void lastOptimal() const; void lastMovable() const; void lastComplex() const; - void beginInt() const; + void beginOptimal() const; void beginMovable() const; void beginComplex() const; - void endInt() const; + void endOptimal() const; void endMovable() const; void endComplex() const; - void containsInt() const; + void containsOptimal() const; void containsMovable() const; void containsComplex() const; - void countInt() const; + void countOptimal() const; void countMovable() const; void countComplex() const; - void emptyInt() const; + void emptyOptimal() const; void emptyMovable() const; void emptyComplex() const; - void endsWithInt() const; + void endsWithOptimal() const; void endsWithMovable() const; void endsWithComplex() const; - void lastIndexOfInt() const; + void lastIndexOfOptimal() const; void lastIndexOfMovable() const; void lastIndexOfComplex() const; - void moveInt() const; + void moveOptimal() const; void moveMovable() const; void moveComplex() const; - void removeAllInt() const; + void removeAllOptimal() const; void removeAllMovable() const; void removeAllComplex() const; - void removeAtInt() const; + void removeAtOptimal() const; void removeAtMovable() const; void removeAtComplex() const; - void removeOneInt() const; + void removeOneOptimal() const; void removeOneMovable() const; void removeOneComplex() const; - void replaceInt() const; + void replaceOptimal() const; void replaceMovable() const; void replaceComplex() const; - void startsWithInt() const; + void startsWithOptimal() const; void startsWithMovable() const; void startsWithComplex() const; - void swapInt() const; + void swapOptimal() const; void swapMovable() const; void swapComplex() const; - void takeAtInt() const; + void takeAtOptimal() const; void takeAtMovable() const; void takeAtComplex() const; - void takeFirstInt() const; + void takeFirstOptimal() const; void takeFirstMovable() const; void takeFirstComplex() const; - void takeLastInt() const; + void takeLastOptimal() const; void takeLastMovable() const; void takeLastComplex() const; - void toSetInt() const; + void toSetOptimal() const; void toSetMovable() const; void toSetComplex() const; - void toStdListInt() const; + void toStdListOptimal() const; void toStdListMovable() const; void toStdListComplex() const; - void toVectorInt() const; + void toVectorOptimal() const; void toVectorMovable() const; void toVectorComplex() const; - void valueInt() const; + void valueOptimal() const; void valueMovable() const; void valueComplex() const; - void testOperatorsInt() const; + void testOperatorsOptimal() const; void testOperatorsMovable() const; void testOperatorsComplex() const; - void testSTLIteratorsInt() const; + void testSTLIteratorsOptimal() const; void testSTLIteratorsMovable() const; void testSTLIteratorsComplex() const; void initializeList() const; - void constSharedNullInt() const; + void constSharedNullOptimal() const; void constSharedNullMovable() const; void constSharedNullComplex() const; void setSharableInt_data() const; @@ -320,7 +425,7 @@ template<typename T> struct SimpleValue }; template<> -const int SimpleValue<int>::values[] = { 10, 20, 30, 40, 100, 101, 102 }; +const Optimal SimpleValue<Optimal>::values[] = { 10, 20, 30, 40, 100, 101, 102 }; template<> const Movable SimpleValue<Movable>::values[] = { 10, 20, 30, 40, 100, 101, 102 }; template<> @@ -369,9 +474,11 @@ void tst_QList::length() const } } -void tst_QList::lengthInt() const +void tst_QList::lengthOptimal() const { - length<int>(); + const int liveCount = Optimal::getLiveCount(); + length<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::lengthMovable() const @@ -421,9 +528,11 @@ void tst_QList::append() const QCOMPARE(list1, listTotal); } -void tst_QList::appendInt() const +void tst_QList::appendOptimal() const { - append<int>(); + const int liveCount = Optimal::getLiveCount(); + append<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::appendMovable() const @@ -486,9 +595,11 @@ void tst_QList::mid() const QCOMPARE(list1.mid(1, 1).length(), 0); } -void tst_QList::midInt() const +void tst_QList::midOptimal() const { - mid<int>(); + const int liveCount = Optimal::getLiveCount(); + mid<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::midMovable() const @@ -534,9 +645,11 @@ void tst_QList::at() const QCOMPARE(list.at(2), T_CAT); } -void tst_QList::atInt() const +void tst_QList::atOptimal() const { - at<int>(); + const int liveCount = Optimal::getLiveCount(); + at<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::atMovable() const @@ -567,9 +680,11 @@ void tst_QList::first() const QCOMPARE(list.first(), T_BAR); } -void tst_QList::firstInt() const +void tst_QList::firstOptimal() const { - first<int>(); + const int liveCount = Optimal::getLiveCount(); + first<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::firstMovable() const @@ -600,9 +715,11 @@ void tst_QList::last() const QCOMPARE(list.last(), T_FOO); } -void tst_QList::lastInt() const +void tst_QList::lastOptimal() const { - last<int>(); + const int liveCount = Optimal::getLiveCount(); + last<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::lastMovable() const @@ -633,9 +750,11 @@ void tst_QList::begin() const QCOMPARE(*list.begin(), T_BAR); } -void tst_QList::beginInt() const +void tst_QList::beginOptimal() const { - begin<int>(); + const int liveCount = Optimal::getLiveCount(); + begin<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::beginMovable() const @@ -666,9 +785,11 @@ void tst_QList::end() const QCOMPARE(*--list.end(), T_FOO); } -void tst_QList::endInt() const +void tst_QList::endOptimal() const { - end<int>(); + const int liveCount = Optimal::getLiveCount(); + end<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::endMovable() const @@ -699,9 +820,11 @@ void tst_QList::contains() const QVERIFY(list.contains(T_BLAH) == true); } -void tst_QList::containsInt() const +void tst_QList::containsOptimal() const { - contains<int>(); + const int liveCount = Optimal::getLiveCount(); + contains<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::containsMovable() const @@ -743,9 +866,11 @@ void tst_QList::count() const QVERIFY(list.count() == 0); } -void tst_QList::countInt() const +void tst_QList::countOptimal() const { - count<int>(); + const int liveCount = Optimal::getLiveCount(); + count<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::countMovable() const @@ -779,9 +904,11 @@ void tst_QList::empty() const QVERIFY(list.empty()); } -void tst_QList::emptyInt() const +void tst_QList::emptyOptimal() const { - empty<int>(); + const int liveCount = Optimal::getLiveCount(); + empty<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::emptyMovable() const @@ -813,9 +940,11 @@ void tst_QList::endsWith() const QVERIFY(list.endsWith(T_BAR)); } -void tst_QList::endsWithInt() const +void tst_QList::endsWithOptimal() const { - endsWith<int>(); + const int liveCount = Optimal::getLiveCount(); + endsWith<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::endsWithMovable() const @@ -856,9 +985,11 @@ void tst_QList::lastIndexOf() const QVERIFY(list.lastIndexOf(T_BAZ, 1) == -1); } -void tst_QList::lastIndexOfInt() const +void tst_QList::lastIndexOfOptimal() const { - lastIndexOf<int>(); + const int liveCount = Optimal::getLiveCount(); + lastIndexOf<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::lastIndexOfMovable() const @@ -894,9 +1025,11 @@ void tst_QList::move() const QCOMPARE(list, QList<T>() << T_BAR << T_FOO << T_BAZ); } -void tst_QList::moveInt() const +void tst_QList::moveOptimal() const { - move<int>(); + const int liveCount = Optimal::getLiveCount(); + move<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::moveMovable() const @@ -933,9 +1066,11 @@ void tst_QList::removeAll() const QCOMPARE(list, QList<T>() << T_FOO << T_BAZ << T_FOO << T_BAZ << T_FOO << T_BAZ << T_FOO << T_BAZ); } -void tst_QList::removeAllInt() const +void tst_QList::removeAllOptimal() const { - removeAll<int>(); + const int liveCount = Optimal::getLiveCount(); + removeAll<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::removeAllMovable() const @@ -971,9 +1106,11 @@ void tst_QList::removeAt() const QCOMPARE(list, QList<T>()); } -void tst_QList::removeAtInt() const +void tst_QList::removeAtOptimal() const { - removeAt<int>(); + const int liveCount = Optimal::getLiveCount(); + removeAt<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::removeAtMovable() const @@ -1018,9 +1155,11 @@ void tst_QList::removeOne() const QCOMPARE(list, QList<T>() << T_FOO); } -void tst_QList::removeOneInt() const +void tst_QList::removeOneOptimal() const { - removeOne<int>(); + const int liveCount = Optimal::getLiveCount(); + removeOne<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::removeOneMovable() const @@ -1059,9 +1198,11 @@ void tst_QList::replace() const << T_DOG << T_BLAH); } -void tst_QList::replaceInt() const +void tst_QList::replaceOptimal() const { - replace<int>(); + const int liveCount = Optimal::getLiveCount(); + replace<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::replaceMovable() const @@ -1092,9 +1233,11 @@ void tst_QList::startsWith() const QVERIFY(list.startsWith(T_BAR)); } -void tst_QList::startsWithInt() const +void tst_QList::startsWithOptimal() const { - startsWith<int>(); + const int liveCount = Optimal::getLiveCount(); + startsWith<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::startsWithMovable() const @@ -1133,9 +1276,11 @@ void tst_QList::swap() const QCOMPARE(list2, QList<T>() << T_BAZ << T_FOO << T_BAR); } -void tst_QList::swapInt() const +void tst_QList::swapOptimal() const { - swap<int>(); + const int liveCount = Optimal::getLiveCount(); + swap<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::swapMovable() const @@ -1166,9 +1311,11 @@ void tst_QList::takeAt() const QVERIFY(list.size() == 0); } -void tst_QList::takeAtInt() const +void tst_QList::takeAtOptimal() const { - takeAt<int>(); + const int liveCount = Optimal::getLiveCount(); + takeAt<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::takeAtMovable() const @@ -1199,9 +1346,11 @@ void tst_QList::takeFirst() const QVERIFY(list.size() == 0); } -void tst_QList::takeFirstInt() const +void tst_QList::takeFirstOptimal() const { - takeFirst<int>(); + const int liveCount = Optimal::getLiveCount(); + takeFirst<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::takeFirstMovable() const @@ -1229,9 +1378,11 @@ void tst_QList::takeLast() const QCOMPARE(list.takeLast(), T_FOO); } -void tst_QList::takeLastInt() const +void tst_QList::takeLastOptimal() const { - takeLast<int>(); + const int liveCount = Optimal::getLiveCount(); + takeLast<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::takeLastMovable() const @@ -1265,9 +1416,11 @@ void tst_QList::toSet() const << T_FOO << T_BAR << T_BAZ); } -void tst_QList::toSetInt() const +void tst_QList::toSetOptimal() const { - toSet<int>(); + const int liveCount = Optimal::getLiveCount(); + toSet<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::toSetMovable() const @@ -1300,9 +1453,11 @@ void tst_QList::toStdList() const QCOMPARE(list, QList<T>() << T_FOO << T_BAR << T_BAZ); } -void tst_QList::toStdListInt() const +void tst_QList::toStdListOptimal() const { - toStdList<int>(); + const int liveCount = Optimal::getLiveCount(); + toStdList<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::toStdListMovable() const @@ -1328,9 +1483,11 @@ void tst_QList::toVector() const QCOMPARE(list.toVector(), QVector<T>() << T_FOO << T_BAR << T_BAZ); } -void tst_QList::toVectorInt() const +void tst_QList::toVectorOptimal() const { - toVector<int>(); + const int liveCount = Optimal::getLiveCount(); + toVector<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::toVectorMovable() const @@ -1367,9 +1524,11 @@ void tst_QList::value() const QCOMPARE(list.value(3, defaultT), defaultT); } -void tst_QList::valueInt() const +void tst_QList::valueOptimal() const { - value<int>(); + const int liveCount = Optimal::getLiveCount(); + value<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::valueMovable() const @@ -1419,9 +1578,11 @@ void tst_QList::testOperators() const QCOMPARE(list[list.size() - 1], T_CAT); } -void tst_QList::testOperatorsInt() const +void tst_QList::testOperatorsOptimal() const { - testOperators<int>(); + const int liveCount = Optimal::getLiveCount(); + testOperators<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::testOperatorsMovable() const @@ -1478,9 +1639,11 @@ void tst_QList::testSTLIterators() const QCOMPARE(*it, T_FOO); } -void tst_QList::testSTLIteratorsInt() const +void tst_QList::testSTLIteratorsOptimal() const { - testSTLIterators<int>(); + const int liveCount = Optimal::getLiveCount(); + testSTLIterators<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::testSTLIteratorsMovable() const @@ -1525,9 +1688,11 @@ void tst_QList::constSharedNull() const QVERIFY(!list2.isDetached()); } -void tst_QList::constSharedNullInt() const +void tst_QList::constSharedNullOptimal() const { - constSharedNull<int>(); + const int liveCount = Optimal::getLiveCount(); + constSharedNull<Optimal>(); + QCOMPARE(liveCount, Optimal::getLiveCount()); } void tst_QList::constSharedNullMovable() const diff --git a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm index 96f133ca2c..f4b748e62a 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm +++ b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index 94cd64ed09..c51d33487e 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -191,6 +191,7 @@ private slots: private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); void buildRegExpData(); + static QString cssFontSizeString(const QFont &font); QTextDocument *doc; QTextCursor cursor; @@ -212,6 +213,13 @@ public: void documentChanged(int, int, int) {} }; +QString tst_QTextDocument::cssFontSizeString(const QFont &font) +{ + return font.pointSize() >= 0 + ? QStringLiteral("%1pt").arg(font.pointSizeF()) + : QStringLiteral("%1px").arg(font.pixelSize()); +} + // Testing get/set functions void tst_QTextDocument::getSetCheck() { @@ -254,8 +262,12 @@ void tst_QTextDocument::init() "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head>" - "<body style=\" font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4;\">\n"); - htmlHead = htmlHead.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + "<body style=\" font-family:'%1'; font-size:%2; font-weight:%3; font-style:%4;\">\n"); + htmlHead = htmlHead + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); htmlTail = QString("</body></html>"); } @@ -1789,12 +1801,16 @@ void tst_QTextDocument::toHtmlBodyBgColor() "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head>" - "<body style=\" font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4;\"" + "<body style=\" font-family:'%1'; font-size:%2; font-weight:%3; font-style:%4;\"" " bgcolor=\"#0000ff\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Blah</p>" "</body></html>"); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } @@ -1814,12 +1830,15 @@ void tst_QTextDocument::toHtmlBodyBgColorRgba() "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head>" - "<body style=\" font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4;\"" + "<body style=\" font-family:'%1'; font-size:%2; font-weight:%3; font-style:%4;\"" " bgcolor=\"rgba(255,0,0,0.2)\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Blah</p>" "</body></html>"); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml.arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } @@ -1839,12 +1858,16 @@ void tst_QTextDocument::toHtmlBodyBgColorTransparent() "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head>" - "<body style=\" font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4;\"" + "<body style=\" font-family:'%1'; font-size:%2; font-weight:%3; font-style:%4;\"" " bgcolor=\"transparent\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Blah</p>" "</body></html>"); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } @@ -2463,8 +2486,10 @@ void tst_QTextDocument::html_defaultFont() doc->setDefaultFont(f); doc->setPlainText("Test"); - QString bodyPart = QString::fromLatin1("<body style=\" font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:italic;\">") - .arg(f.family()).arg(f.pointSizeF()).arg(f.weight() * 8); + QString bodyPart = QString::fromLatin1("<body style=\" font-family:'%1'; font-size:%2; font-weight:%3; font-style:italic;\">") + .arg(f.family()) + .arg(cssFontSizeString(f)) + .arg(f.weight() * 8); QString html = doc->toHtml(); if (!html.contains(bodyPart)) { @@ -2600,13 +2625,17 @@ void tst_QTextDocument::backgroundImage_checkExpectedHtml(const QTextDocument &d "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head>" - "<body style=\" font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4;\">\n" + "<body style=\" font-family:'%1'; font-size:%2; font-weight:%3; font-style:%4;\">\n" "<table border=\"0\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;\" cellspacing=\"2\" cellpadding=\"0\">" "\n<tr>\n<td background=\"foo.png\">" "\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Blah</p>" "</td></tr></table></body></html>"); - expectedHtml = expectedHtml.arg(defaultFont.family()).arg(defaultFont.pointSizeF()).arg(defaultFont.weight() * 8).arg((defaultFont.italic() ? "italic" : "normal")); + expectedHtml = expectedHtml + .arg(defaultFont.family()) + .arg(cssFontSizeString(defaultFont)) + .arg(defaultFont.weight() * 8) + .arg((defaultFont.italic() ? "italic" : "normal")); QCOMPARE(doc.toHtml(), expectedHtml); } diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index c7c0ff3851..b004e985bd 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h b/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h new file mode 100644 index 0000000000..595c0cac3c --- /dev/null +++ b/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h @@ -0,0 +1 @@ +/* a random header file */ diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp b/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp index 4cbb8f8b09..2a56d5b59b 100644 --- a/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp +++ b/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp @@ -31,7 +31,7 @@ ** ****************************************************************************/ - +#include <header.h> #include <qguiapplication.h> diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro b/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro index 61d6f38696..c4e0257769 100644 --- a/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro +++ b/tests/auto/tools/qmake/testdata/quotedfilenames/quotedfilenames.pro @@ -2,8 +2,12 @@ TEMPLATE = app TARGET = quotedfilenames SOURCES = main.cpp +CONFIG += no_batch + +INCLUDEPATH += "include folder" + RCCINPUT = "rc folder/test.qrc" -RCCOUTPUT = test.cpp +RCCOUTPUT = "cpp folder/test.cpp" qtPrepareTool(QMAKE_RCC, rcc) diff --git a/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro b/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro index c57a1c877c..0e78a91f46 100644 --- a/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro +++ b/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro @@ -3,5 +3,5 @@ HEADERS = test_file.h SOURCES = test_file.cpp \ main.cpp RESOURCES = test.qrc -TARGET = simple_app -DESTDIR = ./ +TARGET = "simple app" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro b/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro index f589d2b3d4..c427309b2a 100644 --- a/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro +++ b/tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro @@ -10,5 +10,5 @@ VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp -TARGET = simple_dll -DESTDIR = ./ +TARGET = "simple dll" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro b/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro index 9abc3e9f26..cd6c7dd7f9 100644 --- a/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro +++ b/tests/auto/tools/qmake/testdata/simple_lib/simple_lib.pro @@ -9,5 +9,5 @@ VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp -TARGET = simple_lib -DESTDIR = ./ +TARGET = "simple lib" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp b/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp index 332dde7e2f..3bc36acdb0 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp @@ -31,7 +31,7 @@ ** ****************************************************************************/ - +#include <simple.h> #include "test_file.h" #include <qguiapplication.h> @@ -39,6 +39,7 @@ int main( int argc, char **argv ) { QGuiApplication a( argc, argv ); + Simple s; SomeObject sc; return a.exec(); } diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro b/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro index d63f1d4362..e882c33b3d 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro @@ -2,5 +2,8 @@ TEMPLATE = app HEADERS = test_file.h SOURCES = test_file.cpp \ main.cpp -TARGET = simple_app -DESTDIR = ./ +TARGET = "simple app" +DESTDIR = "dest dir" + +INCLUDEPATH += ../simple_dll +LIBS += -L"../simple_dll/dest dir" -l"simple dll" diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h index d7e5f48730..e24df46f42 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h @@ -35,8 +35,13 @@ #include <qstring.h> -//class SIMPLEDLL_EXPORT Simple -class Simple +#ifdef SIMPLEDLL_MAKEDLL +# define SIMPLEDLL_EXPORT Q_DECL_EXPORT +#else +# define SIMPLEDLL_EXPORT Q_DECL_IMPORT +#endif + +class SIMPLEDLL_EXPORT Simple { public: Simple(); diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro index f589d2b3d4..4e362bb918 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += dll -win32:DEFINES += SIMPLEDLL_MAKEDLL +DEFINES += SIMPLEDLL_MAKEDLL HEADERS = simple.h SOURCES = simple.cpp @@ -10,5 +10,5 @@ VERSION = 1.0.0 INCLUDEPATH += . tmp MOC_DIR = tmp OBJECTS_DIR = tmp -TARGET = simple_dll -DESTDIR = ./ +TARGET = "simple dll" +DESTDIR = "dest dir" diff --git a/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro b/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro index 5da200eabb..bc96812e6d 100644 --- a/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro +++ b/tests/auto/tools/qmake/testdata/subdirs/subdirs.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS = simple_app \ - simple_dll +SUBDIRS = simple_dll \ + simple_app CONFIG += ordered diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp index 6f52ffb9aa..8d7f7bbc68 100644 --- a/tests/auto/tools/qmake/tst_qmake.cpp +++ b/tests/auto/tools/qmake/tst_qmake.cpp @@ -141,14 +141,15 @@ void tst_qmake::cleanup() void tst_qmake::simple_app() { QString workDir = base_path + "/testdata/simple_app"; + QString destDir = workDir + "/dest dir"; QVERIFY( test_compiler.qmake( workDir, "simple_app" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( workDir )); - QVERIFY( !test_compiler.exists( workDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( workDir ) ); } @@ -156,14 +157,15 @@ void tst_qmake::simple_app_shadowbuild() { QString workDir = base_path + "/testdata/simple_app"; QString buildDir = base_path + "/testdata/simple_app_build"; + QString destDir = buildDir + "/dest dir"; QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); QVERIFY( test_compiler.make( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); QVERIFY( test_compiler.makeClean( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( buildDir )); - QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( buildDir ) ); } @@ -171,46 +173,49 @@ void tst_qmake::simple_app_shadowbuild2() { QString workDir = base_path + "/testdata/simple_app"; QString buildDir = base_path + "/testdata/simple_app/build"; + QString destDir = buildDir + "/dest dir"; QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); QVERIFY( test_compiler.make( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); QVERIFY( test_compiler.makeClean( buildDir )); - QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( buildDir )); - QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( buildDir ) ); } void tst_qmake::simple_dll() { QString workDir = base_path + "/testdata/simple_dll"; + QString destDir = workDir + "/dest dir"; QDir D; D.remove( workDir + "/Makefile"); QVERIFY( test_compiler.qmake( workDir, "simple_dll" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( workDir )); - QVERIFY( !test_compiler.exists( workDir, "simple_dll", Dll, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple dll", Dll, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( workDir ) ); } void tst_qmake::simple_lib() { QString workDir = base_path + "/testdata/simple_lib"; + QString destDir = workDir + "/dest dir"; QDir D; D.remove( workDir + "/Makefile"); QVERIFY( test_compiler.qmake( workDir, "simple_lib" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); + QVERIFY( test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); - QVERIFY( test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); // Should still exist after a make clean QVERIFY( test_compiler.makeDistClean( workDir )); - QVERIFY( !test_compiler.exists( workDir, "simple_lib", Lib, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( !test_compiler.exists( destDir, "simple lib", Lib, "1.0.0" )); // Should not exist after a make distclean QVERIFY( test_compiler.removeMakefile( workDir ) ); } @@ -223,12 +228,12 @@ void tst_qmake::subdirs() D.remove( workDir + "/simple_dll/Makefile"); QVERIFY( test_compiler.qmake( workDir, "subdirs" )); QVERIFY( test_compiler.make( workDir )); - QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" )); - QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" )); QVERIFY( test_compiler.makeClean( workDir )); // Should still exist after a make clean - QVERIFY( test_compiler.exists( workDir + "/simple_app", "simple_app", Exe, "1.0.0" )); - QVERIFY( test_compiler.exists( workDir + "/simple_dll", "simple_dll", Dll, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" )); + QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" )); // Since subdirs templates do not have a make dist clean, we should clean up ourselves // properly QVERIFY( test_compiler.makeDistClean( workDir )); diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm index 431d1e4343..6e4ad29190 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm +++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 8775df84c6..587fa250c4 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -1498,8 +1498,7 @@ void tst_QWidget::mapFromAndTo() subWindow2->setGeometry(75, 75, 100, 100); subSubWindow->setGeometry(10, 10, 10, 10); -#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX) \ - || (defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET)) +#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX) || defined(Q_OS_BLACKBERRY) //update visibility if (windowMinimized) { if (!windowHidden) { @@ -7342,7 +7341,7 @@ void tst_QWidget::updateWhileMinimized() { if (m_platform == QStringLiteral("wayland")) QSKIP("Wayland: This fails. Figure out why."); -#if defined(Q_OS_QNX) && (!defined(Q_OS_BLACKBERRY) || defined(Q_OS_BLACKBERRY_TABLET)) +#if defined(Q_OS_QNX) && !defined(Q_OS_BLACKBERRY) QSKIP("Platform does not support showMinimized()"); #endif UpdateWidget widget; @@ -7897,7 +7896,7 @@ void tst_QWidget::doubleRepaint() // Minmize: Should not trigger a repaint. widget.showMinimized(); QTest::qWait(10); -#if defined(Q_OS_QNX) && (!defined(Q_OS_BLACKBERRY) || defined(Q_OS_BLACKBERRY_TABLET)) +#if defined(Q_OS_QNX) && !defined(Q_OS_BLACKBERRY) QEXPECT_FAIL("", "Platform does not support showMinimized()", Continue); #endif QCOMPARE(widget.numPaintEvents, 0); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm index f74322ad68..c67682fd85 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm b/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm index f59c6fd9c1..b1708d8669 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu_mac.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m b/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m index 2cfa286687..8dea62050c 100644 --- a/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m +++ b/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.m @@ -1,6 +1,6 @@ /**************************************************************************** ** - ** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). + ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm b/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm index 44f8a28e81..17d5a75273 100644 --- a/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm +++ b/tests/manual/cocoa/qmaccocoaviewcontainer/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** - ** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). + ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qsystemtrayicon/main.cpp b/tests/manual/cocoa/qsystemtrayicon/main.cpp index 7ca9187082..dece8e8e5d 100644 --- a/tests/manual/cocoa/qsystemtrayicon/main.cpp +++ b/tests/manual/cocoa/qsystemtrayicon/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm index b94618dffe..5dd546479e 100644 --- a/tests/manual/cocoa/qt_on_cocoa/main.mm +++ b/tests/manual/cocoa/qt_on_cocoa/main.mm @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh index b2ab1702b0..f2c64e7633 100755 --- a/tests/manual/mkspecs/test.sh +++ b/tests/manual/mkspecs/test.sh @@ -1,7 +1,7 @@ #!/bin/bash ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/qopenglwindow/multiwindow/main.cpp b/tests/manual/qopenglwindow/multiwindow/main.cpp index 0f6388b1b7..47616ded0f 100644 --- a/tests/manual/qopenglwindow/multiwindow/main.cpp +++ b/tests/manual/qopenglwindow/multiwindow/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. diff --git a/tests/manual/xcb_gl_integration/main.cpp b/tests/manual/xcb_gl_integration/main.cpp index 1b00005934..e891654586 100644 --- a/tests/manual/xcb_gl_integration/main.cpp +++ b/tests/manual/xcb_gl_integration/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). +** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. |