summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-02 14:23:08 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-10-02 16:59:55 +0200
commitd0eaa737e10aed34c09ba753e21c3e027b5ce58c (patch)
treece2a9ea9dbfbabf5cfc390feaed5ee94beb0449a /tests/auto
parent7c0b9e1e8d069afab997efd3df9632d342b23150 (diff)
parenta5f470240f31d35e694a40fe837fc4f49bc32072 (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp5
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp73
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic1.xml9
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic2.xml9
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic3.xml9
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc3
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp92
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h6
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp1
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp16
-rw-r--r--tests/auto/gui/kernel/kernel.pro2
-rw-r--r--tests/auto/gui/kernel/noqteventloop/noqteventloop.pro8
-rw-r--r--tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp271
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp16
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp3
-rw-r--r--tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp31
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp54
-rw-r--r--tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp7
-rw-r--r--tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp8
-rw-r--r--tests/auto/widgets/util/qundostack/tst_qundostack.cpp8
20 files changed, 564 insertions, 67 deletions
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 060ef99d65..655719cffc 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -41,12 +41,7 @@
#include <private/qeventloop_p.h>
#include <private/qthread_p.h>
-#ifdef QT_GUI_LIB
-#include <QtGui/QGuiApplication>
-typedef QGuiApplication TestApplication;
-#else
typedef QCoreApplication TestApplication;
-#endif
class EventSpy : public QObject
{
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
index 930a17c3a9..f49da1f5a8 100644
--- a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
+++ b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
@@ -40,6 +40,7 @@
#include <QtCore/QSocketNotifier>
#include <QtNetwork/QTcpServer>
#include <QtNetwork/QTcpSocket>
+#include <QtNetwork/QUdpSocket>
#ifndef Q_OS_WINRT
#include <private/qnativesocketengine_p.h>
#else
@@ -66,8 +67,29 @@ private slots:
#ifdef Q_OS_UNIX
void posixSockets();
#endif
+ void asyncMultipleDatagram();
+
+protected slots:
+ void async_readDatagramSlot();
+ void async_writeDatagramSlot();
+
+private:
+ QUdpSocket *m_asyncSender;
+ QUdpSocket *m_asyncReceiver;
};
+static QHostAddress makeNonAny(const QHostAddress &address,
+ QHostAddress::SpecialAddress preferForAny = QHostAddress::LocalHost)
+{
+ if (address == QHostAddress::Any)
+ return preferForAny;
+ if (address == QHostAddress::AnyIPv4)
+ return QHostAddress::LocalHost;
+ if (address == QHostAddress::AnyIPv6)
+ return QHostAddress::LocalHostIPv6;
+ return address;
+}
+
class UnexpectedDisconnectTester : public QObject
{
Q_OBJECT
@@ -299,5 +321,56 @@ void tst_QSocketNotifier::posixSockets()
}
#endif
+void tst_QSocketNotifier::async_readDatagramSlot()
+{
+ char buf[1];
+ QVERIFY(m_asyncReceiver->hasPendingDatagrams());
+ do {
+ QCOMPARE(m_asyncReceiver->pendingDatagramSize(), qint64(1));
+ QCOMPARE(m_asyncReceiver->readDatagram(buf, sizeof(buf)), qint64(1));
+ if (buf[0] == '1') {
+ // wait for the second datagram message.
+ QTest::qSleep(100);
+ }
+ } while (m_asyncReceiver->hasPendingDatagrams());
+
+ if (buf[0] == '3')
+ QTestEventLoop::instance().exitLoop();
+}
+
+void tst_QSocketNotifier::async_writeDatagramSlot()
+{
+ m_asyncSender->writeDatagram("3", makeNonAny(m_asyncReceiver->localAddress()),
+ m_asyncReceiver->localPort());
+}
+
+void tst_QSocketNotifier::asyncMultipleDatagram()
+{
+ m_asyncSender = new QUdpSocket;
+ m_asyncReceiver = new QUdpSocket;
+
+ QVERIFY(m_asyncReceiver->bind(QHostAddress(QHostAddress::AnyIPv4), 0));
+ quint16 port = m_asyncReceiver->localPort();
+ QVERIFY(port != 0);
+
+ QSignalSpy spy(m_asyncReceiver, &QIODevice::readyRead);
+ connect(m_asyncReceiver, &QIODevice::readyRead, this,
+ &tst_QSocketNotifier::async_readDatagramSlot);
+ m_asyncSender->writeDatagram("1", makeNonAny(m_asyncReceiver->localAddress()), port);
+ m_asyncSender->writeDatagram("2", makeNonAny(m_asyncReceiver->localAddress()), port);
+ // wait a little to ensure that the datagrams we've just sent
+ // will be delivered on receiver side.
+ QTest::qSleep(100);
+
+ QTimer::singleShot(500, this, &tst_QSocketNotifier::async_writeDatagramSlot);
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QCOMPARE(spy.count(), 2);
+
+ delete m_asyncSender;
+ delete m_asyncReceiver;
+}
+
QTEST_MAIN(tst_QSocketNotifier)
#include <tst_qsocketnotifier.moc>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic1.xml b/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic1.xml
new file mode 100644
index 0000000000..04204d8763
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic1.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+ <mime-type type="text/invalid-magic1">
+ <comment>wrong value for byte type</comment>
+ <magic>
+ <match value="foo" type="byte" offset="0"/>
+ </magic>
+ </mime-type>
+</mime-info>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic2.xml b/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic2.xml
new file mode 100644
index 0000000000..f18075482e
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic2.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+ <mime-type type="text/invalid-magic2">
+ <comment>mask doesn't start with 0x</comment>
+ <magic>
+ <match value="foo" type="string" mask="ffff" offset="0"/>
+ </magic>
+ </mime-type>
+</mime-info>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic3.xml b/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic3.xml
new file mode 100644
index 0000000000..0e2508cc0f
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/invalid-magic3.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+ <mime-type type="text/invalid-magic3">
+ <comment>mask has wrong size</comment>
+ <magic>
+ <match value="foo" type="string" mask="0xffff" offset="0"/>
+ </magic>
+ </mime-type>
+</mime-info>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc b/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc
index 4654a61660..29666627a1 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc
@@ -4,5 +4,8 @@
<file alias="qml-again.xml">qml-again.xml</file>
<file alias="text-x-objcsrc.xml">text-x-objcsrc.xml</file>
<file alias="test.qml">test.qml</file>
+ <file>invalid-magic1.xml</file>
+ <file>invalid-magic2.xml</file>
+ <file>invalid-magic3.xml</file>
</qresource>
</RCC>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 594aef28f0..0171c4ac5a 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -46,9 +46,16 @@
#include <QtTest/QtTest>
-static const char yastFileName[] ="yast2-metapackage-handler-mimetypes.xml";
-static const char qmlAgainFileName[] ="qml-again.xml";
-static const char textXObjCSrcFileName[] ="text-x-objcsrc.xml";
+static const char *const additionalMimeFiles[] = {
+ "yast2-metapackage-handler-mimetypes.xml",
+ "qml-again.xml",
+ "text-x-objcsrc.xml",
+ "invalid-magic1.xml",
+ "invalid-magic2.xml",
+ "invalid-magic3.xml",
+ 0
+};
+
#define RESOURCE_PREFIX ":/qt-project.org/qmime/"
void initializeLang()
@@ -152,12 +159,12 @@ void tst_QMimeDatabase::initTestCase()
qWarning("%s", qPrintable(testSuiteWarning()));
errorMessage = QString::fromLatin1("Cannot find '%1'");
- m_yastMimeTypes = QLatin1String(RESOURCE_PREFIX) + yastFileName;
- QVERIFY2(QFile::exists(m_yastMimeTypes), qPrintable(errorMessage.arg(yastFileName)));
- m_qmlAgainFileName = QLatin1String(RESOURCE_PREFIX) + qmlAgainFileName;
- QVERIFY2(QFile::exists(m_qmlAgainFileName), qPrintable(errorMessage.arg(qmlAgainFileName)));
- m_textXObjCSrcFileName = QLatin1String(RESOURCE_PREFIX) + textXObjCSrcFileName;
- QVERIFY2(QFile::exists(m_textXObjCSrcFileName), qPrintable(errorMessage.arg(textXObjCSrcFileName)));
+ for (uint i = 0; i < sizeof additionalMimeFiles / sizeof additionalMimeFiles[0] - 1; i++) {
+ const QString resourceFilePath = QString::fromLatin1(RESOURCE_PREFIX) + QLatin1String(additionalMimeFiles[i]);
+ QVERIFY2(QFile::exists(resourceFilePath), qPrintable(errorMessage.arg(resourceFilePath)));
+ m_additionalMimeFileNames.append(QLatin1String(additionalMimeFiles[i]));
+ m_additionalMimeFilePaths.append(resourceFilePath);
+ }
initTestCaseInternal();
m_isUsingCacheProvider = !qEnvironmentVariableIsSet("QT_NO_MIME_CACHE");
@@ -866,6 +873,14 @@ static void checkHasMimeType(const QString &mimeType)
QVERIFY(found);
}
+static void ignoreInvalidMimetypeWarnings(const QString &mimeDir)
+{
+ const QByteArray basePath = QFile::encodeName(mimeDir) + "/packages/";
+ QTest::ignoreMessage(QtWarningMsg, ("QMimeDatabase: Error parsing " + basePath + "invalid-magic1.xml\nInvalid magic rule value \"foo\"").constData());
+ QTest::ignoreMessage(QtWarningMsg, ("QMimeDatabase: Error parsing " + basePath + "invalid-magic2.xml\nInvalid magic rule mask \"ffff\"").constData());
+ QTest::ignoreMessage(QtWarningMsg, ("QMimeDatabase: Error parsing " + basePath + "invalid-magic3.xml\nInvalid magic rule mask size \"0xffff\"").constData());
+}
+
QT_BEGIN_NAMESPACE
extern Q_CORE_EXPORT int qmime_secondsBetweenChecks; // see qmimeprovider.cpp
QT_END_NAMESPACE
@@ -886,23 +901,21 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
const QString mimeDir = m_globalXdgDir + QLatin1String("/mime");
const QString destDir = mimeDir + QLatin1String("/packages/");
- const QString destFile = destDir + QLatin1String(yastFileName);
- QFile::remove(destFile);
- const QString destQmlFile = destDir + QLatin1String(qmlAgainFileName);
- QFile::remove(destQmlFile);
- const QString destTextXObjCSrcFile = destDir + QLatin1String(textXObjCSrcFileName);
- QFile::remove(destTextXObjCSrcFile);
- //qDebug() << destFile;
-
if (!QFileInfo(destDir).isDir())
QVERIFY(QDir(m_globalXdgDir).mkpath(destDir));
+
QString errorMessage;
- QVERIFY2(copyResourceFile(m_yastMimeTypes, destFile, &errorMessage), qPrintable(errorMessage));
- QVERIFY2(copyResourceFile(m_qmlAgainFileName, destQmlFile, &errorMessage), qPrintable(errorMessage));
- QVERIFY2(copyResourceFile(m_textXObjCSrcFileName, destTextXObjCSrcFile, &errorMessage), qPrintable(errorMessage));
+ for (int i = 0; i < m_additionalMimeFileNames.size(); ++i) {
+ const QString destFile = destDir + m_additionalMimeFileNames.at(i);
+ QFile::remove(destFile);
+ QVERIFY2(copyResourceFile(m_additionalMimeFilePaths.at(i), destFile, &errorMessage), qPrintable(errorMessage));
+ }
if (m_isUsingCacheProvider && !waitAndRunUpdateMimeDatabase(mimeDir))
QSKIP("shared-mime-info not found, skipping mime.cache test");
+ if (!m_isUsingCacheProvider)
+ ignoreInvalidMimetypeWarnings(mimeDir);
+
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
QString::fromLatin1("text/x-SuSE-ymu"));
QVERIFY(db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
@@ -923,10 +936,9 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
qDebug() << objcsrc.globPatterns();
}
- // Now test removing it again
- QVERIFY(QFile::remove(destFile));
- QVERIFY(QFile::remove(destQmlFile));
- QVERIFY(QFile::remove(destTextXObjCSrcFile));
+ // Now test removing the mimetype definitions again
+ for (int i = 0; i < m_additionalMimeFileNames.size(); ++i)
+ QFile::remove(destDir + m_additionalMimeFileNames.at(i));
if (m_isUsingCacheProvider && !waitAndRunUpdateMimeDatabase(mimeDir))
QSKIP("shared-mime-info not found, skipping mime.cache test");
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
@@ -943,23 +955,35 @@ void tst_QMimeDatabase::installNewLocalMimeType()
qmime_secondsBetweenChecks = 0;
QMimeDatabase db;
+
+ // Check that we're starting clean
QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
+ QVERIFY(!db.mimeTypeForName(QLatin1String("text/invalid-magic1")).isValid());
const QString destDir = m_localMimeDir + QLatin1String("/packages/");
- QDir().mkpath(destDir);
- const QString destFile = destDir + QLatin1String(yastFileName);
- QFile::remove(destFile);
- const QString destQmlFile = destDir + QLatin1String(qmlAgainFileName);
- QFile::remove(destQmlFile);
+ QVERIFY(QDir().mkpath(destDir));
QString errorMessage;
- QVERIFY2(copyResourceFile(m_yastMimeTypes, destFile, &errorMessage), qPrintable(errorMessage));
- QVERIFY2(copyResourceFile(m_qmlAgainFileName, destQmlFile, &errorMessage), qPrintable(errorMessage));
- if (m_isUsingCacheProvider && !runUpdateMimeDatabase(m_localMimeDir)) {
+ for (int i = 0; i < m_additionalMimeFileNames.size(); ++i) {
+ const QString destFile = destDir + m_additionalMimeFileNames.at(i);
+ QFile::remove(destFile);
+ QVERIFY2(copyResourceFile(m_additionalMimeFilePaths.at(i), destFile, &errorMessage), qPrintable(errorMessage));
+ }
+ if (m_isUsingCacheProvider && !waitAndRunUpdateMimeDatabase(m_localMimeDir)) {
const QString skipWarning = QStringLiteral("shared-mime-info not found, skipping mime.cache test (")
+ QDir::toNativeSeparators(m_localMimeDir) + QLatin1Char(')');
QSKIP(qPrintable(skipWarning));
}
+ if (!m_isUsingCacheProvider)
+ ignoreInvalidMimetypeWarnings(m_localMimeDir);
+
+ QVERIFY(db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
+
+ // These mimetypes have invalid magic, but still do exist.
+ QVERIFY(db.mimeTypeForName(QLatin1String("text/invalid-magic1")).isValid());
+ QVERIFY(db.mimeTypeForName(QLatin1String("text/invalid-magic2")).isValid());
+ QVERIFY(db.mimeTypeForName(QLatin1String("text/invalid-magic3")).isValid());
+
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
QString::fromLatin1("text/x-SuSE-ymu"));
QVERIFY(db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
@@ -975,8 +999,8 @@ void tst_QMimeDatabase::installNewLocalMimeType()
QString::fromLatin1("text/x-qml"));
// Now test removing the local mimetypes again (note, this leaves a mostly-empty mime.cache file)
- QVERIFY(QFile::remove(destFile));
- QVERIFY(QFile::remove(destQmlFile));
+ for (int i = 0; i < m_additionalMimeFileNames.size(); ++i)
+ QFile::remove(destDir + m_additionalMimeFileNames.at(i));
if (m_isUsingCacheProvider && !waitAndRunUpdateMimeDatabase(m_localMimeDir))
QSKIP("shared-mime-info not found, skipping mime.cache test");
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
index f12beafe86..2827bd2dc4 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
@@ -36,6 +36,7 @@
#include <QtCore/QObject>
#include <QtCore/QTemporaryDir>
+#include <QtCore/QStringList>
class tst_QMimeDatabase : public QObject
{
@@ -92,9 +93,8 @@ private:
QString m_globalXdgDir;
QString m_localMimeDir;
- QString m_yastMimeTypes;
- QString m_qmlAgainFileName;
- QString m_textXObjCSrcFileName;
+ QStringList m_additionalMimeFileNames;
+ QStringList m_additionalMimeFilePaths;
QTemporaryDir m_temporaryDir;
QString m_testSuite;
bool m_isUsingCacheProvider;
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index 4ab79909e3..df9089057d 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -2170,6 +2170,7 @@ void tst_QDateTime::offsetFromUtc()
// Offset constructor
QDateTime dt1(QDate(2013, 1, 1), QTime(1, 0, 0), Qt::OffsetFromUTC, 60 * 60);
QCOMPARE(dt1.offsetFromUtc(), 60 * 60);
+ QVERIFY(dt1.timeZone().isValid());
dt1 = QDateTime(QDate(2013, 1, 1), QTime(1, 0, 0), Qt::OffsetFromUTC, -60 * 60);
QCOMPARE(dt1.offsetFromUtc(), -60 * 60);
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 745cbbfad3..10747427c7 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -4988,6 +4988,22 @@ void tst_QString::operator_smaller()
QVERIFY(QString("b") >= "a");
QVERIFY(QString("b") > "a");
+ QVERIFY(QString("a") < QByteArray("b"));
+ QVERIFY(QString("a") <= QByteArray("b"));
+ QVERIFY(QString("a") <= QByteArray("a"));
+ QVERIFY(QString("a") == QByteArray("a"));
+ QVERIFY(QString("a") >= QByteArray("a"));
+ QVERIFY(QString("b") >= QByteArray("a"));
+ QVERIFY(QString("b") > QByteArray("a"));
+
+ QVERIFY(QByteArray("a") < QString("b"));
+ QVERIFY(QByteArray("a") <= QString("b"));
+ QVERIFY(QByteArray("a") <= QString("a"));
+ QVERIFY(QByteArray("a") == QString("a"));
+ QVERIFY(QByteArray("a") >= QString("a"));
+ QVERIFY(QByteArray("b") >= QString("a"));
+ QVERIFY(QByteArray("b") > QString("a"));
+
QVERIFY(QLatin1String("a") < QString("b"));
QVERIFY(QLatin1String("a") <= QString("b"));
QVERIFY(QLatin1String("a") <= QString("a"));
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro
index 7d47a4167d..b03a117f83 100644
--- a/tests/auto/gui/kernel/kernel.pro
+++ b/tests/auto/gui/kernel/kernel.pro
@@ -24,6 +24,8 @@ SUBDIRS=\
qopenglwindow \
qrasterwindow
+win32:!wince*:!winrt: SUBDIRS += noqteventloop
+
!qtHaveModule(widgets): SUBDIRS -= \
qmouseevent_modal \
qtouchevent
diff --git a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
new file mode 100644
index 0000000000..de5715e147
--- /dev/null
+++ b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
@@ -0,0 +1,8 @@
+CONFIG += testcase
+TARGET = tst_noqteventloop
+
+QT += core-private gui-private testlib
+
+SOURCES += tst_noqteventloop.cpp
+
+contains(QT_CONFIG,dynamicgl):win32:!wince*:!winrt: LIBS += -luser32
diff --git a/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp b/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
new file mode 100644
index 0000000000..d21569dcc0
--- /dev/null
+++ b/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
@@ -0,0 +1,271 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <QEvent>
+#include <QtCore/qthread.h>
+#include <QtGui/qguiapplication.h>
+
+#include <QtCore/qt_windows.h>
+
+class tst_NoQtEventLoop : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void cleanup();
+ void consumeMouseEvents();
+
+};
+
+void tst_NoQtEventLoop::initTestCase()
+{
+}
+
+void tst_NoQtEventLoop::cleanup()
+{
+}
+
+class Window : public QWindow
+{
+public:
+ Window(QWindow *parentWindow = 0) : QWindow(parentWindow)
+ {
+ }
+
+ void reset()
+ {
+ m_received.clear();
+ }
+
+ bool event(QEvent *event)
+ {
+ m_received[event->type()]++;
+ return QWindow::event(event);
+ }
+
+ int received(QEvent::Type type)
+ {
+ return m_received.value(type, 0);
+ }
+
+
+ QHash<QEvent::Type, int> m_received;
+};
+
+bool g_exit = false;
+
+extern "C" LRESULT QT_WIN_CALLBACK wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (message == WM_SHOWWINDOW && wParam == 0)
+ g_exit = true;
+ return DefWindowProc(hwnd, message, wParam, lParam);
+}
+
+class TestThread : public QThread
+{
+ Q_OBJECT
+public:
+ TestThread(HWND parentWnd, Window *childWindow) : QThread(), m_hwnd(parentWnd), m_childWindow(childWindow) {
+ m_screenW = ::GetSystemMetrics(SM_CXSCREEN);
+ m_screenH = ::GetSystemMetrics(SM_CYSCREEN);
+ }
+
+ enum {
+ MouseClick,
+ MouseMove
+ };
+
+ void mouseInput(int command, const QPoint &p = QPoint())
+ {
+ INPUT mouseEvent;
+ mouseEvent.type = INPUT_MOUSE;
+ MOUSEINPUT &mi = mouseEvent.mi;
+ mi.mouseData = 0;
+ mi.time = 0;
+ mi.dwExtraInfo = 0;
+ mi.dx = 0;
+ mi.dy = 0;
+ switch (command) {
+ case MouseClick:
+ mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+ ::SendInput(1, &mouseEvent, sizeof(INPUT));
+ ::Sleep(50);
+ mi.dwFlags = MOUSEEVENTF_LEFTUP;
+ ::SendInput(1, &mouseEvent, sizeof(INPUT));
+ break;
+ case MouseMove:
+ mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
+ mi.dx = p.x() * 65536 / m_screenW;
+ mi.dy = p.y() * 65536 / m_screenH;
+ ::SendInput(1, &mouseEvent, sizeof(INPUT));
+ break;
+ }
+ }
+
+ void mouseClick()
+ {
+ mouseInput(MouseClick);
+ }
+
+ void mouseMove(const QPoint &pt)
+ {
+ mouseInput(MouseMove, pt);
+ }
+
+
+ void run() {
+ struct ScopedCleanup
+ {
+ /* This is in order to ensure that the window is hidden when returning from run(),
+ regardless of the return point (e.g. with QTRY_COMPARE) */
+ ScopedCleanup(HWND hwnd) : m_hwnd(hwnd) { }
+ ~ScopedCleanup() {
+ ::ShowWindow(m_hwnd, SW_HIDE);
+ }
+ HWND m_hwnd;
+ } cleanup(m_hwnd);
+
+ m_testPassed = false;
+ POINT pt;
+ pt.x = 0;
+ pt.y = 0;
+ if (!::ClientToScreen(m_hwnd, &pt))
+ return;
+ m_windowPos = QPoint(pt.x, pt.y);
+
+
+ // First activate the parent window (which will also activate the child window)
+ m_windowPos += QPoint(5,5);
+ mouseMove(m_windowPos);
+ ::Sleep(150);
+ mouseClick();
+
+
+
+ // At this point the windows are activated, no further events will be send to the QWindow
+ // if we click on the native parent HWND
+ m_childWindow->reset();
+ ::Sleep(150);
+ mouseClick();
+ ::Sleep(150);
+
+ QTRY_COMPARE(m_childWindow->received(QEvent::MouseButtonPress) + m_childWindow->received(QEvent::MouseButtonRelease), 0);
+
+ // Now click in the QWindow. The QWindow should receive those events.
+ m_windowPos.ry() += 50;
+ mouseMove(m_windowPos);
+ ::Sleep(150);
+ mouseClick();
+ QTRY_COMPARE(m_childWindow->received(QEvent::MouseButtonPress), 1);
+ QTRY_COMPARE(m_childWindow->received(QEvent::MouseButtonRelease), 1);
+
+ m_testPassed = true;
+
+ // ScopedCleanup will hide the window here
+ // Once the native window is hidden, it will exit the event loop.
+ }
+
+ bool passed() const { return m_testPassed; }
+
+private:
+ int m_screenW;
+ int m_screenH;
+ bool m_testPassed;
+ HWND m_hwnd;
+ Window *m_childWindow;
+ QPoint m_windowPos;
+
+};
+
+
+void tst_NoQtEventLoop::consumeMouseEvents()
+{
+ int argc = 1;
+ char *argv[] = {const_cast<char*>("test")};
+ QGuiApplication app(argc, argv);
+ QString clsName(QStringLiteral("tst_NoQtEventLoop_WINDOW"));
+ const HINSTANCE appInstance = (HINSTANCE)GetModuleHandle(0);
+ WNDCLASSEX wc;
+ wc.cbSize = sizeof(WNDCLASSEX);
+ wc.style = CS_DBLCLKS | CS_OWNDC; // CS_SAVEBITS
+ wc.lpfnWndProc = wndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = appInstance;
+ wc.hIcon = 0;
+ wc.hIconSm = 0;
+ wc.hCursor = 0;
+ wc.hbrBackground = ::GetSysColorBrush(COLOR_BTNFACE /*COLOR_WINDOW*/);
+ wc.lpszMenuName = 0;
+ wc.lpszClassName = (wchar_t*)clsName.utf16();
+
+ ATOM atom = ::RegisterClassEx(&wc);
+ QVERIFY2(atom, "RegisterClassEx failed");
+
+ DWORD dwExStyle = WS_EX_APPWINDOW;
+ DWORD dwStyle = WS_CAPTION | WS_HSCROLL | WS_TABSTOP | WS_VISIBLE;
+
+ HWND mainWnd = ::CreateWindowEx(dwExStyle, (wchar_t*)clsName.utf16(), TEXT("tst_NoQtEventLoop"), dwStyle, 100, 100, 300, 300, 0, NULL, appInstance, NULL);
+ QVERIFY2(mainWnd, "CreateWindowEx failed");
+
+ ::ShowWindow(mainWnd, SW_SHOW);
+
+ Window *childWindow = new Window;
+ childWindow->setParent(QWindow::fromWinId((WId)mainWnd));
+ childWindow->setGeometry(0, 50, 200, 200);
+ childWindow->show();
+
+ TestThread *testThread = new TestThread(mainWnd, childWindow);
+ connect(testThread, SIGNAL(finished()), testThread, SLOT(deleteLater()));
+ testThread->start();
+
+ // Our own message loop...
+ MSG msg;
+ while (::GetMessage(&msg, NULL, 0, 0) > 0) {
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ if (g_exit)
+ break;
+ }
+
+ QCOMPARE(testThread->passed(), true);
+
+}
+
+#include <tst_noqteventloop.moc>
+
+QTEST_APPLESS_MAIN(tst_NoQtEventLoop)
+
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index 5fbd3e96f8..d18f9664fc 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -60,6 +60,7 @@ class tst_QGuiApplication: public tst_QCoreApplication
Q_OBJECT
private slots:
+ void initTestCase();
void cleanup();
void displayName();
void firstWindowTitle();
@@ -84,6 +85,21 @@ private slots:
void settableStyleHints(); // Needs to run last as it changes style hints.
};
+void tst_QGuiApplication::initTestCase()
+{
+#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
+ if ((QString::compare(QStringLiteral(QT_QPA_DEFAULT_PLATFORM_NAME),
+ QStringLiteral("eglfs"), Qt::CaseInsensitive) == 0) ||
+ (QString::compare(QString::fromLatin1(qgetenv("QT_QPA_PLATFORM")),
+ QStringLiteral("eglfs"), Qt::CaseInsensitive) == 0)) {
+ // Set env variables to disable input and cursor because eglfs is single fullscreen window
+ // and trying to initialize input and cursor will crash test.
+ qputenv("QT_QPA_EGLFS_DISABLE_INPUT", "1");
+ qputenv("QT_QPA_EGLFS_HIDECURSOR", "1");
+ }
+#endif
+}
+
void tst_QGuiApplication::cleanup()
{
QVERIFY(QGuiApplication::allWindows().isEmpty());
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index e8d90edd2d..1ed78fa0ef 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -5025,6 +5025,7 @@ void tst_QPainter::drawPolyline_data()
QTest::newRow("basic") << (QVector<QPointF>() << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20) << QPointF(10, 20));
QTest::newRow("clipped") << (QVector<QPointF>() << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579
QTest::newRow("shortsegment") << (QVector<QPointF>() << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) << QPoint(21, 104)); // QTBUG-42398
+ QTest::newRow("edge") << (QVector<QPointF>() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9) << QPointF(14.2, 184.8) << QPointF(19.1, 130.4));
}
void tst_QPainter::drawPolyline()
@@ -5034,7 +5035,7 @@ void tst_QPainter::drawPolyline()
for (int r = 0; r < 2; r++) {
images[r] = QImage(150, 150, QImage::Format_ARGB32);
- images[r].fill(Qt::transparent);
+ images[r].fill(Qt::white);
QPainter p(images + r);
QPen pen(Qt::red, 0, Qt::SolidLine, Qt::FlatCap);
p.setPen(pen);
diff --git a/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp b/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
index b4e4b9ce0a..8ecb57dd33 100644
--- a/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
+++ b/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
@@ -74,6 +74,10 @@ void tst_QNetworkAccessManager::networkAccessible()
// if there is no session, we cannot know in which state we are in
QNetworkAccessManager::NetworkAccessibility initialAccessibility =
manager.networkAccessible();
+
+ if (initialAccessibility == QNetworkAccessManager::UnknownAccessibility)
+ QSKIP("Unknown accessibility", SkipAll);
+
QCOMPARE(manager.networkAccessible(), initialAccessibility);
manager.setNetworkAccessible(QNetworkAccessManager::NotAccessible);
@@ -94,29 +98,28 @@ void tst_QNetworkAccessManager::networkAccessible()
QCOMPARE(manager.networkAccessible(), initialAccessibility);
QNetworkConfigurationManager configManager;
- bool sessionRequired = (configManager.capabilities()
- & QNetworkConfigurationManager::NetworkSessionRequired);
QNetworkConfiguration defaultConfig = configManager.defaultConfiguration();
if (defaultConfig.isValid()) {
manager.setConfiguration(defaultConfig);
- // the accessibility has not changed if no session is required
- if (sessionRequired) {
+ QCOMPARE(spy.count(), 0);
+
+ if (defaultConfig.state().testFlag(QNetworkConfiguration::Active))
+ QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::Accessible);
+ else
+ QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::NotAccessible);
+
+ manager.setNetworkAccessible(QNetworkAccessManager::NotAccessible);
+
+ if (defaultConfig.state().testFlag(QNetworkConfiguration::Active)) {
QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).value<QNetworkAccessManager::NetworkAccessibility>(),
- QNetworkAccessManager::Accessible);
+ QCOMPARE(QNetworkAccessManager::NetworkAccessibility(spy.takeFirst().at(0).toInt()),
+ QNetworkAccessManager::NotAccessible);
} else {
QCOMPARE(spy.count(), 0);
}
- QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::Accessible);
-
- manager.setNetworkAccessible(QNetworkAccessManager::NotAccessible);
-
- QCOMPARE(spy.count(), 1);
- QCOMPARE(QNetworkAccessManager::NetworkAccessibility(spy.takeFirst().at(0).toInt()),
- QNetworkAccessManager::NotAccessible);
- QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::NotAccessible);
}
+ QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::NotAccessible);
#endif
}
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 09d9448e10..a6f777c084 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -115,10 +115,12 @@ private slots:
void linkLocalIPv4();
void readyRead();
void readyReadForEmptyDatagram();
+ void asyncReadDatagram();
protected slots:
void empty_readyReadSlot();
void empty_connectedSlot();
+ void async_readDatagramSlot();
private:
#ifndef QT_NO_BEARERMANAGEMENT
@@ -126,6 +128,8 @@ private:
QNetworkConfiguration networkConfiguration;
QSharedPointer<QNetworkSession> networkSession;
#endif
+ QUdpSocket *m_asyncSender;
+ QUdpSocket *m_asyncReceiver;
};
static QHostAddress makeNonAny(const QHostAddress &address, QHostAddress::SpecialAddress preferForAny = QHostAddress::LocalHost)
@@ -1670,5 +1674,55 @@ void tst_QUdpSocket::readyReadForEmptyDatagram()
QCOMPARE(receiver.readDatagram(buf, sizeof buf), qint64(0));
}
+void tst_QUdpSocket::async_readDatagramSlot()
+{
+ char buf[1];
+ QVERIFY(m_asyncReceiver->hasPendingDatagrams());
+ QCOMPARE(m_asyncReceiver->pendingDatagramSize(), qint64(1));
+ QCOMPARE(m_asyncReceiver->bytesAvailable(), qint64(1));
+ QCOMPARE(m_asyncReceiver->readDatagram(buf, sizeof(buf)), qint64(1));
+
+ if (buf[0] == '2') {
+ QTestEventLoop::instance().exitLoop();
+ return;
+ }
+
+ m_asyncSender->writeDatagram("2", makeNonAny(m_asyncReceiver->localAddress()), m_asyncReceiver->localPort());
+ // wait a little to ensure that the datagram we've just sent
+ // will be delivered on receiver side.
+ QTest::qSleep(100);
+}
+
+void tst_QUdpSocket::asyncReadDatagram()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ m_asyncSender = new QUdpSocket;
+ m_asyncReceiver = new QUdpSocket;
+#ifdef FORCE_SESSION
+ m_asyncSender->setProperty("_q_networksession", QVariant::fromValue(networkSession));
+ m_asyncReceiver->setProperty("_q_networksession", QVariant::fromValue(networkSession));
+#endif
+
+ QVERIFY(m_asyncReceiver->bind(QHostAddress(QHostAddress::AnyIPv4), 0));
+ quint16 port = m_asyncReceiver->localPort();
+ QVERIFY(port != 0);
+
+ QSignalSpy spy(m_asyncReceiver, SIGNAL(readyRead()));
+ connect(m_asyncReceiver, SIGNAL(readyRead()), SLOT(async_readDatagramSlot()));
+
+ m_asyncSender->writeDatagram("1", makeNonAny(m_asyncReceiver->localAddress()), port);
+
+ QTestEventLoop::instance().enterLoop(1);
+
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QCOMPARE(spy.count(), 2);
+
+ delete m_asyncSender;
+ delete m_asyncReceiver;
+}
+
QTEST_MAIN(tst_QUdpSocket)
#include "tst_qudpsocket.moc"
diff --git a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp
index 53459b13f6..b79b3aba28 100644
--- a/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp
+++ b/tests/auto/other/qprocess_and_guieventloop/tst_qprocess_and_guieventloop.cpp
@@ -45,9 +45,11 @@ private slots:
void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop()
{
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+#if defined(QT_NO_PROCESS)
+ QSKIP("QProcess not supported");
+#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
QSKIP("Not supported on Android");
-#endif
+#else
// based on testcase provided in QTBUG-39488
QByteArray msg = "Hello World";
@@ -78,6 +80,7 @@ void tst_QProcess_and_GuiEventLoop::waitForAndEventLoop()
QCOMPARE(process.exitCode(), 0);
QCOMPARE(spy.count(), 1);
QCOMPARE(process.readAll().trimmed(), msg);
+#endif
}
QTEST_MAIN(tst_QProcess_and_GuiEventLoop)
diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
index f19ef391ff..781adeedad 100644
--- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
@@ -193,9 +193,7 @@ private slots:
void deleteStack();
void checkSignals();
void addStackAndDie();
-#ifndef QT_NO_PROCESS
void commandTextFormat();
-#endif
};
tst_QUndoGroup::tst_QUndoGroup()
@@ -599,9 +597,11 @@ void tst_QUndoGroup::addStackAndDie()
delete stack;
}
-#ifndef QT_NO_PROCESS
void tst_QUndoGroup::commandTextFormat()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No QProcess available");
+#else
QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath);
if (QProcess::execute(binDir + "/lrelease -version") != 0)
@@ -643,8 +643,8 @@ void tst_QUndoGroup::commandTextFormat()
QCOMPARE(redo_action->text(), QString("redo-prefix append redo-suffix"));
qApp->removeTranslator(&translator);
-}
#endif
+}
#else
class tst_QUndoGroup : public QObject
diff --git a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
index 29bc14f372..2c8a9a3ee5 100644
--- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
+++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
@@ -239,9 +239,7 @@ private slots:
void macroBeginEnd();
void compression();
void undoLimit();
-#ifndef QT_NO_PROCESS
void commandTextFormat();
-#endif
void separateUndoText();
};
@@ -2958,9 +2956,11 @@ void tst_QUndoStack::undoLimit()
true); // redoChanged
}
-#ifndef QT_NO_PROCESS
void tst_QUndoStack::commandTextFormat()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("No QProcess available");
+#else
QString binDir = QLibraryInfo::location(QLibraryInfo::BinariesPath);
if (QProcess::execute(binDir + "/lrelease -version") != 0)
@@ -2999,8 +2999,8 @@ void tst_QUndoStack::commandTextFormat()
QCOMPARE(redo_action->text(), QString("redo-prefix append redo-suffix"));
qApp->removeTranslator(&translator);
-}
#endif
+}
void tst_QUndoStack::separateUndoText()
{