summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2021-03-29 18:34:43 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-30 15:10:20 +0000
commit1b1f2b265ebb25df8416293c6692fe82ab08e465 (patch)
tree478986ad2a283a41cc33dca9e92a90dc080010ae /tests/auto/testlib
parent117e0a43694ca26f1720c6ed612ed1b1a4d58a58 (diff)
QAbstractItemModelTester: fix false positive when model has zero columns
Regression introduced by me in commit 72e0d699cec09458ca9325035d477d4899e8e47b Fixes: QTBUG-92220 Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4aac2af19690917553f93660e3ad760fc15d0b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
index de461dd293..bc96cab64b 100644
--- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
+++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
@@ -41,6 +41,7 @@ private slots:
void stringListModel();
void treeWidgetModel();
void standardItemModel();
+ void standardItemModelZeroColumns();
void testInsertThroughProxy();
void moveSourceItems();
void testResetThroughProxy();
@@ -105,6 +106,15 @@ void tst_QAbstractItemModelTester::standardItemModel()
model.insertColumns(0, 5, model.index(1, 3));
}
+void tst_QAbstractItemModelTester::standardItemModelZeroColumns() // QTBUG-92220
+{
+ QStandardItemModel model;
+
+ QAbstractItemModelTester t1(&model);
+ model.insertRows(0, 5);
+ model.removeRows(0, 5);
+}
+
void tst_QAbstractItemModelTester::testInsertThroughProxy()
{
DynamicTreeModel *model = new DynamicTreeModel(this);