From 92dab5ea276732944915a9423fc174db6d84e572 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 12 Oct 2009 12:59:16 +0200 Subject: GraphicsView tests on mac When a widget is shown we get two paint avent on Mac --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index e4eaf4e..c6ee237 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -6183,7 +6183,7 @@ void tst_QGraphicsItem::opacity2() MyGraphicsView view(&scene); view.show(); QTest::qWaitForWindowShown(&view); - QTRY_COMPARE(view.repaints, 1); + QTRY_VERIFY(view.repaints > 1); #define RESET_REPAINT_COUNTERS \ parent->repaints = 0; \ diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index df3ebef..f7c8d35 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -115,6 +115,7 @@ public: } int count() const { return _count; } + void reset() { _count = 0; } protected: bool eventFilter(QObject *watched, QEvent *event) @@ -2938,10 +2939,11 @@ void tst_QGraphicsView::task239729_noViewUpdate() view->show(); QTest::qWaitForWindowShown(view); - QTRY_COMPARE(spy.count(), 1); + QTRY_VERIFY(spy.count() > 1); + spy.reset(); scene.update(); QApplication::processEvents(); - QTRY_COMPARE(spy.count(), 2); + QTRY_COMPARE(spy.count(), 1); delete view; } -- cgit v0.12