summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-21 08:50:26 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-21 09:11:02 +0200
commiteaec2b664aa2c3cbca13b425901888468a4652a1 (patch)
tree93dbd19f3b538baa81dec6c04e5258161f7d8cfb /tests/auto
parent278e557ceacbe7de728987a4a5365f78e56d76b1 (diff)
parent31c251765db45a068f1268027e5dd600151af1e5 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/gui/painting/qcoregraphics.mm src/network/access/qnetworkrequest.h src/plugins/platforms/cocoa/qcocoahelpers.mm Change-Id: I81266414c06ea2edf63cbc7e93a86bd5d66a31a5
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp23
-rw-r--r--tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp1
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp12
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST2
-rw-r--r--[-rwxr-xr-x]tests/auto/network/access/http2/http2srv.cpp0
-rw-r--r--[-rwxr-xr-x]tests/auto/network/access/http2/http2srv.h0
-rw-r--r--tests/auto/tools/moc/parse-defines.h3
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp3
8 files changed, 32 insertions, 12 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 9e369792f1..2cf9ea4913 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -41,7 +41,6 @@
#include <QtCore/QStandardPaths>
#include <QtCore/QTemporaryDir>
#include <QtCore/QTextStream>
-#include <QFutureSynchronizer>
#include <QtConcurrent/QtConcurrentRun>
#include <QtTest/QtTest>
@@ -844,18 +843,18 @@ void tst_QMimeDatabase::findByFile()
void tst_QMimeDatabase::fromThreads()
{
- QThreadPool::globalInstance()->setMaxThreadCount(20);
+ QThreadPool tp;
+ tp.setMaxThreadCount(20);
// Note that data-based tests cannot be used here (QTest::fetchData asserts).
- QFutureSynchronizer<void> sync;
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::mimeTypeForName));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::aliases));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::allMimeTypes));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::icons));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::inheritance));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::knownSuffix));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::mimeTypeForFileWithContent));
- sync.addFuture(QtConcurrent::run(this, &tst_QMimeDatabase::allMimeTypes)); // a second time
- // sync dtor blocks waiting for finished
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::mimeTypeForName);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::aliases);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::allMimeTypes);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::icons);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::inheritance);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::knownSuffix);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::mimeTypeForFileWithContent);
+ QtConcurrent::run(&tp, this, &tst_QMimeDatabase::allMimeTypes); // a second time
+ QVERIFY(tp.waitForDone(60000));
}
#ifndef QT_NO_PROCESS
diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
index 0fdafd9b01..2385aa992c 100644
--- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
+++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
@@ -341,6 +341,7 @@ void tst_QStringList::join() const
QFETCH(QString, expectedResult);
QCOMPARE(input.join(separator), expectedResult);
+ QCOMPARE(input.join(QLatin1String(separator.toLatin1())), expectedResult);
}
void tst_QStringList::join_data() const
diff --git a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
index 9d42ae5850..43b2b79698 100644
--- a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
+++ b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
@@ -26,6 +26,7 @@
**
****************************************************************************/
+#include <QtCore/QTemporaryDir>
#include <QtTest/QtTest>
#include <QtGui/qevent.h>
@@ -38,6 +39,7 @@ public:
public slots:
void initTestCase();
+ void cleanupTestCase();
private slots:
void constructor();
@@ -54,6 +56,9 @@ private:
bool appendFileContent(QFileOpenEvent& event, const QByteArray& writeContent);
bool event(QEvent *);
+
+ QTemporaryDir m_temporaryDir;
+ QString m_originalCurrent;
};
tst_qfileopenevent::~tst_qfileopenevent()
@@ -62,6 +67,13 @@ tst_qfileopenevent::~tst_qfileopenevent()
void tst_qfileopenevent::initTestCase()
{
+ m_originalCurrent = QDir::currentPath();
+ QDir::setCurrent(m_temporaryDir.path());
+}
+
+void tst_qfileopenevent::cleanupTestCase()
+{
+ QDir::setCurrent(m_originalCurrent);
}
void tst_qfileopenevent::createFile(const QString &filename, const QByteArray &content)
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index 81ab693ee7..19d9262bca 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -14,3 +14,5 @@ ubuntu-14.04
ubuntu-16.04
[modalDialogClosingOneOfTwoModal]
osx
+[modalWindowModallity]
+osx
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp
index f919937fc3..f919937fc3 100755..100644
--- a/tests/auto/network/access/http2/http2srv.cpp
+++ b/tests/auto/network/access/http2/http2srv.cpp
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index 73b1d80f8e..73b1d80f8e 100755..100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index 9fb5da4b07..6100bf67ad 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -139,6 +139,9 @@ public slots:
signals:
DEFINE_CMDLINE_SIGNAL;
+#define QTBUG55853(X) PD_DEFINE1(X, signalQTBUG55853)
+#define PD_EMPTY /* empty */
+ void QTBUG55853(PD_EMPTY)();
};
#undef QString
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index a3648c95b6..601b1bb36b 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -3397,6 +3397,9 @@ void tst_Moc::parseDefines()
index = mo->indexOfSignal("cmdlineSignal(QMap<int,int>)");
QVERIFY(index != -1);
+
+ index = mo->indexOfSignal("signalQTBUG55853()");
+ QVERIFY(index != -1);
}
void tst_Moc::preprocessorOnly()