summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/kernel')
-rw-r--r--tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST3
-rw-r--r--tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp14
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp48
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST3
-rw-r--r--tests/auto/corelib/kernel/qtimer/BLACKLIST9
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp27
6 files changed, 34 insertions, 70 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/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index a805bfb747..676999a08c 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -81,9 +81,6 @@ private slots:
void senderTest();
void declareInterface();
void qpointerResetBeforeDestroyedSignal();
-#ifndef QT_NO_USERDATA
- void testUserData();
-#endif
void childDeletesItsSibling();
void dynamicProperties();
void floatProperty();
@@ -2341,51 +2338,6 @@ void tst_QObject::declareInterface()
}
-#ifndef QT_NO_USERDATA
-class CustomData : public QObjectUserData
-{
-public:
- int id;
-};
-
-void tst_QObject::testUserData()
-{
- const int USER_DATA_COUNT = 100;
- int user_data_ids[USER_DATA_COUNT];
-
- // Register a few
- for (int i=0; i<USER_DATA_COUNT; ++i) {
- user_data_ids[i] = QObject::registerUserData();
- }
-
- // Randomize the table a bit
- for (int i=0; i<100; ++i) {
- int p1 = QRandomGenerator::global()->bounded(USER_DATA_COUNT);
- int p2 = QRandomGenerator::global()->bounded(USER_DATA_COUNT);
-
- int tmp = user_data_ids[p1];
- user_data_ids[p1] = user_data_ids[p2];
- user_data_ids[p2] = tmp;
- }
-
- // insert the user data into an object
- QObject my_test_object;
- for (int i=0; i<USER_DATA_COUNT; ++i) {
- CustomData *data = new CustomData;
- data->id = user_data_ids[i];
- my_test_object.setUserData(data->id, data);
- }
-
- // verify that all ids and positions are matching
- for (int i=0; i<USER_DATA_COUNT; ++i) {
- int id = user_data_ids[i];
- CustomData *data = static_cast<CustomData *>(my_test_object.userData(id));
- QVERIFY(data != nullptr);
- QCOMPARE(data->id, id);
- }
-}
-#endif // QT_NO_USERDATA
-
class DestroyedListener : public QObject
{
Q_OBJECT
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"