summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-18 10:43:17 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-18 10:46:22 +0200
commit18934bcb0c388eb4723043cb5001702fecaf90bc (patch)
tree59f4f1e5de00fa49e49bace1a38f1bce52e48457 /tests
parentbc5454d2c41873349ea32c42aca8fc794cba442e (diff)
parentd1210281e41008ce2e3510aa5cfb3ebea1c57734 (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts: src/corelib/global/qglobal.cpp Change-Id: I375fa4afa662fa411a15f212ebd5f2f0dffdba7f
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+mac/test5 (renamed from tests/auto/corelib/io/qfileselector/platforms/+mac/test2)0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+macos/test (renamed from tests/auto/corelib/io/qfileselector/platforms/+osx/test2)0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+macos/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+osx/test40
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/test40
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/test50
-rw-r--r--tests/auto/corelib/io/qfileselector/qfileselector.qrc10
-rw-r--r--tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp8
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp50
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp4
12 files changed, 71 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+mac/test2 b/tests/auto/corelib/io/qfileselector/platforms/+mac/test5
index e69de29bb2..e69de29bb2 100644
--- a/tests/auto/corelib/io/qfileselector/platforms/+mac/test2
+++ b/tests/auto/corelib/io/qfileselector/platforms/+mac/test5
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+osx/test2 b/tests/auto/corelib/io/qfileselector/platforms/+macos/test
index e69de29bb2..e69de29bb2 100644
--- a/tests/auto/corelib/io/qfileselector/platforms/+osx/test2
+++ b/tests/auto/corelib/io/qfileselector/platforms/+macos/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+macos/test2 b/tests/auto/corelib/io/qfileselector/platforms/+macos/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+macos/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+osx/test4 b/tests/auto/corelib/io/qfileselector/platforms/+osx/test4
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+osx/test4
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/test4 b/tests/auto/corelib/io/qfileselector/platforms/test4
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/test4
diff --git a/tests/auto/corelib/io/qfileselector/platforms/test5 b/tests/auto/corelib/io/qfileselector/platforms/test5
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/test5
diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.qrc b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
index ab7a4d7f23..ea9b8270e0 100644
--- a/tests/auto/corelib/io/qfileselector/qfileselector.qrc
+++ b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
@@ -15,6 +15,7 @@
<file>platforms/test</file>
<file>platforms/+unix/+android/test</file>
<file>platforms/+unix/+darwin/+mac/+ios/test</file>
+ <file>platforms/+unix/+darwin/+mac/+osx/+macos/test</file>
<file>platforms/+unix/+darwin/+mac/+osx/test</file>
<file>platforms/+unix/+darwin/+mac/test</file>
<file>platforms/+unix/+darwin/test</file>
@@ -27,6 +28,7 @@
<file>platforms/+windows/test</file>
<file>platforms/+android/test</file>
<file>platforms/+ios/test</file>
+ <file>platforms/+macos/test</file>
<file>platforms/+osx/test</file>
<file>platforms/+darwin/test</file>
<file>platforms/+mac/test</file>
@@ -39,7 +41,7 @@
<file>platforms/test2</file>
<file>platforms/+android/test2</file>
<file>platforms/+ios/test2</file>
- <file>platforms/+osx/test2</file>
+ <file>platforms/+macos/test2</file>
<file>platforms/+haiku/test2</file>
<file>platforms/+linux/test2</file>
<file>platforms/+wince/test2</file>
@@ -50,5 +52,11 @@
<file>platforms/test3</file>
<file>platforms/+windows/test3</file>
<file>platforms/+unix/test3</file>
+
+ <!-- platforms/test4 and 5: special cases for macOS -->
+ <file>platforms/test4</file>
+ <file>platforms/+osx/test4</file>
+ <file>platforms/test5</file>
+ <file>platforms/+mac/test5</file>
</qresource>
</RCC>
diff --git a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
index 8c2886f337..c537e43802 100644
--- a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
+++ b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
@@ -126,6 +126,14 @@ void tst_QFileSelector::basicTest_data()
QTest::newRow("platform3") << QString(":/platforms/test3") << QStringList()
<< expectedPlatform3File;
+#ifdef Q_OS_MACOS
+ // special case for compatibility code
+ QTest::newRow("osx-compat") << QString(":/platforms/test4") << QStringList()
+ << ":/platforms/+osx/test4";
+ QTest::newRow("mac-compat") << QString(":/platforms/test5") << QStringList()
+ << ":/platforms/+mac/test5";
+#endif
+
QString resourceTestPath(":/extras/test");
QString custom1("custom1");
QTest::newRow("custom1-noselector") << resourceTestPath << QStringList()
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index d0a0feb125..7850478602 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -97,6 +97,8 @@ private slots:
void qvariantCast();
void sharedFromThis();
+ void constructorThrow();
+
void threadStressTest_data();
void threadStressTest();
void validConstructs();
@@ -2594,6 +2596,54 @@ void tst_QSharedPointer::sharedFromThis()
QCOMPARE(Data::destructorCounter, destructions + 6);
}
+#ifndef QT_NO_EXCEPTIONS
+class ThrowData: public Data
+{
+public:
+ static int childDestructorCounter;
+ static int childGenerationCounter;
+
+ ThrowData()
+ {
+ childGenerationCounter++;
+ throw QStringLiteral("Dummy exception");
+ }
+
+ ~ThrowData()
+ {
+ childDestructorCounter++;
+ }
+};
+int ThrowData::childDestructorCounter = 0;
+int ThrowData::childGenerationCounter = 0;
+#endif // !QT_NO_EXCEPTIONS
+
+void tst_QSharedPointer::constructorThrow()
+{
+#ifndef QT_NO_EXCEPTIONS
+ int generation = Data::generationCounter;
+ int destructorCounter = Data::destructorCounter;
+
+ int childGeneration = ThrowData::childGenerationCounter;
+ int childDestructorCounter = ThrowData::childDestructorCounter;
+
+ QSharedPointer<ThrowData> ptr;
+ QVERIFY_EXCEPTION_THROWN(ptr = QSharedPointer<ThrowData>::create(), QString);
+ QVERIFY(ptr.isNull());
+ QCOMPARE(ThrowData::childGenerationCounter, childGeneration + 1);
+ // destructor should never be called, if a constructor throws
+ // an exception
+ QCOMPARE(ThrowData::childDestructorCounter, childDestructorCounter);
+
+ QCOMPARE(Data::generationCounter, generation + 1);
+ // but base class constructor doesn't throw, so base class destructor
+ // should be called
+ QCOMPARE(Data::destructorCounter, destructorCounter + 1);
+#else
+ QSKIP("Needs exceptions");
+#endif // !QT_NO_EXCEPTIONS
+}
+
namespace ReentrancyWhileDestructing {
struct IB
{
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index aea97a916e..c2c04b69c5 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -1227,6 +1227,10 @@ void tst_QMatrixNxN::multiply4x4()
QMatrix4x4 m5;
m5 = m1 * m2;
QVERIFY(isSame(m5, (const float *)m3Values));
+
+ QMatrix4x4 m1xm1 = m1 * m1;
+ m1 *= m1;
+ QCOMPARE(m1, m1xm1);
}
// Test matrix multiplication for 4x3 matrices.