From e01dc7e1beb8e54980aa9b400ded95d6087e78c9 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 6 May 2011 13:51:20 +1000 Subject: [PATCH] Remove Q_ASSERT from qabstractxmlnodemodel test Instead of aborting in a debug build and failing silently in a release build when the internal state of the model is incorrect, report a meaningful fatal error in all builds. Change-Id: I64ca4dde070cb7fbe69684a36092d53e5b84d80a Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit 68027b186fe547a5579d07480e097bfb69c79de9) --- tests/auto/qabstractxmlnodemodel/LoadingModel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp index 63fad67..c68857b 100644 --- a/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp +++ b/tests/auto/qabstractxmlnodemodel/LoadingModel.cpp @@ -98,8 +98,10 @@ QXmlNodeModelIndex::DocumentOrder LoadingModel::compareOrder(const QXmlNodeModel { const Node *const in1 = toInternal(n1); const Node *const in2 = toInternal(n2); - Q_ASSERT(m_nodes.indexOf(in1) != -1); - Q_ASSERT(m_nodes.indexOf(in2) != -1); + if (m_nodes.indexOf(in1) == -1) + qFatal("%s: node n1 is not in internal node list", Q_FUNC_INFO); + if (m_nodes.indexOf(in2) == -1) + qFatal("%s: node n2 is not in internal node list", Q_FUNC_INFO); if(in1 == in2) return QXmlNodeModelIndex::Is; -- 2.7.4