diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-10 15:59:55 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-10 16:00:50 (GMT) |
commit | 336f0bf740842ab8defdbf482a7f043de95857e4 (patch) | |
tree | 4d98d5257634f8def710d73eacefcb8e876e302b /tests/auto/qscriptcontext | |
parent | 43c82a93c698f4a1eaa460839f905f1923c2b046 (diff) | |
download | Qt-336f0bf740842ab8defdbf482a7f043de95857e4.zip Qt-336f0bf740842ab8defdbf482a7f043de95857e4.tar.gz Qt-336f0bf740842ab8defdbf482a7f043de95857e4.tar.bz2 |
implement QScriptContext::setActivationObject()
Diffstat (limited to 'tests/auto/qscriptcontext')
-rw-r--r-- | tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index eed0cb1..1bc375a 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -704,25 +704,29 @@ void tst_QScriptContext::getSetActivationObject() QCOMPARE(ctx->engine(), &eng); QScriptValue obj = eng.newObject(); + QTest::ignoreMessage(QtWarningMsg, "QScriptContext::setActivationObject() failed: not an activation object"); ctx->setActivationObject(obj); - QEXPECT_FAIL("", "", Abort); + QEXPECT_FAIL("", "Normal object cannot be set as activation object", Continue); QVERIFY(ctx->activationObject().equals(obj)); { QScriptEngine eng2; QScriptValue obj2 = eng2.newObject(); QTest::ignoreMessage(QtWarningMsg, "QScriptContext::setActivationObject() failed: cannot set an object created in a different engine"); + QScriptValue was = ctx->activationObject(); ctx->setActivationObject(obj2); - QVERIFY(ctx->activationObject().equals(obj)); + QVERIFY(ctx->activationObject().equals(was)); } ctx->setActivationObject(eng.globalObject()); + QVERIFY(ctx->activationObject().equals(eng.globalObject())); QScriptValue fun = eng.newFunction(get_activationObject); eng.globalObject().setProperty("get_activationObject", fun); { QScriptValue ret = eng.evaluate("get_activationObject(1, 2, 3)"); QVERIFY(ret.isObject()); QScriptValue arguments = ret.property("arguments"); + QEXPECT_FAIL("", "Getting arguments property of activation object doesn't work", Abort); QVERIFY(arguments.isObject()); QCOMPARE(arguments.property("length").toInt32(), 3); QCOMPARE(arguments.property("0").toInt32(), 1); |