From 939e59f7f3cd23ab429c48d1be8f3d98f94962ad Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 29 Jun 2009 18:23:23 +0200 Subject: make part of test not assert --- src/script/bridge/qscriptqobject.cpp | 2 ++ tests/auto/qscriptqobject/tst_qscriptqobject.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index de6eecf..da301a0 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -1443,6 +1443,8 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv) JSC::CallData callData; JSC::CallType callType = slot.getCallData(callData); if (callType == JSC::CallTypeJS) { + if (exec->hadException()) + exec->clearException(); // ### otherwise JSC asserts (void)JSC::asFunction(slot)->call(exec, thisObject, jscArgs); } else if (callType == JSC::CallTypeHost) { (void)callData.native.function(exec, JSC::asObject(slot), thisObject, jscArgs); diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp index ed466ff..5f1bb1f 100644 --- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp +++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp @@ -1513,7 +1513,6 @@ void tst_QScriptExtQObject::connectAndDisconnect() m_engine->evaluate("gotSignal = false"); QVERIFY(m_engine->evaluate("myObject.mySignal2.connect(myHandler)").isUndefined()); - QSKIP("Rest of the test causes crash", SkipAll); m_myObject->emitMySignal2(true); QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true); QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0); @@ -1582,6 +1581,7 @@ void tst_QScriptExtQObject::connectAndDisconnect() m_myObject->emitMySignalWithVariantArg(123); QCOMPARE(m_engine->evaluate("gotSignal").toBoolean(), true); QCOMPARE(m_engine->evaluate("signalArgs.length").toNumber(), 1.0); + QVERIFY(m_engine->evaluate("signalArgs[0]").isNumber()); QCOMPARE(m_engine->evaluate("signalArgs[0]").toNumber(), 123.0); QVERIFY(m_engine->evaluate("myObject.mySignalWithVariantArg.disconnect(myHandler)").isUndefined()); @@ -1793,7 +1793,7 @@ void tst_QScriptExtQObject::connectAndDisconnect() void tst_QScriptExtQObject::cppConnectAndDisconnect() { - QSKIP("Crashes", SkipAll); + QSKIP("Crashes (GC-related)", SkipAll); QScriptEngine eng; QLineEdit edit; QLineEdit edit2; -- cgit v0.12