diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-24 03:17:44 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-24 03:30:51 (GMT) |
commit | 50fe8dbed3adae3606bd2c32868821119b4f2808 (patch) | |
tree | 9053b41168d7ce072dfc05a2f86b7be0ab6ce235 /tests/auto/declarative | |
parent | 364f6c200a6faac825c7f1e0158d708fc60a8ff5 (diff) | |
download | Qt-50fe8dbed3adae3606bd2c32868821119b4f2808.zip Qt-50fe8dbed3adae3606bd2c32868821119b4f2808.tar.gz Qt-50fe8dbed3adae3606bd2c32868821119b4f2808.tar.bz2 |
Output all Loader errors.
Previously we were not outputting those that occurred on
component->create().
Diffstat (limited to 'tests/auto/declarative')
3 files changed, 27 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml b/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml new file mode 100644 index 0000000..da4f6cb --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/VmeError.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Rectangle { + width: 100; height: 100; color: "red" + signal somethingHappened + onSomethingHappened: QtObject {} +} diff --git a/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml b/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml new file mode 100644 index 0000000..782562b --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/vmeErrors.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Loader { + source: "VmeError.qml" +} + diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 7123dda..506e1ee 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -92,6 +92,7 @@ private slots: void deleteComponentCrash(); void nonItem(); + void vmeErrors(); private: QDeclarativeEngine engine; @@ -467,7 +468,7 @@ void tst_QDeclarativeLoader::failNetworkRequest() // QTBUG-9241 void tst_QDeclarativeLoader::deleteComponentCrash() { - QDeclarativeComponent component(&engine, TEST_FILE("/crash.qml")); + QDeclarativeComponent component(&engine, TEST_FILE("crash.qml")); QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); @@ -480,7 +481,6 @@ void tst_QDeclarativeLoader::deleteComponentCrash() QCOMPARE(loader->progress(), 1.0); QCOMPARE(loader->status(), QDeclarativeLoader::Ready); QCOMPARE(static_cast<QGraphicsItem*>(loader)->children().count(), 1); - QEXPECT_FAIL("", "QTBUG-9245", Continue); QVERIFY(loader->source() == QUrl::fromLocalFile(SRCDIR "/data/BlueRect.qml")); delete item; @@ -488,8 +488,7 @@ void tst_QDeclarativeLoader::deleteComponentCrash() void tst_QDeclarativeLoader::nonItem() { - QSKIP("QTBUG-9245", SkipAll); - QDeclarativeComponent component(&engine, TEST_FILE("/nonItem.qml")); + QDeclarativeComponent component(&engine, TEST_FILE("nonItem.qml")); QTest::ignoreMessage(QtWarningMsg, "QML Loader (file://" SRCDIR "/data/nonItem.qml:3:1) Loader does not support loading non-visual elements."); QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); QVERIFY(loader); @@ -498,6 +497,17 @@ void tst_QDeclarativeLoader::nonItem() delete loader; } +void tst_QDeclarativeLoader::vmeErrors() +{ + QDeclarativeComponent component(&engine, TEST_FILE("vmeErrors.qml")); + QTest::ignoreMessage(QtWarningMsg, "(file://" SRCDIR "/data/VmeError.qml:6: Cannot assign object type QObject with no default method\n onSomethingHappened: QtObject {}) "); + QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); + QVERIFY(loader); + QVERIFY(loader->item() == 0); + + delete loader; +} + void tst_QDeclarativeLoader::networkSafety_data() { QTest::addColumn<QUrl>("url"); |