summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-06 03:35:14 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-06 07:11:29 (GMT)
commit57fd8c5ac803398238982c4b74bc5ce048671201 (patch)
tree7f0572ccfb1f5d0ef575cd09ae3e170a4d43ecf8 /tests/auto
parente6f7509f18ae88069373d59073cbdcda88fd19c8 (diff)
downloadQt-57fd8c5ac803398238982c4b74bc5ce048671201.zip
Qt-57fd8c5ac803398238982c4b74bc5ce048671201.tar.gz
Qt-57fd8c5ac803398238982c4b74bc5ce048671201.tar.bz2
Remove Q_ASSERT from qabstractxmlnodemodel test
Constructing a model index from a null pointer will cause the test to crash later. Instead of crashing this way in a release build and aborting in a debug build, report the fatal error in all builds. Change-Id: I43ce4c8fa48caa05aaf09ac3c1453d35a2de65bf Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qabstractxmlnodemodel/LoadingModel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp
index cf85486..63fad67 100644
--- a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp
+++ b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp
@@ -77,8 +77,8 @@ const LoadingModel::Node *LoadingModel::toInternal(const QXmlNodeModelIndex &ni)
QXmlNodeModelIndex LoadingModel::createIndex(const Node *const internal) const
{
- Q_ASSERT_X(internal, Q_FUNC_INFO,
- "We shouldn't construct from null pointers.");
+ if (!internal)
+ qFatal("%s: cannot construct a model index from a null pointer", Q_FUNC_INFO);
return QAbstractXmlNodeModel::createIndex(const_cast<Node *>(internal));
}