From 491f5f9cc6da171155c613295018b9d54bb683c9 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 13 Sep 2010 11:02:24 +1000 Subject: Add test for view velocity update on setCurrentIndex() Task-number: QTBUG-13543 --- .../auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp | 2 ++ .../auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index d4d8bf6..5fd373c 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -604,6 +604,8 @@ void tst_QDeclarativeGridView::currentIndex() // no wrap gridview->setCurrentIndex(0); QCOMPARE(gridview->currentIndex(), 0); + // confirm that the velocity is updated + QTRY_VERIFY(gridview->verticalVelocity() != 0.0); gridview->moveCurrentIndexUp(); QCOMPARE(gridview->currentIndex(), 0); diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index e4b59a7..cd17fad 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1016,6 +1016,8 @@ void tst_QDeclarativeListView::currentIndex() // no wrap listview->setCurrentIndex(0); QCOMPARE(listview->currentIndex(), 0); + // confirm that the velocity is updated + QTRY_VERIFY(listview->verticalVelocity() != 0.0); listview->incrementCurrentIndex(); QCOMPARE(listview->currentIndex(), 1); -- cgit v0.12