diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-08-06 09:51:02 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-08-07 12:43:35 +0200 |
commit | ffda7180f3c11c35699ba8aa1a16efc6ee962e02 (patch) | |
tree | 696eaa332a772321ae45ac522f5fbe503810adb5 /tests | |
parent | 6c19dd8989895b29a3f0b46871ed5f360e7b3440 (diff) |
tst_qquicklistview: make addOnCompleted more robust + sanity check
Check that after we could not find an element, we do not suddenly find
one afterwards.
Moreover, disable the cacheBuffer as the asynchronous creation might
cause issues, leading to the flakyness observed in QTBUG-77330
Task-number: QTBUG-77330
Change-Id: I444eede16a99a75340a0b7ccf17193298730a675
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicklistview/data/addoncompleted.qml | 3 | ||||
-rw-r--r-- | tests/auto/quick/qquicklistview/tst_qquicklistview.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/addoncompleted.qml b/tests/auto/quick/qquicklistview/data/addoncompleted.qml index 57265cb2c0..2341295868 100644 --- a/tests/auto/quick/qquicklistview/data/addoncompleted.qml +++ b/tests/auto/quick/qquicklistview/data/addoncompleted.qml @@ -73,6 +73,9 @@ Rectangle { anchors.fill: parent model: listModel objectName: "view" + // buffered delegates are created asynchronously + // therefore we disable buffering + cacheBuffer: 0 delegate: Rectangle { height: 15 diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index 127c873bbb..b896418de0 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -8956,6 +8956,7 @@ void tst_QQuickListView::addOnCompleted() y = 9999999; } else { const qreal newY = item->y(); + QVERIFY(newY != 9999999); // once we could not find an item, we shouldn' find any further ones QVERIFY2(newY > y, objName.toUtf8().constData()); y = newY; } |