OpenCoverage

qqmlscriptstring.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlscriptstring.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3const QQmlScriptStringPrivate* QQmlScriptStringPrivate::get(const QQmlScriptString &script)-
4{-
5 return
never executed: return script.d.constData();
script.d.constData();
never executed: return script.d.constData();
0
6}-
7-
8-
9-
10-
11QQmlScriptString::QQmlScriptString()-
12: d(new QQmlScriptStringPrivate)-
13{-
14}
executed 9218 times by 14 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlecmascript
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
9218
15-
16-
17-
18-
19QQmlScriptString::QQmlScriptString(const QString &script, QQmlContext *context, QObject *scope)-
20: d(new QQmlScriptStringPrivate)-
21{-
22 d->script = script;-
23 d->context = context;-
24 d->scope = scope;-
25}
executed 4340 times by 13 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
4340
26-
27-
28-
29-
30QQmlScriptString::QQmlScriptString(const QQmlScriptString &other)-
31: d(other.d)-
32{-
33}
executed 18266 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
18266
34-
35-
36-
37-
38QQmlScriptString::~QQmlScriptString()-
39{-
40}-
41-
42-
43-
44-
45QQmlScriptString &QQmlScriptString::operator=(const QQmlScriptString &other)-
46{-
47 d = other.d;-
48 return
executed 4340 times by 13 tests: return *this;
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
*this;
executed 4340 times by 13 tests: return *this;
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
4340
49}-
50-
51-
52-
53-
54-
55-
56bool QQmlScriptString::operator==(const QQmlScriptString &other) const-
57{-
58 if (d == other.d
d == other.dDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
)
0-8
59 return
never executed: return true;
true;
never executed: return true;
0
60-
61 if (d->isNumberLiteral
d->isNumberLiteralDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
|| other.d->isNumberLiteral
other.d->isNumberLiteralDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
)
0-8
62 return
never executed: return d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue;
d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue;
never executed: return d->isNumberLiteral && other.d->isNumberLiteral && d->numberValue == other.d->numberValue;
0
63-
64 if (d->isStringLiteral
d->isStringLiteralDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
|| other.d->isStringLiteral
other.d->isStringLiteralDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
)
0-8
65 return
never executed: return d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script;
d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script;
never executed: return d->isStringLiteral && other.d->isStringLiteral && d->script == other.d->script;
0
66-
67 if (d->script == QLatin1String("true")
d->script == Q...String("true")Description
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
||
0-8
68 d->script == QLatin1String("false")
d->script == Q...tring("false")Description
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
||
0-8
69 d->script == QLatin1String("undefined")
d->script == Q...g("undefined")Description
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
||
0-8
70 d->script == QLatin1String("null")
d->script == Q...String("null")Description
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qqmlstatemachine
)
0-8
71 return
never executed: return d->script == other.d->script;
d->script == other.d->script;
never executed: return d->script == other.d->script;
0
72-
73 return
executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;
Executed by:
  • tst_examples
  • tst_qqmlstatemachine
d->context == other.d->context &&
executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;
Executed by:
  • tst_examples
  • tst_qqmlstatemachine
8
74 d->scope == other.d->scope &&
executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;
Executed by:
  • tst_examples
  • tst_qqmlstatemachine
8
75 d->script == other.d->script &&
executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;
Executed by:
  • tst_examples
  • tst_qqmlstatemachine
8
76 d->bindingId == other.d->bindingId;
executed 8 times by 2 tests: return d->context == other.d->context && d->scope == other.d->scope && d->script == other.d->script && d->bindingId == other.d->bindingId;
Executed by:
  • tst_examples
  • tst_qqmlstatemachine
8
77}-
78-
79-
80-
81-
82-
83-
84bool QQmlScriptString::operator!=(const QQmlScriptString &other) const-
85{-
86 return
never executed: return !operator==(other);
!operator==(other);
never executed: return !operator==(other);
0
87}-
88-
89-
90-
91-
92bool QQmlScriptString::isEmpty() const-
93{-
94 if (!d->script.isEmpty()
!d->script.isEmpty()Description
TRUEevaluated 18086 times by 11 tests
Evaluated by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
FALSEnever evaluated
)
0-18086
95 return
executed 18086 times by 11 tests: return false;
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
false;
executed 18086 times by 11 tests: return false;
Executed by:
  • tst_examples
  • tst_qqmlexpression
  • tst_qqmlstatemachine
  • tst_qqmlxmlhttprequest
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpositioners
  • tst_qquickstates
  • tst_scenegraph
18086
96 return
never executed: return d->bindingId == -1;
d->bindingId == -1;
never executed: return d->bindingId == -1;
0
97}-
98-
99-
100-
101-
102bool QQmlScriptString::isUndefinedLiteral() const-
103{-
104 return
executed 96 times by 5 tests: return d->script == QLatin1String("undefined");
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
d->script == QLatin1String("undefined");
executed 96 times by 5 tests: return d->script == QLatin1String("undefined");
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickstates
96
105}-
106-
107-
108-
109-
110bool QQmlScriptString::isNullLiteral() const-
111{-
112 return
never executed: return d->script == QLatin1String("null");
d->script == QLatin1String("null");
never executed: return d->script == QLatin1String("null");
0
113}-
114-
115-
116-
117-
118-
119QString QQmlScriptString::stringLiteral() const-
120{-
121 if (d->isStringLiteral
d->isStringLiteralDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
122 return
never executed: return d->script.mid(1, d->script.length()-2);
d->script.mid(1, d->script.length()-2);
never executed: return d->script.mid(1, d->script.length()-2);
0
123 return
never executed: return QString();
QString();
never executed: return QString();
0
124}-
125-
126-
127-
128-
129-
130qreal QQmlScriptString::numberLiteral(bool *ok) const-
131{-
132 if (ok
okDescription
TRUEevaluated 186 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
FALSEnever evaluated
)
0-186
133 *
executed 186 times by 4 tests: *ok = d->isNumberLiteral;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
ok = d->isNumberLiteral;
executed 186 times by 4 tests: *ok = d->isNumberLiteral;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
186
134 return
executed 186 times by 4 tests: return d->isNumberLiteral ? d->numberValue : 0.;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
d->isNumberLiteral ? d->numberValue : 0.;
executed 186 times by 4 tests: return d->isNumberLiteral ? d->numberValue : 0.;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickpathview
  • tst_qquickstates
186
135}-
136-
137-
138-
139-
140-
141bool QQmlScriptString::booleanLiteral(bool *ok) const-
142{-
143 bool isTrue = d->script == QLatin1String("true");-
144 bool isFalse = !isTrue
!isTrueDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->script == QLatin1String("false")
d->script == Q...tring("false")Description
TRUEnever evaluated
FALSEnever evaluated
;
0
145 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
146 *
never executed: *ok = isTrue || isFalse;
ok = isTrue
isTrueDescription
TRUEnever evaluated
FALSEnever evaluated
|| isFalse
isFalseDescription
TRUEnever evaluated
FALSEnever evaluated
;
never executed: *ok = isTrue || isFalse;
0
147 return
never executed: return isTrue ? true : false;
isTrue ? true : false;
never executed: return isTrue ? true : false;
0
148}-
149-
150-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0