History

Add missing scope guards in script engine tests

Dale Glass committed 6 months ago

Commit 95f600f1 parent c249d712 files · +16 −5Browse files

Showing the changes to tests/script-engine/src/ScriptEngineBenchmarkTests.cpp (1 of 2 files). Show all

Unified · Split

tests/script-engine/src/ScriptEngineBenchmarkTests.cpp+7−0
@@ -106,6 +106,7 @@ void ScriptEngineBenchmarkTests::benchmarkSetProperty() { · 105 unmodified lines
106 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");106 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");
107 107
108 auto engine = sm->engine();108 auto engine = sm->engine();
109 auto scopeGuard = engine->getScopeGuard();
109 auto obj = engine->newObject();110 auto obj = engine->newObject();
110 111
111 QBENCHMARK {112 QBENCHMARK {
@@ -119,6 +120,8 @@ void ScriptEngineBenchmarkTests::benchmarkSetProperty1K() { · 7 unmodified lines
119 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");120 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");
120 121
121 auto engine = sm->engine();122 auto engine = sm->engine();
123 auto scopeGuard = engine->getScopeGuard();
124
122 auto obj = engine->newObject();125 auto obj = engine->newObject();
123 126
124 int i = 0;127 int i = 0;
@@ -138,6 +141,8 @@ void ScriptEngineBenchmarkTests::benchmarkSetProperty16K() { · 13 unmodified lines
138 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");141 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");
139 142
140 auto engine = sm->engine();143 auto engine = sm->engine();
144 auto scopeGuard = engine->getScopeGuard();
145
141 auto obj = engine->newObject();146 auto obj = engine->newObject();
142 147
143 int i = 0;148 int i = 0;
@@ -158,6 +163,8 @@ void ScriptEngineBenchmarkTests::benchmarkQueryProperty() { · 14 unmodified lines
158 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");163 auto sm = makeManager("print(\"script works!\"); Script.stop(true);", "testTrivial.js");
159 164
160 auto engine = sm->engine();165 auto engine = sm->engine();
166 auto scopeGuard = engine->getScopeGuard();
167
161 auto obj = engine->newObject();168 auto obj = engine->newObject();
162 169
163 170