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/qdeclarativelistmodel | |
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/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 69df90b..f8d2411 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 */ |