summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-10-12 13:24:01 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-12 13:24:01 +0200
commitdc6138cd793bf5b39617cb834ff0ee7c536384b9 (patch)
tree9668749687dd3133f8b9b1dc3e0351bcfcdc200e /tests/auto/qgraphicsview
parent106678fe1f27e1df161b2e55ccc88b244fa6d478 (diff)
Fix GraphicsView test on mac
On mac, we always get full update.
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index f7c8d351b0..926335f161 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()