summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-11-04 15:16:35 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-04 07:11:07 +0100
commit9dc4907074dfa18d8b0ecf5daa9950bfac68781e (patch)
treed7f4605eaf423d968bec6ad66b251692c9b73adc /tests
parentc30ebdeac028a3fe4a820cd5fe8360d11d14868d (diff)
Don't rely on PlatformQuirks in qimagereader test
The PlatformQuirks header is, by its author's own admission, based on "very bad assumptions", those being that only Meego has quirks. The assumption that only Meego has versions of libjpeg and libpng with rounding errors is not a good assumption. Change the test to be a little tolerant of rounding error regardless of the platform, at least until there's a reliable way to tell which libjpeg/libpng versions have rounding errors. Change-Id: Id2be5cc54739249b615bf3307ee1850c0a5c06b3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 4f9ec0dfb1..69dd30b90b 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -55,8 +55,6 @@
#include <QTcpServer>
#include <QTimer>
-#include "../../../platformquirks.h"
-
typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QImage)
@@ -320,14 +318,15 @@ void tst_QImageReader::jpegRgbCmyk()
QImage image1(prefix + QLatin1String("YCbCr_cmyk.jpg"));
QImage image2(prefix + QLatin1String("YCbCr_cmyk.png"));
- if (PlatformQuirks::isImageLoaderImprecise()) {
+ if (image1 != image2) {
// first, do some obvious tests
QCOMPARE(image1.height(), image2.height());
QCOMPARE(image1.width(), image2.width());
QCOMPARE(image1.format(), image2.format());
QCOMPARE(image1.format(), QImage::Format_RGB32);
- // compare all the pixels with a slack of 3. This ignores rounding errors in libjpeg/libpng
+ // compare all the pixels with a slack of 3. This ignores rounding errors
+ // in libjpeg/libpng, where some versions sacrifice accuracy for speed.
for (int h = 0; h < image1.height(); ++h) {
const uchar *s1 = image1.constScanLine(h);
const uchar *s2 = image2.constScanLine(h);
@@ -339,8 +338,6 @@ void tst_QImageReader::jpegRgbCmyk()
s2++;
}
}
- } else {
- QCOMPARE(image1, image2);
}
}