summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-08-12 15:01:35 +0200
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-08-19 08:54:55 +0000
commit3d88c2b2356dd1b871626d3a28dd761bf1feb9f0 (patch)
treed199030a6a648e8c34b69aadb56151304dee55f2
parentb5952b7ffe0f332dd382b5ae131ab53687785a25 (diff)
downloadqtquickcontrols-3d88c2b2356dd1b871626d3a28dd761bf1feb9f0.tar.gz
TreeView auto-test: Harden test_indexAt()
Also, print extra information when the test is about to fail since it has proven to be a bit flaky lately. Change-Id: I4042cb99eb2b3fcb3677de63cd425d0ade4bdc34 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r--tests/auto/controls/data/tst_treeview.qml14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml
index 6e17e318..33e64e65 100644
--- a/tests/auto/controls/data/tst_treeview.qml
+++ b/tests/auto/controls/data/tst_treeview.qml
@@ -736,7 +736,7 @@ Item {
compare(component.status, Component.Ready)
var tree = component.createObject(container);
verify(tree !== null, "tree created is null")
- waitForRendering(tree)
+ verify(waitForRendering(tree), "TreeView did not render on time")
var model = tree.model
// Sample each row and test
@@ -744,6 +744,12 @@ Item {
for (var x = 1; x < tree.getColumn(0).width; x += 10) {
var treeIndex = tree.indexAt(x, 50 * (row + 1) + 1) // offset by header height
var modelIndex = model.index(row, 0)
+ if (treeIndex.row !== modelIndex.row
+ || treeIndex.column !== modelIndex.column
+ || treeIndex.internalId !== modelIndex.internalId) {
+ console.log("Test about to fail: row = " + row + ", __listView.count =" + __listView.count)
+ console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + getColumn(0).width)
+ }
compare(treeIndex.row, modelIndex.row)
compare(treeIndex.column, modelIndex.column)
compare(treeIndex.internalId, modelIndex.internalId)
@@ -756,6 +762,12 @@ Item {
for (x = 1; x < tree.getColumn(0).width; x += 10) {
treeIndex = tree.indexAt(x, 50 * row + 1)
modelIndex = model.index(row, 0)
+ if (treeIndex.row !== modelIndex.row
+ || treeIndex.column !== modelIndex.column
+ || treeIndex.internalId !== modelIndex.internalId) {
+ console.log("Test about to fail: row = " + row + ", __listView.count =" + __listView.count)
+ console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + getColumn(0).width)
+ }
compare(treeIndex.row, modelIndex.row)
compare(treeIndex.column, modelIndex.column)
compare(treeIndex.internalId, modelIndex.internalId)