From: Jason McDonald Date: Mon, 9 May 2011 07:14:39 +0000 (+1000) Subject: Remove Q_ASSERT's from QTreeView autotest X-Git-Tag: qt-v5.0.0-alpha1~4297^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77ff187b9264a5da8f5487f9fc2b7f8fe715680b;p=profile%2Fivi%2Fqtbase.git Remove Q_ASSERT's from QTreeView autotest Report fatal errors instead of failing silently in non-debug builds. Change-Id: Ieaff30b71dba2a385a5fffc93d2a8c0f5864aa18 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit e12b912de89088a307c3519a01198a5314b8dd1a) --- diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 551b63f..1f0c2ce 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -277,7 +277,8 @@ public: } int rowCount(const QModelIndex& parent = QModelIndex()) const { - Q_ASSERT(fetched); + if (!fetched) + qFatal("%s: rowCount should not be called before fetching", Q_FUNC_INFO); if ((parent.column() > 0) || (level(parent) > levels)) return 0; return rows; @@ -2567,7 +2568,8 @@ public: } } if (parent == 0) { - Q_ASSERT(children.isEmpty()); + if (!children.isEmpty()) + qFatal("%s: children should be empty when parent is null", Q_FUNC_INFO); populate(); } else { isDead = true;