From fa42ba9b62d42b3c233344e33347ed2a7722afc9 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 10 May 2011 11:48:36 +1000 Subject: [PATCH] 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) --- tests/auto/qitemmodel/modelstotest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.7.4