diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-11-04 02:41:28 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-11-04 02:42:55 (GMT) |
commit | 59d4e2022095d8363cd5373a1a74f86a448c3542 (patch) | |
tree | 7d3e6bd068e24bb2fac9cde8c102ba420e437425 /tests/auto/declarative/qdeclarativeecmascript | |
parent | 5ab0ad47ba216c851c21d7fee73a69d2a793ea65 (diff) | |
download | Qt-59d4e2022095d8363cd5373a1a74f86a448c3542.zip Qt-59d4e2022095d8363cd5373a1a74f86a448c3542.tar.gz Qt-59d4e2022095d8363cd5373a1a74f86a448c3542.tar.bz2 |
Add testcase for QTBUG-13719.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript')
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml b/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml index b4a702b..07bb16b 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml +++ b/tests/auto/declarative/qdeclarativeecmascript/data/ConstantsOverrideBindings.qml @@ -3,4 +3,10 @@ import Qt.test 1.0 MyQmlObject { property int c1: 0 property int c2: c1 + property alias c3: inner.ic1 + + objectProperty: MyQmlObject { + id: inner + property int ic1: c1 + } } diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml new file mode 100644 index 0000000..5a2091f --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/constantsOverrideBindings.4.qml @@ -0,0 +1,11 @@ +import Qt.test 1.0 + +MyQmlObject { + property alias c1: myConstants.c1 + property alias c3: myConstants.c3 + + objectProperty: ConstantsOverrideBindings { + id: myConstants + c3: 10 + } +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 72e2e10..3dd69da 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -733,6 +733,21 @@ void tst_qdeclarativeecmascript::constantsOverrideBindings() QCOMPARE(object->property("c2").toInt(), 13); } #endif + + // Using an alias + { + QDeclarativeComponent component(&engine, TEST_FILE("constantsOverrideBindings.4.qml")); + MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->property("c1").toInt(), 0); + QEXPECT_FAIL("", "QTBUG-13719", Continue); + QCOMPARE(object->property("c3").toInt(), 10); + object->setProperty("c1", QVariant(9)); + QCOMPARE(object->property("c1").toInt(), 9); + QEXPECT_FAIL("", "QTBUG-13719", Continue); + QCOMPARE(object->property("c3").toInt(), 10); + } } /* |