diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-06 13:51:20 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-05-18 11:04:38 +1000 |
commit | e01dc7e1beb8e54980aa9b400ded95d6087e78c9 (patch) | |
tree | 756f21d89c06031733260b870b36b0f5619887c2 | |
parent | 39397733233b243c71d01aa74595ce7c2cc4e3f1 (diff) | |
download | qtxmlpatterns-e01dc7e1beb8e54980aa9b400ded95d6087e78c9.tar.gz |
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)
-rw-r--r-- | tests/auto/qabstractxmlnodemodel/LoadingModel.cpp | 6 |
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; |