diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-30 07:27:47 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-30 07:27:47 (GMT) |
commit | b742568492c56aee9445a1fbf3e90e9ef3cb5823 (patch) | |
tree | 765bfde02d759536e9a1f7cfe95772c89a8b3c3b /tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | |
parent | 89f21d7269ae7bf29e718958d00da84e5c60257f (diff) | |
download | Qt-b742568492c56aee9445a1fbf3e90e9ef3cb5823.zip Qt-b742568492c56aee9445a1fbf3e90e9ef3cb5823.tar.gz Qt-b742568492c56aee9445a1fbf3e90e9ef3cb5823.tar.bz2 |
Ensure eval and Function are in the correct scope
QTBUG-10236
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 49ee335..6d39be2 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -146,6 +146,8 @@ private slots: void noSpuriousWarningsAtShutdown(); void canAssignNullToQObject(); void functionAssignment(); + void eval(); + void function(); void callQtInvokables(); private: @@ -2329,6 +2331,35 @@ void tst_qdeclarativeecmascript::functionAssignment() } } +void tst_qdeclarativeecmascript::eval() +{ + QDeclarativeComponent component(&engine, TEST_FILE("eval.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toBool(), true); + QCOMPARE(o->property("test2").toBool(), true); + QCOMPARE(o->property("test3").toBool(), true); + QCOMPARE(o->property("test4").toBool(), true); + QCOMPARE(o->property("test5").toBool(), true); + + delete o; +} + +void tst_qdeclarativeecmascript::function() +{ + QDeclarativeComponent component(&engine, TEST_FILE("function.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toBool(), true); + QCOMPARE(o->property("test2").toBool(), true); + QCOMPARE(o->property("test3").toBool(), true); + + delete o; +} QTEST_MAIN(tst_qdeclarativeecmascript) |