diff options
-rw-r--r-- | tests/auto/quick/qquickpathview/tst_qquickpathview.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index 274b93e81a..e4ad7b9c40 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -1725,6 +1725,14 @@ void tst_QQuickPathView::missingPercent() delete obj; } +static inline bool hasFraction(qreal o) +{ + const bool result = o != qFloor(o); + if (!result) + qDebug() << "o != qFloor(o)" << o; + return result; +} + void tst_QQuickPathView::cancelDrag() { QScopedPointer<QQuickView> window(createView()); @@ -1747,7 +1755,7 @@ void tst_QQuickPathView::cancelDrag() QTest::mouseMove(window.data(), QPoint(30, 100)); QTest::mouseMove(window.data(), QPoint(85, 100)); - QTRY_VERIFY(pathview->offset() != qFloor(pathview->offset())); + QTRY_VERIFY(hasFraction(pathview->offset())); QTRY_VERIFY(pathview->isMoving()); QVERIFY(pathview->isDragging()); QCOMPARE(draggingSpy.count(), 1); |