diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-08 08:45:57 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-09-08 08:49:39 (GMT) |
commit | fa889cf4b80868249c70715275069eb150b597cc (patch) | |
tree | ab98dc0979d7c2874902e7f2a9812843104e1c49 /tests/auto/qtreeview | |
parent | deff8fcf0ed060b949c3ec0fa0ec4bd81c253825 (diff) | |
download | Qt-fa889cf4b80868249c70715275069eb150b597cc.zip Qt-fa889cf4b80868249c70715275069eb150b597cc.tar.gz Qt-fa889cf4b80868249c70715275069eb150b597cc.tar.bz2 |
Try to make test more robust.
By using QTRY_{COMPARE,VERIFY} instead of waiting an arbitrary amount of
time waiting for the window manager to do his job.
Also use QApplication::setActiveWindow which seems to be more robust
then QWidget::activateWindow
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index fae4b26..f42d5f6 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3354,7 +3354,7 @@ void tst_QTreeView::task246536_scrollbarsNotWorking() o.count = 0; tree.verticalScrollBar()->setValue(50); QTest::qWait(100); - QVERIFY(o.count > 0); + QTRY_VERIFY(o.count > 0); } void tst_QTreeView::task250683_wrongSectionSize() @@ -3404,8 +3404,9 @@ void tst_QTreeView::task239271_addRowsWithFirstColumnHidden() QStandardItem sub1("sub1"), sub11("sub11"); root0.appendRow(QList<QStandardItem*>() << &sub1 << &sub11); - QTest::qWait(200); + QTest::qWait(20); //items in the 2nd column should have been painted + QTRY_VERIFY(!delegate.paintedIndexes.isEmpty()); QVERIFY(delegate.paintedIndexes.contains(sub00.index())); QVERIFY(delegate.paintedIndexes.contains(sub11.index())); } |