summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-06 03:51:20 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-06 07:12:30 (GMT)
commit68027b186fe547a5579d07480e097bfb69c79de9 (patch)
treebcc709f988dc529a9e4647dab0d76ecd6c03dd8f /tests/auto
parent57fd8c5ac803398238982c4b74bc5ce048671201 (diff)
downloadQt-68027b186fe547a5579d07480e097bfb69c79de9.zip
Qt-68027b186fe547a5579d07480e097bfb69c79de9.tar.gz
Qt-68027b186fe547a5579d07480e097bfb69c79de9.tar.bz2
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
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qabstractxmlnodemodel/LoadingModel.cpp6
1 files 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;