summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qimage/tst_qimage.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-10 16:57:11 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-02-10 16:57:11 +0000
commit0866680bd904aff4fe2a643a2b81c460cbb99c77 (patch)
tree242dae052199994a35f5e68578661175241a0a71 /tests/auto/gui/image/qimage/tst_qimage.cpp
parent34ea269b3b173498312b0203d6875ef3b4ba0253 (diff)
parentfc35f714340d5361231506dfbead132122f59460 (diff)
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/gui/image/qimage/tst_qimage.cpp')
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index c61f5f38ca..9feec3f6c7 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -2477,6 +2477,8 @@ void tst_QImage::inplaceConversion_data()
QTest::newRow("Format_RGB666 -> Format_RGB888") << QImage::Format_RGB666 << QImage::Format_RGB888;
QTest::newRow("Format_ARGB8565_Premultiplied, Format_ARGB8555_Premultiplied") << QImage::Format_ARGB8565_Premultiplied << QImage::Format_ARGB8555_Premultiplied;
QTest::newRow("Format_ARGB4444_Premultiplied, Format_RGB444") << QImage::Format_ARGB4444_Premultiplied << QImage::Format_RGB444;
+ QTest::newRow("Format_RGBA8888 -> RGB16") << QImage::Format_RGBA8888 << QImage::Format_RGB16;
+ QTest::newRow("Format_RGBA8888_Premultiplied -> RGB16") << QImage::Format_RGBA8888_Premultiplied << QImage::Format_RGB16;
}
void tst_QImage::inplaceConversion()
@@ -2495,6 +2497,7 @@ void tst_QImage::inplaceConversion()
const uchar* originalPtr = image.constScanLine(0);
QImage imageConverted = std::move(image).convertToFormat(dest_format);
+ QCOMPARE(imageConverted.format(), dest_format);
for (int i = 0; i < imageConverted.height(); ++i) {
for (int j = 0; j < imageConverted.width(); ++j) {
QRgb convertedColor = imageConverted.pixel(j,i);
@@ -2502,8 +2505,8 @@ void tst_QImage::inplaceConversion()
QCOMPARE(qGreen(convertedColor) & 0xF0, i * 16);
}
}
-
- QCOMPARE(imageConverted.constScanLine(0), originalPtr);
+ if (image.depth() == imageConverted.depth())
+ QCOMPARE(imageConverted.constScanLine(0), originalPtr);
#endif
}