summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp6
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro9
-rw-r--r--tests/auto/corelib/io/qfileinfo/testdata.qrc (renamed from tests/auto/corelib/io/qfileinfo/android_testdata.qrc)2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp45
-rw-r--r--tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp2
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl_mac.mm2
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm2
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm2
-rw-r--r--tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp2
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp351
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring_mac.mm2
11 files changed, 288 insertions, 137 deletions
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.