diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-05 01:20:56 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-06 02:49:09 (GMT) |
commit | 22e99d92a71645d643ebd54c6209bced80f7c5b8 (patch) | |
tree | c4cb9d09ea2b36cd3a1492a08cb015eaea20dbb3 /tests/auto/modeltest | |
parent | 524bd6b7120f70a178b03bc6d337e08abd327076 (diff) | |
download | Qt-22e99d92a71645d643ebd54c6209bced80f7c5b8.zip Qt-22e99d92a71645d643ebd54c6209bced80f7c5b8.tar.gz Qt-22e99d92a71645d643ebd54c6209bced80f7c5b8.tar.bz2 |
Remove Q_ASSERT's from modeltest
Report a fatal error in all builds, not just in debug builds.
Change-Id: Ia9e265b2082b55fbac18ca046e586de863ac0623
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/modeltest')
-rw-r--r-- | tests/auto/modeltest/dynamictreemodel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/modeltest/dynamictreemodel.cpp b/tests/auto/modeltest/dynamictreemodel.cpp index fa634b6..80708d4 100644 --- a/tests/auto/modeltest/dynamictreemodel.cpp +++ b/tests/auto/modeltest/dynamictreemodel.cpp @@ -44,6 +44,7 @@ #include <QtCore/QHash> #include <QtCore/QList> #include <QtCore/QTimer> +#include <QtCore/QDebug> DynamicTreeModel::DynamicTreeModel(QObject *parent) @@ -66,9 +67,11 @@ QModelIndex DynamicTreeModel::index(int row, int column, const QModelIndex &pare const qint64 grandParent = findParentId(parent.internalId()); if (grandParent >= 0) { QList<QList<qint64> > parentTable = m_childItems.value(grandParent); - Q_ASSERT(parent.column() < parentTable.size()); + if (parent.column() >= parentTable.size()) + qFatal("%s: parent.column() must be less than parentTable.size()", Q_FUNC_INFO); QList<qint64> parentSiblings = parentTable.at(parent.column()); - Q_ASSERT(parent.row() < parentSiblings.size()); + if (parent.row() >= parentSiblings.size()) + qFatal("%s: parent.row() must be less than parentSiblings.size()", Q_FUNC_INFO); } if (childIdColumns.size() == 0) @@ -189,7 +192,8 @@ QModelIndex ModelChangeCommand::findIndex(QList<int> rows) while (i.hasNext()) { parent = m_model->index(i.next(), col, parent); - Q_ASSERT(parent.isValid()); + if (!parent.isValid()) + qFatal("%s: parent must be valid", Q_FUNC_INFO); } return parent; } |