summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview
diff options
context:
space:
mode:
authorJyri Tahtela <jyri.tahtela@nokia.com>2011-05-18 07:41:09 (GMT)
committerJyri Tahtela <jyri.tahtela@nokia.com>2011-05-18 07:41:09 (GMT)
commit9cacde74f7de702689725882633073e60c0a2baa (patch)
tree330d22dadbd28b14a7d8896823d1c33597e9993e /tests/auto/qtreeview
parent006c8e22075112eff6230d8168d716e44a9e29d5 (diff)
parent2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff)
downloadQt-9cacde74f7de702689725882633073e60c0a2baa.zip
Qt-9cacde74f7de702689725882633073e60c0a2baa.tar.gz
Qt-9cacde74f7de702689725882633073e60c0a2baa.tar.bz2
Merge remote-tracking branch 'qt/4.8'
Conflicts: doc/src/examples/wheel.qdoc src/gui/util/qflickgesture.cpp src/gui/util/qflickgesture_p.h src/gui/util/qscroller.cpp src/gui/util/qscroller.h src/gui/util/qscroller_p.h src/gui/util/qscrollerproperties.cpp src/gui/util/qscrollerproperties.h tests/auto/qscroller/tst_qscroller.cpp
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index c9410b8..b902370 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -277,7 +277,8 @@ public:
}
int rowCount(const QModelIndex& parent = QModelIndex()) const {
- Q_ASSERT(fetched);
+ if (!fetched)
+ qFatal("%s: rowCount should not be called before fetching", Q_FUNC_INFO);
if ((parent.column() > 0) || (level(parent) > levels))
return 0;
return rows;
@@ -2536,7 +2537,7 @@ void tst_QTreeView::sortByColumn()
/*
This is a model that every time kill() is called it will completely change
- all of its nodes for new nodes. It then asserts if you later use a dead node.
+ all of its nodes for new nodes. It then qFatal's if you later use a dead node.
*/
class EvilModel: public QAbstractItemModel
{
@@ -2567,7 +2568,8 @@ public:
}
}
if (parent == 0) {
- Q_ASSERT(children.isEmpty());
+ if (!children.isEmpty())
+ qFatal("%s: children should be empty when parent is null", Q_FUNC_INFO);
populate();
} else {
isDead = true;
@@ -2624,7 +2626,8 @@ public:
Node *parentNode = root;
if (parent.isValid()) {
parentNode = static_cast<Node*>(parent.internalPointer());
- Q_ASSERT(!parentNode->isDead);
+ if (parentNode->isDead)
+ qFatal("%s: parentNode is dead!", Q_FUNC_INFO);
}
return parentNode->children.count();
}
@@ -2639,9 +2642,11 @@ public:
Node *grandparentNode = static_cast<Node*>(parent.internalPointer());
Node *parentNode = root;
if (parent.isValid()) {
- Q_ASSERT(!grandparentNode->isDead);
+ if (grandparentNode->isDead)
+ qFatal("%s: grandparentNode is dead!", Q_FUNC_INFO);
parentNode = grandparentNode->children[parent.row()];
- Q_ASSERT(!parentNode->isDead);
+ if (parentNode->isDead)
+ qFatal("%s: grandparentNode is dead!", Q_FUNC_INFO);
}
return createIndex(row, column, parentNode);
}
@@ -2661,7 +2666,8 @@ public:
Node *parentNode = root;
if (idx.isValid()) {
parentNode = static_cast<Node*>(idx.internalPointer());
- Q_ASSERT(!parentNode->isDead);
+ if (parentNode->isDead)
+ qFatal("%s: grandparentNode is dead!", Q_FUNC_INFO);
}
return QString("[%1,%2,%3]").arg(idx.row()).arg(idx.column())
.arg(parentNode->isDead ? "dead" : "alive");