diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2013-07-30 17:07:48 -0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-02 15:03:09 +0200 |
commit | 0316506d9ddbc3ca9f26f880b9e7fb5d5b0fec36 (patch) | |
tree | f6fffa5d4c860ce56afee2d54649a2f262bf104e /tests/auto/quick/qquickpath | |
parent | b2a1db155bd9cb803abc5d98278cc425b0995c18 (diff) |
Fix tst_qquickpath not to use fuzzy compare
On arm platforms, qreal == float. QPointF stores its coordinates internally on
qreal variables (float on arm). When QPointF comparison takes place, a call to
qFuzzyIsNull(float) will ultimately be triggered, causing the test to fail for
some values, because the epsilon of 0.00001f is too small.
In the particular case regarding BB10, the comparison between QPointF(100,
150) and QPointF(99.9999771, 150) is failing because of that.
Change-Id: I53c8cfe7f8a975f6a015e7690702d3e5f05bc2f2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickpath')
-rw-r--r-- | tests/auto/quick/qquickpath/tst_qquickpath.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickpath/tst_qquickpath.cpp b/tests/auto/quick/qquickpath/tst_qquickpath.cpp index fa68442329..6ecc5cee50 100644 --- a/tests/auto/quick/qquickpath/tst_qquickpath.cpp +++ b/tests/auto/quick/qquickpath/tst_qquickpath.cpp @@ -128,7 +128,7 @@ void tst_QuickPath::catmullromCurve() pos = obj->pointAt(.75); QCOMPARE(pos.toPoint(), QPoint(51,105)); //fuzzy compare pos = obj->pointAt(1); - QCOMPARE(pos, QPointF(100,150)); + QCOMPARE(pos.toPoint(), QPoint(100,150)); } void tst_QuickPath::closedCatmullromCurve() @@ -227,7 +227,7 @@ void tst_QuickPath::line() QCOMPARE(p1.x(), p1.y()); QPointF p2 = path2->pointAt(t); - QCOMPARE(p1, p2); + QCOMPARE(p1.toPoint(), p2.toPoint()); } } |