summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-02 08:37:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-05 02:40:49 (GMT)
commitb4001abf71b3335cedfaf72ca3b7f25ea46be35c (patch)
treebc905ceabea6a2a4cb26a15e3b899ebffde3aff1 /tests/auto
parenta6a2a2373c63ec3c67be62814bc3391de1338883 (diff)
downloadQt-b4001abf71b3335cedfaf72ca3b7f25ea46be35c.zip
Qt-b4001abf71b3335cedfaf72ca3b7f25ea46be35c.tar.gz
Qt-b4001abf71b3335cedfaf72ca3b7f25ea46be35c.tar.bz2
Add attached property ECMAScript test
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/attachedProperty.qml11
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp14
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml b/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml
new file mode 100644
index 0000000..c5088e3
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/attachedProperty.qml
@@ -0,0 +1,11 @@
+import Qt.test 1.0
+import Qt.test 1.0 as Namespace
+
+MyQmlObject {
+ id: Me
+ property int a: MyQmlObject.value
+ property int b: Namespace.MyQmlObject.value
+ property int c: Me.Namespace.MyQmlObject.value
+ property int d: Me.Namespace.MyQmlObject.value
+}
+
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index d5d20b6..eca4b92 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -44,6 +44,7 @@ private slots:
void objectPropertiesTriggerReeval();
void deferredProperties();
void extensionObjects();
+ void attachedProperties();
void enums();
void valueTypeFunctions();
void constantsOverrideBindings();
@@ -379,6 +380,19 @@ void tst_qmlecmascript::extensionObjects()
QCOMPARE(object->baseProperty(), 92);
}
+void tst_qmlecmascript::attachedProperties()
+{
+ QmlComponent component(&engine, TEST_FILE("attachedProperty.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("a").toInt(), 19);
+ QCOMPARE(object->property("b").toInt(), 19);
+ QCOMPARE(object->property("c").toInt(), 19);
+ QCOMPARE(object->property("d").toInt(), 19);
+
+ // ### Need to test attached property assignment
+}
+
void tst_qmlecmascript::enums()
{
// Existant enums