From 6f5751c45868a6dde51647462a331d49f848f2f0 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 10 May 2011 13:30:56 +1000 Subject: Remove Q_ASSERT's from qabstractxmlnodemodel test Report fatal errors rather than ignoring the errors in non-debug builds. Change-Id: I5d2f20113cbca11e272cf8fc2591e38b94d6853b Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern --- tests/auto/qabstractxmlnodemodel/LoadingModel.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp index 052c781..bb8538c 100644 --- a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp +++ b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp @@ -84,13 +84,14 @@ QXmlNodeModelIndex LoadingModel::createIndex(const Node *const internal) const QUrl LoadingModel::documentUri(const QXmlNodeModelIndex &) const { - Q_ASSERT(false); + qFatal("%s: This method should not be called during the test", Q_FUNC_INFO); return QUrl(); } QXmlNodeModelIndex::NodeKind LoadingModel::kind(const QXmlNodeModelIndex &ni) const { - Q_ASSERT(!ni.isNull()); + if (ni.isNull()) + qFatal("%s: node model index should not be null", Q_FUNC_INFO); return toInternal(ni)->kind; } @@ -332,13 +333,11 @@ void Loader::load() break; } case QXmlStreamReader::DTD: - /* Fallthrough. */ + qFatal("%s: QXmlStreamReader::DTD token is not supported", Q_FUNC_INFO); + break; case QXmlStreamReader::EntityReference: - { - Q_ASSERT_X(false, Q_FUNC_INFO, - "We don't support this."); - /* Fallthrough. */ - } + qFatal("%s: QXmlStreamReader::EntityReference token is not supported", Q_FUNC_INFO); + break; case QXmlStreamReader::NoToken: /* Fallthrough. */ case QXmlStreamReader::Invalid: -- cgit v0.12