Remove Q_ASSERT from qitemmodel autotest
authorJason McDonald <jason.mcdonald@nokia.com>
Fri, 6 May 2011 05:22:07 +0000 (15:22 +1000)
committerRohan McGovern <rohan.mcgovern@nokia.com>
Wed, 18 May 2011 00:46:46 +0000 (10:46 +1000)
If populateTestData() is passed an unknown type of model, 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: I7ee8d1262bbced304f9f24c2ec9b40a38704d982
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit 6b2e89843a573cd7c143bca17cec8e69209d2fbd)

tests/auto/qitemmodel/modelstotest.cpp

index cec1703..4e63307 100644 (file)
@@ -372,7 +372,7 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model)
         return QModelIndex();
     }
 
-    Q_ASSERT(false);
+    qFatal("%s: unknown type of model", Q_FUNC_INFO);
     return QModelIndex();
 }