From a5cded843f495b4276a8289b1324778d97bed5ba Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 11 Feb 2019 10:52:06 +0100 Subject: Avoid creating wide images with negative bytesPerLine The QImage API can not handle images with more bytes per line than what an integer can hold. Fixes: QTBUG-73731 Fixes: QTBUG-73732 Change-Id: Ieed6fec7645661fd58d8d25335f806faaa1bb3e9 Reviewed-by: Thiago Macieira --- tests/auto/gui/image/qimage/tst_qimage.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 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 eded206d37..6bc27a6e16 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -230,6 +230,8 @@ private slots: void convertColorTable(); + void wideImage(); + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void toWinHBITMAP_data(); void toWinHBITMAP(); @@ -3535,6 +3537,24 @@ void tst_QImage::convertColorTable() QCOMPARE(rgb32.pixel(0,0), 0xffffffff); } +void tst_QImage::wideImage() +{ + // QTBUG-73731 and QTBUG-73732 + QImage i(538994187, 2, QImage::Format_ARGB32); + QImage i2(32, 32, QImage::Format_ARGB32); + i2.fill(Qt::white); + + // Test that it doesn't crash: + QPainter painter(&i); + // With the composition mode is SourceOver out it's an invalid write + // With the composition mode is Source it's an invalid read + painter.drawImage(0, 0, i2); + painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.drawImage(0, 0, i2); + + // Qt6: Test that it actually works on 64bit architectures. +} + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QT_BEGIN_NAMESPACE Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &p, int hbitmapFormat = 0); -- cgit v1.2.3 From 0f163887b526d00ccdcead907dde042aa370fc16 Mon Sep 17 00:00:00 2001 From: Juha Karjalainen Date: Tue, 19 Feb 2019 13:57:47 +0200 Subject: Fix blacklisting tst_QTimer::basic_chrono() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blacklisting did not work as blacklist should have contained osx instead macos Change-Id: Ifd76a38d371ccce545eb5df030aaa819b00a5b48 Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/kernel/qtimer/BLACKLIST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST index c31e15f171..16cbab4587 100644 --- a/tests/auto/corelib/kernel/qtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST @@ -2,4 +2,4 @@ windows osx [basic_chrono] -macos +osx -- cgit v1.2.3 From 01f5d41a406b7baf1cb01692c870e5084fc11b1f Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 20 Feb 2019 13:30:52 +0100 Subject: Make tst_QUdpSocket::lincLocalIPv6 less sadistic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It fails on CI (Windows 10). Given our qabstractsocket disables read notifications/stops emitting readyRead if it already has pending data (unbuffered, aka UDP socket type) - make sure we do not suffer from this. The change does not affect the test's logic (unless the logic was to fail), it just makes it more fail-proof. Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197 Fixes: QTBUG-73884 Reviewed-by: Edward Welbourne Reviewed-by: Mårten Nordheim (cherry picked from commit d3eb9e944ac73f238b8716bb25b8051377bba946) Reviewed-by: Timur Pocheptsov --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8ebb27e58c..707c1acf48 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1640,15 +1640,14 @@ void tst_QUdpSocket::linkLocalIPv6() sockets << s; } - QUdpSocket neutral; - QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); - QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); - QByteArray testData("hello"); foreach (QUdpSocket *s, sockets) { + QUdpSocket neutral; + QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); + QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); + QSignalSpy spy(s, SIGNAL(readyRead())); - neutralReadSpy.clear(); QVERIFY(s->writeDatagram(testData, s->localAddress(), neutral.localPort())); QTRY_VERIFY(neutralReadSpy.count() > 0); //note may need to accept a firewall prompt -- cgit v1.2.3 From 50f3f8f6bb8f5482c713480fad80421760184216 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Mar 2019 08:34:01 +0100 Subject: Use High DPI pixmaps in prominent examples and tests Set AA_UseHighDpiPixmaps. Task-number: QTBUG-52622 Change-Id: Ic4373a9c94952f50bc1ad36bcc0dec850efc124a Reviewed-by: Robert Loehning Reviewed-by: Richard Moe Gustavsen --- tests/manual/dialogs/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/manual/dialogs/main.cpp b/tests/manual/dialogs/main.cpp index 2676ceeb52..07df8f5cf4 100644 --- a/tests/manual/dialogs/main.cpp +++ b/tests/manual/dialogs/main.cpp @@ -126,6 +126,10 @@ void MainWindow::aboutDialog() int main(int argc, char *argv[]) { +#if QT_VERSION >= 0x050600 + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif + for (int a = 1; a < argc; ++a) { if (!qstrcmp(argv[a], "-n")) { qDebug("AA_DontUseNativeDialogs"); -- cgit v1.2.3 From adaa3acc7418ba212d403bc5f79a2d6fbd0af0ed Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Fri, 15 Mar 2019 12:02:18 +0100 Subject: Use Q_UNUSED(updateRect) when building without QT_BUILD_INTERNAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3e5292bc09ae53bee5f8bb8c7c1922d1a20b2e10 Reviewed-by: Mårten Nordheim --- tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 55139ff99a..28df3a3c38 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -4075,6 +4075,8 @@ void tst_QGraphicsView::update() QTRY_COMPARE(view.lastUpdateRegions.at(0), QRegion(updateRect) & viewportRect); } QTRY_VERIFY(!viewPrivate->fullUpdatePending); +#else + Q_UNUSED(updateRect); #endif } -- cgit v1.2.3