diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-09-23 14:07:33 +1000 |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-09-23 14:08:31 +1000 |
commit | e1c895912a89824af6b8a826b6c28865ac13b392 (patch) | |
tree | b2f2e1c7b0e143cd50ea78ad2c8eb9b06cf903b8 /tests/auto/declarative/qdeclarativelistmodel | |
parent | e8c36529d78b99ce651e26779e96986561f63646 (diff) | |
download | qt4-tools-e1c895912a89824af6b8a826b6c28865ac13b392.tar.gz |
Various declarative autotest additions.
Diffstat (limited to 'tests/auto/declarative/qdeclarativelistmodel')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 69df90b12f..f8d2411f81 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -91,6 +91,7 @@ private slots: void enumerate(); void error_data(); void error(); + void syncError(); void set(); void get(); void get_data(); @@ -661,6 +662,21 @@ void tst_qdeclarativelistmodel::error() } } +void tst_qdeclarativelistmodel::syncError() +{ + QString qml = "import Qt 4.7\nListModel { id: lm; Component.onCompleted: lm.sync() }"; + QString error = "file:dummy.qml:2:1: QML ListModel: List sync() can only be called from a WorkerScript"; + + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine); + component.setData(qml.toUtf8(), + QUrl::fromLocalFile(QString("dummy.qml"))); + QTest::ignoreMessage(QtWarningMsg,error.toUtf8()); + QObject *obj = component.create(); + QVERIFY(obj); + delete obj; +} + /* Test model changes from set() are available to the view */ |