OpenCoverage

qv4compileddata.cpp #1

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/compiler/qv4compileddata.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8namespace QV4 {-
9-
10namespace CompiledData {-
11-
12static_assert(sizeof(Unit::libraryVersionHash) >= 40 + 1, "Compile hash length exceeds reserved size in data structure. Please adjust and bump the format version");-
13-
14CompilationUnit::CompilationUnit(const Unit *unitData)-
15{-
16 data = unitData;-
17}
executed 2391957 times by 146 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • 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_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
2391957
18bool CompilationUnit::saveToDisk(const QString &outputFileName, QString *errorString)-
19-
20-
21-
22{-
23 errorString->clear();-
24 QSaveFile cacheFile(outputFileName);-
25 if (!cacheFile.open(QIODevice::WriteOnly | QIODevice::Truncate)
!cacheFile.ope...ice::Truncate)Description
TRUEnever evaluated
FALSEevaluated 2726 times by 125 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • ...
) {
0-2726
26 *errorString = cacheFile.errorString();-
27 return
never executed: return false;
false;
never executed: return false;
0
28 }-
29-
30 QByteArray modifiedUnit;-
31 modifiedUnit.resize(data->unitSize);-
32 memcpy(modifiedUnit.data(), data, data->unitSize);-
33 const char *dataPtr = modifiedUnit.data();-
34 Unit *unitPtr;-
35 memcpy(&unitPtr, &dataPtr, sizeof(unitPtr));-
36 unitPtr->flags |= Unit::StaticData;-
37-
38 qint64 headerWritten = cacheFile.write(modifiedUnit);-
39 if (headerWritten != modifiedUnit.size()
headerWritten ...iedUnit.size()Description
TRUEnever evaluated
FALSEevaluated 2726 times by 125 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • ...
) {
0-2726
40 *errorString = cacheFile.errorString();-
41 return
never executed: return false;
false;
never executed: return false;
0
42 }-
43-
44 if (!cacheFile.commit()
!cacheFile.commit()Description
TRUEnever evaluated
FALSEevaluated 2726 times by 125 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • ...
) {
0-2726
45 *errorString = cacheFile.errorString();-
46 return
never executed: return false;
false;
never executed: return false;
0
47 }-
48-
49 return
executed 2726 times by 125 tests: return true;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • ...
true;
executed 2726 times by 125 tests: return true;
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • ...
2726
50-
51-
52-
53-
54-
55}-
56-
57Unit *CompilationUnit::createUnitData(QmlIR::Document *irDocument)-
58{-
59 if (!irDocument->javaScriptCompilationUnit->data
!irDocument->j...tionUnit->dataDescription
TRUEevaluated 48529 times by 141 tests
Evaluated 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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qmlcachegen
)
24-48529
60 return
executed 48529 times by 141 tests: return irDocument->jsGenerator.generateUnit(QV4::Compiler::JSUnitGenerator::GenerateWithoutStringTable);
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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
irDocument->jsGenerator.generateUnit(QV4::Compiler::JSUnitGenerator::GenerateWithoutStringTable);
executed 48529 times by 141 tests: return irDocument->jsGenerator.generateUnit(QV4::Compiler::JSUnitGenerator::GenerateWithoutStringTable);
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_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
48529
61-
62 QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit = irDocument->javaScriptCompilationUnit;-
63 QV4::CompiledData::Unit *jsUnit = const_cast<QV4::CompiledData::Unit*>(compilationUnit->data);-
64 auto ensureWritableUnit = [&jsUnit, &compilationUnit]() {-
65 if (jsUnit == compilationUnit->data
jsUnit == comp...tionUnit->dataDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qmlcachegen
) {
4-24
66 char *unitCopy = (char*)malloc(jsUnit->unitSize);-
67 memcpy(unitCopy, jsUnit, jsUnit->unitSize);-
68 jsUnit = reinterpret_cast<QV4::CompiledData::Unit*>(unitCopy);-
69 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
24
70 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
;
28
71-
72 QV4::Compiler::StringTableGenerator &stringTable = irDocument->jsGenerator.stringTable;-
73-
74 if (jsUnit->sourceFileIndex == quint32(0)
jsUnit->source... == quint32(0)Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEnever evaluated
|| jsUnit->stringAt(jsUnit->sourceFileIndex) != irDocument->jsModule.fileName
jsUnit->string...odule.fileNameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-24
75 ensureWritableUnit();-
76 jsUnit->sourceFileIndex = stringTable.registerString(irDocument->jsModule.fileName);-
77 jsUnit->finalUrlIndex = stringTable.registerString(irDocument->jsModule.finalUrl);-
78 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
24
79-
80-
81-
82-
83 QVector<quint32> changedSignals;-
84 QVector<QQmlJS::AST::FormalParameterList*> changedSignalParameters;-
85 for (QmlIR::Object *o: qAsConst(irDocument->objects)) {-
86 for (QmlIR::Binding *binding = o->firstBinding(); binding
bindingDescription
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qmlcachegen
; binding = binding->next) {
38-62
87 if (!(binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression)
!(binding->fla...lerExpression)Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qmlcachegen
)
10-52
88 continue;
executed 52 times by 1 test: continue;
Executed by:
  • tst_qmlcachegen
52
89-
90 quint32 functionIndex = binding->value.compiledScriptIndex;-
91 QmlIR::CompiledFunctionOrExpression *foe = o->functionsAndExpressions->slowAt(functionIndex);-
92 if (!foe
!foeDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qmlcachegen
)
0-10
93 continue;
never executed: continue;
0
94-
95-
96 changedSignals << o->runtimeFunctionIndices.at(functionIndex);-
97-
98 ((foe->node) ? static_cast<void>(0) : qt_assert("foe->node", __FILE__, 499));-
99 ((QQmlJS::AST::cast<QQmlJS::AST::FunctionDeclaration*>(foe->node)) ? static_cast<void>(0) : qt_assert("QQmlJS::AST::cast<QQmlJS::AST::FunctionDeclaration*>(foe->node)", __FILE__, 500));-
100-
101 QQmlJS::AST::FormalParameterList *parameters = QQmlJS::AST::cast<QQmlJS::AST::FunctionDeclaration*>(foe->node)->formals;-
102 changedSignalParameters << parameters;-
103-
104 if (parameters
parametersDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmlcachegen
) {
4-6
105 const QStringList formals = parameters->formals();-
106 for (const QString &arg : formals)-
107 stringTable.registerString(arg);
executed 4 times by 1 test: stringTable.registerString(arg);
Executed by:
  • tst_qmlcachegen
4
108 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
4
109 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
10
110 }
executed 38 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
38
111-
112 QVector<quint32> signalParameterNameTable;-
113 quint32 signalParameterNameTableOffset = jsUnit->unitSize;-
114-
115-
116 if (!changedSignals.isEmpty()
!changedSignals.isEmpty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qmlcachegen
) {
8-16
117 if (jsUnit == compilationUnit->data
jsUnit == comp...tionUnit->dataDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qmlcachegen
) {
0-8
118 char *unitCopy = (char*)malloc(jsUnit->unitSize);-
119 memcpy(unitCopy, jsUnit, jsUnit->unitSize);-
120 jsUnit = reinterpret_cast<QV4::CompiledData::Unit*>(unitCopy);-
121 }
never executed: end of block
0
122-
123 for (int i = 0; i < changedSignals.count()
i < changedSignals.count()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qmlcachegen
; ++i) {
8-10
124 const uint functionIndex = changedSignals.at(i);-
125-
126 QV4::CompiledData::Function *function = const_cast<QV4::CompiledData::Function *>(jsUnit->functionAt(functionIndex));-
127 ((function->nFormals == quint32(0)) ? static_cast<void>(0) : qt_assert("function->nFormals == quint32(0)", __FILE__, 528));-
128-
129 function->formalsOffset = signalParameterNameTableOffset - jsUnit->functionOffsetTable()[functionIndex];-
130-
131 if (QQmlJS::AST::FormalParameterList *parameters = changedSignalParameters.at(i)
QQmlJS::AST::F...rameters.at(i)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmlcachegen
) {
4-6
132 const QStringList formals = parameters->formals();-
133 for (const QString &arg : formals)-
134 signalParameterNameTable.append(stringTable.getStringId(arg));
executed 4 times by 1 test: signalParameterNameTable.append(stringTable.getStringId(arg));
Executed by:
  • tst_qmlcachegen
4
135-
136 function->nFormals = formals.size();-
137 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
4
138 function->length = function->nFormals;-
139-
140 signalParameterNameTableOffset += function->nFormals * sizeof(quint32);-
141 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
10
142 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
8
143-
144 if (!signalParameterNameTable.isEmpty()
!signalParamet...able.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qmlcachegen
) {
4-20
145 ensureWritableUnit();-
146 ((jsUnit != compilationUnit->data) ? static_cast<void>(0) : qt_assert("jsUnit != compilationUnit->data", __FILE__, 547));-
147 const uint signalParameterTableSize = signalParameterNameTable.count() * sizeof(quint32);-
148 uint newSize = jsUnit->unitSize + signalParameterTableSize;-
149 const uint oldSize = jsUnit->unitSize;-
150 char *unitWithSignalParameters = (char*)realloc(jsUnit, newSize);-
151 memcpy(unitWithSignalParameters + oldSize, signalParameterNameTable.constData(), signalParameterTableSize);-
152 jsUnit = reinterpret_cast<QV4::CompiledData::Unit*>(unitWithSignalParameters);-
153 jsUnit->unitSize = newSize;-
154 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
4
155-
156 if (jsUnit != compilationUnit->data
jsUnit != comp...tionUnit->dataDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qmlcachegen
FALSEnever evaluated
)
0-24
157 jsUnit->flags &= ~QV4::CompiledData::Unit::StaticData;
executed 24 times by 1 test: jsUnit->flags &= ~QV4::CompiledData::Unit::StaticData;
Executed by:
  • tst_qmlcachegen
24
158-
159 return
executed 24 times by 1 test: return jsUnit;
Executed by:
  • tst_qmlcachegen
jsUnit;
executed 24 times by 1 test: return jsUnit;
Executed by:
  • tst_qmlcachegen
24
160}-
161-
162QString Binding::valueAsString(const Unit *unit) const-
163{-
164 switch (type) {-
165 case
executed 4414 times by 19 tests: case Type_Script:
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlexpression
  • tst_qqmllistmodel
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • tst_qqmlstatemachine
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
Type_Script:
executed 4414 times by 19 tests: case Type_Script:
Executed by:
  • tst_examples
  • tst_qqmlbinding
  • tst_qqmlecmascript
  • tst_qqmlexpression
  • tst_qqmllistmodel
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • tst_qqmlstatemachine
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
4414
166 case
executed 272438 times by 118 tests: case Type_String:
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlfileselector
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • ...
Type_String:
executed 272438 times by 118 tests: case Type_String:
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlfileselector
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • ...
272438
167 return
executed 276852 times by 120 tests: return unit->stringAt(stringIndex);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • ...
unit->stringAt(stringIndex);
executed 276852 times by 120 tests: return unit->stringAt(stringIndex);
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmetaobject
  • tst_qqmlmetatype
  • tst_qqmlnotifier
  • ...
276852
168 case
never executed: case Type_Boolean:
Type_Boolean:
never executed: case Type_Boolean:
0
169 return
never executed: return value.b ? ([]() noexcept -> QString { enum { Size = sizeof(u"" "true")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "true" }; QStringDataPtr holder = { qstring_literal.data_p...static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "false" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());
value.b ? ([]() noexcept -> QString { enum { Size = sizeof(u"" "true")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "true" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}()) : ([]() noexcept -> QString { enum { Size = sizeof(u"" "false")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "false" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
never executed: return value.b ? ([]() noexcept -> QString { enum { Size = sizeof(u"" "true")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "true" }; QStringDataPtr holder = { qstring_literal.data_p...static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "false" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());
0
170 case
executed 184 times by 4 tests: case Type_Number:
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
Type_Number:
executed 184 times by 4 tests: case Type_Number:
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
184
171 return
executed 184 times by 4 tests: return QString::number(valueAsNumber());
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
QString::number(valueAsNumber());
executed 184 times by 4 tests: return QString::number(valueAsNumber());
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
184
172 case
never executed: case Type_Invalid:
Type_Invalid:
never executed: case Type_Invalid:
0
173 return
never executed: return QString();
QString();
never executed: return QString();
0
174-
175-
176-
177-
178-
179 case
executed 8 times by 3 tests: case Type_TranslationById:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltranslation
Type_TranslationById:
executed 8 times by 3 tests: case Type_TranslationById:
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltranslation
{
8
180 QByteArray id = unit->stringAt(stringIndex).toUtf8();-
181 return
executed 8 times by 3 tests: return qtTrId(id.constData(), value.translationData.number);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltranslation
qtTrId(id.constData(), value.translationData.number);
executed 8 times by 3 tests: return qtTrId(id.constData(), value.translationData.number);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
  • tst_qqmltranslation
8
182 }-
183 case
executed 42 times by 7 tests: case Type_Translation:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
Type_Translation:
executed 42 times by 7 tests: case Type_Translation:
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
{
42
184-
185 const QString &path = unit->stringAt(unit->sourceFileIndex);-
186 int lastSlash = path.lastIndexOf(QLatin1Char('/'));-
187 QStringRef context = (
(lastSlash > -1)Description
TRUEevaluated 40 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
lastSlash > -1)
(lastSlash > -1)Description
TRUEevaluated 40 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
? path.midRef(lastSlash + 1, path.length() - lastSlash - 5)
2-40
188 : QStringRef();-
189 QByteArray contextUtf8 = context.toUtf8();-
190 QByteArray comment = unit->stringAt(value.translationData.commentIndex).toUtf8();-
191 QByteArray text = unit->stringAt(stringIndex).toUtf8();-
192 return
executed 42 times by 7 tests: return QCoreApplication::translate(contextUtf8.constData(), text.constData(), comment.constData(), value.translationData.number);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
QCoreApplication::translate(contextUtf8.constData(), text.constData(),
executed 42 times by 7 tests: return QCoreApplication::translate(contextUtf8.constData(), text.constData(), comment.constData(), value.translationData.number);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
42
193 comment.constData(), value.translationData.number);
executed 42 times by 7 tests: return QCoreApplication::translate(contextUtf8.constData(), text.constData(), comment.constData(), value.translationData.number);
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmllistmodel
  • tst_qqmlprofilerservice
  • tst_qqmltranslation
  • tst_qquicklayouts
  • tst_qquickstates
42
194 }-
195-
196 default
never executed: default:
:
never executed: default:
0
197 break;
never executed: break;
0
198 }-
199 return
never executed: return QString();
QString();
never executed: return QString();
0
200}-
201-
202-
203QString Binding::escapedString(const QString &string)-
204{-
205 QString tmp = QLatin1String("\"");-
206 for (int i = 0; i < string.length()
i < string.length()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
207 const QChar &c = string.at(i);-
208 switch (c.unicode()) {-
209 case
never executed: case 0x08:
0x08:
never executed: case 0x08:
0
210 tmp += QLatin1String("\\b");-
211 break;
never executed: break;
0
212 case
never executed: case 0x09:
0x09:
never executed: case 0x09:
0
213 tmp += QLatin1String("\\t");-
214 break;
never executed: break;
0
215 case
never executed: case 0x0A:
0x0A:
never executed: case 0x0A:
0
216 tmp += QLatin1String("\\n");-
217 break;
never executed: break;
0
218 case
never executed: case 0x0B:
0x0B:
never executed: case 0x0B:
0
219 tmp += QLatin1String("\\v");-
220 break;
never executed: break;
0
221 case
never executed: case 0x0C:
0x0C:
never executed: case 0x0C:
0
222 tmp += QLatin1String("\\f");-
223 break;
never executed: break;
0
224 case
never executed: case 0x0D:
0x0D:
never executed: case 0x0D:
0
225 tmp += QLatin1String("\\r");-
226 break;
never executed: break;
0
227 case
never executed: case 0x22:
0x22:
never executed: case 0x22:
0
228 tmp += QLatin1String("\\\"");-
229 break;
never executed: break;
0
230 case
never executed: case 0x27:
0x27:
never executed: case 0x27:
0
231 tmp += QLatin1String("\\\'");-
232 break;
never executed: break;
0
233 case
never executed: case 0x5C:
0x5C:
never executed: case 0x5C:
0
234 tmp += QLatin1String("\\\\");-
235 break;
never executed: break;
0
236 default
never executed: default:
:
never executed: default:
0
237 tmp += c;-
238 break;
never executed: break;
0
239 }-
240 }-
241 tmp += QLatin1Char('\"');-
242 return
never executed: return tmp;
tmp;
never executed: return tmp;
0
243}-
244-
245QString Binding::valueAsScriptString(const Unit *unit) const-
246{-
247 if (type == Type_String
type == Type_StringDescription
TRUEnever evaluated
FALSEevaluated 4532 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmllistmodel
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
)
0-4532
248 return
never executed: return escapedString(unit->stringAt(stringIndex));
escapedString(unit->stringAt(stringIndex));
never executed: return escapedString(unit->stringAt(stringIndex));
0
249 else-
250 return
executed 4532 times by 14 tests: return valueAsString(unit);
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmllistmodel
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
valueAsString(unit);
executed 4532 times by 14 tests: return valueAsString(unit);
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmllistmodel
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
4532
251}-
252void CompilationUnit::destroy()-
253{-
254-
255-
256-
257-
258-
259 delete this;-
260}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
10
261-
262-
263void Unit::generateChecksum()-
264{-
265 memset(md5Checksum, 0, sizeof(md5Checksum));-
266-
267}
executed 2383537 times by 146 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_ecmascripttests
  • 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_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • ...
2383537
268-
269bool Unit::verifyHeader(QDateTime expectedSourceTimeStamp, QString *errorString) const-
270{-
271 (void)expectedSourceTimeStamp;-
272 (void)errorString;-
273 return
never executed: return false;
false;
never executed: return false;
0
274-
275}-
276-
277}-
278-
279}-
280-
281-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0