diff options
Diffstat (limited to 'tests/auto/corelib/kernel')
5 files changed, 34 insertions, 22 deletions
diff --git a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST index 4c9fe53c14..569880e1db 100644 --- a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST @@ -1,4 +1,3 @@ [elapsed] -windows-10 msvc-2015 osx-10.13 -windows-10 msvc-2017 +windows-10 diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp index 026c6a6324..60000316cc 100644 --- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp @@ -507,6 +507,7 @@ public slots: { QObject::moveToThread(t); } void slotWithUnregisteredParameterType(MyUnregisteredType); + void slotWithOneUnregisteredParameterType(QString a1, MyUnregisteredType a2); CountedStruct throwingSlot(const CountedStruct &, CountedStruct s2) { #ifndef QT_NO_EXCEPTIONS @@ -604,6 +605,9 @@ void QtTestObject::testSender() void QtTestObject::slotWithUnregisteredParameterType(MyUnregisteredType) { slotResult = "slotWithUnregisteredReturnType"; } +void QtTestObject::slotWithOneUnregisteredParameterType(QString a1, MyUnregisteredType) +{ slotResult = "slotWithUnregisteredReturnType-" + a1; } + void QtTestObject::staticFunction0() { staticResult = "staticFunction0"; @@ -885,6 +889,16 @@ void tst_QMetaObject::invokeQueuedMetaMember() QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithUnregisteredParameterType", Qt::QueuedConnection, Q_ARG(MyUnregisteredType, t))); QVERIFY(obj.slotResult.isEmpty()); } + + obj.slotResult.clear(); + { + QString a1("Cannot happen"); + MyUnregisteredType t; + QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyUnregisteredType'"); + QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithOneUnregisteredParameterType", Qt::QueuedConnection, + Q_ARG(QString, a1), Q_ARG(MyUnregisteredType, t))); + QVERIFY(obj.slotResult.isEmpty()); + } } void tst_QMetaObject::invokeQueuedPointer() diff --git a/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST index f3b7fc97b1..f2e5e78592 100644 --- a/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST +++ b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST @@ -1,4 +1,3 @@ [unexpectedDisconnection] -osx-10.12 -windows-10 msvc-2015 windows-7sp1 +windows-10 msvc-2015 diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST deleted file mode 100644 index dc8b8987e5..0000000000 --- a/tests/auto/corelib/kernel/qtimer/BLACKLIST +++ /dev/null @@ -1,9 +0,0 @@ -[remainingTime] -osx-10.12 -osx-10.14 -osx-10.13 -windows-10 msvc-2017 -[basic_chrono] -osx-10.14 -osx-10.13 - diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index 262dbea913..8e0bdac520 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -47,7 +47,11 @@ class tst_QTimer : public QObject { Q_OBJECT +public: + static void initMain(); + private slots: + void cleanupTestCase(); void zeroTimer(); void singleShotTimeout(); void timeout(); @@ -1138,22 +1142,27 @@ struct StaticSingleShotUser } }; +// NOTE: to prevent any static initialization order fiasco, we implement +// initMain() to instantiate staticSingleShotUser before qApp + static StaticSingleShotUser *s_staticSingleShotUser = nullptr; -void tst_QTimer::singleShot_static() +void tst_QTimer::initMain() { - QCoreApplication::processEvents(); - QCOMPARE(s_staticSingleShotUser->helper.calls, s_staticSingleShotUser->calls()); + s_staticSingleShotUser = new StaticSingleShotUser; } -// NOTE: to prevent any static initialization order fiasco, we handle QTEST_MAIN -// ourselves, but instantiate the staticSingleShotUser before qApp +void tst_QTimer::cleanupTestCase() +{ + delete s_staticSingleShotUser; +} -int main(int argc, char *argv[]) +void tst_QTimer::singleShot_static() { - StaticSingleShotUser staticSingleShotUser; - s_staticSingleShotUser = &staticSingleShotUser; - QTEST_MAIN_IMPL(tst_QTimer) + QCoreApplication::processEvents(); + QCOMPARE(s_staticSingleShotUser->helper.calls, s_staticSingleShotUser->calls()); } +QTEST_MAIN(tst_QTimer) + #include "tst_qtimer.moc" |