aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-01-20 13:57:16 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-01-22 09:51:40 +0000
commitb60a5dc9405ce89d7a742abc81b906d5c8cf5f7d (patch)
tree87467995a5d8b09dffec4e522eb8515f307a0824 /tests
parent5537027094d26e517fc4ad3173ea84d254dd3013 (diff)
Clean up QV4DataCollector
We don't need to pass debuggers and engines around as the data collector already has all the necessary information. Also, the exception collect job is only used in the test case, so we don't need to define it in the collector. Change-Id: I3197dd5c2d99e95465aa787097c6f8bf8aee794e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qv4debugger/tst_qv4debugger.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
index 2532f73466..313f5893e1 100644
--- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
@@ -96,6 +96,23 @@ signals:
void evaluateFinished();
};
+class ExceptionCollectJob: public CollectJob
+{
+ QV4DataCollector::Ref exception;
+
+public:
+ ExceptionCollectJob(QV4DataCollector *collector) :
+ CollectJob(collector), exception(-1) {}
+
+ void run() {
+ QV4::Scope scope(collector->engine());
+ QV4::ScopedValue v(scope, *collector->engine()->exceptionValue);
+ exception = collector->collect(v);
+ }
+
+ QV4DataCollector::Ref exceptionValue() const { return exception; }
+};
+
class TestAgent : public QObject
{
Q_OBJECT
@@ -174,7 +191,7 @@ public slots:
if (debugger->state() == V4Debugger::Paused &&
debugger->engine()->hasException) {
- ExceptionCollectJob job(debugger->engine(), &collector);
+ ExceptionCollectJob job(&collector);
debugger->runInEngine(&job);
m_thrownValue = job.exceptionValue();
}