summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLuca Beldi <v.ronin@yahoo.it>2021-04-15 23:41:28 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-19 20:13:58 +0000
commit3cdcb53a37bbdbd42f5da2b22d3adeba3cd9ed9a (patch)
tree14249e1a4e3842f3e7acb64a581d146ed2a3c1f2 /tests
parent905c71a434ae6de2cc075e00da2149065f7b5f98 (diff)
Fix QAbstractItemModelTester false positive
When rows are removed from a model with no columns, the test should not report a problem if indexes are invalid Fixes: QTBUG-92886 Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit fed2c0d23614df1b96dcc8746223501b07597a52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
index bc96cab64b..5cbdd7beae 100644
--- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
+++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
@@ -106,13 +106,16 @@ void tst_QAbstractItemModelTester::standardItemModel()
model.insertColumns(0, 5, model.index(1, 3));
}
-void tst_QAbstractItemModelTester::standardItemModelZeroColumns() // QTBUG-92220
+void tst_QAbstractItemModelTester::standardItemModelZeroColumns()
{
QStandardItemModel model;
-
QAbstractItemModelTester t1(&model);
+ // QTBUG-92220
model.insertRows(0, 5);
model.removeRows(0, 5);
+ // QTBUG-92886
+ model.insertRows(0, 5);
+ model.removeRows(1, 2);
}
void tst_QAbstractItemModelTester::testInsertThroughProxy()