Fix overflow in rgb30 gradient tests
The tests were trying to access one pixel outside of the image. Change-Id: Ieabdefbbdb76bb736214a0495bec72c881b27d2c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
parent
74f28ef1ca
commit
71203b1f0e
@ -3978,9 +3978,9 @@ void tst_QPainter::linearGradientRgb30()
|
||||
painter.fillRect(image.rect(), gradient);
|
||||
painter.end();
|
||||
|
||||
for (int i = 0; i < 1000; ++i) {
|
||||
QColor p1 = image.pixelColor(i, 0);
|
||||
QColor p2 = image.pixelColor(i + 1, 0);
|
||||
for (int i = 1; i < 1000; ++i) {
|
||||
QColor p1 = image.pixelColor(i - 1, 0);
|
||||
QColor p2 = image.pixelColor(i, 0);
|
||||
QVERIFY(p1 != p2);
|
||||
QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
|
||||
}
|
||||
@ -4005,9 +4005,9 @@ void tst_QPainter::radialGradientRgb30()
|
||||
painter.fillRect(image.rect(), gradient);
|
||||
painter.end();
|
||||
|
||||
for (int i = 0; i < 1000; ++i) {
|
||||
QColor p1 = image.pixelColor(i, 0);
|
||||
QColor p2 = image.pixelColor(i + 1, 0);
|
||||
for (int i = 1; i < 1000; ++i) {
|
||||
QColor p1 = image.pixelColor(i - 1, 0);
|
||||
QColor p2 = image.pixelColor(i, 0);
|
||||
QVERIFY(p1 != p2);
|
||||
QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user