summaryrefslogtreecommitdiffstats
path: root/tests/auto/modeltest
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-05 04:04:16 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-06 02:53:30 (GMT)
commit841cc610df61a266ebcca2bfef2542a7d4fea68d (patch)
treedebe6b5f610f871571755c7b579c892b04cd70ee /tests/auto/modeltest
parent416d45caa9feefe8337795adc4b93a8148d57a3a (diff)
downloadQt-841cc610df61a266ebcca2bfef2542a7d4fea68d.zip
Qt-841cc610df61a266ebcca2bfef2542a7d4fea68d.tar.gz
Qt-841cc610df61a266ebcca2bfef2542a7d4fea68d.tar.bz2
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
Diffstat (limited to 'tests/auto/modeltest')
-rw-r--r--tests/auto/modeltest/modeltest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/modeltest/modeltest.cpp b/tests/auto/modeltest/modeltest.cpp
index 5ef27f9..ec1091a 100644
--- a/tests/auto/modeltest/modeltest.cpp
+++ b/tests/auto/modeltest/modeltest.cpp
@@ -53,7 +53,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() ) );