diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-10 11:48:36 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-05-18 10:46:47 +1000 |
commit | fa42ba9b62d42b3c233344e33347ed2a7722afc9 (patch) | |
tree | e3888a588203b1e3ef1b5c118d9396525852f9fb /tests | |
parent | 65833e7d9e0e9cce17e18144dafd4ea54c26b768 (diff) |
Remove Q_ASSERT from QItemModel autotest
If populateTestData() would return an invalid model index, report a
meaningful fatal error rather than failing silently in a release build
and aborting with an uninformative error message in a debug build.
Change-Id: I96820429a25ce5c4eb375d50e7e1f672851e26e6
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit 984a72a8bbf853059f0eb7e1054538b48d5f3bc8)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qitemmodel/modelstotest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/qitemmodel/modelstotest.cpp b/tests/auto/qitemmodel/modelstotest.cpp index 7ebf2c7dc5..df06c95254 100644 --- a/tests/auto/qitemmodel/modelstotest.cpp +++ b/tests/auto/qitemmodel/modelstotest.cpp @@ -308,7 +308,8 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model) */ } QModelIndex returnIndex = model->index(0,0); - Q_ASSERT(returnIndex.isValid()); + if (!returnIndex.isValid()) + qFatal("%s: model index to be returned is invalid", Q_FUNC_INFO); return returnIndex; } |