From ab40ff7046db2a922ae6959b44f1a52416566b7a Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 2 Aug 2011 14:36:12 +1000 Subject: Fix broken GridView moved() test Test values for moving multiple items were incorrect. Change-Id: I184afee6c44df240ef39450c530ff5991cd591e5 Reviewed-on: http://codereview.qt.nokia.com/2485 Reviewed-by: Bea Lam Reviewed-by: Qt Sanity Bot --- tests/auto/declarative/qsggridview/tst_qsggridview.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp index e7dce4c86d..11d90eca6e 100644 --- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp +++ b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp @@ -641,8 +641,8 @@ void tst_QSGGridView::moved() QSGItem *item = findItem(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); - QTRY_VERIFY(item->x() == (i%3)*80); - QTRY_VERIFY(item->y() == (i/3)*60 + itemsOffsetAfterMove); + QTRY_COMPARE(item->x(), (i%3)*80.0); + QTRY_COMPARE(item->y(), (i/3)*60.0 + itemsOffsetAfterMove); name = findItem(contentItem, "textName", i); QVERIFY(name != 0); @@ -725,17 +725,17 @@ void tst_QSGGridView::moved_data() QTest::newRow("move multiple forwards, within visible items") << 0.0 << 0 << 5 << 3 - << 0.0; + << 60.0; // moved 3 items (i.e. 1 row) down QTest::newRow("move multiple forwards, from non-visible -> visible") << 120.0 // show 6-23 << 1 << 6 << 3 - << 0.0; + << 60.0; // top row moved, all items should shift down by 1 row QTest::newRow("move multiple forwards, from non-visible -> visible (move first item)") << 120.0 // show 6-23 << 0 << 6 << 3 - << 0.0; + << 60.0; // top row moved, all items should shift down by 1 row QTest::newRow("move multiple forwards, from visible -> non-visible") << 0.0 @@ -745,7 +745,7 @@ void tst_QSGGridView::moved_data() QTest::newRow("move multiple forwards, from visible -> non-visible (move first item)") << 0.0 << 0 << 16 << 3 - << 0.0; + << 60.0; QTest::newRow("move multiple backwards, within visible items") -- cgit v1.2.3