diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-24 07:37:43 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-24 07:38:02 +0100 |
commit | 135ebe4f3d268121047fdbfee49f2dd52006165e (patch) | |
tree | 6b303103f36e69e29cfa860b8b7afc584c55d6f3 /tests/auto/corelib/kernel | |
parent | e7feb956280105113b3e58f12e5f32f54199a95a (diff) | |
parent | 1e8f50a8d069c97ea6a4f00d664c12e594884f54 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: If5d2e621c2fa5476c3ab687a3f4620c54fc3b32e
Diffstat (limited to 'tests/auto/corelib/kernel')
4 files changed, 53 insertions, 16 deletions
diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro index 6b93439a56..f85c39e9e6 100644 --- a/tests/auto/corelib/kernel/kernel.pro +++ b/tests/auto/corelib/kernel/kernel.pro @@ -38,4 +38,4 @@ SUBDIRS=\ # This test is only applicable on Windows !win32*|winrt: SUBDIRS -= qwineventnotifier -android: SUBDIRS -= qsharedmemory qsystemsemaphore +android|ios: SUBDIRS -= qsharedmemory qsystemsemaphore diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 24cfe8f3bc..263cc5a07a 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com> +** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com> ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -91,9 +91,7 @@ private slots: void floatProperty(); void qrealProperty(); void property(); -#ifndef QT_NO_PROCESS void recursiveSignalEmission(); -#endif void signalBlocking(); void blockingQueuedConnection(); void childEvents(); @@ -129,6 +127,7 @@ private slots: void connectConvert(); void connectWithReference(); void connectManyArguments(); + void connectForwardDeclare(); void returnValue_data(); void returnValue(); void returnValue2_data(); @@ -2981,9 +2980,11 @@ void tst_QObject::dynamicProperties() QVERIFY(obj.dynamicPropertyNames().isEmpty()); } -#ifndef QT_NO_PROCESS void tst_QObject::recursiveSignalEmission() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QProcess proc; // signalbug helper app should always be next to this test binary const QString path = QStringLiteral("signalbug/signalbug"); @@ -2992,8 +2993,8 @@ void tst_QObject::recursiveSignalEmission() QVERIFY(proc.waitForFinished()); QVERIFY(proc.exitStatus() == QProcess::NormalExit); QCOMPARE(proc.exitCode(), 0); -} #endif +} void tst_QObject::signalBlocking() { @@ -5208,6 +5209,24 @@ void tst_QObject::connectManyArguments() QCOMPARE(ManyArgumentNamespace::count, 12); } +class ForwardDeclared; + +class ForwardDeclareArguments : public QObject +{ + Q_OBJECT +signals: + void mySignal(const ForwardDeclared&); +public slots: + void mySlot(const ForwardDeclared&) {} +}; + +void tst_QObject::connectForwardDeclare() +{ + ForwardDeclareArguments ob; + // it should compile + QVERIFY(connect(&ob, &ForwardDeclareArguments::mySignal, &ob, &ForwardDeclareArguments::mySlot, Qt::QueuedConnection)); +} + class ReturnValue : public QObject { friend class tst_QObject; Q_OBJECT diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp index 5a92c2f0cb..26bb70fc66 100644 --- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp +++ b/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp @@ -74,7 +74,7 @@ private slots: void removeWhileAttached(); #endif void emptyMemory(); -#if !defined(Q_OS_WIN) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WIN) void readOnly(); #endif @@ -90,10 +90,8 @@ private slots: void simpleThreadedProducerConsumer(); // with processes -#ifndef QT_NO_PROCESS void simpleProcessProducerConsumer_data(); void simpleProcessProducerConsumer(); -#endif // extreme cases void useTooMuchMemory(); @@ -457,9 +455,12 @@ void tst_QSharedMemory::emptyMemory() by writing to data and causing a segfault. */ // This test opens a crash dialog on Windows. -#if !defined(Q_OS_WIN) && !defined(QT_NO_PROCESS) +#if !defined(Q_OS_WIN) void tst_QSharedMemory::readOnly() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else rememberKey("readonly_segfault"); // ### on windows disable the popup somehow QProcess p; @@ -467,6 +468,7 @@ void tst_QSharedMemory::readOnly() p.setProcessChannelMode(QProcess::ForwardedChannels); p.waitForFinished(); QCOMPARE(p.error(), QProcess::Crashed); +#endif } #endif @@ -738,15 +740,16 @@ void tst_QSharedMemory::simpleThreadedProducerConsumer() } } -#ifndef QT_NO_PROCESS void tst_QSharedMemory::simpleProcessProducerConsumer_data() { +#ifndef QT_NO_PROCESS QTest::addColumn<int>("processes"); int tries = 5; for (int i = 0; i < tries; ++i) { QTest::newRow("1 process") << 1; QTest::newRow("5 processes") << 5; } +#endif } /*! @@ -754,6 +757,9 @@ void tst_QSharedMemory::simpleProcessProducerConsumer_data() */ void tst_QSharedMemory::simpleProcessProducerConsumer() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QFETCH(int, processes); QSKIP("This test is unstable: QTBUG-25655"); @@ -797,8 +803,8 @@ void tst_QSharedMemory::simpleProcessProducerConsumer() producer.write("", 1); producer.waitForBytesWritten(); QVERIFY(producer.waitForFinished(5000)); -} #endif +} void tst_QSharedMemory::uniqueKey_data() { diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp index b2198e9267..169a13aff2 100644 --- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp +++ b/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp @@ -59,7 +59,6 @@ private slots: void complexacquire(); void release(); -#ifndef QT_NO_PROCESS void basicProcesses(); void processes_data(); @@ -69,7 +68,6 @@ private slots: void undo(); #endif void initialValue(); -#endif // QT_NO_PROCESS private: static QString helperBinary(); @@ -177,9 +175,11 @@ void tst_QSystemSemaphore::release() QCOMPARE(sem.errorString(), QString()); } -#ifndef QT_NO_PROCESS void tst_QSystemSemaphore::basicProcesses() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 0, QSystemSemaphore::Create); QProcess acquire; @@ -198,6 +198,7 @@ void tst_QSystemSemaphore::basicProcesses() acquire.waitForFinished(HELPERWAITTIME); release.waitForFinished(HELPERWAITTIME); QVERIFY(acquire.state() == QProcess::NotRunning); +#endif } void tst_QSystemSemaphore::processes_data() @@ -212,6 +213,9 @@ void tst_QSystemSemaphore::processes_data() void tst_QSystemSemaphore::processes() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); QFETCH(int, processes); @@ -231,12 +235,16 @@ void tst_QSystemSemaphore::processes() QCOMPARE(consumers.first()->exitCode(), 0); delete consumers.takeFirst(); } +#endif } // This test only checks a system v unix behavior. #if !defined(Q_OS_WIN) && !defined(QT_POSIX_IPC) void tst_QSystemSemaphore::undo() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); QStringList acquireArguments = QStringList("acquire"); @@ -253,11 +261,15 @@ void tst_QSystemSemaphore::undo() QVERIFY2(acquire.waitForStarted(), "Could not start helper binary"); acquire.waitForFinished(HELPERWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); +#endif } #endif void tst_QSystemSemaphore::initialValue() { +#ifdef QT_NO_PROCESS + QSKIP("No qprocess support", SkipAll); +#else QSystemSemaphore sem("store", 1, QSystemSemaphore::Create); QStringList acquireArguments = QStringList("acquire"); @@ -284,8 +296,8 @@ void tst_QSystemSemaphore::initialValue() acquire.waitForFinished(HELPERWAITTIME); release.waitForFinished(HELPERWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); -} #endif +} QString tst_QSystemSemaphore::helperBinary() { |