diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-09-28 11:06:54 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-09-28 11:06:54 (GMT) |
commit | ce1355dbb219688b1cb3c0b5539f40425a59ae84 (patch) | |
tree | bf2b244347977e663650e65116bf4740703f2b5e /tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp | |
parent | b0792a5c548c600443edbeaa3c4b0612e0eb4045 (diff) | |
parent | 30c5f0d8cc52d0945256e91af85143629f85ff50 (diff) | |
download | Qt-ce1355dbb219688b1cb3c0b5539f40425a59ae84.zip Qt-ce1355dbb219688b1cb3c0b5539f40425a59ae84.tar.gz Qt-ce1355dbb219688b1cb3c0b5539f40425a59ae84.tar.bz2 |
Merge branch '4.7' into newSearch
Diffstat (limited to 'tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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) { |