From 67d3086c6aa1cfd1579a8230a0b2b94fff3735f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 17 Sep 2009 15:29:23 +0200 Subject: Fix the scrollTo() test function on Windows. After the QTRY_COMPARE was added, the size of the view suddenly became a hard requirement. However, this reqirement was not met on windows, since the forcedSize was smaller than the minimum size allowed for the view. Thus, it would never have its size set to forcedSize and the QTRY_COMPARE would fail. --- tests/auto/qtableview/tst_qtableview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 48fcb3e..964841e 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -2279,7 +2279,7 @@ void tst_QTableView::scrollTo_data() << (int)QAbstractItemView::ScrollPerItem << (int)QAbstractItemView::ScrollPerItem << 10 << 10 // table - << 40 << 40 // size + << 80 << 80 // size << -1 << -1 // hide << 0 << 0 // cell << 1 << 1 // span @@ -2291,7 +2291,7 @@ void tst_QTableView::scrollTo_data() << (int)QAbstractItemView::ScrollPerPixel << (int)QAbstractItemView::ScrollPerPixel << 10 << 10 // table - << 40 << 40 // size + << 80 << 80 // size << -1 << -1 // hide << 0 << 0 // cell << 1 << 1 // span @@ -2303,7 +2303,7 @@ void tst_QTableView::scrollTo_data() << (int)QAbstractItemView::ScrollPerItem << (int)QAbstractItemView::ScrollPerItem << 10 << 10 // table - << 40 << 40 // size + << 80 << 80 // size << 3 << 3 // hide << 5 << 5 // cell << 1 << 1 // span @@ -2336,7 +2336,8 @@ void tst_QTableView::scrollTo() QtTestTableView view; view.show(); - QSize forcedSize(columnWidth * 2, rowHeight * 2); + // resizing to this size will ensure that there can ONLY_BE_ONE_CELL inside the view. + QSize forcedSize(columnWidth*2, rowHeight * 2); view.resize(forcedSize); QTest::qWait(0); QTRY_COMPARE(view.size(), forcedSize); @@ -2362,6 +2363,8 @@ void tst_QTableView::scrollTo() view.scrollTo(index, (QAbstractItemView::ScrollHint)scrollHint); QCOMPARE(view.verticalScrollBar()->value(), expectedVerticalScroll); QCOMPARE(view.horizontalScrollBar()->value(), expectedHorizontalScroll); + + //QTest::qWait(22100); // ### needed to pass the test } void tst_QTableView::indexAt_data() -- cgit v0.12