summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimage/tst_qimage.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-16 15:54:02 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-16 15:54:02 (GMT)
commit684de9f1bf5886e91547db6726afaa88587310ce (patch)
treec8ac6588f80067737626208b7a09c61295a32c30 /tests/auto/qimage/tst_qimage.cpp
parentd7c1b7cddbfb7ba57e33c4286bba5c75ddcaedad (diff)
parent660145873a05b159b2f96dab8f0eaa75499146ff (diff)
downloadQt-684de9f1bf5886e91547db6726afaa88587310ce.zip
Qt-684de9f1bf5886e91547db6726afaa88587310ce.tar.gz
Qt-684de9f1bf5886e91547db6726afaa88587310ce.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: qdrawhelper: Use SSE2 in fetchTransformedBilinear (when scalling up) QListView: speedup QListView::setRowHidden() Remove debug info from tst_QGlyphs Fix tst_QGlyphs to pass on Windows XP Finally, remove some trailing whitespace. Fix warning with gcc in -pedantic Make tst_image a little bit more tollerent to rounding errors Fix compilation with RVCT Test native graphics engine in tst_QGlyphs Remove unused function in tst_QGlyphs qdrawhelper: optimize fetchTransformedBilinear qdrawhelper: remove code duplication Fix maketestselftest by adding the qglyphs test add missing header make the plugin loader autotests pass Reimplement more of QAbstractItemModel in QAbstractProxyModel Qt now really unloads plugins and libraries when exiting an app Don't add the qmediaplayer.pro to the destination path of the sources. New class: QGlyphs
Diffstat (limited to 'tests/auto/qimage/tst_qimage.cpp')
-rw-r--r--tests/auto/qimage/tst_qimage.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 16deb03..2164b05 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -1426,11 +1426,6 @@ static inline int rand8()
return int(256. * (qrand() / (RAND_MAX + 1.0)));
}
-static inline bool compare(int a, int b, int tolerance)
-{
- return qAbs(a - b) <= tolerance;
-}
-
// compares img.scale against the bilinear filtering used by QPainter
void tst_QImage::smoothScale3()
{
@@ -1458,6 +1453,7 @@ void tst_QImage::smoothScale3()
p.scale(scales[i], scales[i]);
p.drawImage(0, 0, img);
p.end();
+ int err = 0;
for (int y = 0; y < a.height(); ++y) {
for (int x = 0; x < a.width(); ++x) {
@@ -1465,11 +1461,15 @@ void tst_QImage::smoothScale3()
QRgb cb = b.pixel(x, y);
// tolerate a little bit of rounding errors
- QVERIFY(compare(qRed(ca), qRed(cb), 3));
- QVERIFY(compare(qGreen(ca), qGreen(cb), 3));
- QVERIFY(compare(qBlue(ca), qBlue(cb), 3));
+ bool r = true;
+ r &= qAbs(qRed(ca) - qRed(cb)) <= 18;
+ r &= qAbs(qGreen(ca) - qGreen(cb)) <= 18;
+ r &= qAbs(qBlue(ca) - qBlue(cb)) <= 18;
+ if (!r)
+ err++;
}
}
+ QCOMPARE(err, 0);
}
}