summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-02 11:37:41 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-03 14:21:29 +0000
commit5bd41b850f65b8054d94b58b787704bb45ede16c (patch)
tree570fd23d47c5c389e5af4b305e2ff387fa13b600 /tests/auto
parent1b329bfc79d34d7859e27a1fc2aa6eb58e690dbc (diff)
Correct inplace conversion methods from RGBA8888 formats
The methods for inplace conversion from RGBA to ARGB was misplaced by one step causing conversion to RGB16 to get an invalid method. Change-Id: I3b2b4cffe993705c48613eec7d9b7c6213f57fc2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'tests/auto')
-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 1fef747399..ed1d915670 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -2462,6 +2462,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()
@@ -2480,6 +2482,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);
@@ -2487,8 +2490,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
}