From 7980f7aa3f01aeb4e33fab76f495ad7f6c885cc2 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 14 Oct 2011 17:41:29 +1000 Subject: [PATCH] Autotest Change-Id: I796ef5e0d70a7e3a95858468583c4ecb447991ee Task-number: QTBUG-21864 Reviewed-by: Aaron Kennedy --- .../declarative/qdeclarativeecmascript/data/qtbug_21864.js | 2 ++ .../declarative/qdeclarativeecmascript/data/qtbug_21864.qml | 6 ++++++ .../qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 10 ++++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.qml diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js new file mode 100644 index 0000000..e1a688e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.js @@ -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 index 0000000..a8f679b --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_21864.qml @@ -0,0 +1,6 @@ +import "qtbug_21864.js" as Test +import QtQuick 1.0 + +QtObject { + property bool test: Test.test +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 9638368..4891e50 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -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() { -- 2.7.4