diff options
Diffstat (limited to 'tests/auto/qml')
7 files changed, 34 insertions, 4 deletions
diff --git a/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro b/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro index 6193ee7c88..6f3f765aba 100644 --- a/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro +++ b/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro @@ -9,6 +9,8 @@ HEADERS += testtypes.h \ ../../shared/testhttpserver.h INCLUDEPATH += ../../shared +RESOURCES += qqmlecmascript.qrc + include (../../shared/util.pri) # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage diff --git a/tests/auto/qml/qqmlecmascript/qqmlecmascript.qrc b/tests/auto/qml/qqmlecmascript/qqmlecmascript.qrc new file mode 100644 index 0000000000..e0e29ad4a5 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/qqmlecmascript.qrc @@ -0,0 +1,8 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> +<file>data/include.qml</file> +<file>data/include.js</file> +<file>data/js/include2.js</file> +<file>data/js/include3.js</file> +</qresource> +</RCC> diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index c68f1190dd..2550dd5473 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -6051,6 +6051,23 @@ void tst_qqmlecmascript::include() delete o; } + + // include from resources + { + QQmlComponent component(&engine, QUrl("qrc:///data/include.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test0").toInt(), 99); + QCOMPARE(o->property("test1").toBool(), true); + QCOMPARE(o->property("test2").toBool(), true); + QCOMPARE(o->property("test2_1").toBool(), true); + QCOMPARE(o->property("test3").toBool(), true); + QCOMPARE(o->property("test3_1").toBool(), true); + + delete o; + } + } void tst_qqmlecmascript::includeRemoteSuccess() diff --git a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp index 0b9872f94c..75b10ed804 100644 --- a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp +++ b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp @@ -171,10 +171,6 @@ void tst_qqmlincubator::objectDeleted() controller.incubateWhile(&b); } - // We have to cheat and manually remove it from the creator->allCreatedObjects - // otherwise we will do a double delete - QQmlIncubatorPrivate *incubatorPriv = QQmlIncubatorPrivate::get(&incubator); - incubatorPriv->creator->allCreatedObjects().pop(); delete SelfRegisteringType::me(); { diff --git a/tests/auto/qml/qqmllanguage/data/nonexistantProperty.8.errors.txt b/tests/auto/qml/qqmllanguage/data/nonexistantProperty.8.errors.txt new file mode 100644 index 0000000000..b60b59b111 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/nonexistantProperty.8.errors.txt @@ -0,0 +1 @@ +4:24:Cannot assign to non-existent property "root" diff --git a/tests/auto/qml/qqmllanguage/data/nonexistantProperty.8.qml b/tests/auto/qml/qqmllanguage/data/nonexistantProperty.8.qml new file mode 100644 index 0000000000..86c5f3bd7d --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/nonexistantProperty.8.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 +Item { + id: root + NumberAnimation on root.opacity { duration: 1000 } +} diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 6364a8ebdd..8bc937d2bc 100644 --- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp +++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp @@ -348,6 +348,7 @@ void tst_qqmllanguage::errors_data() QTest::newRow("nonexistantProperty.5") << "nonexistantProperty.5.qml" << "nonexistantProperty.5.errors.txt" << false; QTest::newRow("nonexistantProperty.6") << "nonexistantProperty.6.qml" << "nonexistantProperty.6.errors.txt" << false; QTest::newRow("nonexistantProperty.7") << "nonexistantProperty.7.qml" << "nonexistantProperty.7.errors.txt" << false; + QTest::newRow("nonexistantProperty.8") << "nonexistantProperty.8.qml" << "nonexistantProperty.8.errors.txt" << false; QTest::newRow("wrongType (string for int)") << "wrongType.1.qml" << "wrongType.1.errors.txt" << false; QTest::newRow("wrongType (int for bool)") << "wrongType.2.qml" << "wrongType.2.errors.txt" << false; |