aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-07-18 10:56:12 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-07-18 13:36:57 +0000
commit98f848ef834d1be33929b39ca1a85ef42b8c9a78 (patch)
treea97c79331a1af77d25e1f8a039bc4a1bec0617ba /tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
parentd241dfdde503daa306914cf0410ff312e2473b3d (diff)
V4 debugger: Drop redundantRefs option
No client is using this anymore and we can eliminate a lot of code this way. Change-Id: I454581928fe88e59cd28738c4f7fddd060999181 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp')
-rw-r--r--tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp50
1 files changed, 5 insertions, 45 deletions
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index a176f674e6..b75fb6b895 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -105,7 +105,7 @@ public:
void run() {
QV4::Scope scope(collector->engine());
QV4::ScopedValue v(scope, *collector->engine()->exceptionValue);
- exception = collector->collect(v);
+ exception = collector->addValueRef(v);
}
QV4DataCollector::Ref exceptionValue() const { return exception; }
@@ -238,11 +238,7 @@ public:
NamedRefs &refs = m_capturedScope.last();
QJsonObject object = job.returnValue();
object = object.value(QLatin1String("object")).toObject();
- if (object.contains("ref") && !object.contains("properties")) {
- QVERIFY(collector.redundantRefs());
- object = collector.lookupRef(object.value("ref").toInt(), true);
- QVERIFY(object.contains("properties"));
- }
+ QVERIFY(!object.contains("ref") || object.contains("properties"));
foreach (const QJsonValue &value, object.value(QLatin1String("properties")).toArray()) {
QJsonObject property = value.toObject();
QString name = property.value(QLatin1String("name")).toString();
@@ -308,14 +304,10 @@ private slots:
void conditionalBreakPointInQml();
// context access:
- void readArguments_data() { redundancy_data(); }
void readArguments();
void readComplicatedArguments();
- void readLocals_data() { redundancy_data(); }
void readLocals();
- void readObject_data() { redundancy_data(); }
void readObject();
- void readContextInAllFrames_data() { redundancy_data(); }
void readContextInAllFrames();
// exceptions:
@@ -323,9 +315,7 @@ private slots:
void breakInCatch();
void breakInWith();
- void evaluateExpression_data() { redundancy_data(); }
void evaluateExpression();
- void stepToEndOfScript_data() { redundancy_data(); }
void stepToEndOfScript();
void lastLineOfConditional_data();
@@ -345,8 +335,6 @@ private:
waitForSignal(m_engine, SIGNAL(evaluateFinished()), /*timeout*/0);
}
- void redundancy_data();
-
TestEngine *m_engine;
QV4::ExecutionEngine *m_v4;
TestAgent *m_debuggerAgent;
@@ -539,9 +527,6 @@ void tst_qv4debugger::conditionalBreakPointInQml()
void tst_qv4debugger::readArguments()
{
- QFETCH(bool, redundantRefs);
- m_debuggerAgent->collector.setRedundantRefs(redundantRefs);
-
m_debuggerAgent->m_captureContextInfo = true;
QString script =
"var f = function(a, b, c, d) {\n"
@@ -565,7 +550,6 @@ void tst_qv4debugger::readArguments()
void tst_qv4debugger::readComplicatedArguments()
{
- m_debuggerAgent->collector.setRedundantRefs(false);
m_debuggerAgent->m_captureContextInfo = true;
QString script =
"var f = function(a) {\n"
@@ -586,9 +570,6 @@ void tst_qv4debugger::readComplicatedArguments()
void tst_qv4debugger::readLocals()
{
- QFETCH(bool, redundantRefs);
- m_debuggerAgent->collector.setRedundantRefs(redundantRefs);
-
m_debuggerAgent->m_captureContextInfo = true;
QString script =
"var f = function(a, b) {\n"
@@ -612,9 +593,6 @@ void tst_qv4debugger::readLocals()
void tst_qv4debugger::readObject()
{
- QFETCH(bool, redundantRefs);
- m_debuggerAgent->collector.setRedundantRefs(redundantRefs);
-
m_debuggerAgent->m_captureContextInfo = true;
QString script =
"var f = function(a) {\n"
@@ -636,7 +614,7 @@ void tst_qv4debugger::readObject()
QVERIFY(!b.contains(QStringLiteral("properties")));
QVERIFY(b.value("value").isDouble());
QCOMPARE(b.value("value").toInt(), 2);
- b = m_debuggerAgent->collector.lookupRef(b.value("ref").toInt(), true);
+ b = m_debuggerAgent->collector.lookupRef(b.value("ref").toInt());
QVERIFY(b.contains(QStringLiteral("properties")));
QVERIFY(b.value("properties").isArray());
QJsonArray b_props = b.value("properties").toArray();
@@ -652,8 +630,7 @@ void tst_qv4debugger::readObject()
QCOMPARE(b_tail.value("name").toString(), QStringLiteral("tail"));
QVERIFY(b_tail.contains("ref"));
- QJsonObject b_tail_value = m_debuggerAgent->collector.lookupRef(b_tail.value("ref").toInt(),
- true);
+ QJsonObject b_tail_value = m_debuggerAgent->collector.lookupRef(b_tail.value("ref").toInt());
QCOMPARE(b_tail_value.value("type").toString(), QStringLiteral("object"));
QVERIFY(b_tail_value.contains("properties"));
QJsonArray b_tail_props = b_tail_value.value("properties").toArray();
@@ -670,9 +647,6 @@ void tst_qv4debugger::readObject()
void tst_qv4debugger::readContextInAllFrames()
{
- QFETCH(bool, redundantRefs);
- m_debuggerAgent->collector.setRedundantRefs(redundantRefs);
-
m_debuggerAgent->m_captureContextInfo = true;
QString script =
"var fact = function(n) {\n"
@@ -720,8 +694,7 @@ void tst_qv4debugger::pauseOnThrow()
QCOMPARE(m_debuggerAgent->m_pauseReason, QV4Debugger::Throwing);
QCOMPARE(m_debuggerAgent->m_stackTrace.size(), 2);
QVERIFY(m_debuggerAgent->m_thrownValue >= qint64(0));
- QJsonObject exception = m_debuggerAgent->collector.lookupRef(m_debuggerAgent->m_thrownValue,
- true);
+ QJsonObject exception = m_debuggerAgent->collector.lookupRef(m_debuggerAgent->m_thrownValue);
// DUMP_JSON(exception);
QCOMPARE(exception.value("type").toString(), QStringLiteral("string"));
QCOMPARE(exception.value("value").toString(), QStringLiteral("hard"));
@@ -765,9 +738,6 @@ void tst_qv4debugger::breakInWith()
void tst_qv4debugger::evaluateExpression()
{
- QFETCH(bool, redundantRefs);
- m_debuggerAgent->collector.setRedundantRefs(redundantRefs);
-
QString script =
"function testFunction() {\n"
" var x = 10\n"
@@ -809,9 +779,6 @@ void tst_qv4debugger::evaluateExpression()
void tst_qv4debugger::stepToEndOfScript()
{
- QFETCH(bool, redundantRefs);
- m_debuggerAgent->collector.setRedundantRefs(redundantRefs);
-
QString script =
"var ret = 0;\n"
"ret += 4;\n"
@@ -932,13 +899,6 @@ void tst_qv4debugger::readThis()
QCOMPARE(a.value("value").toInt(), 5);
}
-void tst_qv4debugger::redundancy_data()
-{
- QTest::addColumn<bool>("redundantRefs");
- QTest::addRow("redundant") << true;
- QTest::addRow("sparse") << false;
-}
-
QTEST_MAIN(tst_qv4debugger)
#include "tst_qv4debugger.moc"