aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-08-02 14:36:12 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-02 06:42:28 +0200
commitab40ff7046db2a922ae6959b44f1a52416566b7a (patch)
tree17111fe6e871ac77ee9e0e4f2f18f2b72e98fa8e /tests
parentec55d20563254f946135666412e2bdf8f8184e77 (diff)
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 <bea.lam@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qsggridview/tst_qsggridview.cpp12
1 files changed, 6 insertions, 6 deletions
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<QSGItem>(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<QSGText>(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")