diff options
Diffstat (limited to 'tests/auto/gui/image/qimage/tst_qimage.cpp')
-rw-r--r-- | tests/auto/gui/image/qimage/tst_qimage.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index 0fad243cb2..bee6ff9f8c 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -137,6 +137,8 @@ private slots: void fillColorWithAlpha(); + void fillRGB888(); + void rgbSwapped_data(); void rgbSwapped(); @@ -1047,11 +1049,11 @@ void tst_QImage::setPixel_data() QTest::newRow("ARGB8555_Premultiplied blue") << int(QImage::Format_ARGB8555_Premultiplied) << 0xff0000ff << 0x001fffu; QTest::newRow("RGB888 red") << int(QImage::Format_RGB888) - << 0xffff0000 << 0x0000ffu; + << 0xffff0000 << 0xff0000u; QTest::newRow("RGB888 green") << int(QImage::Format_RGB888) << 0xff00ff00 << 0x00ff00u; QTest::newRow("RGB888 blue") << int(QImage::Format_RGB888) - << 0xff0000ff << 0xff0000u; + << 0xff0000ff << 0x0000ffu; } void tst_QImage::setPixel() @@ -1872,6 +1874,21 @@ void tst_QImage::fillColorWithAlpha() QCOMPARE(argb32pm.pixel(0, 0), 0x7f7f0000u); } +void tst_QImage::fillRGB888() +{ + QImage expected(1, 1, QImage::Format_RGB888); + QImage actual(1, 1, QImage::Format_RGB888); + + for (int c = Qt::black; c < Qt::transparent; ++c) { + QColor color = QColor(Qt::GlobalColor(c)); + + expected.fill(color); + actual.fill(color.rgba()); + + QCOMPARE(actual.pixel(0, 0), expected.pixel(0, 0)); + } +} + void tst_QImage::rgbSwapped_data() { QTest::addColumn<QImage::Format>("format"); |