From e1f7d33dcd8267fd2fc9658df6245ca30df3741e Mon Sep 17 00:00:00 2001 From: ninerider Date: Thu, 8 Oct 2009 14:05:54 +0200 Subject: Comparison tolerance increased for handhelds The 'fuzzy' value for the was not relaxed enoough for small devices such as Windows Mobile and the like. Reviewed-by: Joerg --- tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp index e8979ea..b407fef 100644 --- a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp +++ b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp @@ -159,7 +159,11 @@ void tst_QGraphicsTransform::scale() // definitions correct for the difference. static inline bool fuzzyCompare(qreal p1, qreal p2) { - return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2))); + // increase delta on small machines using float instead of double + if (sizeof(qreal) == sizeof(float)) + return (qAbs(p1 - p2) <= 0.00002f * qMin(qAbs(p1), qAbs(p2))); + else + return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2))); } static bool fuzzyCompare(const QTransform& t1, const QTransform& t2) { -- cgit v0.12