From 16c866533b887dff4067484f05be02377d42955b Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 5 May 2011 14:04:16 +1000 Subject: Remove Q_ASSERT from modeltest Report an informative fatal error if passed a null model, rather than aborting in a debug build and giving a bunch of signal connection errors in a release build. Change-Id: Ia240e741b9d6ec03fd5ed3a14cf4fa44b55af911 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit 841cc610df61a266ebcca2bfef2542a7d4fea68d) --- tests/auto/modeltest/modeltest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/modeltest/modeltest.cpp b/tests/auto/modeltest/modeltest.cpp index 98d707c8da..0329c3ef9c 100644 --- a/tests/auto/modeltest/modeltest.cpp +++ b/tests/auto/modeltest/modeltest.cpp @@ -55,7 +55,8 @@ Q_DECLARE_METATYPE ( QModelIndex ) */ ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject ( parent ), model ( _model ), fetchingMore ( false ) { - Q_ASSERT ( model ); + if (!model) + qFatal("%s: model must not be null", Q_FUNC_INFO); connect ( model, SIGNAL ( columnsAboutToBeInserted ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); -- cgit v1.2.3