Autotest
authorAaron Kennedy <aaron.kennedy@nokia.com>
Fri, 14 Oct 2011 07:41:29 +0000 (17:41 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Dec 2011 17:55:39 +0000 (18:55 +0100)
Change-Id: I796ef5e0d70a7e3a95858468583c4ecb447991ee
Task-number: QTBUG-21864
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js [new file with mode: 0644]
tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp

diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js
new file mode 100644 (file)
index 0000000..e1a688e
--- /dev/null
@@ -0,0 +1,2 @@
+var a = { b: 10 }
+var test = (typeof a) == "object"
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.qml
new file mode 100644 (file)
index 0000000..a8f679b
--- /dev/null
@@ -0,0 +1,6 @@
+import "qtbug_21864.js" as Test
+import QtQuick 1.0
+
+QtObject {
+    property bool test: Test.test
+}
index 9638368..4891e50 100644 (file)
@@ -203,6 +203,7 @@ private slots:
     void qtbug_10696();
     void qtbug_11606();
     void qtbug_11600();
+    void qtbug_21864();
     void nonscriptable();
     void deleteLater();
     void in();
@@ -4851,6 +4852,15 @@ void tst_qdeclarativeecmascript::qtbug_11600()
     delete o;
 }
 
+void tst_qdeclarativeecmascript::qtbug_21864()
+{
+    QDeclarativeComponent component(&engine, TEST_FILE("qtbug_21864.qml"));
+    QObject *o = component.create();
+    QVERIFY(o != 0);
+    QCOMPARE(o->property("test").toBool(), true);
+    delete o;
+}
+
 // Reading and writing non-scriptable properties should fail
 void tst_qdeclarativeecmascript::nonscriptable()
 {