diff options
Diffstat (limited to 'tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp')
-rw-r--r-- | tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 0a636db..54442d5 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -109,6 +109,8 @@ private slots: void i18n_data(); void onCompleted(); void scriptString(); + void defaultPropertyListOrder(); + void declaredPropertyValues(); void importsBuiltin_data(); void importsBuiltin(); @@ -528,7 +530,7 @@ void tst_qmllanguage::idProperty() MyTypeObject *child = qobject_cast<MyTypeObject *>(object->children()->at(0)); QVERIFY(child != 0); - QCOMPARE(child->id(), QString("MyObjectId")); + QCOMPARE(child->id(), QString("myObjectId")); QCOMPARE(object->property("object"), QVariant::fromValue((QObject *)child)); } @@ -1019,6 +1021,32 @@ void tst_qmllanguage::scriptString() QCOMPARE(object->grouped()->script().context(), qmlContext(object)); } +// Check that default property assignments are correctly spliced into explicit +// property assignments +void tst_qmllanguage::defaultPropertyListOrder() +{ + QmlComponent component(&engine, TEST_FILE("defaultPropertyListOrder.qml")); + VERIFY_ERRORS(0); + + MyContainer *container = qobject_cast<MyContainer *>(component.create()); + QVERIFY(container != 0); + + QCOMPARE(container->children()->count(), 6); + QCOMPARE(container->children()->at(0)->property("index"), QVariant(0)); + QCOMPARE(container->children()->at(1)->property("index"), QVariant(1)); + QCOMPARE(container->children()->at(2)->property("index"), QVariant(2)); + QCOMPARE(container->children()->at(3)->property("index"), QVariant(3)); + QCOMPARE(container->children()->at(4)->property("index"), QVariant(4)); + QCOMPARE(container->children()->at(5)->property("index"), QVariant(5)); +} + +void tst_qmllanguage::declaredPropertyValues() +{ + QmlComponent component(&engine, TEST_FILE("declaredPropertyValues.qml")); + QEXPECT_FAIL("", "QTBUG-7860", Abort); + VERIFY_ERRORS(0); +} + // Check that first child of qml is of given type. Empty type insists on error. void tst_qmllanguage::testType(const QString& qml, const QString& type) { |