OpenCoverage

qjsengine.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsapi/qjsengine.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10 template <> struct QMetaTypeId< QList<int> > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QList<int> >("QList<int>", reinterpret_cast< QList<int> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } };-
11-
12-
13static void checkForApplicationInstance()-
14{-
15 if (!QCoreApplication::instance()
!QCoreApplication::instance()Description
TRUEnever evaluated
FALSEevaluated 10338 times by 151 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • ...
)
0-10338
16 QMessageLogger(__FILE__, 285, __PRETTY_FUNCTION__).fatal("QJSEngine: Must construct a QCoreApplication before a QJSEngine");
never executed: QMessageLogger(__FILE__, 285, __PRETTY_FUNCTION__).fatal("QJSEngine: Must construct a QCoreApplication before a QJSEngine");
0
17}
executed 10338 times by 151 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • ...
10338
18-
19-
20-
21-
22-
23-
24-
25QJSEngine::QJSEngine()-
26 : QJSEngine(nullptr)-
27{-
28}
executed 2662 times by 8 tests: end of block
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qv4debugger
2662
29QJSEngine::QJSEngine(QObject *parent)-
30 : QObject(*new QJSEnginePrivate, parent)-
31 , m_v4Engine(new QV4::ExecutionEngine(this))-
32{-
33 m_v4Engine->v8Engine = new QV8Engine(m_v4Engine);-
34 checkForApplicationInstance();-
35-
36 QJSEnginePrivate::addToDebugServer(this);-
37}
executed 2664 times by 8 tests: end of block
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlvaluetypes
  • tst_qv4debugger
2664
38-
39-
40-
41-
42QJSEngine::QJSEngine(QJSEnginePrivate &dd, QObject *parent)-
43 : QObject(dd, parent)-
44 , m_v4Engine(new QV4::ExecutionEngine(this))-
45{-
46 m_v4Engine->v8Engine = new QV8Engine(m_v4Engine);-
47 checkForApplicationInstance();-
48}
executed 7674 times by 148 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • ...
7674
49QJSEngine::~QJSEngine()-
50{-
51 QJSEnginePrivate::removeFromDebugServer(this);-
52 delete m_v4Engine->v8Engine;-
53 delete m_v4Engine;-
54}
executed 10324 times by 151 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • ...
10324
55void QJSEngine::collectGarbage()-
56{-
57 m_v4Engine->memoryManager->runGC();-
58}
executed 280 times by 11 tests: end of block
Executed by:
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmltypeloader
  • tst_qquickitem
  • tst_qquickloader
  • tst_qquickrepeater
  • tst_qv4mm
280
59void QJSEngine::installTranslatorFunctions(const QJSValue &object)-
60{-
61 installExtensions(TranslationExtension, object);-
62}
executed 142 times by 1 test: end of block
Executed by:
  • tst_qjsengine
142
63void QJSEngine::installExtensions(QJSEngine::Extensions extensions, const QJSValue &object)-
64{-
65 QV4::ExecutionEngine *otherEngine = QJSValuePrivate::engine(&object);-
66 if (otherEngine
otherEngineDescription
TRUEnever evaluated
FALSEevaluated 164 times by 1 test
Evaluated by:
  • tst_qjsengine
&& otherEngine != m_v4Engine
otherEngine != m_v4EngineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-164
67 QMessageLogger(__FILE__, 417, __PRETTY_FUNCTION__).warning("QJSEngine: Trying to install extensions from a different engine");-
68 return;
never executed: return;
0
69 }-
70-
71 QV4::Scope scope(m_v4Engine);-
72 QV4::ScopedObject obj(scope);-
73 QV4::Value *val = QJSValuePrivate::getValue(&object);-
74 if (val
valDescription
TRUEnever evaluated
FALSEevaluated 164 times by 1 test
Evaluated by:
  • tst_qjsengine
)
0-164
75 obj = val;
never executed: obj = val;
0
76 if (!obj
!objDescription
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEnever evaluated
)
0-164
77 obj = scope.engine->globalObject;
executed 164 times by 1 test: obj = scope.engine->globalObject;
Executed by:
  • tst_qjsengine
164
78-
79 QV4::GlobalExtensions::init(obj, extensions);-
80}
executed 164 times by 1 test: end of block
Executed by:
  • tst_qjsengine
164
81QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, int lineNumber)-
82{-
83 QV4::ExecutionEngine *v4 = m_v4Engine;-
84 QV4::Scope scope(v4);-
85 QV4::ScopedValue result(scope);-
86-
87 QV4::Script script(v4->rootContext(), QV4::Compiler::ContextType::Global, program, fileName, lineNumber);-
88 script.strictMode = false;-
89 if (v4->currentStackFrame
v4->currentStackFrameDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qqmlecmascript
FALSEevaluated 35746 times by 8 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
)
4-35746
90 script.strictMode = v4->currentStackFrame->v4Function->isStrict();
executed 4 times by 2 tests: script.strictMode = v4->currentStackFrame->v4Function->isStrict();
Executed by:
  • tst_qjsengine
  • tst_qqmlecmascript
4
91 else if (v4->globalCode
v4->globalCodeDescription
TRUEnever evaluated
FALSEevaluated 35746 times by 8 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
)
0-35746
92 script.strictMode = v4->globalCode->isStrict();
never executed: script.strictMode = v4->globalCode->isStrict();
0
93 script.inheritContext = true;-
94 script.parse();-
95 if (!scope.engine->hasException
!scope.engine->hasExceptionDescription
TRUEevaluated 35480 times by 8 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
FALSEevaluated 270 times by 3 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlecmascript
)
270-35480
96 result = script.run();
executed 35480 times by 8 tests: result = script.run();
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
35480
97 if (scope.engine->hasException
scope.engine->hasExceptionDescription
TRUEevaluated 412 times by 5 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlecmascript
  • tst_qv4debugger
FALSEevaluated 35338 times by 8 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
)
412-35338
98 result = v4->catchException();
executed 412 times by 5 tests: result = v4->catchException();
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlecmascript
  • tst_qv4debugger
412
99-
100 QJSValue retval(v4, result->asReturnedValue());-
101-
102 return
executed 35750 times by 8 tests: return retval;
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
retval;
executed 35750 times by 8 tests: return retval;
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qv4debugger
35750
103}-
104QJSValue QJSEngine::newObject()-
105{-
106 QV4::Scope scope(m_v4Engine);-
107 QV4::ScopedValue v(scope, m_v4Engine->newObject());-
108 return
executed 144 times by 6 tests: return QJSValue(m_v4Engine, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qquicktext
QJSValue(m_v4Engine, v->asReturnedValue());
executed 144 times by 6 tests: return QJSValue(m_v4Engine, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlecmascript
  • tst_qqmlxmlhttprequest
  • tst_qquicktext
144
109}-
110-
111-
112-
113-
114-
115-
116QJSValue QJSEngine::newArray(uint length)-
117{-
118 QV4::Scope scope(m_v4Engine);-
119 QV4::ScopedArrayObject array(scope, m_v4Engine->newArrayObject());-
120 if (length < 0x1000
length < 0x1000Description
TRUEevaluated 32 times by 7 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
)
2-32
121 array->arrayReserve(length);
executed 32 times by 7 tests: array->arrayReserve(length);
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
32
122 array->setArrayLengthUnchecked(length);-
123 return
executed 34 times by 7 tests: return QJSValue(m_v4Engine, array.asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
QJSValue(m_v4Engine, array.asReturnedValue());
executed 34 times by 7 tests: return QJSValue(m_v4Engine, array.asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
34
124}-
125QJSValue QJSEngine::newQObject(QObject *object)-
126{-
127 ;-
128 QV4::ExecutionEngine *v4 = m_v4Engine;-
129 QV4::Scope scope(v4);-
130 if (object
objectDescription
TRUEevaluated 282 times by 5 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
  • tst_qquickrepeater
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
) {
6-282
131 QQmlData *ddata = QQmlData::get(object, true);-
132 if (!ddata
!ddataDescription
TRUEnever evaluated
FALSEevaluated 282 times by 5 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
  • tst_qquickrepeater
|| !ddata->explicitIndestructibleSet
!ddata->explic...estructibleSetDescription
TRUEevaluated 260 times by 4 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
FALSEevaluated 22 times by 4 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
  • tst_qqmlcontext
  • tst_qquickrepeater
)
0-282
133 QQmlEngine::setObjectOwnership(object, QQmlEngine::JavaScriptOwnership);
executed 260 times by 4 tests: QQmlEngine::setObjectOwnership(object, QQmlEngine::JavaScriptOwnership);
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
260
134 }
executed 282 times by 5 tests: end of block
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
  • tst_qquickrepeater
282
135 QV4::ScopedValue v(scope, QV4::QObjectWrapper::wrap(v4, object));-
136 return
executed 288 times by 5 tests: return QJSValue(v4, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
  • tst_qquickrepeater
QJSValue(v4, v->asReturnedValue());
executed 288 times by 5 tests: return QJSValue(v4, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlcontext
  • tst_qquickrepeater
288
137}-
138QJSValue QJSEngine::newQMetaObject(const QMetaObject* metaObject) {-
139 ;-
140 QV4::ExecutionEngine *v4 = m_v4Engine;-
141 QV4::Scope scope(v4);-
142 QV4::ScopedValue v(scope, QV4::QMetaObjectWrapper::create(v4, metaObject));-
143 return
executed 6 times by 1 test: return QJSValue(v4, v->asReturnedValue());
Executed by:
  • tst_qjsengine
QJSValue(v4, v->asReturnedValue());
executed 6 times by 1 test: return QJSValue(v4, v->asReturnedValue());
Executed by:
  • tst_qjsengine
6
144}-
145QJSValue QJSEngine::globalObject() const-
146{-
147 QV4::Scope scope(m_v4Engine);-
148 QV4::ScopedValue v(scope, m_v4Engine->globalObject);-
149 return
executed 348 times by 3 tests: return QJSValue(m_v4Engine, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
QJSValue(m_v4Engine, v->asReturnedValue());
executed 348 times by 3 tests: return QJSValue(m_v4Engine, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
348
150}-
151-
152-
153-
154-
155-
156QJSValue QJSEngine::create(int type, const void *ptr)-
157{-
158 QV4::Scope scope(m_v4Engine);-
159 QV4::ScopedValue v(scope, scope.engine->metaTypeToJS(type, ptr));-
160 return
executed 48668 times by 5 tests: return QJSValue(m_v4Engine, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlvaluetypes
QJSValue(m_v4Engine, v->asReturnedValue());
executed 48668 times by 5 tests: return QJSValue(m_v4Engine, v->asReturnedValue());
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qqmlvaluetypes
48668
161}-
162-
163-
164-
165-
166-
167bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr)-
168{-
169 QV4::ExecutionEngine *v4 = QJSValuePrivate::engine(&value);-
170 QV4::Value scratch;-
171 QV4::Value *val = QJSValuePrivate::valueForData(&value, &scratch);-
172 if (v4
v4Description
TRUEevaluated 330 times by 4 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlvaluetypes
FALSEevaluated 152 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
) {
152-330
173 QV4::Scope scope(v4);-
174 QV4::ScopedValue v(scope, *val);-
175 return
executed 330 times by 4 tests: return scope.engine->metaTypeFromJS(v, type, ptr);
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlvaluetypes
scope.engine->metaTypeFromJS(v, type, ptr);
executed 330 times by 4 tests: return scope.engine->metaTypeFromJS(v, type, ptr);
Executed by:
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qqmlvaluetypes
330
176 }-
177-
178 if (!val
!valDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qjsvalue
FALSEevaluated 108 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qjsvalue
) {
44-108
179 QVariant *variant = QJSValuePrivate::getVariant(&value);-
180 ((variant) ? static_cast<void>(0) : qt_assert("variant", __FILE__, 625));-
181-
182 if (variant->userType() == QMetaType::QString
variant->userT...aType::QStringDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_qjsvalue
FALSEnever evaluated
) {
0-44
183 QString string = variant->toString();-
184-
185 if (type == QMetaType::Bool
type == QMetaType::BoolDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qjsvalue
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_qjsvalue
) {
8-36
186 *reinterpret_cast<bool*>(ptr) = string.length() != 0;-
187 return
executed 8 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 8 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
8
188 }-
189 if (type == QMetaType::QString
type == QMetaType::QStringDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsvalue
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_qjsvalue
) {
2-34
190 *reinterpret_cast<QString*>(ptr) = string;-
191 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
2
192 }-
193 double d = QV4::RuntimeHelpers::stringToNumber(string);-
194 switch (type) {-
195 case
executed 14 times by 1 test: case QMetaType::Int:
Executed by:
  • tst_qjsvalue
QMetaType::Int:
executed 14 times by 1 test: case QMetaType::Int:
Executed by:
  • tst_qjsvalue
14
196 *reinterpret_cast<int*>(ptr) = QV4::Primitive::toInt32(d);-
197 return
executed 14 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 14 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
14
198 case
executed 14 times by 1 test: case QMetaType::UInt:
Executed by:
  • tst_qjsvalue
QMetaType::UInt:
executed 14 times by 1 test: case QMetaType::UInt:
Executed by:
  • tst_qjsvalue
14
199 *reinterpret_cast<uint*>(ptr) = QV4::Primitive::toUInt32(d);-
200 return
executed 14 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 14 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
14
201 case
never executed: case QMetaType::LongLong:
QMetaType::LongLong:
never executed: case QMetaType::LongLong:
0
202 *reinterpret_cast<qlonglong*>(ptr) = QV4::Primitive::toInteger(d);-
203 return
never executed: return true;
true;
never executed: return true;
0
204 case
never executed: case QMetaType::ULongLong:
QMetaType::ULongLong:
never executed: case QMetaType::ULongLong:
0
205 *reinterpret_cast<qulonglong*>(ptr) = QV4::Primitive::toInteger(d);-
206 return
never executed: return true;
true;
never executed: return true;
0
207 case
executed 4 times by 1 test: case QMetaType::Double:
Executed by:
  • tst_qjsvalue
QMetaType::Double:
executed 4 times by 1 test: case QMetaType::Double:
Executed by:
  • tst_qjsvalue
4
208 *reinterpret_cast<double*>(ptr) = d;-
209 return
executed 4 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
4
210 case
never executed: case QMetaType::Float:
QMetaType::Float:
never executed: case QMetaType::Float:
0
211 *reinterpret_cast<float*>(ptr) = d;-
212 return
never executed: return true;
true;
never executed: return true;
0
213 case
never executed: case QMetaType::Short:
QMetaType::Short:
never executed: case QMetaType::Short:
0
214 *reinterpret_cast<short*>(ptr) = QV4::Primitive::toInt32(d);-
215 return
never executed: return true;
true;
never executed: return true;
0
216 case
never executed: case QMetaType::UShort:
QMetaType::UShort:
never executed: case QMetaType::UShort:
0
217 *reinterpret_cast<unsigned short*>(ptr) = QV4::Primitive::toUInt32(d);-
218 return
never executed: return true;
true;
never executed: return true;
0
219 case
never executed: case QMetaType::Char:
QMetaType::Char:
never executed: case QMetaType::Char:
0
220 *reinterpret_cast<char*>(ptr) = QV4::Primitive::toInt32(d);-
221 return
never executed: return true;
true;
never executed: return true;
0
222 case
never executed: case QMetaType::UChar:
QMetaType::UChar:
never executed: case QMetaType::UChar:
0
223 *reinterpret_cast<unsigned char*>(ptr) = QV4::Primitive::toUInt32(d);-
224 return
never executed: return true;
true;
never executed: return true;
0
225 case
never executed: case QMetaType::QChar:
QMetaType::QChar:
never executed: case QMetaType::QChar:
0
226 *reinterpret_cast<QChar*>(ptr) = QV4::Primitive::toUInt32(d);-
227 return
never executed: return true;
true;
never executed: return true;
0
228 default
executed 2 times by 1 test: default:
Executed by:
  • tst_qjsvalue
:
executed 2 times by 1 test: default:
Executed by:
  • tst_qjsvalue
2
229 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_qjsvalue
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qjsvalue
2
230 }-
231 } else {-
232 return
never executed: return QMetaType::convert(&variant->data_ptr(), variant->userType(), ptr, type);
QMetaType::convert(&variant->data_ptr(), variant->userType(), ptr, type);
never executed: return QMetaType::convert(&variant->data_ptr(), variant->userType(), ptr, type);
0
233 }-
234 }-
235-
236 ((val) ? static_cast<void>(0) : qt_assert("val", __FILE__, 681));-
237-
238 switch (type) {-
239 case
executed 28 times by 1 test: case QMetaType::Bool:
Executed by:
  • tst_qjsvalue
QMetaType::Bool:
executed 28 times by 1 test: case QMetaType::Bool:
Executed by:
  • tst_qjsvalue
28
240 *reinterpret_cast<bool*>(ptr) = val->toBoolean();-
241 return
executed 28 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 28 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
28
242 case
executed 18 times by 1 test: case QMetaType::Int:
Executed by:
  • tst_qjsvalue
QMetaType::Int:
executed 18 times by 1 test: case QMetaType::Int:
Executed by:
  • tst_qjsvalue
18
243 *reinterpret_cast<int*>(ptr) = val->toInt32();-
244 return
executed 18 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 18 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
18
245 case
executed 14 times by 1 test: case QMetaType::UInt:
Executed by:
  • tst_qjsvalue
QMetaType::UInt:
executed 14 times by 1 test: case QMetaType::UInt:
Executed by:
  • tst_qjsvalue
14
246 *reinterpret_cast<uint*>(ptr) = val->toUInt32();-
247 return
executed 14 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 14 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
14
248 case
executed 2 times by 1 test: case QMetaType::LongLong:
Executed by:
  • tst_qjsengine
QMetaType::LongLong:
executed 2 times by 1 test: case QMetaType::LongLong:
Executed by:
  • tst_qjsengine
2
249 *reinterpret_cast<qlonglong*>(ptr) = val->toInteger();-
250 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
251 case
executed 2 times by 1 test: case QMetaType::ULongLong:
Executed by:
  • tst_qjsengine
QMetaType::ULongLong:
executed 2 times by 1 test: case QMetaType::ULongLong:
Executed by:
  • tst_qjsengine
2
252 *reinterpret_cast<qulonglong*>(ptr) = val->toInteger();-
253 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
254 case
executed 10 times by 2 tests: case QMetaType::Double:
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
QMetaType::Double:
executed 10 times by 2 tests: case QMetaType::Double:
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
10
255 *reinterpret_cast<double*>(ptr) = val->toNumber();-
256 return
executed 10 times by 2 tests: return true;
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
true;
executed 10 times by 2 tests: return true;
Executed by:
  • tst_qjsengine
  • tst_qjsvalue
10
257 case
executed 6 times by 1 test: case QMetaType::QString:
Executed by:
  • tst_qjsvalue
QMetaType::QString:
executed 6 times by 1 test: case QMetaType::QString:
Executed by:
  • tst_qjsvalue
6
258 *reinterpret_cast<QString*>(ptr) = val->toQStringNoThrow();-
259 return
executed 6 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_qjsvalue
6
260 case
executed 2 times by 1 test: case QMetaType::Float:
Executed by:
  • tst_qjsengine
QMetaType::Float:
executed 2 times by 1 test: case QMetaType::Float:
Executed by:
  • tst_qjsengine
2
261 *reinterpret_cast<float*>(ptr) = val->toNumber();-
262 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
263 case
executed 2 times by 1 test: case QMetaType::Short:
Executed by:
  • tst_qjsengine
QMetaType::Short:
executed 2 times by 1 test: case QMetaType::Short:
Executed by:
  • tst_qjsengine
2
264 *reinterpret_cast<short*>(ptr) = val->toInt32();-
265 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
266 case
executed 2 times by 1 test: case QMetaType::UShort:
Executed by:
  • tst_qjsengine
QMetaType::UShort:
executed 2 times by 1 test: case QMetaType::UShort:
Executed by:
  • tst_qjsengine
2
267 *reinterpret_cast<unsigned short*>(ptr) = val->toUInt16();-
268 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
269 case
executed 2 times by 1 test: case QMetaType::Char:
Executed by:
  • tst_qjsengine
QMetaType::Char:
executed 2 times by 1 test: case QMetaType::Char:
Executed by:
  • tst_qjsengine
2
270 *reinterpret_cast<char*>(ptr) = val->toInt32();-
271 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
272 case
executed 2 times by 1 test: case QMetaType::UChar:
Executed by:
  • tst_qjsengine
QMetaType::UChar:
executed 2 times by 1 test: case QMetaType::UChar:
Executed by:
  • tst_qjsengine
2
273 *reinterpret_cast<unsigned char*>(ptr) = val->toUInt16();-
274 return
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
true;
executed 2 times by 1 test: return true;
Executed by:
  • tst_qjsengine
2
275 case
never executed: case QMetaType::QChar:
QMetaType::QChar:
never executed: case QMetaType::QChar:
0
276 *reinterpret_cast<QChar*>(ptr) = val->toUInt16();-
277 return
never executed: return true;
true;
never executed: return true;
0
278 default
executed 18 times by 1 test: default:
Executed by:
  • tst_qjsvalue
:
executed 18 times by 1 test: default:
Executed by:
  • tst_qjsvalue
18
279 return
executed 18 times by 1 test: return false;
Executed by:
  • tst_qjsvalue
false;
executed 18 times by 1 test: return false;
Executed by:
  • tst_qjsvalue
18
280 }-
281}-
282void QJSEngine::throwError(const QString &message)-
283{-
284 m_v4Engine->throwError(message);-
285}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qjsengine
2
286-
287QJSEnginePrivate *QJSEnginePrivate::get(QV4::ExecutionEngine *e)-
288{-
289 return
executed 369004 times by 44 tests: return e->jsEngine()->d_func();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • ...
e->jsEngine()->d_func();
executed 369004 times by 44 tests: return e->jsEngine()->d_func();
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdynamicpropertyanimation
  • tst_qquickflickable
  • tst_qquickgridview
  • ...
369004
290}-
291-
292QJSEnginePrivate::~QJSEnginePrivate()-
293{-
294 QQmlMetaType::freeUnusedTypesAndCaches();-
295}
executed 10324 times by 151 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • ...
10324
296-
297void QJSEnginePrivate::addToDebugServer(QJSEngine *q)-
298{-
299 if (QCoreApplication::instance()->thread() != q->thread()
QCoreApplicati...!= q->thread()Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qjsengine
  • tst_qqmlmoduleplugin
FALSEevaluated 10328 times by 151 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • ...
)
10-10328
300 return;
executed 10 times by 2 tests: return;
Executed by:
  • tst_qjsengine
  • tst_qqmlmoduleplugin
10
301-
302 QQmlDebugConnector *server = QQmlDebugConnector::instance();-
303 if (!server
!serverDescription
TRUEevaluated 10286 times by 145 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • ...
FALSEevaluated 42 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
|| server->hasEngine(q)
server->hasEngine(q)Description
TRUEnever evaluated
FALSEevaluated 42 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
)
0-10286
304 return;
executed 10286 times by 145 tests: return;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • ...
10286
305-
306 server->open();-
307 server->addEngine(q);-
308}
executed 42 times by 7 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
42
309-
310void QJSEnginePrivate::removeFromDebugServer(QJSEngine *q)-
311{-
312 QQmlDebugConnector *server = QQmlDebugConnector::instance();-
313 if (server
serverDescription
TRUEevaluated 94 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
FALSEevaluated 18038 times by 145 tests
Evaluated by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • ...
&& server->hasEngine(q)
server->hasEngine(q)Description
TRUEevaluated 42 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
FALSEevaluated 52 times by 7 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
)
42-18038
314 server->removeEngine(q);
executed 42 times by 7 tests: server->removeEngine(q);
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
  • tst_qqmlnativeconnector
  • tst_qqmlprofilerservice
42
315}
executed 18132 times by 151 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qjsonbinding
  • tst_qjsvalue
  • tst_qjsvalueiterator
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • ...
18132
316QJSEngine *qjsEngine(const QObject *object)-
317{-
318 QQmlData *data = QQmlData::get(object, false);-
319 if (!data
!dataDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 16 times by 3 tests
Evaluated by:
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qquicktext
|| data->jsWrapper.isNullOrUndefined()
data->jsWrappe...lOrUndefined()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qjsengine
FALSEevaluated 14 times by 3 tests
Evaluated by:
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qquicktext
)
2-16
320 return
executed 4 times by 1 test: return nullptr;
Executed by:
  • tst_qjsengine
nullptr;
executed 4 times by 1 test: return nullptr;
Executed by:
  • tst_qjsengine
4
321 return
executed 14 times by 3 tests: return data->jsWrapper.engine()->jsEngine();
Executed by:
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qquicktext
data->jsWrapper.engine()->jsEngine();
executed 14 times by 3 tests: return data->jsWrapper.engine()->jsEngine();
Executed by:
  • tst_qjsengine
  • tst_qqmlcomponent
  • tst_qquicktext
14
322}-
323-
324-
325-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0