summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-02 22:49:38 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-08-02 22:52:32 +0200
commitee07b912a1768ea0b103544f9eeac41f3cf50cf6 (patch)
tree15bfa7e4a9c098511c1fc89e2b2c240520b85e2d /tests/auto
parent4bfff6a98b59b32605d881a463ad3edc221a7dc8 (diff)
parenta96656a8fb6a3c1fc7765659efff28f807fd0deb (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp45
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp2
-rw-r--r--tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp4
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp99
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp1
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp9
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp22
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp4
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp27
-rw-r--r--tests/auto/gui/kernel/qguieventloop/BLACKLIST2
-rw-r--r--tests/auto/network/access/qftp/tst_qftp.cpp2
-rw-r--r--tests/auto/network/socket/qudpsocket/BLACKLIST1
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp2
-rw-r--r--tests/auto/other/macgui/BLACKLIST3
-rw-r--r--tests/auto/other/macgui/tst_macgui.cpp1
-rw-r--r--tests/auto/other/macnativeevents/BLACKLIST10
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp8
-rw-r--r--tests/auto/other/qaccessibilitymac/BLACKLIST2
-rw-r--r--tests/auto/other/qfocusevent/BLACKLIST5
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp38
-rw-r--r--tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp16
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp12
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST3
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp19
-rw-r--r--tests/auto/widgets/styles/qstyle/task_25863.pngbin910 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/testdata.qrc1
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp15
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp32
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp10
-rw-r--r--tests/auto/widgets/widgets/qmenu/BLACKLIST1
32 files changed, 270 insertions, 130 deletions
diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index 4bb3fa5b28..2e698e6615 100644
--- a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -81,7 +81,6 @@ private slots:
void stresstest();
void noIterations();
void throttling();
- void blockSize();
void multipleResults();
};
@@ -240,50 +239,6 @@ void tst_QtConcurrentIterateKernel::throttling()
QCOMPARE(threads.count(), 1);
}
-class BlockSizeRecorder : public IterateKernel<TestIterator, void>
-{
-public:
- BlockSizeRecorder(TestIterator begin, TestIterator end)
- : IterateKernel<TestIterator, void>(begin, end)
- , peakBlockSize(0)
- , peakBegin(0)
- {}
-
- inline bool runIterations(TestIterator, int begin, int end, void *)
- {
- const int blockSize = end - begin;
- if (blockSize > peakBlockSize) {
- peakBlockSize = blockSize;
- peakBegin = begin;
- }
- return false;
- }
- int peakBlockSize;
- int peakBegin;
-};
-
-static QByteArray msgBlockSize(const BlockSizeRecorder &recorder, int expectedMinimumBlockSize)
-{
- return QByteArrayLiteral("peakBlockSize=") + QByteArray::number(recorder.peakBlockSize)
- + QByteArrayLiteral(" is less than expectedMinimumBlockSize=")
- + QByteArray::number(expectedMinimumBlockSize)
- + QByteArrayLiteral(", reached at: ") + QByteArray::number(recorder.peakBegin)
- + QByteArrayLiteral(" (ideal thread count: ") + QByteArray::number(QThread::idealThreadCount())
- + ')';
-}
-
-void tst_QtConcurrentIterateKernel::blockSize()
-{
- const int expectedMinimumBlockSize = 1024 / QThread::idealThreadCount();
- BlockSizeRecorder recorder(0, 10000);
- recorder.startBlocking();
-#ifdef Q_OS_WIN
- if (recorder.peakBlockSize < expectedMinimumBlockSize)
- QEXPECT_FAIL("", msgBlockSize(recorder, expectedMinimumBlockSize).constData(), Abort);
-#endif // Q_OS_WIN
- QVERIFY2(recorder.peakBlockSize >= expectedMinimumBlockSize, msgBlockSize(recorder, expectedMinimumBlockSize));
-}
-
class MultipleResultsFor : public IterateKernel<TestIterator, int>
{
public:
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index 99e1d5a32f..5975303ca6 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -228,7 +228,7 @@ QByteArray const &tst_LargeFile::getDataBlock(int index, qint64 position)
void tst_LargeFile::initTestCase()
{
m_previousCurrent = QDir::currentPath();
- m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir);
+ m_tempDir = QSharedPointer<QTemporaryDir>::create();
QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory."));
QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory"));
diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
index 4e5059c1a2..68fc628a41 100644
--- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
+++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
@@ -473,7 +473,7 @@ protected:
if (create) {
QSharedPointer<File> &p = fileSystem[fileName_];
if (p.isNull())
- p = QSharedPointer<File>(new File);
+ p = QSharedPointer<File>::create();
return p;
}
@@ -571,7 +571,7 @@ class FileEngineHandler
void tst_QAbstractFileEngine::initTestCase()
{
m_previousCurrent = QDir::currentPath();
- m_currentDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir());
+ m_currentDir = QSharedPointer<QTemporaryDir>::create();
QVERIFY2(!m_currentDir.isNull(), qPrintable("Could not create current directory."));
QDir::setCurrent(m_currentDir->path());
}
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index 0068411b94..14a2528cc6 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -300,7 +300,7 @@ void tst_QDataStream::getSetCheck()
void tst_QDataStream::initTestCase()
{
m_previousCurrent = QDir::currentPath();
- m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir);
+ m_tempDir = QSharedPointer<QTemporaryDir>::create();
QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory."));
QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory"));
}
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index da948849f6..e6bad9a8ef 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -93,6 +93,9 @@ private slots:
void entryList_data();
void entryList();
+ void entryListWithTestFiles_data();
+ void entryListWithTestFiles();
+
void entryListTimedSort();
void entryListSimple_data();
@@ -717,6 +720,32 @@ void tst_QDir::entryList_data()
QTest::newRow("resources2") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data")
<< (int)(QDir::Files) << (int)(QDir::NoSort)
<< QString("file1.data,file2.data,file3.data").split(',');
+}
+
+void tst_QDir::entryList()
+{
+ QFETCH(QString, dirName);
+ QFETCH(QStringList, nameFilters);
+ QFETCH(int, filterspec);
+ QFETCH(int, sortspec);
+ QFETCH(QStringList, expected);
+
+ QDir dir(dirName);
+ QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData());
+
+ QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec,
+ (QDir::SortFlags)sortspec);
+
+ QCOMPARE(actual, expected);
+}
+
+void tst_QDir::entryListWithTestFiles_data()
+{
+ QTest::addColumn<QString>("dirName"); // relative from current path or abs
+ QTest::addColumn<QStringList>("nameFilters");
+ QTest::addColumn<int>("filterspec");
+ QTest::addColumn<int>("sortspec");
+ QTest::addColumn<QStringList>("expected");
QTest::newRow("nofilter") << (m_dataPath + "/entrylist/") << QStringList("*")
<< int(QDir::NoFilter) << int(QDir::Name)
@@ -823,7 +852,7 @@ void tst_QDir::entryList_data()
<< QString("c,b,a,a.a,a.b,a.c,b.b,b.c,b.a,c.c,c.b,c.a,f.c,f.b,f.a,f,e.c,e.b,e.a,e,d.c,d.b,d.a,d").split(',');
}
-void tst_QDir::entryList()
+void tst_QDir::entryListWithTestFiles()
{
QFETCH(QString, dirName);
QFETCH(QStringList, nameFilters);
@@ -831,28 +860,49 @@ void tst_QDir::entryList()
QFETCH(int, sortspec);
QFETCH(QStringList, expected);
+ QStringList testFiles;
+
QString entrylistPath = (m_dataPath + "/entrylist/");
- QFile(entrylistPath + "writable").open(QIODevice::ReadWrite);
- QFile(entrylistPath + "file").setPermissions(QFile::ReadOwner | QFile::ReadUser);
- QFile::remove(entrylistPath + "linktofile");
- QFile::remove(entrylistPath + "linktodirectory");
- QFile::remove(entrylistPath + "linktofile.lnk");
- QFile::remove(entrylistPath + "linktodirectory.lnk");
- QFile::remove(entrylistPath + "brokenlink.lnk");
- QFile::remove(entrylistPath + "brokenlink");
+
+ {
+ const QString writableFileName = entrylistPath + "writable";
+ QFile writableFile(writableFileName);
+ testFiles.append(writableFileName);
+
+ QVERIFY2(writableFile.open(QIODevice::ReadWrite),
+ qPrintable(writableFile.errorString()));
+ }
+
+ {
+ QFile readOnlyFile(entrylistPath + "file");
+ QVERIFY2(readOnlyFile.setPermissions(QFile::ReadOwner | QFile::ReadUser),
+ qPrintable(readOnlyFile.errorString()));
+ }
+
#ifndef Q_NO_SYMLINKS
#if defined(Q_OS_WIN)
// ### Sadly, this is a platform difference right now.
// Note we are using capital L in entryList on one side here, to test case-insensitivity
- QFile::link((m_dataPath + "/entryList/") + "file", entrylistPath + "linktofile.lnk");
- QFile::link((m_dataPath + "/entryList/") + "directory", entrylistPath + "linktodirectory.lnk");
- QFile::link((m_dataPath + "/entryList/") + "nothing", entrylistPath + "brokenlink.lnk");
+ const QVector<QPair<QString, QString> > symLinks =
+ {
+ {m_dataPath + "/entryList/file", entrylistPath + "linktofile.lnk"},
+ {m_dataPath + "/entryList/directory", entrylistPath + "linktodirectory.lnk"},
+ {m_dataPath + "/entryList/nothing", entrylistPath + "brokenlink.lnk"}
+ };
#else
- QFile::link("file", entrylistPath + "linktofile.lnk");
- QFile::link("directory", entrylistPath + "linktodirectory.lnk");
- QFile::link("nothing", entrylistPath + "brokenlink.lnk");
+ const QVector<QPair<QString, QString> > symLinks =
+ {
+ {"file", entrylistPath + "linktofile.lnk"},
+ {"directory", entrylistPath + "linktodirectory.lnk"},
+ {"nothing", entrylistPath + "brokenlink.lnk"}
+ };
#endif
+ for (const auto &symLink : symLinks) {
+ QVERIFY2(QFile::link(symLink.first, symLink.second),
+ qPrintable(symLink.first + "->" + symLink.second));
+ testFiles.append(symLink.second);
+ }
#endif //Q_NO_SYMLINKS
QDir dir(dirName);
@@ -861,8 +911,6 @@ void tst_QDir::entryList()
QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec,
(QDir::SortFlags)sortspec);
- int max = qMin(actual.count(), expected.count());
-
bool doContentCheck = true;
#if defined(Q_OS_UNIX)
if (qstrcmp(QTest::currentDataTag(), "QDir::AllEntries | QDir::Writable") == 0) {
@@ -872,20 +920,11 @@ void tst_QDir::entryList()
}
#endif
- if (doContentCheck) {
- for (int i=0; i<max; ++i)
- QCOMPARE(actual[i], expected[i]);
-
- QCOMPARE(actual.count(), expected.count());
- }
+ for (int i = testFiles.size() - 1; i >= 0; --i)
+ QVERIFY2(QFile::remove(testFiles.at(i)), qPrintable(testFiles.at(i)));
- QFile::remove(entrylistPath + "writable");
- QFile::remove(entrylistPath + "linktofile");
- QFile::remove(entrylistPath + "linktodirectory");
- QFile::remove(entrylistPath + "linktofile.lnk");
- QFile::remove(entrylistPath + "linktodirectory.lnk");
- QFile::remove(entrylistPath + "brokenlink.lnk");
- QFile::remove(entrylistPath + "brokenlink");
+ if (doContentCheck)
+ QCOMPARE(actual, expected);
}
void tst_QDir::entryListTimedSort()
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 17497e46b9..54d089f3bb 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -1155,7 +1155,6 @@ void tst_QFile::invalidFile_data()
#else
#if !defined(Q_OS_WINRT)
QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid");
- QTest::newRow( "date" ) << QString( "testLog-03:20.803Z.txt" );
#endif
QTest::newRow( "colon3" ) << QString( ":failinvalid" );
QTest::newRow( "forwardslash" ) << QString( "fail/invalid" );
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index 5cb532f76b..a76fd4703e 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -71,7 +71,7 @@ void tst_QIODevice::initTestCase()
|| QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp")));
#endif
m_previousCurrent = QDir::currentPath();
- m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir);
+ m_tempDir = QSharedPointer<QTemporaryDir>::create();
QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory."));
QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory"));
}
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
index aff04afe08..0b4f76ef70 100644
--- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
@@ -216,12 +216,11 @@ void tst_QEventLoop::processEvents()
awakeSpy.clear();
QVERIFY(eventLoop.processEvents(QEventLoop::WaitForMoreEvents));
- // Verify that the eventloop has blocked and woken up. Some eventloops
- // may block and wake up multiple times.
- QVERIFY(aboutToBlockSpy.count() > 0);
- QVERIFY(awakeSpy.count() > 0);
// We should get one awake for each aboutToBlock, plus one awake when
- // processEvents is entered.
+ // processEvents is entered. There is no guarantee that that the
+ // processEvents call actually blocked, since the OS may introduce
+ // native events at any time.
+ QVERIFY(awakeSpy.count() > 0);
QVERIFY(awakeSpy.count() >= aboutToBlockSpy.count());
killTimer(timerId);
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 88984feff7..d424e6086d 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -139,6 +139,7 @@ private slots:
void formattedDataSize_data();
void formattedDataSize();
+ void bcp47Name();
private:
QString m_decimal, m_thousand, m_sdate, m_ldate, m_time;
@@ -2609,5 +2610,26 @@ void tst_QLocale::formattedDataSize()
QCOMPARE(QLocale(language).formattedDataSize(bytes, decimalPlaces, units), output);
}
+void tst_QLocale::bcp47Name()
+{
+ QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("en"));
+ QCOMPARE(QLocale("en").bcp47Name(), QStringLiteral("en"));
+ QCOMPARE(QLocale("en_US").bcp47Name(), QStringLiteral("en"));
+ QCOMPARE(QLocale("en_GB").bcp47Name(), QStringLiteral("en-GB"));
+ QCOMPARE(QLocale("en_DE").bcp47Name(), QStringLiteral("en-DE"));
+ QCOMPARE(QLocale("de_DE").bcp47Name(), QStringLiteral("de"));
+ QCOMPARE(QLocale("sr_RS").bcp47Name(), QStringLiteral("sr"));
+ QCOMPARE(QLocale("sr_Cyrl_RS").bcp47Name(), QStringLiteral("sr"));
+ QCOMPARE(QLocale("sr_Latn_RS").bcp47Name(), QStringLiteral("sr-Latn"));
+ QCOMPARE(QLocale("sr_ME").bcp47Name(), QStringLiteral("sr-ME"));
+ QCOMPARE(QLocale("sr_Cyrl_ME").bcp47Name(), QStringLiteral("sr-Cyrl-ME"));
+ QCOMPARE(QLocale("sr_Latn_ME").bcp47Name(), QStringLiteral("sr-ME"));
+
+ // Fall back to defaults when country isn't in CLDR for this language:
+ QCOMPARE(QLocale("sr_HR").bcp47Name(), QStringLiteral("sr"));
+ QCOMPARE(QLocale("sr_Cyrl_HR").bcp47Name(), QStringLiteral("sr"));
+ QCOMPARE(QLocale("sr_Latn_HR").bcp47Name(), QStringLiteral("sr-Latn"));
+}
+
QTEST_MAIN(tst_QLocale)
#include "tst_qlocale.moc"
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index 9e257267ca..11896d2f15 100644
--- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
@@ -56,7 +56,7 @@ class tst_QDBusAbstractInterface: public QObject
return Pinger();
if (service.isEmpty() && !service.isNull())
service = con.baseService();
- return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con));
+ return Pinger::create(service, path, con);
}
Pinger getPingerPeer(const QString &path = "/", const QString &service = "")
@@ -64,7 +64,7 @@ class tst_QDBusAbstractInterface: public QObject
QDBusConnection con = QDBusConnection("peer");
if (!con.isConnected())
return Pinger();
- return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con));
+ return Pinger::create(service, path, con);
}
void resetServer()
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index cff26be7bb..2f5537adfe 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -117,6 +117,9 @@ private slots:
void useCase2();
void useCase3();
+ void setNullChild();
+ void deleteChild();
+
void rootItemFlags();
#ifdef QT_BUILD_INTERNAL
void treeDragAndDrop();
@@ -1364,6 +1367,30 @@ void tst_QStandardItemModel::useCase3()
delete childItem;
}
+void tst_QStandardItemModel::setNullChild()
+{
+ QStandardItemModel model;
+ model.setColumnCount(2);
+ createChildren(&model, model.invisibleRootItem(), 0);
+ QStandardItem *item = model.item(0);
+ QSignalSpy spy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
+ item->setChild(0, nullptr);
+ QCOMPARE(item->child(0), nullptr);
+ QCOMPARE(spy.count(), 1);
+}
+
+void tst_QStandardItemModel::deleteChild()
+{
+ QStandardItemModel model;
+ model.setColumnCount(2);
+ createChildren(&model, model.invisibleRootItem(), 0);
+ QStandardItem *item = model.item(0);
+ QSignalSpy spy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)));
+ delete item->child(0);
+ QCOMPARE(item->child(0), nullptr);
+ QCOMPARE(spy.count(), 1);
+}
+
void tst_QStandardItemModel::rootItemFlags()
{
QStandardItemModel model(6, 4);
diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST
index 2303d9380e..03acb2f5b0 100644
--- a/tests/auto/gui/kernel/qguieventloop/BLACKLIST
+++ b/tests/auto/gui/kernel/qguieventloop/BLACKLIST
@@ -1,4 +1,2 @@
-[processEvents]
-osx-10.12
[testQuitLock]
osx-10.12
diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp
index a1c8399a26..3711ce431c 100644
--- a/tests/auto/network/access/qftp/tst_qftp.cpp
+++ b/tests/auto/network/access/qftp/tst_qftp.cpp
@@ -205,7 +205,7 @@ void tst_QFtp::initTestCase()
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager manager;
- networkSessionImplicit = QSharedPointer<QNetworkSession>(new QNetworkSession(manager.defaultConfiguration()));
+ networkSessionImplicit = QSharedPointer<QNetworkSession>::create(manager.defaultConfiguration());
networkSessionImplicit->open();
QVERIFY(networkSessionImplicit->waitForOpened(60000)); //there may be user prompt on 1st connect
#endif
diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST
index cf25c96fd8..5adb05d3f2 100644
--- a/tests/auto/network/socket/qudpsocket/BLACKLIST
+++ b/tests/auto/network/socket/qudpsocket/BLACKLIST
@@ -6,7 +6,6 @@ osx
windows
osx
[asyncReadDatagram]
-windows
osx
[multicastLeaveAfterClose]
osx
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 43d0781083..af7cf24838 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -213,7 +213,7 @@ void tst_QUdpSocket::initTestCase_data()
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
networkConfiguration = netConfMan->defaultConfiguration();
- networkSession = QSharedPointer<QNetworkSession>(new QNetworkSession(networkConfiguration));
+ networkSession = QSharedPointer<QNetworkSession>::create(networkConfiguration);
if (!networkSession->isOpen()) {
networkSession->open();
QVERIFY(networkSession->waitForOpened(30000));
diff --git a/tests/auto/other/macgui/BLACKLIST b/tests/auto/other/macgui/BLACKLIST
index 2b6a0e2fe8..5a5d6a175f 100644
--- a/tests/auto/other/macgui/BLACKLIST
+++ b/tests/auto/other/macgui/BLACKLIST
@@ -1,3 +1,2 @@
[nonModalOrder]
-osx-10.11 ci
-osx-10.12 ci
+osx
diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp
index c6fc67f998..75fa4815c9 100644
--- a/tests/auto/other/macgui/tst_macgui.cpp
+++ b/tests/auto/other/macgui/tst_macgui.cpp
@@ -190,7 +190,6 @@ void tst_MacGui::nonModalOrder()
primary.resize(400, 400);
primary.move(100, 100);
primary.exec();
- QEXPECT_FAIL("", "Non-modal child windows show behind the modal dialig", Abort);
QCOMPARE(primary.frontWidget, primary.secondaryWindow);
}
diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST
index 5be479a6b1..674e62144a 100644
--- a/tests/auto/other/macnativeevents/BLACKLIST
+++ b/tests/auto/other/macnativeevents/BLACKLIST
@@ -21,10 +21,6 @@ osx
osx
[testMouseDragToNonClientArea]
osx
-# QTQAINFRA-1292
-[testPushButtonPressRelease]
-osx-10.11 ci
-
# The following key tests fail after switching to synchronous
# expose events, and we don't know why yet. QTBUG-62042
[testKeyPressOnToplevel]
@@ -35,3 +31,9 @@ osx
osx
[testModifierCtrl]
osx
+# QTQAINFRA-1292
+[testPushButtonPressRelease]
+osx-10.11 ci
+# QTQAINFRA-1292
+[testModifierCtrlWithDontSwapCtrlAndMeta]
+osx-10.12 ci
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 4f60fe3d96..4ffdc4c762 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -3344,7 +3344,7 @@ void tst_QAccessibility::tableTest()
void tst_QAccessibility::calendarWidgetTest()
{
-#ifndef QT_NO_CALENDARWIDGET
+#if QT_CONFIG(calendarwidget)
{
QCalendarWidget calendarWidget;
@@ -3420,12 +3420,12 @@ void tst_QAccessibility::calendarWidgetTest()
}
QTestAccessibility::clearEvents();
-#endif // QT_NO_CALENDARWIDGET
+#endif // QT_CONFIG(calendarwidget)
}
void tst_QAccessibility::dockWidgetTest()
{
-#ifndef QT_NO_DOCKWIDGET
+#if QT_CONFIG(dockwidget)
// Set up a proper main window with two dock widgets
QMainWindow *mw = new QMainWindow();
QFrame *central = new QFrame(mw);
@@ -3558,7 +3558,7 @@ void tst_QAccessibility::dockWidgetTest()
delete mw;
QTestAccessibility::clearEvents();
-#endif // QT_NO_DOCKWIDGET
+#endif // QT_CONFIG(dockwidget)
}
void tst_QAccessibility::comboBoxTest()
diff --git a/tests/auto/other/qaccessibilitymac/BLACKLIST b/tests/auto/other/qaccessibilitymac/BLACKLIST
new file mode 100644
index 0000000000..f53fa7e853
--- /dev/null
+++ b/tests/auto/other/qaccessibilitymac/BLACKLIST
@@ -0,0 +1,2 @@
+[hierarchyTest]
+osx-10.12 ci
diff --git a/tests/auto/other/qfocusevent/BLACKLIST b/tests/auto/other/qfocusevent/BLACKLIST
new file mode 100644
index 0000000000..502820fa12
--- /dev/null
+++ b/tests/auto/other/qfocusevent/BLACKLIST
@@ -0,0 +1,5 @@
+[checkReason_Shortcut]
+osx-10.12 ci
+[checkReason_ActiveWindow]
+osx-10.12 ci
+
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 8deb5ddf8f..35f86772e2 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -243,6 +243,9 @@ private slots:
void integralTypesMysql_data() { generic_data("QMYSQL"); }
void integralTypesMysql();
+ void QTBUG_57138_data() { generic_data("QSQLITE"); }
+ void QTBUG_57138();
+
private:
// returns all database connections
void generic_data(const QString &engine=QString());
@@ -4083,5 +4086,40 @@ void tst_QSqlQuery::integralTypesMysql()
}
}
+void tst_QSqlQuery::QTBUG_57138()
+{
+ QDateTime utc = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::UTC);
+ QDateTime localtime = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::LocalTime);
+ QDateTime tzoffset = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::OffsetFromUTC, 3600);
+
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlQuery create(db);
+ QString tableName = qTableName("qtbug57138", __FILE__, db);
+
+ QVERIFY_SQL(create, exec("create table " + tableName + " (id int, dt_utc datetime, dt_lt datetime, dt_tzoffset datetime)"));
+ QVERIFY_SQL(create, prepare("insert into " + tableName + " (id, dt_utc, dt_lt, dt_tzoffset) values (?, ?, ?, ?)"));
+
+ create.addBindValue(0);
+ create.addBindValue(utc);
+ create.addBindValue(localtime);
+ create.addBindValue(tzoffset);
+
+ QVERIFY_SQL(create, exec());
+
+ QSqlQuery q(db);
+ q.prepare("SELECT dt_utc, dt_lt, dt_tzoffset FROM " + tableName + " WHERE id = ?");
+ q.addBindValue(0);
+
+ QVERIFY_SQL(q, exec());
+ QVERIFY(q.next());
+
+ QCOMPARE(q.value(0).toDateTime(), utc);
+ QCOMPARE(q.value(1).toDateTime(), localtime);
+ QCOMPARE(q.value(2).toDateTime(), tzoffset);
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
index a0273513f7..62286d703f 100644
--- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
+++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
@@ -260,6 +260,14 @@ void tst_QInputDialog::getInt()
QFETCH(int, min);
QFETCH(int, max);
QVERIFY(min < max);
+
+#if defined(Q_OS_MACOS)
+ if (QSysInfo::productVersion() == QLatin1String("10.12")) {
+ QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1356");
+ return;
+ }
+#endif
+
parent = new QWidget;
doneCode = QDialog::Accepted;
testFunc = &tst_QInputDialog::testFuncGetInt;
@@ -300,6 +308,14 @@ void tst_QInputDialog::getDouble()
QFETCH(double, max);
QFETCH(int, decimals);
QVERIFY(min < max && decimals >= 0 && decimals <= 13);
+
+#if defined(Q_OS_MACOS)
+ if (QSysInfo::productVersion() == QLatin1String("10.12")) {
+ QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1356");
+ return;
+ }
+#endif
+
parent = new QWidget;
doneCode = QDialog::Accepted;
testFunc = &tst_QInputDialog::testFuncGetDouble;
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index c75c1dc87e..a27e0b6048 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -3442,7 +3442,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_Right << Qt::Key_Down;
- model.reset(new QStandardItemModel(4, 2));
+ model = QSharedPointer<QStandardItemModel>::create(4, 2);
QTest::newRow("row span, top down")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1);
@@ -3455,7 +3455,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_End << Qt::Key_Down << Qt::Key_Left;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("row span, right to left")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1);
@@ -3468,7 +3468,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_PageDown << Qt::Key_Right;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("row span, left to right")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1);
@@ -3481,7 +3481,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_PageDown << Qt::Key_Up;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, bottom up")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 0) << model->index(1, 0);
@@ -3494,7 +3494,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_PageDown << Qt::Key_Right << Qt::Key_Up;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, bottom up #2")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 1) << model->index(1, 0);
@@ -3507,7 +3507,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_End << Qt::Key_Down;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, top down")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0);
}
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 21575fbaf9..5648218d04 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -48,6 +48,7 @@ osx
[showMinimizedKeepsFocus]
osx-10.10
osx-10.11 ci
+osx-10.12 ci
[moveWindowInShowEvent:1]
osx
[moveWindowInShowEvent:2]
@@ -75,3 +76,5 @@ osx
ubuntu-14.04
[moveChild:right]
osx
+[activateWindow]
+osx-10.12 ci
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 3da26613bb..096beedf63 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -4954,8 +4954,7 @@ static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height)
{
QScreen *screen = window->screen();
Q_ASSERT(screen);
- QPixmap result = screen->grabWindow(window->winId(), x, y, width, height);
- return result.devicePixelRatio() > 1 ? result.scaled(width, height) : result;
+ return screen->grabWindow(window->winId(), x, y, width, height);
}
#define VERIFY_COLOR(child, region, color) verifyColor(child, region, color, __LINE__)
@@ -4973,7 +4972,8 @@ bool verifyColor(QWidget &child, const QRegion &region, const QColor &color, uns
const QPixmap pixmap = grabBackingStore
? child.grab(rect)
: grabWindow(window, rect.left(), rect.top(), rect.width(), rect.height());
- if (!QTest::qCompare(pixmap.size(), rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine))
+ const QSize actualSize = pixmap.size() / pixmap.devicePixelRatioF();
+ if (!QTest::qCompare(actualSize, rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine))
return false;
QPixmap expectedPixmap(pixmap); /* ensure equal formats */
expectedPixmap.detach();
@@ -5718,6 +5718,8 @@ void tst_QWidget::setToolTip()
QTest::qWait(2200); // delay is 2000
QTest::mouseMove(popupWindow);
}
+
+ QTRY_COMPARE(QApplication::topLevelWidgets().size(), 1);
}
void tst_QWidget::testWindowIconChangeEventPropagation()
@@ -5755,14 +5757,14 @@ void tst_QWidget::testWindowIconChangeEventPropagation()
QList <EventSpyPtr> applicationEventSpies;
QList <EventSpyPtr> widgetEventSpies;
foreach (QWidget *widget, widgets) {
- applicationEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::ApplicationWindowIconChange)));
- widgetEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::WindowIconChange)));
+ applicationEventSpies.append(EventSpyPtr::create(widget, QEvent::ApplicationWindowIconChange));
+ widgetEventSpies.append(EventSpyPtr::create(widget, QEvent::WindowIconChange));
}
QList <WindowEventSpyPtr> appWindowEventSpies;
QList <WindowEventSpyPtr> windowEventSpies;
foreach (QWindow *window, windows) {
- appWindowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::ApplicationWindowIconChange)));
- windowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::WindowIconChange)));
+ appWindowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::ApplicationWindowIconChange));
+ windowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::WindowIconChange));
}
// QApplication::setWindowIcon
@@ -10341,7 +10343,8 @@ public slots:
QPoint point2(15, 20);
QPoint point3(20, 20);
QWindow *window = modal->windowHandle();
- QWindowSystemInterface::handleEnterEvent(window, point1, window->mapToGlobal(point1));
+ const QPoint nativePoint1 = QHighDpi::toNativePixels(point1, window->screen());
+ QWindowSystemInterface::handleEnterEvent(window, nativePoint1);
QTest::mouseMove(window, point1);
QTest::mouseMove(window, point2);
QTest::mouseMove(window, point3);
diff --git a/tests/auto/widgets/styles/qstyle/task_25863.png b/tests/auto/widgets/styles/qstyle/task_25863.png
deleted file mode 100644
index a2de8d6f78..0000000000
--- a/tests/auto/widgets/styles/qstyle/task_25863.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc
index c16b9be775..29bb46726e 100644
--- a/tests/auto/widgets/styles/qstyle/testdata.qrc
+++ b/tests/auto/widgets/styles/qstyle/testdata.qrc
@@ -15,6 +15,5 @@
<file>images/vista/radiobutton.png</file>
<file>images/vista/slider.png</file>
<file>images/vista/spinbox.png</file>
- <file>task_25863.png</file>
</qresource>
</RCC>
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index 3607f1ba92..d5ef2fe94b 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -58,6 +58,8 @@
#include <qscrollarea.h>
#include <qwidget.h>
+#include <algorithm>
+
// Make a widget frameless to prevent size constraints of title bars
// from interfering (Windows).
static inline void setFrameless(QWidget *w)
@@ -197,13 +199,12 @@ void tst_QStyle::drawItemPixmap()
testWidget->resize(300, 300);
testWidget->showNormal();
- const QString imageFileName = QFINDTESTDATA("task_25863.png");
- QVERIFY(!imageFileName.isEmpty());
-
- QPixmap p(imageFileName, "PNG");
- const QPixmap actualPix = testWidget->grab();
-
- QCOMPARE(actualPix, p);
+ QImage image = testWidget->grab().toImage();
+ const QRgb green = QColor(Qt::green).rgb();
+ QVERIFY(image.reinterpretAsFormat(QImage::Format_RGB32));
+ const QRgb *bits = reinterpret_cast<const QRgb *>(image.constBits());
+ const QRgb *end = bits + image.byteCount() / sizeof(QRgb);
+ QVERIFY(std::all_of(bits, end, [green] (QRgb r) { return r == green; }));
testWidget->hide();
}
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 3e21c4ecab..8f0dd10940 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -147,6 +147,7 @@ private slots:
void keypress_inputMask_data();
void keypress_inputMask();
+ void keypress_inputMethod_inputMask();
void inputMaskAndValidator_data();
void inputMaskAndValidator();
@@ -803,6 +804,37 @@ void tst_QLineEdit::keypress_inputMask()
QCOMPARE(testWidget->displayText(), expectedDisplayText);
}
+void tst_QLineEdit::keypress_inputMethod_inputMask()
+{
+ // Similar to the keypress_inputMask test, but this is done solely via
+ // input methods
+ QLineEdit *testWidget = ensureTestWidget();
+ testWidget->setInputMask("AA.AA.AA");
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("EE");
+ QApplication::sendEvent(testWidget, &event);
+ }
+ QCOMPARE(testWidget->cursorPosition(), 3);
+ QCOMPARE(testWidget->text(), QStringLiteral("EE.."));
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("EE");
+ QApplication::sendEvent(testWidget, &event);
+ }
+ QCOMPARE(testWidget->cursorPosition(), 6);
+ QCOMPARE(testWidget->text(), QStringLiteral("EE.EE."));
+ {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event("", attributes);
+ event.setCommitString("EE");
+ QApplication::sendEvent(testWidget, &event);
+ }
+ QCOMPARE(testWidget->cursorPosition(), 8);
+ QCOMPARE(testWidget->text(), QStringLiteral("EE.EE.EE"));
+}
void tst_QLineEdit::hasAcceptableInputMask_data()
{
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 680fea27dd..292080c55f 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -29,8 +29,10 @@
#include <QtTest/QtTest>
-
+#include <QtWidgets/qtwidgetsglobal.h>
+#if QT_CONFIG(dockwidget)
#include <qdockwidget.h>
+#endif
#include <qlayout.h>
#include <qmainwindow.h>
#include <qmenubar.h>
@@ -45,7 +47,7 @@
#include <private/qmainwindowlayout_p.h>
#include <private/qdockarealayout_p.h>
-#ifndef QT_NO_TABBAR
+#if QT_CONFIG(tabbar)
#include <qtabbar.h>
#endif
@@ -148,7 +150,7 @@ private slots:
void QTBUG21378_animationFinished();
void resizeDocks();
void resizeDocks_data();
-#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR)
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar)
void QTBUG52175_tabifiedDockWidgetActivated();
#endif
};
@@ -2044,7 +2046,7 @@ void tst_QMainWindow::resizeDocks()
}
}
-#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR)
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar)
void tst_QMainWindow::QTBUG52175_tabifiedDockWidgetActivated()
{
QMainWindow w;
diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST
index 92a810bc84..1c970c43b3 100644
--- a/tests/auto/widgets/widgets/qmenu/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST
@@ -2,6 +2,7 @@
osx
[submenuTearOffDontClose]
osx-10.11 ci
+osx-10.12 ci
[layoutDirection]
# Fails when enabling synchronous expose events QTBUG-62092
osx ci