From d9d76d0f56b0e2b0ce09abf39c710a1e666fa09f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 13 Oct 2009 13:55:44 +0200 Subject: Fix graphicsview test on Cocoa. Cocoa doesn't support regions update and always update the bounding rect (see comment in QWidgetPrivate::update_sys in qwidget_mac.cpp) Change tests that checked that we get the exact regions. Reviewed-by: MortenS --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/auto/qgraphicsview') diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 8acaa72eb5..389200b9aa 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -2210,9 +2210,11 @@ void tst_QGraphicsView::viewportUpdateMode() // The view gets two updates for the update scene updates. QTRY_VERIFY(!view.lastUpdateRegions.isEmpty()); +#ifndef QT_MAC_USE_COCOA //cocoa doesn't support drawing regions QCOMPARE(view.lastUpdateRegions.last().rects().size(), 2); QCOMPARE(view.lastUpdateRegions.last().rects().at(0).size(), QSize(15, 15)); QCOMPARE(view.lastUpdateRegions.last().rects().at(1).size(), QSize(15, 15)); +#endif // Set full update mode. view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); @@ -3431,10 +3433,12 @@ void tst_QGraphicsView::exposeRegion() // Make sure it triggers correct repaint on the view. QTRY_COMPARE(view.lastUpdateRegions.size(), 1); - QTRY_COMPARE(view.lastUpdateRegions.at(0), expectedExposeRegion); + COMPARE_REGIONS(view.lastUpdateRegions.at(0), expectedExposeRegion); // Make sure the item didn't get any repaints. +#ifndef QT_MAC_USE_COCOA QCOMPARE(item->paints, 0); +#endif } void tst_QGraphicsView::update_data() -- cgit v1.2.1