From 25502811723a026a38c0a861a6a304d24b8e6a95 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 29 Oct 2009 09:37:26 +0100 Subject: Stabilize tests --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp | 4 +++- tests/auto/qtreeview/tst_qtreeview.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 2c948cc..28f249f 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -7463,7 +7463,7 @@ void tst_QGraphicsItem::moveLineItem() // Make sure the calculated region is correct. item->update(); QTest::qWait(10); - QCOMPARE(view.paintedRegion, expectedRegion); + QTRY_COMPARE(view.paintedRegion, expectedRegion); view.reset(); // Old position: (50, 50) diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp index 9dfd486..7d98748 100644 --- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp +++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp @@ -45,6 +45,8 @@ #include #include #include +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -356,7 +358,7 @@ void tst_QGraphicsSceneIndex::clear() MyItem *item = new MyItem; scene.addItem(item); qApp->processEvents(); - QCOMPARE(item->numPaints, 1); + QTRY_COMPARE(item->numPaints, 1); } QTEST_MAIN(tst_QGraphicsSceneIndex) diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 1429771..75c02e9 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3552,6 +3552,7 @@ void tst_QTreeView::doubleClickedWithSpans() view.setModel(&model); view.setFirstColumnSpanned(0, QModelIndex(), true); view.show(); + QTest::qWaitForWindowShown(&view); QPoint p(10, 10); QCOMPARE(view.indexAt(p), model.index(0, 0)); -- cgit v0.12