From 21674735ccd029c17dc8b36211e9b5bc3595ba34 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 2 Jun 2015 16:20:28 +0200 Subject: Rename QTextStream::readLine(QString *, qint64) into readLineInto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed on the development mailing list, the new overload is ambiguous and breaks source compatibility. Therefore this function that is new in 5.5 shall be called readLineInto. Change-Id: I2aecb8441af4edb72f16d0bc6dabf10cdabf32e2 Reviewed-by: Jan Kundrát Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index aa7a3762ce..36da3b8770 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -81,7 +81,7 @@ private slots: void readLineMaxlen_data(); void readLineMaxlen(); void readLinesFromBufferCRCR(); - void readLineOverload(); + void readLineInto(); // all void readAllFromDevice_data(); @@ -612,22 +612,22 @@ protected: } }; -void tst_QTextStream::readLineOverload() +void tst_QTextStream::readLineInto() { QByteArray data = "1\n2\n3"; QTextStream ts(&data); QString line; - ts.readLine(&line); + ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("1")); - ts.readLine(Q_NULLPTR, 0); // read the second line, but don't store it + ts.readLineInto(Q_NULLPTR, 0); // read the second line, but don't store it - ts.readLine(&line); + ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("3")); - QVERIFY(!ts.readLine(&line)); + QVERIFY(!ts.readLineInto(&line)); QVERIFY(line.isEmpty()); QFile file(m_rfc3261FilePath); @@ -637,7 +637,7 @@ void tst_QTextStream::readLineOverload() line.reserve(1); int maxLineCapacity = line.capacity(); - while (ts.readLine(&line)) { + while (ts.readLineInto(&line)) { QVERIFY(line.capacity() >= maxLineCapacity); maxLineCapacity = line.capacity(); } @@ -647,7 +647,7 @@ void tst_QTextStream::readLineOverload() QVERIFY(errorDevice.open(QIODevice::ReadOnly)); ts.setDevice(&errorDevice); - QVERIFY(!ts.readLine(&line)); + QVERIFY(!ts.readLineInto(&line)); QVERIFY(line.isEmpty()); } @@ -1025,7 +1025,7 @@ void tst_QTextStream::performance() QTextStream stream2(&file3); QString line; - while (stream2.readLine(&line)) + while (stream2.readLineInto(&line)) ++nlines3; elapsed[2] = stopWatch.elapsed(); -- cgit v1.2.3 From 8f760808e0fe0fe6dd89d561f118b19ed8085e7a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 6 May 2015 14:23:57 +0200 Subject: Fix premul conversion from ARGB32 to A2RGB30 formats. When a premultiplied alpha changes value because it is rounded to fewer bits the premultiplied colors may need to be recalculated with the new value. Otherwise the color will both be wrong and potentially invalid. Change-Id: I9ec74a22aac73cd7ffab04e180cf2bf35bb4c315 Reviewed-by: Gunnar Sletta --- tests/auto/gui/image/qimage/tst_qimage.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index da29a57f98..f7c71f05bd 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -190,6 +190,8 @@ private slots: void devicePixelRatio(); void rgb30Unpremul(); + void rgb30Repremul_data(); + void rgb30Repremul(); void metadataPassthrough(); @@ -2946,6 +2948,31 @@ void tst_QImage::rgb30Unpremul() QCOMPARE(bbits[2], (3U << 30) | (201 << 20) | (393 << 10) | 777); } +void tst_QImage::rgb30Repremul_data() +{ + QTest::addColumn("color"); + for (int i = 255; i > 0; i -= 15) { + QTest::newRow(qPrintable(QStringLiteral("100% red=") + QString::number(i))) << qRgba(i, 0, 0, 0xff); + QTest::newRow(qPrintable(QStringLiteral("75% red=") + QString::number(i))) << qRgba(i, 0, 0, 0xc0); + QTest::newRow(qPrintable(QStringLiteral("50% red=") + QString::number(i))) << qRgba(i, 0, 0, 0x80); + QTest::newRow(qPrintable(QStringLiteral("37.5% red=") + QString::number(i))) << qRgba(i, 0, 0, 0x60); + } +} + +void tst_QImage::rgb30Repremul() +{ + QFETCH(uint, color); + + QImage a(1, 1, QImage::Format_ARGB32); + a.setPixel(0, 0, color); + + QImage b = a.convertToFormat(QImage::Format_A2BGR30_Premultiplied); + b = b.convertToFormat(QImage::Format_ARGB32); + uint expectedColor = qUnpremultiply(qPremultiply(color)); + uint newColor = b.pixel(0, 0); + QVERIFY(qAbs(qRed(newColor) - qRed(expectedColor)) <= 1); +} + void tst_QImage::metadataPassthrough() { QImage a(64, 64, QImage::Format_ARGB32); -- cgit v1.2.3 From f04ed82ca2ca7b1e4e2bbb79bec02ce932e11e48 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 13 May 2015 15:33:26 +0200 Subject: Font definitions with different style names are not equal Since we added font matching by style name, the style name is not just a derived property and should not be ignored in comparisons. The QFontDef::exactMatch comparison is left unchanged, since it tests if a loaded font matches a requested one. Task-number: QTBUG-30851 Change-Id: I4187c5b993815001f35bcf24dc449059bfdcba6f Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp index bac72f0365..796b4b9fdb 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp @@ -225,6 +225,8 @@ void tst_QFontDialog::qtbug_41513_stylesheetStyle() QFontDialog::DontUseNativeDialog); QVERIFY(accepted); + // The fontdialog sets the styleName, when the fontdatabase knows the style name. + resultFont.setStyleName(testFont.styleName()); QCOMPARE(resultFont, testFont); // reset stylesheet -- cgit v1.2.3 From d32f47b70387713335656a8e93f289c819fb9b05 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2015 17:04:53 +0200 Subject: fix usage of wince scope Fix style issues along the way. Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9 Reviewed-by: Joerg Bornemann --- tests/auto/auto.pro | 2 +- tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro | 2 +- tests/auto/corelib/io/largefile/largefile.pro | 2 +- tests/auto/corelib/io/qfile/test/test.pro | 2 +- tests/auto/corelib/io/qfileinfo/qfileinfo.pro | 2 +- tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro | 2 +- tests/auto/corelib/kernel/qeventloop/qeventloop.pro | 2 +- tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro | 2 +- tests/auto/corelib/plugin/qlibrary/lib/lib.pro | 2 +- tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro | 2 +- tests/auto/corelib/tools/qsharedpointer/externaltests.pri | 2 +- tests/auto/gui/image/qicoimageformat/qicoimageformat.pro | 2 +- tests/auto/gui/image/qpixmap/qpixmap.pro | 2 +- tests/auto/gui/kernel/qwindow/qwindow.pro | 2 +- tests/auto/network/access/qftp/qftp.pro | 2 +- tests/auto/network/access/qnetworkreply/qnetworkreply.pro | 2 +- tests/auto/network/kernel/qhostaddress/qhostaddress.pro | 2 +- tests/auto/network/kernel/qhostinfo/qhostinfo.pro | 2 +- .../network/socket/platformsocketengine/platformsocketengine.pri | 2 +- tests/auto/network/socket/qtcpserver/test/test.pro | 2 +- tests/auto/network/socket/qtcpsocket/qtcpsocket.pro | 5 ++--- tests/auto/network/socket/qtcpsocket/test/test.pro | 2 +- tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro | 2 +- tests/auto/network/ssl/qsslcipher/qsslcipher.pro | 2 +- tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro | 2 +- tests/auto/network/ssl/qsslerror/qsslerror.pro | 2 +- tests/auto/network/ssl/qsslkey/qsslkey.pro | 2 +- tests/auto/network/ssl/qsslsocket/qsslsocket.pro | 2 +- .../qsslsocket_onDemandCertificates_member.pro | 2 +- .../qsslsocket_onDemandCertificates_static.pro | 2 +- tests/auto/other/other.pro | 2 +- tests/auto/other/qaccessibility/qaccessibility.pro | 2 +- tests/auto/sql/kernel/qsql/qsql.pro | 2 +- tests/auto/sql/kernel/qsqldatabase/qsqldatabase.pro | 4 ++-- tests/auto/sql/kernel/qsqldriver/qsqldriver.pro | 2 +- tests/auto/sql/kernel/qsqlquery/qsqlquery.pro | 4 ++-- tests/auto/sql/kernel/qsqlthread/qsqlthread.pro | 2 +- tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro | 2 +- .../sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro | 2 +- tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro | 2 +- tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro | 2 +- tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro | 2 +- tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro | 4 ++-- tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro | 2 +- tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro | 2 +- tests/auto/widgets/itemviews/qlistview/qlistview.pro | 2 +- tests/auto/widgets/kernel/qapplication/qapplication.pro | 2 +- tests/auto/widgets/kernel/qapplication/test/test.pro | 2 +- tests/auto/widgets/kernel/qwidget/qwidget.pro | 2 +- tests/auto/widgets/styles/styles.pro | 2 +- tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro | 2 +- tests/benchmarks/gui/image/qimagereader/qimagereader.pro | 2 +- tests/manual/manual.pro | 2 +- 53 files changed, 57 insertions(+), 58 deletions(-) (limited to 'tests') diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index a46b8af4ff..6f06ba591f 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -21,7 +21,7 @@ installed_cmake.depends = cmake ios: SUBDIRS = corelib gui -wince*: SUBDIRS -= printsupport +wince: SUBDIRS -= printsupport cross_compile: SUBDIRS -= tools !qtHaveModule(opengl): SUBDIRS -= opengl !qtHaveModule(gui): SUBDIRS -= gui cmake diff --git a/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro index 0bcf067c4f..9f2e4f9c92 100644 --- a/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro +++ b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs SUBDIRS = test -!wince*:SUBDIRS += echo +!wince: SUBDIRS += echo diff --git a/tests/auto/corelib/io/largefile/largefile.pro b/tests/auto/corelib/io/largefile/largefile.pro index 55878196cd..d9938d07d5 100644 --- a/tests/auto/corelib/io/largefile/largefile.pro +++ b/tests/auto/corelib/io/largefile/largefile.pro @@ -3,5 +3,5 @@ TARGET = tst_largefile QT = core testlib SOURCES = tst_largefile.cpp -wince*: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp +wince: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 03863e9943..9aa4119795 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -7,7 +7,7 @@ else: DEFINES += QT_NO_NETWORK TARGET = ../tst_qfile SOURCES = ../tst_qfile.cpp -wince*: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp +wince: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp RESOURCES += ../qfile.qrc ../rename-fallback.qrc ../copy-fallback.qrc diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index aa5a9d92f1..de99447404 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -5,5 +5,5 @@ SOURCES = tst_qfileinfo.cpp RESOURCES += qfileinfo.qrc \ testdata.qrc -win32*:!wince*:!winrt:LIBS += -ladvapi32 -lnetapi32 +win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro index 7f3b8ade3e..b59241851f 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro +++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro @@ -1,6 +1,6 @@ win32 { SOURCES = main_win.cpp - !wince*:LIBS += -luser32 + !wince: LIBS += -luser32 } unix { SOURCES = main_unix.cpp diff --git a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro index 5593aa2430..ea4792fc1c 100644 --- a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro +++ b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro @@ -4,7 +4,7 @@ TARGET = tst_qeventloop QT = core network testlib core-private SOURCES = $$PWD/tst_qeventloop.cpp -win32:!wince*:!winrt:LIBS += -luser32 +win32:!wince:!winrt: LIBS += -luser32 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 contains(QT_CONFIG, glib): DEFINES += HAVE_GLIB diff --git a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro index 8823d54590..b08dfb1838 100644 --- a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro +++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro @@ -2,7 +2,7 @@ CONFIG -= app_bundle debug_and_release CONFIG += console DESTDIR = ./ QT = core -wince*: { +wince { LIBS += coredll.lib } diff --git a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro index a92b4faca5..195e48da93 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro @@ -6,7 +6,7 @@ TARGET = mylib DESTDIR = ../ QT = core -wince*: DEFINES += WIN32_MSVC +wince: DEFINES += WIN32_MSVC win32-msvc: DEFINES += WIN32_MSVC # This project is testdata for tst_qlibrary diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro index dc6a660c0a..52dd8b9679 100644 --- a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro +++ b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro @@ -7,7 +7,7 @@ DESTDIR = ../ VERSION = 2 QT = core -wince*: DEFINES += WIN32_MSVC +wince: DEFINES += WIN32_MSVC win32-msvc: DEFINES += WIN32_MSVC # Force a copy of the library to have an extension that is non-standard. diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri index b3a01f7990..cac94bb522 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri @@ -4,4 +4,4 @@ cleanedQMAKESPEC = $$replace(QMAKESPEC, \\\\, /) DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\" cross_compile:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED -wince*:DEFINES += QTEST_CROSS_COMPILED QTEST_NO_RTTI +wince: DEFINES += QTEST_CROSS_COMPILED QTEST_NO_RTTI diff --git a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro index a58336e511..7ed69ce1d1 100644 --- a/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/gui/image/qicoimageformat/qicoimageformat.pro @@ -4,7 +4,7 @@ TARGET = tst_qicoimageformat SOURCES+= tst_qicoimageformat.cpp QT += testlib -wince*: { +wince { CONFIG(debug, debug|release):{ addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll } else { diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro index 33c301a500..5a4656998a 100644 --- a/tests/auto/gui/image/qpixmap/qpixmap.pro +++ b/tests/auto/gui/image/qpixmap/qpixmap.pro @@ -5,7 +5,7 @@ QT += core-private gui-private testlib qtHaveModule(widgets): QT += widgets widgets-private SOURCES += tst_qpixmap.cpp -!wince*:!winrt { +!wince:!winrt { win32:LIBS += -lgdi32 -luser32 } diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro index 5210585796..08e1b1d3a0 100644 --- a/tests/auto/gui/kernel/qwindow/qwindow.pro +++ b/tests/auto/gui/kernel/qwindow/qwindow.pro @@ -5,4 +5,4 @@ QT += core-private gui-private testlib SOURCES += tst_qwindow.cpp -contains(QT_CONFIG,dynamicgl):win32:!wince*:!winrt: LIBS += -luser32 +contains(QT_CONFIG,dynamicgl):win32:!wince:!winrt: LIBS += -luser32 diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro index 44161f4e1e..850e1a9417 100644 --- a/tests/auto/network/access/qftp/qftp.pro +++ b/tests/auto/network/access/qftp/qftp.pro @@ -5,7 +5,7 @@ SOURCES += tst_qftp.cpp requires(contains(QT_CONFIG,private_tests)) QT = core network network-private testlib -wince*: { +wince { addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro index 885e7f15b6..7cb6fddbaf 100644 --- a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro +++ b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs -!wince*:SUBDIRS += echo +!wince: SUBDIRS += echo test.depends += $$SUBDIRS SUBDIRS += test diff --git a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro index 421685d855..f349cab976 100644 --- a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro +++ b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro @@ -7,7 +7,7 @@ SOURCES += tst_qhostaddress.cpp QT = core network testlib win32: { -wince*: { +wince { LIBS += -lws2 } else { LIBS += -lws2_32 diff --git a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro index 4fca7950dd..c9b795d098 100644 --- a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro +++ b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro @@ -6,7 +6,7 @@ SOURCES += tst_qhostinfo.cpp requires(contains(QT_CONFIG,private_tests)) QT = core-private network-private testlib -wince*: { +wince { LIBS += ws2.lib } else { win32:LIBS += -lws2_32 diff --git a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri index 15f31fdbb5..a3b4e89450 100644 --- a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri +++ b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri @@ -5,7 +5,7 @@ QNETWORK_SRC = $$QT_SOURCE_TREE/src/network INCLUDEPATH += $$QNETWORK_SRC win32 { - wince*: { + wince { LIBS += -lws2 } else { LIBS += -lws2_32 diff --git a/tests/auto/network/socket/qtcpserver/test/test.pro b/tests/auto/network/socket/qtcpserver/test/test.pro index 4daa9963ce..f0abfbc085 100644 --- a/tests/auto/network/socket/qtcpserver/test/test.pro +++ b/tests/auto/network/socket/qtcpserver/test/test.pro @@ -2,7 +2,7 @@ CONFIG += testcase SOURCES += ../tst_qtcpserver.cpp win32: { -wince*: { +wince { LIBS += -lws2 crashApp.files = ../crashingServer/crashingServer.exe crashApp.path = crashingServer diff --git a/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro b/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro index 347359f508..fe6042b8a7 100644 --- a/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro +++ b/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro @@ -1,7 +1,6 @@ TEMPLATE = subdirs - -!wince*: SUBDIRS = test stressTest -wince*|vxworks* : SUBDIRS = test +SUBDIRS = test +!wince:!vxworks: SUBDIRS += stressTest requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/network/socket/qtcpsocket/test/test.pro b/tests/auto/network/socket/qtcpsocket/test/test.pro index 6c6697bfdc..3e64b87b53 100644 --- a/tests/auto/network/socket/qtcpsocket/test/test.pro +++ b/tests/auto/network/socket/qtcpsocket/test/test.pro @@ -3,7 +3,7 @@ CONFIG += testcase QT = core-private network-private testlib SOURCES += ../tst_qtcpsocket.cpp win32: { -wince*: { +wince { LIBS += -lws2 } else { LIBS += -lws2_32 diff --git a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro index f2d6589410..26d6424a97 100644 --- a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro @@ -2,7 +2,7 @@ CONFIG += testcase CONFIG += parallel_test SOURCES += tst_qsslcertificate.cpp -!wince*:win32:LIBS += -lws2_32 +!wince:win32:LIBS += -lws2_32 QT = core network testlib TARGET = tst_qsslcertificate diff --git a/tests/auto/network/ssl/qsslcipher/qsslcipher.pro b/tests/auto/network/ssl/qsslcipher/qsslcipher.pro index a091bd0184..36e3c29b31 100644 --- a/tests/auto/network/ssl/qsslcipher/qsslcipher.pro +++ b/tests/auto/network/ssl/qsslcipher/qsslcipher.pro @@ -2,7 +2,7 @@ CONFIG += testcase CONFIG += parallel_test SOURCES += tst_qsslcipher.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core network testlib TARGET = tst_qsslcipher diff --git a/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro b/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro index d9a771a080..747bb55ade 100644 --- a/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro +++ b/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro @@ -2,7 +2,7 @@ CONFIG += testcase CONFIG += parallel_test SOURCES += tst_qsslellipticcurve.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core network testlib TARGET = tst_qsslellipticcurve diff --git a/tests/auto/network/ssl/qsslerror/qsslerror.pro b/tests/auto/network/ssl/qsslerror/qsslerror.pro index 85a5046923..6b7090db99 100644 --- a/tests/auto/network/ssl/qsslerror/qsslerror.pro +++ b/tests/auto/network/ssl/qsslerror/qsslerror.pro @@ -2,7 +2,7 @@ CONFIG += testcase CONFIG += parallel_test SOURCES += tst_qsslerror.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core network testlib TARGET = tst_qsslerror diff --git a/tests/auto/network/ssl/qsslkey/qsslkey.pro b/tests/auto/network/ssl/qsslkey/qsslkey.pro index 4ec4f27e6f..a74f432890 100644 --- a/tests/auto/network/ssl/qsslkey/qsslkey.pro +++ b/tests/auto/network/ssl/qsslkey/qsslkey.pro @@ -2,7 +2,7 @@ CONFIG += testcase CONFIG += parallel_test SOURCES += tst_qsslkey.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core network testlib contains(QT_CONFIG, private_tests) { QT += core-private network-private diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro index 07774d1847..de2be8e126 100644 --- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro +++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro @@ -1,7 +1,7 @@ CONFIG += testcase SOURCES += tst_qsslsocket.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core core-private network-private testlib TARGET = tst_qsslsocket diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro index 9b12785081..4f216ebb37 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro @@ -3,7 +3,7 @@ CONFIG += parallel_test testcase.timeout = 300 # this test is slow SOURCES += tst_qsslsocket_onDemandCertificates_member.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core core-private network-private testlib TARGET = tst_qsslsocket_onDemandCertificates_member diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro index c4d56436d0..96a6162ce6 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro @@ -2,7 +2,7 @@ CONFIG += testcase CONFIG += parallel_test SOURCES += tst_qsslsocket_onDemandCertificates_static.cpp -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 QT = core core-private network-private testlib TARGET = tst_qsslsocket_onDemandCertificates_static diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro index 8c911da2e0..673e922fdd 100644 --- a/tests/auto/other/other.pro +++ b/tests/auto/other/other.pro @@ -58,7 +58,7 @@ wince*|!contains(QT_CONFIG, accessibility): SUBDIRS -= qaccessibility macplist \ qaccessibilitymac -!embedded|wince*: SUBDIRS -= \ +!embedded|wince: SUBDIRS -= \ qdirectpainter winrt: SUBDIRS -= \ diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro index 70cced1dac..1d6fc6bcd1 100644 --- a/tests/auto/other/qaccessibility/qaccessibility.pro +++ b/tests/auto/other/qaccessibility/qaccessibility.pro @@ -7,7 +7,7 @@ HEADERS += accessiblewidgets.h unix:!mac:!haiku:LIBS+=-lm -wince*: { +wince { accessneeded.files = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll accessneeded.path = accessible DEPLOYMENT += accessneeded diff --git a/tests/auto/sql/kernel/qsql/qsql.pro b/tests/auto/sql/kernel/qsql/qsql.pro index 6bef8d4601..03918f5d3d 100644 --- a/tests/auto/sql/kernel/qsql/qsql.pro +++ b/tests/auto/sql/kernel/qsql/qsql.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsql.cpp QT = core-private sql-private testlib -wince*: { +wince { DEPLOYMENT_PLUGIN += qsqlite } mingw: LIBS += -lws2_32 diff --git a/tests/auto/sql/kernel/qsqldatabase/qsqldatabase.pro b/tests/auto/sql/kernel/qsqldatabase/qsqldatabase.pro index d562e47c55..7da5b8bc8e 100644 --- a/tests/auto/sql/kernel/qsqldatabase/qsqldatabase.pro +++ b/tests/auto/sql/kernel/qsqldatabase/qsqldatabase.pro @@ -5,11 +5,11 @@ SOURCES += tst_qsqldatabase.cpp QT = core sql testlib core-private sql-private win32: { - !wince*: LIBS += -lws2_32 + !wince: LIBS += -lws2_32 else: LIBS += -lws2 } -wince*: { +wince { DEPLOYMENT_PLUGIN += qsqlite testData.files = testdata diff --git a/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro b/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro index 13674f7c9e..5633840635 100644 --- a/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro +++ b/tests/auto/sql/kernel/qsqldriver/qsqldriver.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsqldriver.cpp QT = core sql testlib core-private sql-private -wince*: { +wince { plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles diff --git a/tests/auto/sql/kernel/qsqlquery/qsqlquery.pro b/tests/auto/sql/kernel/qsqlquery/qsqlquery.pro index 360d874f1a..a6be23892d 100644 --- a/tests/auto/sql/kernel/qsqlquery/qsqlquery.pro +++ b/tests/auto/sql/kernel/qsqlquery/qsqlquery.pro @@ -5,9 +5,9 @@ SOURCES += tst_qsqlquery.cpp QT = core sql testlib core-private sql-private -!wince*:win32:LIBS += -lws2_32 +win32:!wince: LIBS += -lws2_32 -wince*: { +wince { plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles diff --git a/tests/auto/sql/kernel/qsqlthread/qsqlthread.pro b/tests/auto/sql/kernel/qsqlthread/qsqlthread.pro index 3249309bf4..64d8c5ccfb 100644 --- a/tests/auto/sql/kernel/qsqlthread/qsqlthread.pro +++ b/tests/auto/sql/kernel/qsqlthread/qsqlthread.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsqlthread.cpp QT = core sql testlib core-private sql-private -wince*: { +wince { plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles diff --git a/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro index 7bcde08469..bc627e0724 100644 --- a/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/sql/models/qsqlquerymodel/qsqlquerymodel.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsqlquerymodel.cpp QT += widgets sql testlib core-private sql-private -wince*: { +wince { DEPLOYMENT_PLUGIN += qsqlite LIBS += -lws2 } else { diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index 6bcc3a1870..5ce1b5694c 100644 --- a/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/sql/models/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsqlrelationaltablemodel.cpp QT = core sql testlib core-private sql-private -wince*: { +wince { plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles diff --git a/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro b/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro index 211c2f2c2e..fedb41ba1d 100644 --- a/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro +++ b/tests/auto/sql/models/qsqltablemodel/qsqltablemodel.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsqltablemodel.cpp QT = core core-private sql sql-private testlib -wince*: { +wince { plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles diff --git a/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro b/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro index 879d31604b..b6693eeb5f 100644 --- a/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro +++ b/tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro @@ -7,7 +7,7 @@ QT += gui-private SOURCES += tst_qpixmapfilter.cpp -wince*: { +wince { addFiles.files = noise.png addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro index 527f62b22d..66e39869bb 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro @@ -5,5 +5,5 @@ QT += core-private gui-private SOURCES += tst_qgraphicsitem.cpp DEFINES += QT_NO_CAST_TO_ASCII -win32:!wince*:!winrt: LIBS += -luser32 +win32:!wince:!winrt: LIBS += -luser32 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro index a6022e0d7d..25a43d6821 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro @@ -4,9 +4,9 @@ QT += widgets widgets-private testlib QT += core-private gui-private SOURCES += tst_qgraphicsscene.cpp RESOURCES += images.qrc -win32:!wince*:!winrt: LIBS += -luser32 +win32:!wince:!winrt: LIBS += -luser32 -!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\" +!wince: DEFINES += SRCDIR=\\\"$$PWD\\\" DEFINES += QT_NO_CAST_TO_ASCII wince* { diff --git a/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro b/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro index 79848ac22c..f1bc968b88 100644 --- a/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro +++ b/tests/auto/widgets/itemviews/qdirmodel/qdirmodel.pro @@ -13,7 +13,7 @@ wince* { DEPLOYMENT += addit tests sourceFile } -android|wince*: { +android|wince { DEFINES += SRCDIR=\\\"./\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro index 313cadd6a1..f7fb41e60c 100644 --- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro +++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro @@ -3,4 +3,4 @@ TARGET = tst_qitemdelegate QT += widgets testlib SOURCES += tst_qitemdelegate.cpp -win32:!wince*:!winrt: LIBS += -luser32 +win32:!wince:!winrt: LIBS += -luser32 diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro index 1ea8beb8df..0623fc8ede 100644 --- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro +++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro @@ -2,4 +2,4 @@ CONFIG += testcase TARGET = tst_qlistview QT += widgets gui-private widgets-private core-private testlib SOURCES += tst_qlistview.cpp -win32:!wince*:!winrt: LIBS += -luser32 +win32:!wince:!winrt: LIBS += -luser32 diff --git a/tests/auto/widgets/kernel/qapplication/qapplication.pro b/tests/auto/widgets/kernel/qapplication/qapplication.pro index 5f369bf61a..3d167827a3 100644 --- a/tests/auto/widgets/kernel/qapplication/qapplication.pro +++ b/tests/auto/widgets/kernel/qapplication/qapplication.pro @@ -2,6 +2,6 @@ TEMPLATE = subdirs SUBDIRS = desktopsettingsaware modal -win32:!wince*:SUBDIRS += wincmdline +win32:!wince: SUBDIRS += wincmdline test.depends += $$SUBDIRS SUBDIRS += test diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro index 7b00ba5293..b617c228ac 100644 --- a/tests/auto/widgets/kernel/qapplication/test/test.pro +++ b/tests/auto/widgets/kernel/qapplication/test/test.pro @@ -10,6 +10,6 @@ TARGET = ../tst_qapplication TESTDATA = ../test/test.pro ../tmp/README SUBPROGRAMS = desktopsettingsaware modal -win32: !wince*: SUBPROGRAMS += wincmdline +win32:!wince: SUBPROGRAMS += wincmdline for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}" diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro index aae083d45e..a3fd622896 100644 --- a/tests/auto/widgets/kernel/qwidget/qwidget.pro +++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro @@ -20,4 +20,4 @@ x11 { LIBS += $$QMAKE_LIBS_X11 } -!wince*:win32:!winrt: LIBS += -luser32 -lgdi32 +win32:!wince:!winrt: LIBS += -luser32 -lgdi32 diff --git a/tests/auto/widgets/styles/styles.pro b/tests/auto/widgets/styles/styles.pro index 508b6ecd41..0de9dfcdab 100644 --- a/tests/auto/widgets/styles/styles.pro +++ b/tests/auto/widgets/styles/styles.pro @@ -12,5 +12,5 @@ SUBDIRS=\ !mac:SUBDIRS -= \ qmacstyle \ -ios|android|qnx|*wince*:SUBDIRS -= \ +ios|android|qnx|wince: SUBDIRS -= \ qstylesheetstyle \ diff --git a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro index c367959cbc..92c2f6cb7e 100644 --- a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro +++ b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro @@ -8,4 +8,4 @@ INCLUDEPATH += ../ HEADERS += SOURCES += tst_qtabwidget.cpp -win32:!wince*:!winrt:LIBS += -luser32 +win32:!wince:!winrt: LIBS += -luser32 diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro index 4f82123596..5f1c72153d 100644 --- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro +++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro @@ -9,7 +9,7 @@ SOURCES += tst_qimagereader.cpp !contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG QT += network -wince*: { +wince { addFiles.files = images addFiles.path = . diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 0a1987d647..cffe76b2b4 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -58,7 +58,7 @@ contains(QT_CONFIG, opengl) { win32 { SUBDIRS -= network_remote_stresstest network_stresstest # disable some tests on wince because of missing dependencies - wince*:SUBDIRS -= lance windowmodality + wince: SUBDIRS -= lance windowmodality } lessThan(QT_MAJOR_VERSION, 5): SUBDIRS -= bearerex lance qnetworkaccessmanager/qget qmimedatabase qnetworkreply \ -- cgit v1.2.3 From eb926dc31f2a3e7fa287889ba478225ed2498a39 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 29 May 2015 14:02:03 +0200 Subject: QSwipeGestureRecognizer: Allow for small direction changes. When trying to do a straight right/left/up/down swipe, a minimal change in the other direction caused to the gesture to be canceled. Introduce a threshold for checking such to prevent this. Task-number: QTBUG-46195 Change-Id: I3e199f2ec0c81d23a16073b1f5b8fff004958239 Reviewed-by: Shawn Rutledge --- .../qgesturerecognizer/tst_qgesturerecognizer.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp index 67c431d16e..dc2adad5da 100644 --- a/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp +++ b/tests/auto/widgets/gestures/qgesturerecognizer/tst_qgesturerecognizer.cpp @@ -269,7 +269,8 @@ void tst_QGestureRecognizer::pinchGesture() enum SwipeSubTest { SwipeLineSubTest, - SwipeChangeDirectionSubTest, + SwipeDirectionChangeSubTest, + SwipeSmallDirectionChangeSubTest }; void tst_QGestureRecognizer::swipeGesture_data() @@ -277,7 +278,8 @@ void tst_QGestureRecognizer::swipeGesture_data() QTest::addColumn("swipeSubTest"); QTest::addColumn("gestureExpected"); QTest::newRow("Line") << int(SwipeLineSubTest) << true; - QTest::newRow("ChangeDirection") << int(SwipeChangeDirectionSubTest) << false; + QTest::newRow("DirectionChange") << int(SwipeDirectionChangeSubTest) << false; + QTest::newRow("SmallDirectionChange") << int(SwipeSmallDirectionChangeSubTest) << true; } void tst_QGestureRecognizer::swipeGesture() @@ -314,10 +316,17 @@ void tst_QGestureRecognizer::swipeGesture() case SwipeLineSubTest: linearSequence(5, moveDelta, swipeSequence, points, &widget); break; - case SwipeChangeDirectionSubTest: + case SwipeDirectionChangeSubTest: linearSequence(5, moveDelta, swipeSequence, points, &widget); linearSequence(3, QPoint(-moveDelta.x(), moveDelta.y()), swipeSequence, points, &widget); break; + case SwipeSmallDirectionChangeSubTest: { // QTBUG-46195, small changes in direction should not cause the gesture to be canceled. + const QPoint smallChangeMoveDelta(50, 1); + linearSequence(5, smallChangeMoveDelta, swipeSequence, points, &widget); + linearSequence(1, QPoint(smallChangeMoveDelta.x(), -3), swipeSequence, points, &widget); + linearSequence(5, smallChangeMoveDelta, swipeSequence, points, &widget); + } + break; } releaseSequence(swipeSequence, points, &widget); -- cgit v1.2.3 From d0d0ee4ed7a1cc538363a82cde24f1b626b415ec Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sun, 7 Jun 2015 19:12:19 -0700 Subject: Fix build on 32-bit OS X. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5f01cb2a5a34a7a2a0c8f0571d50698bd46be733 Reviewed-by: Erik Verbruggen Reviewed-by: Morten Johan Sørvig --- tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm index d0ff6af640..3056904dcf 100644 --- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -129,7 +129,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err) - (AXUIElementRef) ref { return reference; } - (void) print { - NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(self.rect)); + NSLog(@"Accessible Object role: '%@', title: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.title, self.description, self.value, NSStringFromRect(NSRectFromCGRect(self.rect))); NSLog(@" Children: %ld", [[self childList] count]); } -- cgit v1.2.3 From bf440c18bb60a6964b32778157db2a22b168e946 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 9 Jun 2015 09:53:18 +0200 Subject: Fix return value of QWindowsFileSystemWatcherEngine::removePaths(). Previously, the path was removed from list returned (indicating failure to remove) only when the thread's list was empty (last file in directory). Move the statement up so that removal happens when it is found in thread's list. Task-number: QTBUG-46449 Change-Id: Ib79199c731f79357b0e5c17636254fbeb3a754a0 Reviewed-by: Robin Burchell --- .../qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 0ebfd2ae35..7e56ecaab3 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -62,6 +62,7 @@ private slots: void removePath(); void addPaths(); void removePaths(); + void removePathsFilesInSameDirectory(); void watchFileAndItsDirectory_data() { basicTest_data(); } void watchFileAndItsDirectory(); @@ -460,6 +461,31 @@ void tst_QFileSystemWatcher::removePaths() watcher.removePaths(paths); } +void tst_QFileSystemWatcher::removePathsFilesInSameDirectory() +{ + // QTBUG-46449/Windows: Check the return values of removePaths(). + // When adding the 1st file, a thread is started to watch the temp path. + // After adding and removing the 2nd file, the thread is still running and + // success should be reported. + QTemporaryFile file1(m_tempDirPattern); + QTemporaryFile file2(m_tempDirPattern); + QVERIFY2(file1.open(), qPrintable(file1.errorString())); + QVERIFY2(file2.open(), qPrintable(file1.errorString())); + const QString path1 = file1.fileName(); + const QString path2 = file2.fileName(); + file1.close(); + file2.close(); + QFileSystemWatcher watcher; + QVERIFY(watcher.addPath(path1)); + QCOMPARE(watcher.files().size(), 1); + QVERIFY(watcher.addPath(path2)); + QCOMPARE(watcher.files().size(), 2); + QVERIFY(watcher.removePath(path1)); + QCOMPARE(watcher.files().size(), 1); + QVERIFY(watcher.removePath(path2)); + QCOMPARE(watcher.files().size(), 0); +} + static QByteArray msgFileOperationFailed(const char *what, const QFile &f) { return what + QByteArrayLiteral(" failed on \"") -- cgit v1.2.3 From 4fe332f543ab169be0052d6533b8ed48b09d8f28 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 8 Jun 2015 14:45:03 +0200 Subject: Fix leaking of link in tst_QFileInfo::canonicalFilePath(). Give the link a name containing time stamp and ensure it is deleted. Change-Id: I846c58095acbcd92e7daccfd43a69dd97e95e7b0 Reviewed-by: Simon Hausmann --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 26 +++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 62e183f619..ef51422579 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -609,6 +609,16 @@ void tst_QFileInfo::canonicalPath() QCOMPARE(fi.canonicalPath(), QFileInfo(QDir::tempPath()).canonicalFilePath()); } +class FileDeleter { + Q_DISABLE_COPY(FileDeleter) +public: + explicit FileDeleter(const QString fileName) : m_fileName(fileName) {} + ~FileDeleter() { QFile::remove(m_fileName); } + +private: + const QString m_fileName; +}; + void tst_QFileInfo::canonicalFilePath() { const QString fileName("tmp.canon"); @@ -639,9 +649,13 @@ void tst_QFileInfo::canonicalFilePath() QCOMPARE(info1.canonicalFilePath(), info2.canonicalFilePath()); } } + + const QString dirSymLinkName = QLatin1String("tst_qfileinfo") + + QDateTime::currentDateTime().toString(QLatin1String("yyMMddhhmmss")); + const QString link(QDir::tempPath() + QLatin1Char('/') + dirSymLinkName); + FileDeleter dirSymLinkDeleter(link); + { - const QString link(QDir::tempPath() + QDir::separator() + "tst_qfileinfo"); - QFile::remove(link); QFile file(QDir::currentPath()); if (file.link(link)) { QFile tempfile("tempfile.txt"); @@ -666,12 +680,12 @@ void tst_QFileInfo::canonicalFilePath() } } { - QString link(QDir::tempPath() + QDir::separator() + "tst_qfileinfo" - + QDir::separator() + "link_to_tst_qfileinfo"); + QString link(QDir::tempPath() + QLatin1Char('/') + dirSymLinkName + + "/link_to_tst_qfileinfo"); QFile::remove(link); - QFile file(QDir::tempPath() + QDir::separator() + "tst_qfileinfo" - + QDir::separator() + "tst_qfileinfo.cpp"); + QFile file(QDir::tempPath() + QLatin1Char('/') + dirSymLinkName + + "tst_qfileinfo.cpp"); if (file.link(link)) { QFileInfo info1("tst_qfileinfo.cpp"); -- cgit v1.2.3 From 92cda9474245c79b635c21cd140c5d0a3a6d2e5b Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 8 Jun 2015 11:55:10 +0200 Subject: QSslSocket: move default cipher, EC and default CA APIs to QSslConfiguration QSslConfiguration is better suited for these APIs. The ones in QSslSocket that already have a counterpart have been deprecated. [ChangeLog][QtNetwork][SSL/TLS Support] Most of the QSslSocket functions to deal with ciphersuites, certification authorities as well as elliptic curves have been deprecated in favor of the corresponding counterparts in QSslConfiguration. Task-number: QTBUG-46558 Change-Id: I1de03379efcbcab931c20e876e252769fe4279e0 Reviewed-by: Liang Qi Reviewed-by: Richard J. Moore Reviewed-by: Jani Heikkinen --- tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp index c97b46a512..685d354cc9 100644 --- a/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp +++ b/tests/auto/network/ssl/qsslellipticcurve/tst_qsslellipticcurve.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include class tst_QSslEllipticCurve : public QObject { @@ -84,7 +84,7 @@ void tst_QSslEllipticCurve::fromShortName_data() QTest::newRow("QString()") << QString() << QSslEllipticCurve() << false; QTest::newRow("\"\"") << QString("") << QSslEllipticCurve() << false; QTest::newRow("does-not-exist") << QStringLiteral("does-not-exist") << QSslEllipticCurve() << false; - Q_FOREACH (QSslEllipticCurve ec, QSslSocket::supportedEllipticCurves()) { + Q_FOREACH (QSslEllipticCurve ec, QSslConfiguration::supportedEllipticCurves()) { const QString sN = ec.shortName(); QTest::newRow(qPrintable("supported EC \"" + sN + '"')) << sN << ec << true; // At least in the OpenSSL impl, the short name is case-sensitive. That feels odd. @@ -117,7 +117,7 @@ void tst_QSslEllipticCurve::fromLongName_data() QTest::newRow("QString()") << QString() << QSslEllipticCurve() << false; QTest::newRow("\"\"") << QString("") << QSslEllipticCurve() << false; QTest::newRow("does-not-exist") << QStringLiteral("does-not-exist") << QSslEllipticCurve() << false; - Q_FOREACH (QSslEllipticCurve ec, QSslSocket::supportedEllipticCurves()) { + Q_FOREACH (QSslEllipticCurve ec, QSslConfiguration::supportedEllipticCurves()) { const QString lN = ec.longName(); QTest::newRow(qPrintable("supported EC \"" + lN + '"')) << lN << ec << true; } -- cgit v1.2.3 From 0b8cb39d341eee30f806a8bf7bb2b77650086d8a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 8 Jun 2015 11:24:06 +0200 Subject: Diaglib: Output window/widget state(s). Change-Id: I0f27027c95ed70a0b2992c58df7e12eddfad17e3 Task-number: QTBUG-46416 Reviewed-by: Friedemann Kleint --- tests/manual/diaglib/qwidgetdump.cpp | 2 ++ tests/manual/diaglib/qwindowdump.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp index 432e651678..f057a58ff0 100644 --- a/tests/manual/diaglib/qwidgetdump.cpp +++ b/tests/manual/diaglib/qwidgetdump.cpp @@ -58,6 +58,8 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, str << (w->testAttribute(Qt::WA_Mapped) ? "[mapped] " : "[not mapped] "); if (w->testAttribute(Qt::WA_DontCreateNativeAncestors)) str << "[NoNativeAncestors] "; + if (const int states = w->windowState()) + str << "windowState=" << hex << showbase << states << dec << noshowbase << ' '; formatRect(str, w->geometry()); if (!(options & DontPrintWindowFlags)) { str << ' '; diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp index ca76d7b80d..a77bae22e9 100644 --- a/tests/manual/diaglib/qwindowdump.cpp +++ b/tests/manual/diaglib/qwindowdump.cpp @@ -131,6 +131,8 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option str << "[top] "; if (w->isExposed()) str << "[exposed] "; + if (const Qt::WindowState state = w->windowState()) + str << "windowState=" << state << ' '; formatRect(str, w->geometry()); if (!(options & DontPrintWindowFlags)) { str << ' '; -- cgit v1.2.3 From 56d62345ad34b8efb6a72a3c189542eb295ac2b9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 10 Jun 2015 16:46:54 +0200 Subject: Fix less-than comparison for QStandardItem and QSortFilterProxyModel with invalid data. Previously, QStandardItem::operator<() returned true when both items had invalid data. With MSVC in debug mode (checked iterators/STL), this triggered an assert in tst_QStandardItem::sortChildren() since that verifies that !(b < a) when a < b: Debug Assertion Failed! Line: 3006 Expression: invalid operator< Introduce a stable sort order for invalid items such that other items are always less than invalid items and comparing invalid items returns false (indicating equivalence). Change-Id: Ica0f0d9f001c86973b1941dbcc1faf282e4c47df Reviewed-by: Marc Mutz --- .../qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp | 12 ++++++------ .../gui/itemmodels/qstandarditem/tst_qstandarditem.cpp | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 01c10886c5..1c30adc8de 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -2502,16 +2502,16 @@ void tst_QSortFilterProxyModel::sortColumnTracking2() proxyModel.sort(0); QCOMPARE(proxyModel.sortColumn(), 0); - QList items; - QStringList strings; - strings << "foo" << "bar" << "some" << "others" << "item" << "aa" << "zz"; - foreach (QString s, strings) - items << new QStandardItem(s); + QList items; // Stable sorting: Items with invalid data should move to the end + items << new QStandardItem << new QStandardItem("foo") << new QStandardItem("bar") + << new QStandardItem("some") << new QStandardItem("others") << new QStandardItem("item") + << new QStandardItem("aa") << new QStandardItem("zz") << new QStandardItem; model.insertColumn(0,items); QCOMPARE(proxyModel.sortColumn(), 0); QCOMPARE(proxyModel.data(proxyModel.index(0,0)).toString(),QString::fromLatin1("aa")); - QCOMPARE(proxyModel.data(proxyModel.index(strings.count()-1,0)).toString(),QString::fromLatin1("zz")); + const int zzIndex = items.count() - 3; // 2 invalid at end. + QCOMPARE(proxyModel.data(proxyModel.index(zzIndex,0)).toString(),QString::fromLatin1("zz")); } void tst_QSortFilterProxyModel::sortStable() diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp index 5dce228ca0..2448b89296 100644 --- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp +++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp @@ -81,6 +81,7 @@ private slots: void clone(); void sortChildren(); void subclassing(); + void lessThan(); }; tst_QStandardItem::tst_QStandardItem() @@ -1095,5 +1096,19 @@ void tst_QStandardItem::subclassing() QCOMPARE(item->child(2), (QStandardItem*)child1); } +void tst_QStandardItem::lessThan() +{ + QStandardItem stringA("A"); + QStandardItem stringB("B"); + QStandardItem invalid1; + QStandardItem invalid2; + QVERIFY(stringA < stringB); + QVERIFY(!(stringB < stringA)); + // Items with invalid data go to the end. + QVERIFY(stringA < invalid1); + QVERIFY(!(invalid1 < stringA)); + QVERIFY(!(invalid1 < invalid2)); +} + QTEST_MAIN(tst_QStandardItem) #include "tst_qstandarditem.moc" -- cgit v1.2.3 From 9a029c9de409976b8983fce81ae2029e010cb5f7 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Tue, 26 May 2015 12:10:51 +0300 Subject: Fix sizes QStorageInfo returns for invalid drives Zero is a legitimate size to be returned by bytesFree/bytesAvailable functions, so change those functions to return some 'invalid' size in case of an invalid drive. This is also consistent with the original version from the Qt Systems framework. [ChangeLog][QtCore][QStorageInfo] Fixed sizes returned for invalid drives. Task-number: QTBUG-45724 Change-Id: I312fba521fdf8d52d7a0ac0e46cacca625775e80 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- .../auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp index 2190c32c01..a7a0cf4ddb 100644 --- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp +++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp @@ -61,9 +61,9 @@ void tst_QStorageInfo::defaultValues() QVERIFY(!storage.isRoot()); QVERIFY(storage.device().isEmpty()); QVERIFY(storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() == 0); - QVERIFY(storage.bytesFree() == 0); - QVERIFY(storage.bytesAvailable() == 0); + QVERIFY(storage.bytesTotal() == -1); + QVERIFY(storage.bytesFree() == -1); + QVERIFY(storage.bytesAvailable() == -1); } void tst_QStorageInfo::operatorEqual() @@ -106,9 +106,9 @@ void tst_QStorageInfo::root() QVERIFY(!storage.device().isEmpty()); QVERIFY(!storage.fileSystemType().isEmpty()); #ifndef Q_OS_HAIKU - QVERIFY(storage.bytesTotal() > 0); - QVERIFY(storage.bytesFree() > 0); - QVERIFY(storage.bytesAvailable() > 0); + QVERIFY(storage.bytesTotal() >= 0); + QVERIFY(storage.bytesFree() >= 0); + QVERIFY(storage.bytesAvailable() >= 0); #endif } @@ -121,9 +121,9 @@ void tst_QStorageInfo::currentStorage() QVERIFY(appPath.startsWith(storage.rootPath(), Qt::CaseInsensitive)); QVERIFY(!storage.device().isEmpty()); QVERIFY(!storage.fileSystemType().isEmpty()); - QVERIFY(storage.bytesTotal() > 0); - QVERIFY(storage.bytesFree() > 0); - QVERIFY(storage.bytesAvailable() > 0); + QVERIFY(storage.bytesTotal() >= 0); + QVERIFY(storage.bytesFree() >= 0); + QVERIFY(storage.bytesAvailable() >= 0); } void tst_QStorageInfo::storageList() -- cgit v1.2.3 From 61ca116a2eaf8a275803524ade494ace6b9cb812 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 8 Jun 2015 21:49:48 +0200 Subject: QTest: Make qExtractTestData() return the created QTemporaryDir ... and enable auto-deletion on it. This allows users of the function to get rid of their own cleanup code. They just need to keep the shared pointer alive for as long as they need it. Drive-by changes: - replaced QStringLiterals that were only used as the rhs of op+ - replaced an instance of mid() used as the rhs of op+ with midRef() - enabled NRVO Change-Id: I161d39461e020c9e8d473c0810dea2109fe0d62d Reviewed-by: Lars Knoll --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 62e183f619..1e51f2c5f4 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -263,21 +263,23 @@ private slots: private: const QString m_currentDir; - QString m_dataPath; QString m_sourceFile; QString m_proFile; QString m_resourcesDir; QTemporaryDir m_dir; + QSharedPointer m_dataDir; }; void tst_QFileInfo::initTestCase() { - m_dataPath = QEXTRACTTESTDATA("/testdata"); - QVERIFY(!m_dataPath.isEmpty()); + m_dataDir = QEXTRACTTESTDATA("/testdata"); + QVERIFY(m_dataDir); + const QString dataPath = m_dataDir->path(); + QVERIFY(!dataPath.isEmpty()); - m_sourceFile = m_dataPath + QStringLiteral("/tst_qfileinfo.cpp"); - m_resourcesDir = m_dataPath + QStringLiteral("/resources"); - m_proFile = m_dataPath + QStringLiteral("/tst_qfileinfo.pro"); + m_sourceFile = dataPath + QLatin1String("/tst_qfileinfo.cpp"); + m_resourcesDir = dataPath + QLatin1String("/resources"); + m_proFile = dataPath + QLatin1String("/tst_qfileinfo.pro"); QVERIFY(m_dir.isValid()); QVERIFY(QDir::setCurrent(m_dir.path())); @@ -286,7 +288,6 @@ void tst_QFileInfo::initTestCase() void tst_QFileInfo::cleanupTestCase() { QDir::setCurrent(m_currentDir); // Release temporary directory so that it can be deleted on Windows - QDir(m_dataPath).removeRecursively(); } // Testing get/set functions -- cgit v1.2.3 From fefa8cf3922b124c3919859bb4a18fc3e48d5d81 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 12 Jun 2015 09:09:00 +0200 Subject: Fix boundingRect test in tst_QPicture Verify the bounding rect of the left hand side of copy/assignment, not the right hand side (which is passed by const ref). Change-Id: I5044d269fe0acb5f4484c82da7e030ca33958792 Reviewed-by: Gunnar Sletta --- tests/auto/gui/image/qpicture/tst_qpicture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/gui/image/qpicture/tst_qpicture.cpp b/tests/auto/gui/image/qpicture/tst_qpicture.cpp index 3cf848b08d..5406284c05 100644 --- a/tests/auto/gui/image/qpicture/tst_qpicture.cpp +++ b/tests/auto/gui/image/qpicture/tst_qpicture.cpp @@ -133,10 +133,10 @@ void tst_QPicture::boundingRect() QRect r2( 10, 20, 100, 60 ); QCOMPARE( p1.boundingRect(), r2 ); QPicture p2( p1 ); - QCOMPARE( p1.boundingRect(), r2 ); + QCOMPARE( p2.boundingRect(), r2 ); QPicture p3; p3 = p1; - QCOMPARE( p1.boundingRect(), r2 ); + QCOMPARE( p3.boundingRect(), r2 ); { QPicture p4; -- cgit v1.2.3 From 54589f293297f0c132a7814a14f0d6ab38393b19 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Apr 2015 16:13:37 -0700 Subject: Autotest: Check where global event filters get run Global (application-level) event filters are supposed to be run only in the main thread, so ensure that it is the case. Change-Id: I27eaacb532114dd188c4ffff13d5a17d991b8bd2 Reviewed-by: Olivier Goffart (Woboq GmbH) --- .../qcoreapplication/tst_qcoreapplication.cpp | 55 ++++++++++++++++++++++ .../kernel/qcoreapplication/tst_qcoreapplication.h | 3 ++ 2 files changed, 58 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 924db17c04..efecf31d66 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2015 Intel Corporation. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -60,6 +61,23 @@ public: } }; +class ThreadedEventReceiver : public QObject +{ + Q_OBJECT +public: + QList recordedEvents; + bool event(QEvent *event) Q_DECL_OVERRIDE + { + if (event->type() != QEvent::Type(QEvent::User + 1)) + return QObject::event(event); + recordedEvents.append(event->type()); + QThread::currentThread()->quit(); + QCoreApplication::quit(); + moveToThread(0); + return true; + } +}; + void tst_QCoreApplication::sendEventsOnProcessEvents() { int argc = 1; @@ -797,6 +815,43 @@ void tst_QCoreApplication::QTBUG31606_QEventDestructorDeadLock() QVERIFY(spy.recordedEvents.contains(QEvent::User + 2)); } +// this is almost identical to sendEventsOnProcessEvents +void tst_QCoreApplication::applicationEventFilters_mainThread() +{ + int argc = 1; + char *argv[] = { const_cast(QTest::currentAppName()) }; + TestApplication app(argc, argv); + + EventSpy spy; + app.installEventFilter(&spy); + + QCoreApplication::postEvent(&app, new QEvent(QEvent::Type(QEvent::User + 1))); + QTimer::singleShot(10, &app, SLOT(quit())); + app.exec(); + QVERIFY(spy.recordedEvents.contains(QEvent::User + 1)); +} + +void tst_QCoreApplication::applicationEventFilters_auxThread() +{ + int argc = 1; + char *argv[] = { const_cast(QTest::currentAppName()) }; + TestApplication app(argc, argv); + QThread thread; + ThreadedEventReceiver receiver; + receiver.moveToThread(&thread); + + EventSpy spy; + app.installEventFilter(&spy); + + // this is very similar to sendEventsOnProcessEvents + QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User + 1))); + QTimer::singleShot(1000, &app, SLOT(quit())); + thread.start(); + app.exec(); + QVERIFY(thread.wait(1000)); + QVERIFY(receiver.recordedEvents.contains(QEvent::User + 1)); + QVERIFY(!spy.recordedEvents.contains(QEvent::User + 1)); +} static void createQObjectOnDestruction() { diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h index 3dd84482d7..09e15723ac 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2015 Intel Corporation. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -58,6 +59,8 @@ private slots: void customEventDispatcher(); void testQuitLock(); void QTBUG31606_QEventDestructorDeadLock(); + void applicationEventFilters_mainThread(); + void applicationEventFilters_auxThread(); }; #endif // TST_QCOREAPPLICATION_H -- cgit v1.2.3 From b2be272d354defaebd82dfaa2dffefa5a8f3a303 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 19 May 2015 11:49:37 -0700 Subject: Make QMetaObject::Connection check its state deeply Since Connection can be copied, one copy could be used for disconnecting, but the other's d_ptr wouldn't get updated and would continue to report as still connected. This patch fixes that by making it check the internal state. That is only done after d_ptr is already known to be non-null. Unfortunately, that is the common path: if (connect(sender, &Sender::signal, [] {})) will call an out-of-line function. I don't see a way out. Task-number: QTBUG-46213 Change-Id: I66a35ce5f88941f29aa6ffff13dfb45dca68a350 Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 3ec84b5198..4617ce5e74 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -918,6 +918,8 @@ void tst_QObject::connectDisconnectNotifyPMF() QMetaObject::Connection conn = connect((SenderObject*)s, &SenderObject::signal1, (ReceiverObject*)r, &ReceiverObject::slot1); + QVERIFY(conn); + // Test disconnectNotify when disconnecting by QMetaObject::Connection QVERIFY(QObject::disconnect(conn)); // disconnectNotify() is not called, but it probably should be. @@ -5751,7 +5753,6 @@ void tst_QObject::connectFunctorWithContext() { int status = 1; SenderObject obj; - QMetaObject::Connection handle; ContextObject *context = new ContextObject; QEventLoop e; @@ -6058,8 +6059,12 @@ void tst_QObject::disconnectDoesNotLeakFunctor() QVERIFY(c2); QCOMPARE(countedStructObjectsCount, 2); QVERIFY(QObject::disconnect(c1)); + QVERIFY(!c1); + QVERIFY(!c2); // functor object has been destroyed QCOMPARE(countedStructObjectsCount, 1); + QVERIFY(!QObject::disconnect(c2)); + QCOMPARE(countedStructObjectsCount, 1); } QCOMPARE(countedStructObjectsCount, 0); } -- cgit v1.2.3 From 94e364464ee162ac919a66a44e27ee9adda65c77 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 18 Jun 2015 13:39:20 -0700 Subject: Autotest: make the test pass with the Intel compiler The Intel compiler defaults to "fast math" mode, which is why those tests had been failing. So for the test that is trying to check whether we conform to IEEE strict requirements, turn on strict requirements. Change-Id: I02f8426b1c8e4241ac10ffff13e8efa224f313b2 Reviewed-by: Oswald Buddenhagen --- tests/auto/corelib/global/qnumeric/qnumeric.pro | 2 ++ tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/global/qnumeric/qnumeric.pro b/tests/auto/corelib/global/qnumeric/qnumeric.pro index 4cfb3fa7ac..00f3635be9 100644 --- a/tests/auto/corelib/global/qnumeric/qnumeric.pro +++ b/tests/auto/corelib/global/qnumeric/qnumeric.pro @@ -3,3 +3,5 @@ TARGET = tst_qnumeric QT = core testlib SOURCES = tst_qnumeric.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +intel_icc: QMAKE_CXXFLAGS += -fp-model strict +intel_icl: QMAKE_CXXFLAGS += /fp:strict diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp index 9a50df379c..fdc8bc6aab 100644 --- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp +++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp @@ -107,13 +107,7 @@ void tst_QNumeric::qNan() QVERIFY(qIsInf(-inf)); QVERIFY(qIsInf(2*inf)); QCOMPARE(1/inf, 0.0); -#ifdef Q_CC_INTEL - QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue); -#endif QVERIFY(qIsNaN(0*nan)); -#ifdef Q_CC_INTEL - QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue); -#endif QVERIFY(qIsNaN(0*inf)); QVERIFY(qFuzzyCompare(1/inf, 0.0)); } -- cgit v1.2.3 From 56aad2ad6074237537fecf10d0cda0f3872e7f71 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 18 Jun 2015 10:08:01 +0200 Subject: Fix global coordinate mapping for child widgets in QGraphicsView. Move the code path handling widgets embedded in QGraphicsProxyWidget into the loop moving up the parent hierarchy. Add child widget to test. Task-number: QTBUG-41135 Change-Id: Ibd86413faaa927145a85a2f5864f162979135053 Reviewed-by: Marc Mutz --- .../tst_qgraphicsproxywidget.cpp | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index f8d852888c..cd40c5541c 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -3670,6 +3670,14 @@ void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget() QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true); } +static QByteArray msgPointMismatch(const QPoint &actual, const QPoint &expected) +{ + QString result; + QDebug(&result) << actual << " != " << expected << " manhattanLength=" + << (expected - actual).manhattanLength(); + return result.toLocal8Bit(); +} + void tst_QGraphicsProxyWidget::mapToGlobal() // QTBUG-41135 { const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry(); @@ -3681,20 +3689,29 @@ void tst_QGraphicsProxyWidget::mapToGlobal() // QTBUG-41135 view.move(availableGeometry.bottomRight() - QPoint(size.width(), size.height()) - QPoint(100, 100)); QWidget *embeddedWidget = new QWidget; embeddedWidget->setFixedSize(size / 2); + QWidget *childWidget = new QWidget(embeddedWidget); + childWidget->setStyleSheet(QLatin1String("background-color: \"red\"; ")); + childWidget->resize(embeddedWidget->size() / 2); + childWidget->move(embeddedWidget->width() / 4, embeddedWidget->height() / 4); // center in embeddedWidget scene.addWidget(embeddedWidget); QApplication::setActiveWindow(&view); view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - const QPoint embeddedCenter = embeddedWidget->geometry().center(); + const QPoint embeddedCenter = embeddedWidget->rect().center(); const QPoint embeddedCenterGlobal = embeddedWidget->mapToGlobal(embeddedCenter); QCOMPARE(embeddedWidget->mapFromGlobal(embeddedCenterGlobal), embeddedCenter); // This should be equivalent to the view center give or take rounding // errors due to odd window margins const QPoint viewCenter = view.geometry().center(); QVERIFY2((viewCenter - embeddedCenterGlobal).manhattanLength() <= 2, - qPrintable(QStringLiteral("%1, %2 != %3, %4") - .arg(viewCenter.x()).arg(viewCenter.y()) - .arg(embeddedCenterGlobal.x()).arg(embeddedCenterGlobal.y()))); + msgPointMismatch(embeddedCenterGlobal, viewCenter).constData()); + + // Same test with child centered on embeddedWidget + const QPoint childCenter = childWidget->rect().center(); + const QPoint childCenterGlobal = childWidget->mapToGlobal(childCenter); + QCOMPARE(childWidget->mapFromGlobal(childCenterGlobal), childCenter); + QVERIFY2((viewCenter - childCenterGlobal).manhattanLength() <= 4, + msgPointMismatch(childCenterGlobal, viewCenter).constData()); } void tst_QGraphicsProxyWidget::mapToGlobalWithoutScene() // QTBUG-44509 -- cgit v1.2.3 From 03fd8fa46356a70c9eabcf7ca703ddaa5e16e96f Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 8 Jun 2015 14:53:29 +0200 Subject: Further tune curveThreshold setting based on strokeWidth ad9698713f91a2e706fcd391f9806057649632ff reduced the curvethreshold for wide lines, to fix QTBUG-46151. But as a side effect, the threshold was increased for lines of widths >=0 and <4. This commit fixes that, and also adds a lance test for the issue in QTBUG-46151. Change-Id: I52507db622435fe1d2646640cb0bd9cd8222e453 Reviewed-by: Gunnar Sletta --- tests/auto/other/lancelot/scripts/arcs2.qps | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/auto/other/lancelot/scripts/arcs2.qps b/tests/auto/other/lancelot/scripts/arcs2.qps index 411ff08014..a2739a8c97 100644 --- a/tests/auto/other/lancelot/scripts/arcs2.qps +++ b/tests/auto/other/lancelot/scripts/arcs2.qps @@ -45,3 +45,10 @@ drawArc 100 350 300 300 5440 5760 drawArc 100 350 300 300 5600 5760 setPen white drawArc 100 350 300 300 0 5760 + +translate 400 300 +setRenderHint Antialiasing true +setPen blue 40 +drawArc 100 100 200 200 0 4320 +setPen red 40 +drawArc 60 60 280 280 0 4320 -- cgit v1.2.3 From bf24838c3344f009f9fe40f596a4eab798f071b3 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 10 Jun 2015 12:48:17 +0200 Subject: Use qthread_win.cpp for WinRT as well Since of Windows (Phone) 8.1 most of the desktop's thread functionality is also available, so we might be able to share the code and get rid of the extra implementation for WinRT. Task-number: QTBUG-43837 Change-Id: I0ce907cd94899834527f88c70e1e395bafdb14b3 Reviewed-by: Maurice Kalinowski --- tests/auto/corelib/thread/qthread/tst_qthread.cpp | 46 +++-------------------- 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index 3bc4bb80b8..3230472d5b 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -669,9 +669,7 @@ void NativeThreadWrapper::start(FunctionPointer functionPointer, void *data) #if defined Q_OS_UNIX const int state = pthread_create(&nativeThreadHandle, 0, NativeThreadWrapper::runUnix, this); Q_UNUSED(state); -#elif defined(Q_OS_WINRT) - // creating a new worker from within the GUI thread is not supported -#elif defined(Q_OS_WINCE) +#elif defined(Q_OS_WINCE) || defined(Q_OS_WINRT) nativeThreadHandle = CreateThread(NULL, 0 , (LPTHREAD_START_ROUTINE)NativeThreadWrapper::runWin , this, 0, NULL); #elif defined Q_OS_WIN unsigned thrdid = 0; @@ -690,10 +688,12 @@ void NativeThreadWrapper::join() { #if defined Q_OS_UNIX pthread_join(nativeThreadHandle, 0); -#elif defined Q_OS_WINRT - // not supported #elif defined Q_OS_WIN +#ifndef Q_OS_WINCE + WaitForSingleObjectEx(nativeThreadHandle, INFINITE, FALSE); +#else WaitForSingleObject(nativeThreadHandle, INFINITE); +#endif CloseHandle(nativeThreadHandle); #endif } @@ -747,9 +747,6 @@ void testNativeThreadAdoption(void *) } void tst_QThread::nativeThreadAdoption() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif threadAdoptedOk = false; mainThread = QThread::currentThread(); NativeThreadWrapper nativeThread; @@ -773,9 +770,6 @@ void adoptedThreadAffinityFunction(void *arg) void tst_QThread::adoptedThreadAffinity() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif QThread *affinity[2] = { 0, 0 }; NativeThreadWrapper thread; @@ -788,9 +782,6 @@ void tst_QThread::adoptedThreadAffinity() void tst_QThread::adoptedThreadSetPriority() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif NativeThreadWrapper nativeThread; nativeThread.setWaitForStop(); nativeThread.startAndWait(); @@ -818,9 +809,6 @@ void tst_QThread::adoptedThreadSetPriority() void tst_QThread::adoptedThreadExit() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif NativeThreadWrapper nativeThread; nativeThread.setWaitForStop(); @@ -850,9 +838,6 @@ void adoptedThreadExecFunction(void *) void tst_QThread::adoptedThreadExec() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif NativeThreadWrapper nativeThread; nativeThread.start(adoptedThreadExecFunction); nativeThread.join(); @@ -863,9 +848,6 @@ void tst_QThread::adoptedThreadExec() */ void tst_QThread::adoptedThreadFinished() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif NativeThreadWrapper nativeThread; nativeThread.setWaitForStop(); nativeThread.startAndWait(); @@ -876,17 +858,11 @@ void tst_QThread::adoptedThreadFinished() nativeThread.join(); QTestEventLoop::instance().enterLoop(5); -#if defined(Q_OS_WINRT) - QEXPECT_FAIL("", "QTBUG-31397: Known not to work on WinRT", Abort); -#endif QVERIFY(!QTestEventLoop::instance().timeout()); } void tst_QThread::adoptedThreadExecFinished() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif NativeThreadWrapper nativeThread; nativeThread.setWaitForStop(); nativeThread.startAndWait(adoptedThreadExecFunction); @@ -902,9 +878,6 @@ void tst_QThread::adoptedThreadExecFinished() void tst_QThread::adoptMultipleThreads() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif #if defined(Q_OS_WIN) // Windows CE is not capable of handling that many threads. On the emulator it is dead with 26 threads already. # if defined(Q_OS_WINCE) @@ -936,18 +909,12 @@ void tst_QThread::adoptMultipleThreads() } QTestEventLoop::instance().enterLoop(5); -#if defined(Q_OS_WINRT) - QEXPECT_FAIL("", "QTBUG-31397: Known not to work on WinRT", Abort); -#endif QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(recorder.activationCount.load(), numThreads); } void tst_QThread::adoptMultipleThreadsOverlap() { -#ifdef Q_OS_WINRT - QSKIP("Native thread adoption is not supported on WinRT."); -#endif #if defined(Q_OS_WIN) // Windows CE is not capable of handling that many threads. On the emulator it is dead with 26 threads already. # if defined(Q_OS_WINCE) @@ -984,9 +951,6 @@ void tst_QThread::adoptMultipleThreadsOverlap() } QTestEventLoop::instance().enterLoop(5); -#if defined(Q_OS_WINRT) - QEXPECT_FAIL("", "QTBUG-31397: Known not to work on WinRT", Abort); -#endif QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(recorder.activationCount.load(), numThreads); } -- cgit v1.2.3 From ec8c1dcf147ac71ea3c0105d67c2575ab733d348 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 4 Jun 2015 16:02:06 +0200 Subject: Make QDir::relativeFilePath() return "." for a path to itself. The rationale being that the empty string is not a valid path component. [ChangeLog][QtCore][QDir] QDir::relativeFilePath() now returns "." instead of an empty string if the given path is the same as the directory. Change-Id: Ibcf31904b2ae5edf5639d4c2e5ba234365d347fd Reviewed-by: Oswald Buddenhagen --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 11 +++++++---- tests/auto/tools/qmakelib/evaltest.cpp | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index e8a7105f6e..45289df398 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -1366,6 +1366,9 @@ void tst_QDir::relativeFilePath_data() QTest::newRow("11") << "" << "" << ""; + QTest::newRow("same path 1") << "/tmp" << "/tmp" << "."; + QTest::newRow("same path 2") << "//tmp" << "/tmp/" << "."; + #if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) QTest::newRow("12") << "C:/foo/bar" << "ding" << "ding"; QTest::newRow("13") << "C:/foo/bar" << "C:/ding/dong" << "../../ding/dong"; @@ -1373,10 +1376,10 @@ void tst_QDir::relativeFilePath_data() QTest::newRow("15") << "C:/foo/bar" << "D:/ding/dong" << "D:/ding/dong"; QTest::newRow("16") << "C:" << "C:/ding/dong" << "ding/dong"; QTest::newRow("17") << "C:/" << "C:/ding/dong" << "ding/dong"; - QTest::newRow("18") << "C:" << "C:" << ""; - QTest::newRow("19") << "C:/" << "C:" << ""; - QTest::newRow("20") << "C:" << "C:/" << ""; - QTest::newRow("21") << "C:/" << "C:/" << ""; + QTest::newRow("18") << "C:" << "C:" << "."; + QTest::newRow("19") << "C:/" << "C:" << "."; + QTest::newRow("20") << "C:" << "C:/" << "."; + QTest::newRow("21") << "C:/" << "C:/" << "."; QTest::newRow("22") << "C:" << "C:file.txt" << "file.txt"; QTest::newRow("23") << "C:/" << "C:file.txt" << "file.txt"; QTest::newRow("24") << "C:" << "C:/file.txt" << "file.txt"; diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp index fab2cdce17..bed4c792a1 100644 --- a/tests/auto/tools/qmakelib/evaltest.cpp +++ b/tests/auto/tools/qmakelib/evaltest.cpp @@ -1356,7 +1356,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir) QTest::newRow("$$relative_path(): relative file to empty") << "VAR = $$relative_path(dir/..)" - << "VAR =" + << "VAR = ." << "" << true; @@ -1368,7 +1368,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir) QTest::newRow("$$relative_path(): empty file & path") << "VAR = $$relative_path('', /root/sub)" - << "VAR =" + << "VAR = ." << "" << true; -- cgit v1.2.3 From a79dd87f3f0a46cdabe1683b7e2411071c627ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 25 Jun 2015 14:37:49 +0200 Subject: Add lancelot test for Emoji text rendering / color glyphs Change-Id: Id69c28ec49be660e40beaf37bad9ac0d4ce0662d Reviewed-by: aavit --- tests/auto/other/lancelot/scripts/text.qps | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/other/lancelot/scripts/text.qps b/tests/auto/other/lancelot/scripts/text.qps index 344c7a813d..169549a5bd 100644 --- a/tests/auto/other/lancelot/scripts/text.qps +++ b/tests/auto/other/lancelot/scripts/text.qps @@ -159,4 +159,11 @@ save setPen black drawText 0 70 "testing glyph cache textures" -restore \ No newline at end of file +restore + +translate 0 75 +save + setPen black + setFont "sansserif" 16 normal + drawText 0 40 "e😃m😇o😍j😜i😸!" +restore -- cgit v1.2.3 From 97207e2c7f98d7910ef46b2cb7ee41a102995720 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Jun 2015 11:48:34 +0200 Subject: Prospective fix to stabilize tst_QAbstractItemView::task200665_itemEntered(). The test tried to position the mouse cursor over item #0 . This sometimes results in the cursor being outside the window when the window manager adds the window decoration on X11. Move the cursor to the center of the window instead. Add cleanup slot checking top level leaks, remove empty functions. Change-Id: I908240e1cc3fdbe370b43eae0015272ca342a312 Reviewed-by: Simon Hausmann --- .../qabstractitemview/tst_qabstractitemview.cpp | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 90580aea05..eed38752d9 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -197,16 +197,11 @@ class tst_QAbstractItemView : public QObject Q_OBJECT public: - - tst_QAbstractItemView(); - virtual ~tst_QAbstractItemView(); void basic_tests(TestView *view); -public slots: - void initTestCase(); - void cleanupTestCase(); - private slots: + void initTestCase(); + void cleanup(); void getSetCheck(); void emptyModels_data(); void emptyModels(); @@ -360,14 +355,6 @@ void tst_QAbstractItemView::getSetCheck() QCOMPARE(16, obj1->autoScrollMargin()); } -tst_QAbstractItemView::tst_QAbstractItemView() -{ -} - -tst_QAbstractItemView::~tst_QAbstractItemView() -{ -} - void tst_QAbstractItemView::initTestCase() { #ifdef Q_OS_WINCE_WM @@ -375,8 +362,9 @@ void tst_QAbstractItemView::initTestCase() #endif } -void tst_QAbstractItemView::cleanupTestCase() +void tst_QAbstractItemView::cleanup() { + QVERIFY(QApplication::topLevelWidgets().isEmpty()); } void tst_QAbstractItemView::emptyModels_data() @@ -1330,8 +1318,7 @@ void tst_QAbstractItemView::task200665_itemEntered() moveCursorAway(&view); view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - QRect rect = view.visualRect(model.index(0,0)); - QCursor::setPos( view.viewport()->mapToGlobal(rect.center()) ); + QCursor::setPos( view.geometry().center() ); QCoreApplication::processEvents(); QSignalSpy spy(&view, SIGNAL(entered(QModelIndex))); view.verticalScrollBar()->setValue(view.verticalScrollBar()->maximum()); -- cgit v1.2.3 From 2d1189d9f281f1f78abed1a47939a4e2b5e747d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 26 Jun 2015 12:45:35 +0200 Subject: lance: Ensure that OpenGL FBO is cleared before being used as surface Merely filling with Qt::transparent is not enough, as the default blend mode of QPainter is QPainter::CompositionMode_SourceOver, where the alpha of the source is used to blend the pixel on top of the destination. The destination in the case of an FBO may contain garbage, and we end up with the same garbage as the alpha is 0. This was evident when running the ellipses and porter_duff/porter_duff2 tests on OS X. These tests can now be un-blacklisted. Change-Id: I315fa764fa29fb3a06e38945a738a6feadf4502d Reviewed-by: aavit --- tests/auto/other/lancelot/paintcommands.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index caca0f2ebd..4fc41fd649 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -2383,7 +2383,10 @@ void PaintCommands::command_surface_begin(QRegExp re) m_surface_glbuffer->bind(); m_surface_glpaintdevice = new QOpenGLPaintDevice(qRound(w), qRound(h)); m_painter = new QPainter(m_surface_glpaintdevice); + m_painter->save(); + m_painter->setCompositionMode(QPainter::CompositionMode_Clear); m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent); + m_painter->restore(); #endif #ifdef Q_DEAD_CODE_FROM_QT4_X11 } else if (m_type == WidgetType) { -- cgit v1.2.3 From f1b01b7d159bcf04a2b832dba36f876479669641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Martsum?= Date: Fri, 26 Jun 2015 07:17:03 +0200 Subject: QHeaderView - fix a logical / visual index mismatch f9408317e70bc2e635a2f9baeff35d1c06227734 was unfortunately approved though it had an annoying bug. The patch had an assign of a visual index into a logical index. This patch fixes that issue. Change-Id: I9cc75e4e9701858c92e2c3e5817415041b42f8e8 Reviewed-by: J-P Nurmi --- tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp b/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp index 1e26af8f57..af11e2a098 100644 --- a/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp +++ b/tests/manual/widgets/itemviews/qheaderview/qheaderviewtest1.cpp @@ -140,10 +140,12 @@ private: QTableView *setupTableView() { tableView = new QTableView; - m.setRowCount(500); + const int rowCount = 200; + m.setRowCount(rowCount); m.setColumnCount(250); tableView->setSelectionMode(QAbstractItemView::SingleSelection); tableView->setModel(&m); + tableView->verticalHeader()->swapSections(rowCount - 1, 5); return tableView; } -- cgit v1.2.3 From a7f2af09114cfa0996794c85bc48a601f665772d Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 28 May 2015 12:45:48 +0200 Subject: Replace MAC OS X with OS X Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith --- tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp | 2 +- tests/auto/corelib/io/qfile/tst_qfile.cpp | 2 +- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 2 +- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 2 +- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 2 +- tests/auto/corelib/tools/qcollator/tst_qcollator.cpp | 2 +- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 2 +- tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp | 2 +- tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp | 4 ++-- tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 2 +- tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp | 2 +- tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 2 +- tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp | 2 +- tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 9d29b5401f..2cf93e1c45 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -1837,7 +1837,7 @@ static QRegion qRegionData(int index) case 12: return QRegion(0, 0, 3, 3, QRegion::Ellipse); #else case 7: - qWarning("Skipping streaming of elliptical regions on embedded, Mac OS X, and X11;" + qWarning("Skipping streaming of elliptical regions on embedded, OS X, and X11;" " our pointarray stuff is not that great at approximating."); #endif } diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 5025dd38db..b423e857d0 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -2192,7 +2192,7 @@ void tst_QFile::removeOpenFile() bool opened = f.open(QIODevice::ReadOnly); QVERIFY(opened); f.readAll(); - // this used to only fail on FreeBSD (and Mac OS X) + // this used to only fail on FreeBSD (and OS X) QVERIFY(f.flush()); bool removed = f.remove(); // remove should both close and remove the file QVERIFY(removed); diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index f215e87a48..2b01cfd7a9 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1281,7 +1281,7 @@ void tst_QFileInfo::isHidden_data() #endif #if defined(Q_OS_MAC) - // /bin has the hidden attribute on Mac OS X + // /bin has the hidden attribute on OS X QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << true; #elif !defined(Q_OS_WIN) QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false; diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 399e9b9222..0c65ceb0eb 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -1558,7 +1558,7 @@ void tst_QProcess::failToStart() QVERIFY(finishedSpy.isValid()); QVERIFY(finishedSpy2.isValid()); -// Mac OS X and HP-UX have a really low default process limit (~100), so spawning +// OS X and HP-UX have a really low default process limit (~100), so spawning // to many processes here will cause test failures later on. #if defined Q_OS_HPUX const int attempts = 15; diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index bc33d5991b..e2e1d99657 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -1476,7 +1476,7 @@ void tst_QSettings::remove() void tst_QSettings::contains() { QSettings settings1(QSettings::UserScope, "software.org", "KillerAPP"); - int initialNumKeys = settings1.allKeys().size(); // 0 on all platforms but Mac OS X. + int initialNumKeys = settings1.allKeys().size(); // 0 on all platforms but OS X. settings1.setValue("alpha/beta/geometry", -7); settings1.setValue("alpha/beta/geometry/x", 1); settings1.setValue("alpha/beta/geometry/y", 2); diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index e5675397f5..b0135ab6af 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -103,7 +103,7 @@ void tst_QCollator::compare_data() It's hard to test English, because it's treated differently on different platforms. For example, on Linux, it uses the iso14651_t1 template file, which happens to provide good - defaults for Swedish. Mac OS X seems to do a pure bytewise + defaults for Swedish. OS X seems to do a pure bytewise comparison of Latin-1 values, although I'm not sure. So I just test digits to make sure that it's not totally broken. */ diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index d2f7a6ee50..6d4dbab1fd 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -4843,7 +4843,7 @@ void tst_QString::localeAwareCompare_data() It's hard to test English, because it's treated differently on different platforms. For example, on Linux, it uses the iso14651_t1 template file, which happens to provide good - defaults for Swedish. Mac OS X seems to do a pure bytewise + defaults for Swedish. OS X seems to do a pure bytewise comparison of Latin-1 values, although I'm not sure. So I just test digits to make sure that it's not totally broken. */ diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 2edfddf6dd..3fcbd0a16f 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -400,7 +400,7 @@ void tst_QKeySequence::keyBindings() void tst_QKeySequence::mnemonic_data() { #ifdef Q_OS_MAC - QSKIP("Test not applicable to Mac OS X"); + QSKIP("Test not applicable to OS X"); #endif QTest::addColumn("string"); QTest::addColumn("key"); diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index bef51bd73d..cb816a7e85 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -363,7 +363,7 @@ void tst_QMessageBox::statics() } } -// shortcuts are not used on MAC OS X +// shortcuts are not used on OS X #ifndef Q_OS_MAC void tst_QMessageBox::shortcut() { @@ -483,7 +483,7 @@ void tst_QMessageBox::instanceSourceCompat() QCOMPARE(exec(&mb, Qt::Key_Enter), int(QMessageBox::Yes)); QCOMPARE(exec(&mb, Qt::Key_Escape), int(QMessageBox::Cancel)); #ifndef Q_OS_MAC - // mnemonics are not used on Mac OS X + // mnemonics are not used on OS X QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_R), 0); QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_Z), 1); #endif diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 119e9dfecb..d1d4c1ab86 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -2683,7 +2683,7 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState() view.viewport()->repaint(); #ifdef Q_OS_MAC - // Repaint on Mac OS X actually does require spinning the event loop. + // Repaint on OS X actually does require spinning the event loop. QTest::qWait(100); #endif QVERIFY(!parent->dirtyPainter); diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp index 1324027af6..340637513c 100644 --- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp @@ -850,7 +850,7 @@ void tst_QTreeView::editTriggers() case QAbstractItemView::EditKeyPressed: view.setFocus(); #ifdef Q_OS_MAC - // Mac OS X uses Enter for editing + // OS X uses Enter for editing QTest::keyPress(&view, Qt::Key_Enter); #else // All other platforms use F2 diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index c33fd5a951..15532bf4fd 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -1302,7 +1302,7 @@ void DeleteLaterWidget::checkDeleteLater() void tst_QApplication::testDeleteLater() { #ifdef Q_OS_MAC - QSKIP("This test fails and then hangs on Mac OS X, see QTBUG-24318"); + QSKIP("This test fails and then hangs on OS X, see QTBUG-24318"); #endif int argc = 0; QApplication app(argc, 0); diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp index 619c62d7c0..1d995b5eea 100644 --- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp +++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp @@ -187,7 +187,7 @@ void tst_QLabel::cleanup() } } -// Set buddy doesn't make much sense on Mac OS X +// Set buddy doesn't make much sense on OS X #ifndef Q_OS_MAC void tst_QLabel::setBuddy() { diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index 1037d94734..0b7189179d 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -100,7 +100,7 @@ void tst_QScrollBar::scrollSingleStep() QTest::qWait(510); // initial delay is 500 for setRepeatAction disconnect(&testWidget, &QAbstractSlider::actionTriggered, &testWidget, &SingleStepTestScrollBar::hideAndShow); #ifdef Q_OS_MAC - QEXPECT_FAIL("", "This test fails on Mac OS X, see QTBUG-25272", Abort); + QEXPECT_FAIL("", "This test fails on OS X, see QTBUG-25272", Abort); #endif QCOMPARE(testWidget.value(), testWidget.singleStep()); } -- cgit v1.2.3 From b0852eb2714eac824bff36216b3301f2e02f82a9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 11 Jun 2015 12:20:00 +0200 Subject: tst_qtooltip: Move cursor away from tooltip. When executing the test in a sequence (as done by make check after tst_qstackedlayout), tst_QToolTip::task183679 often fails since apparently the tooltip is hidden when the cursor is near it. Move to the cursor to the right corner of the widget to fix this. Change-Id: I3b13239e77cb387f1b1425fab79c8d6faa27b5bb Reviewed-by: Simon Hausmann --- tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp index 0de9e188a0..d7746a2ee1 100644 --- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp @@ -103,6 +103,10 @@ void tst_QToolTip::task183679() Widget_task183679 widget; widget.move(QGuiApplication::primaryScreen()->availableGeometry().topLeft() + QPoint(50, 50)); + // Ensure cursor is not over tooltip, which causes it to hide +#ifndef QT_NO_CURSOR + QCursor::setPos(widget.geometry().topRight() + QPoint(-50, 50)); +#endif widget.setWindowTitle(QLatin1String(QTest::currentTestFunction()) + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag())); widget.show(); -- cgit v1.2.3 From 52e7aba6bf717c673151c9267040c7a90dbea039 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 24 Jun 2015 10:31:07 +0200 Subject: QFileIconEngine: Remove reference to QFileIconProvider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keeping the reference may end up in a crash if a created QIcon outlives the QFileIconProvider and we then try to generate a pixmap. The reference is not necessary since the options are queried only when creating the icon, so they can be saved in the icon provider. Task-number: QTBUG-46755 Change-Id: I5c60887c2ed39030a2a20298ff10fd652189e4e7 Reviewed-by: Timur Pocheptsov Reviewed-by: Marc Mutz Reviewed-by: Morten Johan Sørvig --- .../qfileiconprovider/tst_qfileiconprovider.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp b/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp index 0bc972d0cb..fba83a24c7 100644 --- a/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp +++ b/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp @@ -58,6 +58,8 @@ private slots: void type_data(); void type(); + + void taskQTBUG_46755_QFileIconEngine_crash(); }; // Subclass that exposes the protected functions. @@ -167,6 +169,21 @@ void tst_QFileIconProvider::type() QVERIFY(!provider.type(info).isEmpty()); } +static QIcon getIcon() +{ + QFileIconProvider fip; + return fip.icon(QDir::currentPath()); +} + +void tst_QFileIconProvider::taskQTBUG_46755_QFileIconEngine_crash() +{ + const QIcon &icon = getIcon(); + foreach (const QSize &size, icon.availableSizes()) + icon.pixmap(size); + + // No crash, all good. +} + QTEST_MAIN(tst_QFileIconProvider) #include "tst_qfileiconprovider.moc" -- cgit v1.2.3