diff options
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/test2 | 0 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/platforms/+osx/test4 | 0 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+macos/test | 0 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/platforms/+unix/+darwin/+mac/+osx/+macos/test | 0 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/platforms/test4 | 0 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/platforms/test5 | 0 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/qfileselector.qrc | 10 | ||||
-rw-r--r-- | tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp | 8 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 50 | ||||
-rw-r--r-- | tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp | 4 |
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. |