diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-09-23 04:07:33 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-09-23 04:08:31 (GMT) |
commit | e1c895912a89824af6b8a826b6c28865ac13b392 (patch) | |
tree | b2f2e1c7b0e143cd50ea78ad2c8eb9b06cf903b8 /tests/auto/declarative/qdeclarativeview | |
parent | e8c36529d78b99ce651e26779e96986561f63646 (diff) | |
download | Qt-e1c895912a89824af6b8a826b6c28865ac13b392.zip Qt-e1c895912a89824af6b8a826b6c28865ac13b392.tar.gz Qt-e1c895912a89824af6b8a826b6c28865ac13b392.tar.bz2 |
Various declarative autotest additions.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeview')
-rw-r--r-- | tests/auto/declarative/qdeclarativeview/data/error1.qml | 5 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeview/data/error1.qml b/tests/auto/declarative/qdeclarativeview/data/error1.qml new file mode 100644 index 0000000..c154716 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeview/data/error1.qml @@ -0,0 +1,5 @@ +import Qt 4.7 + +Rectangle { + nonExistentProperty: 5 +} diff --git a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp index 6450e38..9ac79e4 100644 --- a/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp +++ b/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp @@ -62,6 +62,7 @@ public: private slots: void resizemodedeclarativeitem(); void resizemodegraphicswidget(); + void errors(); private: template<typename T> @@ -255,6 +256,22 @@ void tst_QDeclarativeView::resizemodegraphicswidget() delete canvas; } +static void silentErrorsMsgHandler(QtMsgType, const char *) +{ +} + +void tst_QDeclarativeView::errors() +{ + QDeclarativeView *canvas = new QDeclarativeView; + QVERIFY(canvas); + QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/error1.qml")); + qInstallMsgHandler(old); + QVERIFY(canvas->status() == QDeclarativeView::Error); + QVERIFY(canvas->errors().count() == 1); + delete canvas; +} + template<typename T> T *tst_QDeclarativeView::findItem(QGraphicsObject *parent, const QString &objectName) { |