diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-10 01:48:36 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-10 03:15:02 (GMT) |
commit | 984a72a8bbf853059f0eb7e1054538b48d5f3bc8 (patch) | |
tree | e25dda46cac50a77bc3c4b94e8a7e15a93e811e8 | |
parent | 1acca025082bad566e5fe7078aa41f73316cd40b (diff) | |
download | Qt-984a72a8bbf853059f0eb7e1054538b48d5f3bc8.zip Qt-984a72a8bbf853059f0eb7e1054538b48d5f3bc8.tar.gz Qt-984a72a8bbf853059f0eb7e1054538b48d5f3bc8.tar.bz2 |
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
-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 7ebf2c7..df06c95 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; } |