diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-12 11:24:01 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-12 11:24:01 (GMT) |
commit | dc6138cd793bf5b39617cb834ff0ee7c536384b9 (patch) | |
tree | 9668749687dd3133f8b9b1dc3e0351bcfcdc200e /tests/auto/qgraphicsview/tst_qgraphicsview.cpp | |
parent | 106678fe1f27e1df161b2e55ccc88b244fa6d478 (diff) | |
download | Qt-dc6138cd793bf5b39617cb834ff0ee7c536384b9.zip Qt-dc6138cd793bf5b39617cb834ff0ee7c536384b9.tar.gz Qt-dc6138cd793bf5b39617cb834ff0ee7c536384b9.tar.bz2 |
Fix GraphicsView test on mac
On mac, we always get full update.
Diffstat (limited to 'tests/auto/qgraphicsview/tst_qgraphicsview.cpp')
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index f7c8d35..926335f 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -84,6 +84,12 @@ Q_DECLARE_METATYPE(QPolygonF) Q_DECLARE_METATYPE(QRectF) Q_DECLARE_METATYPE(Qt::ScrollBarPolicy) +#ifdef Q_WS_MAC +//On mac we get full update. So check that the expected region is contained inside the actual +#define COMPARE_REGIONS(ACTUAL, EXPECTED) QVERIFY((EXPECTED).subtracted(ACTUAL).isEmpty()) +#else +#define COMPARE_REGIONS QCOMPARE +#endif static void sendMousePress(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::LeftButton) { @@ -3179,7 +3185,7 @@ void tst_QGraphicsView::moveItemWhileScrolling() int a = adjustForAntialiasing ? 2 : 1; expectedRegion += QRect(40, 50, 10, 10).adjusted(-a, -a, a, a); expectedRegion += QRect(40, 60, 10, 10).adjusted(-a, -a, a, a); - QCOMPARE(view.lastPaintedRegion, expectedRegion); + COMPARE_REGIONS(view.lastPaintedRegion, expectedRegion); } void tst_QGraphicsView::centerOnDirtyItem() |