diff options
Diffstat (limited to 'tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp')
-rw-r--r-- | tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp index fd74135727..9da4a63ce6 100644 --- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp @@ -38,7 +38,6 @@ #include <private/qv4debugging_p.h> #include <private/qv8engine_p.h> #include <private/qv4objectiterator_p.h> -#include <private/qv4isel_moth_p.h> #include <private/qv4string_p.h> #include <private/qqmlbuiltinfunctions_p.h> #include <private/qqmldebugservice_p.h> @@ -46,7 +45,7 @@ using namespace QV4; using namespace QV4::Debugging; -typedef void (*InjectedFunction)(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData); +typedef QV4::ReturnedValue (*InjectedFunction)(const QV4::BuiltinFunction *, QV4::CallData *callData); Q_DECLARE_METATYPE(InjectedFunction) static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000) @@ -343,7 +342,6 @@ void tst_qv4debugger::init() m_javaScriptThread = new QThread; m_engine = new TestEngine; m_v4 = m_engine->v4Engine(); - m_v4->iselFactory.reset(new QV4::Moth::ISelFactory); m_v4->setDebugger(new QV4Debugger(m_v4)); m_engine->moveToThread(m_javaScriptThread); m_javaScriptThread->start(); @@ -438,9 +436,9 @@ void tst_qv4debugger::addBreakPointWhilePaused() QCOMPARE(state.lineNumber, 2); } -static void someCall(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *) +static QV4::ReturnedValue someCall(const QV4::BuiltinFunction *function, QV4::CallData *) { - static_cast<QV4Debugger *>(scope.engine->debugger()) + static_cast<QV4Debugger *>(function->engine()->debugger()) ->removeBreakPoint("removeBreakPointForNextInstruction", 2); RETURN_UNDEFINED(); } @@ -464,7 +462,7 @@ void tst_qv4debugger::conditionalBreakPoint() { m_debuggerAgent->m_captureContextInfo = true; QString script = - "function test() {\n" + "var test = function() {\n" " for (var i = 0; i < 15; ++i) {\n" " var x = i;\n" " }\n" @@ -491,7 +489,6 @@ void tst_qv4debugger::conditionalBreakPointInQml() QQmlEngine engine; QV4::ExecutionEngine *v4 = QV8Engine::getV4(&engine); QV4Debugger *v4Debugger = new QV4Debugger(v4); - v4->iselFactory.reset(new QV4::Moth::ISelFactory); v4->setDebugger(v4Debugger); QScopedPointer<QThread> debugThread(new QThread); @@ -531,7 +528,7 @@ void tst_qv4debugger::readArguments() m_debuggerAgent->m_captureContextInfo = true; QString script = - "function f(a, b, c, d) {\n" + "var f = function(a, b, c, d) {\n" " return a === b\n" "}\n" "var four;\n" @@ -557,7 +554,7 @@ void tst_qv4debugger::readLocals() m_debuggerAgent->m_captureContextInfo = true; QString script = - "function f(a, b) {\n" + "var f = function(a, b) {\n" " var c = a + b\n" " var d = a - b\n" // breakpoint, c should be set, d should be undefined " return c === d\n" @@ -583,7 +580,7 @@ void tst_qv4debugger::readObject() m_debuggerAgent->m_captureContextInfo = true; QString script = - "function f(a) {\n" + "var f = function(a) {\n" " var b = a\n" " return b\n" "}\n" @@ -641,7 +638,7 @@ void tst_qv4debugger::readContextInAllFrames() m_debuggerAgent->m_captureContextInfo = true; QString script = - "function fact(n) {\n" + "var fact = function(n) {\n" " if (n > 1) {\n" " var n_1 = n - 1;\n" " n_1 = fact(n_1);\n" @@ -814,13 +811,13 @@ void tst_qv4debugger::lastLineOfConditional_data() QTest::newRow("do..while {block}") << "do {\n" << "} while (ret < 10);" << 4 << 7; QTest::newRow("if true {block}") << "if (true) {\n" << "}" - << 4 << 7; + << 4 << 8; QTest::newRow("if false {block}") << "if (false) {\n" << "}" << 2 << 8; QTest::newRow("if true else {block}") << "if (true) {\n" << "} else {\n ret += 8;\n}" - << 4 << 7; + << 4 << 10; QTest::newRow("if false else {block}") << "if (false) {\n" << "} else {\n ret += 8;\n}" - << 8 << 9; + << 8 << 10; QTest::newRow("for statement") << "for (var i = 0; i < 10; ++i)\n" << "" << 4 << 2; QTest::newRow("for..in statement") << "for (var i in [0, 1, 2, 3, 4])\n" << "" << 4 << 2; @@ -829,11 +826,11 @@ void tst_qv4debugger::lastLineOfConditional_data() // For two nested if statements without blocks, we need to map the jump from the inner to the // outer one on the outer "if". There is just no better place. - QTest::newRow("if true statement") << "if (true)\n" << "" << 4 << 2; + QTest::newRow("if true statement") << "if (true)\n" << "" << 4 << 8; QTest::newRow("if false statement") << "if (false)\n" << "" << 2 << 8; // Also two nested ifs without blocks. - QTest::newRow("if true else statement") << "if (true)\n" << "else\n ret += 8;" << 4 << 2; + QTest::newRow("if true else statement") << "if (true)\n" << "else\n ret += 8;" << 4 << 9; QTest::newRow("if false else statement") << "if (false)\n" << "else\n ret += 8;" << 8 << 9; } |