summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-12-08 07:09:26 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-12-08 07:09:47 +0100
commit3ec31ef9c5acd57a4a59c0d5f5e20b8d9a19bfa1 (patch)
tree8b55dd13dbc2a33fe7c857f622e10b817386bdb3 /tests/auto
parent6f87f2d23fb50d8183ea173fe423b7e1a24c0e2e (diff)
parent4ad8798de428b44fe4c56e1ca111940068056c57 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp18
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp5
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp17
3 files changed, 38 insertions, 2 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 1935e86fc7..26b812715d 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -196,6 +196,8 @@ private slots:
void metadataPassthrough();
+ void pixelColor();
+
private:
const QString m_prefix;
};
@@ -3027,5 +3029,21 @@ void tst_QImage::metadataPassthrough()
QCOMPARE(swapped.devicePixelRatio(), a.devicePixelRatio());
}
+void tst_QImage::pixelColor()
+{
+ QImage argb32(1, 1, QImage::Format_ARGB32);
+ QImage argb32pm(1, 1, QImage::Format_ARGB32_Premultiplied);
+
+ QColor c(Qt::red);
+ c.setAlpha(128);
+ argb32.setPixelColor(QPoint(0, 0), c);
+ argb32pm.setPixelColor(QPoint(0, 0), c);
+ QCOMPARE(argb32.pixelColor(QPoint(0, 0)), c);
+ QCOMPARE(argb32pm.pixelColor(QPoint(0, 0)), c);
+
+ QImage t = argb32.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(t.pixel(0,0), argb32pm.pixel(0,0));
+}
+
QTEST_GUILESS_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index c70fbce46c..0a112e3e07 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -733,7 +733,10 @@ public:
int done = clients;
while (done > 0) {
bool timedOut = true;
- QVERIFY(server.waitForNewConnection(7000, &timedOut));
+ QVERIFY2(server.waitForNewConnection(7000, &timedOut),
+ (QByteArrayLiteral("done=") + QByteArray::number(done)
+ + QByteArrayLiteral(", timedOut=")
+ + (timedOut ? "true" : "false")).constData());
QVERIFY(!timedOut);
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index f146955e95..95e4d92cd2 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -4562,8 +4562,18 @@ void tst_QWidget::setWindowGeometry_data()
QList<int> windowFlags;
windowFlags << 0 << Qt::FramelessWindowHint;
+ const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
foreach (QList<QRect> l, rects) {
QRect rect = l.first();
+ if (skipEmptyRects) {
+ QList<QRect>::iterator it = l.begin();
+ while (it != l.end()) {
+ if (it->isEmpty())
+ it = l.erase(it);
+ else
+ ++it;
+ }
+ }
foreach (int windowFlag, windowFlags) {
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
.arg(rect.x())
@@ -4612,8 +4622,13 @@ void tst_QWidget::setWindowGeometry()
widget.setGeometry(rect);
widget.showNormal();
- if (rect.isValid())
+ if (rect.isValid()) {
QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ } else {
+ // in case of an invalid rect, wait for the geometry to become
+ // adjusted to the actual (valid) value.
+ QApplication::processEvents();
+ }
QTRY_COMPARE(widget.geometry(), rect);
// setGeometry() while shown