summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-15 01:00:11 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-11-15 16:29:40 +0100
commitadc7bbe910a4b89a579ffa93da5a937cfc1379f4 (patch)
treee28a2fadc82652798302cc7f79a6f4310a2eb8d7 /tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
parent14bb413309092adc53e8451daff5690c4698c07d (diff)
parentc15a069830baf87f57c84e86326cf86ba9a39713 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/gui/rhi/qshader.cpp tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
Diffstat (limited to 'tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp')
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index dcffe8043b..9750a31824 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -2868,6 +2868,7 @@ public:
};
Node *root;
+ bool crash = false;
EvilModel(QObject *parent = nullptr): QAbstractItemModel(parent), root(new Node)
{}
@@ -2876,6 +2877,11 @@ public:
delete root;
}
+ void setCrash()
+ {
+ crash = true;
+ }
+
void change()
{
emit layoutAboutToBeChanged();
@@ -2944,6 +2950,10 @@ public:
QVariant data(const QModelIndex &idx, int role) const override
{
+ if (crash) {
+ QTest::qFail("Should not get here...", __FILE__, __LINE__);
+ return QVariant();
+ }
if (idx.isValid() && role == Qt::DisplayRole) {
Node *parentNode = root;
if (idx.isValid()) {
@@ -2963,6 +2973,7 @@ void tst_QTreeView::evilModel_data()
{
QTest::addColumn<bool>("visible");
QTest::newRow("visible") << false;
+ QTest::newRow("visible") << true;
}
void tst_QTreeView::evilModel()
@@ -3132,6 +3143,9 @@ void tst_QTreeView::evilModel()
model.change();
view.setRootIndex(secondLevel);
+
+ model.setCrash();
+ view.setModel(nullptr);
}
void tst_QTreeView::indexRowSizeHint()