summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-08-15 11:46:23 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-15 13:34:35 +0200
commitdf0ec196031d33850324dc5eeed2d71f61413885 (patch)
tree9e98812061839c550f2d3b4e86f57a47e6bf2b37 /tests
parent8854338fe988a38514e69fe52a831a1ac3c6f936 (diff)
downloadqtscript-df0ec196031d33850324dc5eeed2d71f61413885.tar.gz
Make QScriptEngine::uncaughtExceptionBacktrace() work again
This function has been broken since Qt 4.6 (when the JavaScriptCore- based back-end was introduced). Fix it by introducing a callback in JSC that allows us to capture the stack when an uncaught exception occurs. Task-number: QTBUG-6139 Change-Id: I4a829323c9fb0c8b2f16a2e5d6f0aeb13cc32561 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index dc81cdb..6d7540f 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -3057,20 +3057,19 @@ void tst_QScriptEngine::stacktrace()
const QString fileName("testfile");
QStringList backtrace;
- backtrace << "foo(5)@testfile:9"
- << "foo(4)@testfile:7"
- << "foo(3)@testfile:6"
- << "foo(2)@testfile:5"
- << "foo(1)@testfile:4"
- << "foo(0)@testfile:3"
- << "<global>()@testfile:12";
+ backtrace << "foo(counter = 5) at testfile:9"
+ << "foo(counter = 4) at testfile:7"
+ << "foo(counter = 3) at testfile:6"
+ << "foo(counter = 2) at testfile:5"
+ << "foo(counter = 1) at testfile:4"
+ << "foo(counter = 0) at testfile:3"
+ << "<global>() at testfile:12";
QScriptEngine eng;
QScriptValue result = eng.evaluate(script, fileName);
QVERIFY(eng.hasUncaughtException());
QVERIFY(result.isError());
- QEXPECT_FAIL("", "QTBUG-6139: uncaughtExceptionBacktrace() doesn't give the full backtrace", Abort);
QCOMPARE(eng.uncaughtExceptionBacktrace(), backtrace);
QVERIFY(eng.hasUncaughtException());
QVERIFY(result.strictlyEquals(eng.uncaughtException()));