summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-06-24 13:15:56 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-06-25 09:34:06 (GMT)
commit1223f3f3d32bdc394a0fcd8d034fb3ad0afab0c5 (patch)
tree1083f70bad8b9c79aba5d0141a5c5b130d04b71f /tests/auto/qpainter
parent3b7ae67fe2715838c32ff28694761e57e4f79537 (diff)
downloadQt-1223f3f3d32bdc394a0fcd8d034fb3ad0afab0c5.zip
Qt-1223f3f3d32bdc394a0fcd8d034fb3ad0afab0c5.tar.gz
Qt-1223f3f3d32bdc394a0fcd8d034fb3ad0afab0c5.tar.bz2
Fixed autotest failure in QPainter::setOpacity when NEON is used.
Be more lenient in the comparison, rounding errors might lead to slightly different values. Reviewed-by: Trond
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 701dc2e..27ee6e7 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -2648,12 +2648,16 @@ void tst_QPainter::setOpacity()
p.drawImage(imageRect, src, imageRect);
p.end();
- QImage expected(imageSize, destFormat);
- p.begin(&expected);
- p.fillRect(imageRect, QColor(127, 127, 127));
- p.end();
-
- QCOMPARE(dest, expected);
+ QImage actual = dest.convertToFormat(QImage::Format_RGB32);
+
+ for (int y = 0; y < actual.height(); ++y) {
+ QRgb *p = (QRgb *)actual.scanLine(y);
+ for (int x = 0; x < actual.width(); ++x) {
+ QVERIFY(qAbs(qRed(p[x]) - 127) <= 0xf);
+ QVERIFY(qAbs(qGreen(p[x]) - 127) <= 0xf);
+ QVERIFY(qAbs(qBlue(p[x]) - 127) <= 0xf);
+ }
+ }
}
void tst_QPainter::drawhelper_blend_untransformed_data()