aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-06-04 10:45:14 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-06-04 10:45:14 +0200
commit3ca5f33c8b9c273f0169ec4c11417328f8071e97 (patch)
tree155da80482fb4593ca074f7a1bf9b22d031dba4a /tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
parent5f4698c4e7952d64e78e3a06de5ac28d68415b19 (diff)
parentb7a1bcd83a8f68185b617b860cef6f2d2d7c8d9b (diff)
Merge remote-tracking branch 'gerrit/5.11' into wip/webassembly
Diffstat (limited to 'tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp')
-rw-r--r--tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index 4ce0f9fd89..c65c592f10 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -297,6 +297,7 @@ private slots:
// context access:
void readArguments_data() { redundancy_data(); }
void readArguments();
+ void readComplicatedArguments();
void readLocals_data() { redundancy_data(); }
void readLocals();
void readObject_data() { redundancy_data(); }
@@ -549,6 +550,27 @@ void tst_qv4debugger::readArguments()
QCOMPARE(frame0.value(QStringLiteral("b")).toString(), QStringLiteral("two"));
}
+void tst_qv4debugger::readComplicatedArguments()
+{
+ m_debuggerAgent->collector.setRedundantRefs(false);
+ m_debuggerAgent->m_captureContextInfo = true;
+ QString script =
+ "var f = function(a) {\n"
+ " a = 12;\n"
+ " return a;\n"
+ "}\n"
+ "f(1, 2);\n";
+ debugger()->addBreakPoint("readArguments", 3);
+ evaluateJavaScript(script, "readArguments");
+ QVERIFY(m_debuggerAgent->m_wasPaused);
+ QVERIFY(m_debuggerAgent->m_capturedScope.size() > 1);
+ const TestAgent::NamedRefs &frame0 = m_debuggerAgent->m_capturedScope.at(0);
+ QCOMPARE(frame0.size(), 1);
+ QVERIFY(frame0.contains(QStringLiteral("a")));
+ QCOMPARE(frame0.type(QStringLiteral("a")), QStringLiteral("number"));
+ QCOMPARE(frame0.value(QStringLiteral("a")).toInt(), 12);
+}
+
void tst_qv4debugger::readLocals()
{
QFETCH(bool, redundantRefs);