diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-06-25 02:44:12 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-06-25 02:44:12 (GMT) |
commit | cfa9eee32081dc49ab0697b1f483db01c8aee7cd (patch) | |
tree | 29e4d1b4897d2c4f83d44a7a30a3fa9013ba8b87 /tests | |
parent | a0d4f94c0eb3f724df979d9d22c4c944f34d547a (diff) | |
download | Qt-cfa9eee32081dc49ab0697b1f483db01c8aee7cd.zip Qt-cfa9eee32081dc49ab0697b1f483db01c8aee7cd.tar.gz Qt-cfa9eee32081dc49ab0697b1f483db01c8aee7cd.tar.bz2 |
Reading a property that doesn't exist throws a ReferenceError test
QTBUG-11606
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml | 12 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml new file mode 100644 index 0000000..6efb9c1 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml @@ -0,0 +1,12 @@ +import Qt 4.7 + +QtObject { + property bool test: false + Component.onCompleted: { + try { + console.log(sorryNoSuchProperty); + } catch (e) { + test = true; + } + } +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 50da55d..7e8a272 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -155,6 +155,7 @@ private slots: void eval(); void function(); void qtbug_10696(); + void qtbug_11606(); void include(); @@ -2503,6 +2504,15 @@ void tst_qdeclarativeecmascript::qtbug_10696() delete o; } +void tst_qdeclarativeecmascript::qtbug_11606() +{ + QDeclarativeComponent component(&engine, TEST_FILE("qtbug_11606.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + QCOMPARE(o->property("test").toBool(), true); + delete o; +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" |