summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-20 11:37:26 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-20 11:58:32 +0200
commit01bc69f99f189b03d0b9cad77cc300798937cad1 (patch)
tree730f3b691cfc1830ec617b3c2ad8df16180de724 /tests
parentc23c4a921d0e9e2d18a62af82d38ca27eac7bcb3 (diff)
parent6d699d08200b1fe3a616dfbc275d46c98b77fcbd (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp4
-rw-r--r--tests/auto/corelib/kernel/kernel.pro3
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp13
-rw-r--r--tests/auto/gui/qopengl/BLACKLIST2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp9
-rw-r--r--tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST2
-rw-r--r--tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro2
-rw-r--r--tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp4
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp4
-rw-r--r--tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp8
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp16
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp21
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp5
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp5
-rw-r--r--tests/benchmarks/dbus/dbus.pro4
15 files changed, 64 insertions, 38 deletions
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index e6bad9a8ef..8dbac28183 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -394,7 +394,7 @@ void tst_QDir::mkdirRmdir()
void tst_QDir::mkdirOnSymlink()
{
-#ifndef Q_OS_UNIX
+#if !defined(Q_OS_UNIX) || defined(Q_NO_SYMLINKS)
QSKIP("Test only valid on an OS that supports symlinks");
#else
// Create the structure:
@@ -1662,9 +1662,7 @@ void tst_QDir::homePath()
QVERIFY(!strHome.endsWith('/'));
QByteArray envHome = qgetenv("HOME");
-#if !defined(_WRS_KERNEL) // unsetenv is not available on VxWorks DKM mode
unsetenv("HOME");
-#endif
QCOMPARE(QDir::homePath(), QDir::rootPath());
qputenv("HOME", envHome);
diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro
index 75b98bcd09..b5b64973d3 100644
--- a/tests/auto/corelib/kernel/kernel.pro
+++ b/tests/auto/corelib/kernel/kernel.pro
@@ -41,3 +41,6 @@ SUBDIRS=\
!win32*|winrt: SUBDIRS -= qwineventnotifier
android|uikit: SUBDIRS -= qclipboard qobject qsharedmemory qsystemsemaphore
+
+!qtConfig(systemsemaphore): SUBDIRS -= \
+ qsystemsemaphore
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 0e65f6a23d..235d53f3c1 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -69,6 +69,7 @@ private slots:
void convertToFormat_data();
void convertToFormat();
+ void convertToFormatWithColorTable();
void convertToFormatRgb888ToRGB32();
@@ -959,6 +960,18 @@ void tst_QImage::convertToFormat()
QFile::remove(QLatin1String("expected2.xpm"));
}
+void tst_QImage::convertToFormatWithColorTable()
+{
+ QVector<QRgb> colors(2);
+ colors[0] = 0xFF000000;
+ colors[1] = 0xFFFFFFFF;
+ for (int format = QImage::Format_RGB32; format < QImage::Format_Alpha8; ++format) {
+ QImage fromImage(10, 10, (QImage::Format)format);
+ QImage bitmap = fromImage.convertToFormat(QImage::Format_Mono, colors);
+ QVERIFY(!bitmap.isNull());
+ }
+}
+
void tst_QImage::convertToFormatRgb888ToRGB32()
{
// 545 so width % 4 != 0. This ensure there is padding at the end of the scanlines
diff --git a/tests/auto/gui/qopengl/BLACKLIST b/tests/auto/gui/qopengl/BLACKLIST
index 7f167d81df..a16327d411 100644
--- a/tests/auto/gui/qopengl/BLACKLIST
+++ b/tests/auto/gui/qopengl/BLACKLIST
@@ -6,3 +6,5 @@ windows
windows
[openGLPaintDevice]
windows
+[wglContextWrap]
+windows-7
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 855b1f9041..e995b69f60 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -5773,6 +5773,15 @@ void tst_QNetworkReply::proxyChange()
QNetworkRequest req(QUrl("http://" + QtNetworkSettings::serverName()));
proxyServer.doClose = false;
+ {
+ // Needed to initialize a network session in QNAM. Without an initialized session the GET
+ // will be deferred until later, and the proxy will be unset first. This caused the test to
+ // fail in standalone runs (it passed in CI because the same QNAM instance is used for the
+ // entire test).
+ QNetworkReplyPtr temporary(manager.get(req));
+ waitForFinish(temporary);
+ }
+
manager.setProxy(dummyProxy);
QNetworkReplyPtr reply1(manager.get(req));
connect(reply1, SIGNAL(finished()), &helper, SLOT(finishedSlot()));
diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST b/tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST
deleted file mode 100644
index 73570c98b7..0000000000
--- a/tests/auto/network/kernel/qnetworkproxyfactory/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[genericSystemProxy]
-ubuntu-14.04
diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro b/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro
index ed73e3e10e..a7fa43015f 100644
--- a/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro
+++ b/tests/auto/network/kernel/qnetworkproxyfactory/qnetworkproxyfactory.pro
@@ -4,6 +4,6 @@
CONFIG += testcase
TARGET = tst_qnetworkproxyfactory
-QT = core network testlib
+QT = core network-private testlib
SOURCES += tst_qnetworkproxyfactory.cpp
diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index 81d598641b..f3a1ac84ff 100644
--- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -42,6 +42,8 @@
#include <QSysInfo>
#include <QThread>
+#include <private/qtnetworkglobal_p.h>
+
class tst_QNetworkProxyFactory : public QObject {
Q_OBJECT
@@ -255,7 +257,7 @@ void tst_QNetworkProxyFactory::genericSystemProxy()
QFETCH(int, port);
// The generic system proxy is only available on the following platforms
-#if (!defined Q_OS_WIN) && (!defined Q_OS_OSX)
+#if (!defined Q_OS_WIN) && (!defined Q_OS_OSX) && !QT_CONFIG(libproxy)
qputenv(envVar, url);
const QList<QNetworkProxy> systemProxy = QNetworkProxyFactory::systemProxyForQuery();
QCOMPARE(systemProxy.size(), 1);
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
index e3f088e763..9b0d5b6920 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
@@ -754,8 +754,8 @@ void tst_QSqlDatabase::recordOCI()
FieldDef("long raw", QVariant::ByteArray, QByteArray("blah5")),
FieldDef("raw(2000)", QVariant::ByteArray, QByteArray("blah6"), false),
FieldDef("blob", QVariant::ByteArray, QByteArray("blah7")),
- FieldDef("clob", QVariant::String, QString("blah8")),
- FieldDef("nclob", QVariant::String, QString("blah9")),
+ FieldDef("clob", QVariant::ByteArray, QByteArray("blah8")),
+ FieldDef("nclob", QVariant::ByteArray, QByteArray("blah9")),
// FieldDef("bfile", QVariant::ByteArray, QByteArray("blah10")),
intytm,
diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
index a19c849b4d..8f8cfe009d 100644
--- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
+++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
@@ -72,7 +72,13 @@ void tst_QSqlDriver::recreateTestTables(QSqlDatabase db)
QVERIFY_SQL( q, exec("set client_min_messages='warning'"));
tst_Databases::safeDropTable( db, relTEST1 );
- QString doubleField = (dbType == QSqlDriver::SQLite) ? "more_data double" : "more_data double(8,7)";
+ QString doubleField;
+ if (dbType == QSqlDriver::SQLite)
+ doubleField = "more_data double";
+ else if (dbType == QSqlDriver::Oracle)
+ doubleField = "more_data number(8,7)";
+ else
+ doubleField = "more_data double(8,7)";
QVERIFY_SQL( q, exec("create table " + relTEST1 +
" (id int not null primary key, name varchar(20), title_key int, another_title_key int, " + doubleField + QLatin1Char(')')));
QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(1, 'harry', 1, 2, 1.234567)"));
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index d3bc83fe6d..d704d212dd 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -73,7 +73,7 @@ private slots:
void toolDialogPosition();
void deleteMainDefault();
void deleteInExec();
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
void showSizeGrip();
#endif
void setVisible();
@@ -235,7 +235,7 @@ void tst_QDialog::showMaximized()
{
QDialog dialog(0);
dialog.setSizeGripEnabled(true);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QSizeGrip *sizeGrip = dialog.findChild<QSizeGrip *>();
QVERIFY(sizeGrip);
#endif
@@ -243,14 +243,14 @@ void tst_QDialog::showMaximized()
dialog.showMaximized();
QVERIFY(dialog.isMaximized());
QVERIFY(dialog.isVisible());
-#if !defined(QT_NO_SIZEGRIP) && !defined(Q_OS_MAC) && !defined(Q_OS_IRIX) && !defined(Q_OS_HPUX)
+#if QT_CONFIG(sizegrip) && !defined(Q_OS_DARWIN) && !defined(Q_OS_IRIX) && !defined(Q_OS_HPUX)
QVERIFY(!sizeGrip->isVisible());
#endif
dialog.showNormal();
QVERIFY(!dialog.isMaximized());
QVERIFY(dialog.isVisible());
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QVERIFY(sizeGrip->isVisible());
#endif
@@ -312,7 +312,7 @@ void tst_QDialog::showFullScreen()
{
QDialog dialog(0, Qt::X11BypassWindowManagerHint);
dialog.setSizeGripEnabled(true);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QSizeGrip *sizeGrip = dialog.findChild<QSizeGrip *>();
QVERIFY(sizeGrip);
#endif
@@ -320,14 +320,14 @@ void tst_QDialog::showFullScreen()
dialog.showFullScreen();
QVERIFY(dialog.isFullScreen());
QVERIFY(dialog.isVisible());
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QVERIFY(!sizeGrip->isVisible());
#endif
dialog.showNormal();
QVERIFY(!dialog.isFullScreen());
QVERIFY(dialog.isVisible());
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QVERIFY(sizeGrip->isVisible());
#endif
@@ -414,7 +414,7 @@ void tst_QDialog::deleteInExec()
QCOMPARE(dialog->exec(), int(QDialog::Rejected));
}
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
// From Task 124269
void tst_QDialog::showSizeGrip()
{
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 096beedf63..e284d92f72 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -1743,8 +1743,6 @@ void tst_QWidget::activation()
{
Q_CHECK_PAINTEVENTS
- int waitTime = 100;
-
QWidget widget1;
widget1.setObjectName("activation-Widget1");
widget1.setWindowTitle(widget1.objectName());
@@ -1756,25 +1754,18 @@ void tst_QWidget::activation()
widget1.show();
widget2.show();
- QTest::qWait(waitTime);
- QCOMPARE(QApplication::activeWindow(), &widget2);
+ QTRY_COMPARE(QApplication::activeWindow(), &widget2);
widget2.showMinimized();
- QTest::qWait(waitTime);
- QCOMPARE(QApplication::activeWindow(), &widget1);
+ QTRY_COMPARE(QApplication::activeWindow(), &widget1);
widget2.showMaximized();
- QTest::qWait(waitTime);
- QCOMPARE(QApplication::activeWindow(), &widget2);
+ QTRY_COMPARE(QApplication::activeWindow(), &widget2);
widget2.showMinimized();
- QTest::qWait(waitTime);
- QCOMPARE(QApplication::activeWindow(), &widget1);
+ QTRY_COMPARE(QApplication::activeWindow(), &widget1);
widget2.showNormal();
- QTest::qWait(waitTime);
- QTest::qWait(waitTime);
- QCOMPARE(QApplication::activeWindow(), &widget2);
+ QTRY_COMPARE(QApplication::activeWindow(), &widget2);
widget2.hide();
- QTest::qWait(waitTime);
- QCOMPARE(QApplication::activeWindow(), &widget1);
+ QTRY_COMPARE(QApplication::activeWindow(), &widget1);
}
#endif // Q_OS_WIN
diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
index cd5a83e547..e71daccf7d 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
@@ -28,6 +28,7 @@
#include <QDebug>
#include <QDirIterator>
#include <QString>
+#include <qplatformdefs.h>
#ifdef Q_OS_WIN
# include <qt_windows.h>
@@ -142,8 +143,8 @@ static int posix_helper(const char *dirpath)
QByteArray ba = dirpath;
ba += '/';
ba += entry->d_name;
- struct stat st;
- lstat(ba.constData(), &st);
+ QT_STATBUF st;
+ QT_LSTAT(ba.constData(), &st);
if (S_ISDIR(st.st_mode))
count += posix_helper(ba.constData());
}
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
index f5fb13fca6..d68264b78f 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
@@ -82,6 +82,7 @@
#include <QtCore/qset.h>
#include <QtCore/qstack.h>
#include <QtCore/qvariant.h>
+#include <qplatformdefs.h>
#ifdef Q_OS_WIN
# include <windows.h>
@@ -343,8 +344,8 @@ bool QFileSystemIteratorPrivate::advanceHelper()
QByteArray ba = m_dirPaths.top();
ba += '/';
ba += name;
- struct stat st;
- lstat(ba.constData(), &st);
+ QT_STATBUF st;
+ QT_LSTAT(ba.constData(), &st);
if (S_ISDIR(st.st_mode)) {
pushSubDirectory(ba);
diff --git a/tests/benchmarks/dbus/dbus.pro b/tests/benchmarks/dbus/dbus.pro
index 989a0db2d4..1254ad95e9 100644
--- a/tests/benchmarks/dbus/dbus.pro
+++ b/tests/benchmarks/dbus/dbus.pro
@@ -1,4 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = \
- qdbusperformance \
qdbustype
+
+qtConfig(process): SUBDIRS += \
+ qdbusperformance