summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp17
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)
{