OpenCoverage

qqmlcustomparser.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlcustomparser.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5void QQmlCustomParser::clearErrors()-
6{-
7 exceptions.clear();-
8}
executed 926 times by 30 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlconnections
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmllistmodel
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • tst_qqmltranslation
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickbehaviors
  • tst_qquickdesignersupport
  • tst_qquickflipable
  • tst_qquickfontloader
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • ...
926
9-
10-
11-
12-
13-
14-
15void QQmlCustomParser::error(const QV4::CompiledData::Location &location, const QString &description)-
16{-
17 exceptions << QQmlCompileError(location, description);-
18}
executed 28 times by 3 tests: end of block
Executed by:
  • tst_qqmlconnections
  • tst_qqmllistmodel
  • tst_qquickstates
28
19-
20struct StaticQtMetaObject : public QObject-
21{-
22 static const QMetaObject *get()-
23 { return
executed 4 times by 1 test: return &staticQtMetaObject;
Executed by:
  • tst_qqmllistmodel
&staticQtMetaObject;
executed 4 times by 1 test: return &staticQtMetaObject;
Executed by:
  • tst_qqmllistmodel
}
4
24};-
25int QQmlCustomParser::evaluateEnum(const QByteArray& script, bool *ok) const-
26{-
27 ((ok) ? static_cast<void>(0) : qt_assert_x("QQmlCustomParser::evaluateEnum", "ok must not be a null pointer", __FILE__, 122));-
28 *ok = false;-
29-
30-
31-
32-
33-
34 int dot = script.indexOf('.');-
35 if (dot == -1
dot == -1Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 182 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
|| dot == script.length()-1
dot == script.length()-1Description
TRUEnever evaluated
FALSEevaluated 182 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
)
0-182
36 return
executed 6 times by 1 test: return -1;
Executed by:
  • tst_qqmllistmodel
-1;
executed 6 times by 1 test: return -1;
Executed by:
  • tst_qqmllistmodel
6
37-
38 QString scope = QString::fromUtf8(script.left(dot));-
39-
40 if (scope != QLatin1String("Qt")
scope != QLatin1String("Qt")Description
TRUEevaluated 178 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
) {
4-178
41 if (imports.isNull()
imports.isNull()Description
TRUEnever evaluated
FALSEevaluated 178 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
)
0-178
42 return
never executed: return -1;
-1;
never executed: return -1;
0
43 QQmlType type;-
44-
45 if (imports.isT1()
imports.isT1()Description
TRUEevaluated 90 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEevaluated 88 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
) {
88-90
46 imports.asT1()->resolveType(scope, &type, nullptr, nullptr, nullptr);-
47 }
executed 90 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
else {
90
48 QQmlTypeNameCache::Result result = imports.asT2()->query(scope);-
49 if (result.isValid()
result.isValid()Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
FALSEnever evaluated
)
0-88
50 type = result.type;
executed 88 times by 2 tests: type = result.type;
Executed by:
  • tst_examples
  • tst_qqmllistmodel
88
51 }
executed 88 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmllistmodel
88
52-
53 if (!type.isValid()
!type.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
)
2-176
54 return
executed 2 times by 1 test: return -1;
Executed by:
  • tst_qqmllistmodel
-1;
executed 2 times by 1 test: return -1;
Executed by:
  • tst_qqmllistmodel
2
55-
56 int dot2 = script.indexOf('.', dot+1);-
57 const bool dot2Valid = dot2 != -1
dot2 != -1Description
TRUEnever evaluated
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
&& dot2 != script.length()-1
dot2 != script.length()-1Description
TRUEnever evaluated
FALSEnever evaluated
;
0-176
58 QByteArray enumValue = script.mid(dot2Valid ? dot2 + 1 : dot + 1);-
59 QByteArray scopedEnumName = (dot2Valid
dot2ValidDescription
TRUEnever evaluated
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
? script.mid(dot + 1, dot2 - dot - 1) : QByteArray());
0-176
60 if (!scopedEnumName.isEmpty()
!scopedEnumName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 176 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmllistmodel
)
0-176
61 return
never executed: return type.scopedEnumValue(engine, scopedEnumName, enumValue, ok);
type.scopedEnumValue(engine, scopedEnumName, enumValue, ok);
never executed: return type.scopedEnumValue(engine, scopedEnumName, enumValue, ok);
0
62 else-
63 return
executed 176 times by 2 tests: return type.enumValue(engine, QHashedCStringRef(enumValue.constData(), enumValue.length()), ok);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
type.enumValue(engine, QHashedCStringRef(enumValue.constData(), enumValue.length()), ok);
executed 176 times by 2 tests: return type.enumValue(engine, QHashedCStringRef(enumValue.constData(), enumValue.length()), ok);
Executed by:
  • tst_examples
  • tst_qqmllistmodel
176
64 }-
65-
66 QByteArray enumValue = script.mid(dot + 1);-
67 const QMetaObject *mo = StaticQtMetaObject::get();-
68 int i = mo->enumeratorCount();-
69 while (i--
i--Description
TRUEevaluated 296 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEnever evaluated
) {
0-296
70 int v = mo->enumerator(i).keyToValue(enumValue.constData(), ok);-
71 if (*
*okDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 292 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
ok
*okDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
FALSEevaluated 292 times by 1 test
Evaluated by:
  • tst_qqmllistmodel
)
4-292
72 return
executed 4 times by 1 test: return v;
Executed by:
  • tst_qqmllistmodel
v;
executed 4 times by 1 test: return v;
Executed by:
  • tst_qqmllistmodel
4
73 }
executed 292 times by 1 test: end of block
Executed by:
  • tst_qqmllistmodel
292
74 return
never executed: return -1;
-1;
never executed: return -1;
0
75}-
76-
77-
78-
79-
80-
81const QMetaObject *QQmlCustomParser::resolveType(const QString& name) const-
82{-
83 if (!imports.isT1()
!imports.isT1()Description
TRUEnever evaluated
FALSEevaluated 388 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
0-388
84 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
85 QQmlType qmltype;-
86 if (!imports.asT1()->resolveType(name, &qmltype, nullptr, nullptr, nullptr)
!imports.asT1(...lptr, nullptr)Description
TRUEnever evaluated
FALSEevaluated 388 times by 14 tests
Evaluated by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
)
0-388
87 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
88 return
executed 388 times by 14 tests: return qmltype.metaObject();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
qmltype.metaObject();
executed 388 times by 14 tests: return qmltype.metaObject();
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmllistmodel
  • tst_qqmltranslation
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_qtqmlmodules
388
89}-
90-
91-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0