diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-08-14 09:12:22 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-14 09:16:11 +0200 |
commit | 1a699b64cf637b67fc42f8a0efab3de8bf910079 (patch) | |
tree | e52e8f93ca8ddbbd0fc01622d215cb620c4d86fd | |
parent | 967b7097f74de0a0c4ddd00cf5f3e772f9d9fc90 (diff) |
Update autotest to match new QScriptEngine::pushContext behavior
See commit 68458376c0db2f786b2c9ab3b8dfd21695a5645e in qtscript.
Change-Id: If62bf96d9a965ba500c7a4786d347c828a1683b1
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index d561fbb3..61d04985 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -3043,10 +3043,11 @@ void tst_qdeclarativeecmascript::pushCleanContext() QScriptContext *context1 = engine.pushContext(); context1->pushScope(object); QCOMPARE(engine.evaluate("a").toInt32(), 15); + QScriptValue func0 = engine.evaluate("(function() { return a; })"); QScriptContext *context2 = engine.pushContext(); Q_UNUSED(context2); - QCOMPARE(engine.evaluate("a").toInt32(), 15); + QCOMPARE(engine.evaluate("a").toInt32(), 6); QScriptValue func1 = engine.evaluate("(function() { return a; })"); // Now check that pushCleanContext() works @@ -3055,7 +3056,7 @@ void tst_qdeclarativeecmascript::pushCleanContext() QScriptValue func2 = engine.evaluate("(function() { return a; })"); engine.popContext(); - QCOMPARE(engine.evaluate("a").toInt32(), 15); + QCOMPARE(engine.evaluate("a").toInt32(), 6); engine.popContext(); QCOMPARE(engine.evaluate("a").toInt32(), 15); @@ -3064,7 +3065,8 @@ void tst_qdeclarativeecmascript::pushCleanContext() QCOMPARE(engine.evaluate("a").toInt32(), 6); // Check that function objects created in these contexts work - QCOMPARE(func1.call().toInt32(), 15); + QCOMPARE(func0.call().toInt32(), 15); + QCOMPARE(func1.call().toInt32(), 6); QCOMPARE(func2.call().toInt32(), 6); } |