From 57fd8c5ac803398238982c4b74bc5ce048671201 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 6 May 2011 13:35:14 +1000 Subject: 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 --- tests/auto/qabstractxmlnodemodel/LoadingModel.cpp | 4 ++-- 1 file 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(internal)); } -- cgit v0.12