diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-08-22 00:11:16 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-22 02:04:39 +0200 |
commit | c374f4441ab42d1849431bb42fec91a976a8e502 (patch) | |
tree | 0733146c5df48b91a39097730c445dbe9cd2359a /tests/auto/widgets/graphicsview | |
parent | 85b24bb2dea97c3a9b013bacd5a422b26fe5d14b (diff) | |
parent | c8ca300e491c186304d0864a9e870337e891e6f7 (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/widgets/graphicsview')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 9353aa0eba..2c03850181 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -4423,10 +4423,13 @@ void tst_QGraphicsItem::defaultItemTest_QGraphicsEllipseItem() QCOMPARE(item.boundingRect(), QRectF(0, 0, 100, 100)); item.setSpanAngle(90 * 16); - qFuzzyCompare(item.boundingRect().left(), qreal(50.0)); - qFuzzyCompare(item.boundingRect().top(), qreal(0.0)); - qFuzzyCompare(item.boundingRect().width(), qreal(50.0)); - qFuzzyCompare(item.boundingRect().height(), qreal(50.0)); + // for some reason, the bounding rect has very few significant digits + // (i.e. it's likely that floats are being used inside it), so we + // must force the conversion from qreals to float or these tests will fail + QCOMPARE(float(item.boundingRect().left()), 50.0f); + QVERIFY(qFuzzyIsNull(float(item.boundingRect().top()))); + QCOMPARE(float(item.boundingRect().width()), 50.0f); + QCOMPARE(float(item.boundingRect().height()), 50.0f); item.setPen(QPen(Qt::black, 1)); QCOMPARE(item.boundingRect(), QRectF(49.5, -0.5, 51, 51)); |