qdbusutil.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9static inline bool isValidCharacterNoDash(QChar c) -
10{ -
11 register ushort u = c.unicode(); -
12 return (u >= 'a' && u <= 'z') 73364
13 || (u >= 'A' && u <= 'Z') 73364
14 || (u >= '0' && u <= '9') 73364
15 || (u == '_');
executed: return (u >= 'a' && u <= 'z') || (u >= 'A' && u <= 'Z') || (u >= '0' && u <= '9') || (u == '_');
Execution Count:73364
73364
16} -
17 -
18static inline bool isValidCharacter(QChar c) -
19{ -
20 register ushort u = c.unicode(); -
21 return (u >= 'a' && u <= 'z') 16055
22 || (u >= 'A' && u <= 'Z') 16055
23 || (u >= '0' && u <= '9') 16055
24 || (u == '_') || (u == '-');
executed: return (u >= 'a' && u <= 'z') || (u >= 'A' && u <= 'Z') || (u >= '0' && u <= '9') || (u == '_') || (u == '-');
Execution Count:16055
16055
25} -
26 -
27static inline bool isValidNumber(QChar c) -
28{ -
29 register ushort u = c.unicode(); -
30 return (u >= '0' && u <= '9');
executed: return (u >= '0' && u <= '9');
Execution Count:10184
10184
31} -
32 -
33 -
34static bool argToString(const QDBusArgument &arg, QString &out); -
35 -
36static bool variantToString(const QVariant &arg, QString &out) -
37{ -
38 int argType = arg.userType(); -
39 -
40 if (argType == QVariant::StringList) {
never evaluated: argType == QVariant::StringList
0
41 out += QLatin1Char('{'); -
42 QStringList list = arg.toStringList(); -
43 for (QForeachContainer<__typeof__(list)> _container_(list); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QString &item = *_container_.i;; __extension__ ({--_container_.brk; break;})) -
44 out += QLatin1Char('\"') + item + QLatin1String("\", ");
never executed: out += QLatin1Char('\"') + item + QLatin1String("\", ");
0
45 if (!list.isEmpty())
never evaluated: !list.isEmpty()
0
46 out.chop(2);
never executed: out.chop(2);
0
47 out += QLatin1Char('}'); -
48 } else if (argType == QVariant::ByteArray) {
never evaluated: argType == QVariant::ByteArray
never executed: }
0
49 out += QLatin1Char('{'); -
50 QByteArray list = arg.toByteArray(); -
51 for (int i = 0; i < list.count(); ++i) {
never evaluated: i < list.count()
0
52 out += QString::number(list.at(i)); -
53 out += QLatin1String(", "); -
54 }
never executed: }
0
55 if (!list.isEmpty())
never evaluated: !list.isEmpty()
0
56 out.chop(2);
never executed: out.chop(2);
0
57 out += QLatin1Char('}'); -
58 } else if (argType == QVariant::List) {
never evaluated: argType == QVariant::List
never executed: }
0
59 out += QLatin1Char('{'); -
60 QList<QVariant> list = arg.toList(); -
61 for (QForeachContainer<__typeof__(list)> _container_(list); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QVariant &item = *_container_.i;; __extension__ ({--_container_.brk; break;})) { -
62 if (!variantToString(item, out))
never evaluated: !variantToString(item, out)
0
63 return false;
never executed: return false;
0
64 out += QLatin1String(", "); -
65 }
never executed: }
0
66 if (!list.isEmpty())
never evaluated: !list.isEmpty()
0
67 out.chop(2);
never executed: out.chop(2);
0
68 out += QLatin1Char('}'); -
69 } else if (argType == QMetaType::Char || argType == QMetaType::Short || argType == QMetaType::Int
never executed: }
never evaluated: argType == QMetaType::Char
never evaluated: argType == QMetaType::Short
never evaluated: argType == QMetaType::Int
0
70 || argType == QMetaType::Long || argType == QMetaType::LongLong) {
never evaluated: argType == QMetaType::Long
never evaluated: argType == QMetaType::LongLong
0
71 out += QString::number(arg.toLongLong()); -
72 } else if (argType == QMetaType::UChar || argType == QMetaType::UShort || argType == QMetaType::UInt
never executed: }
never evaluated: argType == QMetaType::UChar
never evaluated: argType == QMetaType::UShort
never evaluated: argType == QMetaType::UInt
0
73 || argType == QMetaType::ULong || argType == QMetaType::ULongLong) {
never evaluated: argType == QMetaType::ULong
never evaluated: argType == QMetaType::ULongLong
0
74 out += QString::number(arg.toULongLong()); -
75 } else if (argType == QMetaType::Double) {
never executed: }
never evaluated: argType == QMetaType::Double
0
76 out += QString::number(arg.toDouble()); -
77 } else if (argType == QMetaType::Bool) {
never executed: }
never evaluated: argType == QMetaType::Bool
0
78 out += QLatin1String(arg.toBool() ? "true" : "false"); -
79 } else if (argType == qMetaTypeId<QDBusArgument>()) {
never evaluated: argType == qMetaTypeId<QDBusArgument>()
never executed: }
0
80 argToString(qvariant_cast<QDBusArgument>(arg), out); -
81 } else if (argType == qMetaTypeId<QDBusObjectPath>()) {
never evaluated: argType == qMetaTypeId<QDBusObjectPath>()
never executed: }
0
82 const QString path = qvariant_cast<QDBusObjectPath>(arg).path(); -
83 out += QLatin1String("[ObjectPath: "); -
84 out += path; -
85 out += QLatin1Char(']'); -
86 } else if (argType == qMetaTypeId<QDBusSignature>()) {
never evaluated: argType == qMetaTypeId<QDBusSignature>()
never executed: }
0
87 out += QLatin1String("[Signature: ") + qvariant_cast<QDBusSignature>(arg).signature(); -
88 out += QLatin1Char(']'); -
89 } else if (argType == qMetaTypeId<QDBusUnixFileDescriptor>()) {
never evaluated: argType == qMetaTypeId<QDBusUnixFileDescriptor>()
never executed: }
0
90 out += QLatin1String("[Unix FD: "); -
91 out += QLatin1String(qvariant_cast<QDBusUnixFileDescriptor>(arg).isValid() ? "valid" : "not valid"); -
92 out += QLatin1Char(']'); -
93 } else if (argType == qMetaTypeId<QDBusVariant>()) {
never evaluated: argType == qMetaTypeId<QDBusVariant>()
never executed: }
0
94 const QVariant v = qvariant_cast<QDBusVariant>(arg).variant(); -
95 out += QLatin1String("[Variant"); -
96 int vUserType = v.userType(); -
97 if (vUserType != qMetaTypeId<QDBusVariant>()
never evaluated: vUserType != qMetaTypeId<QDBusVariant>()
0
98 && vUserType != qMetaTypeId<QDBusSignature>()
never evaluated: vUserType != qMetaTypeId<QDBusSignature>()
0
99 && vUserType != qMetaTypeId<QDBusObjectPath>()
never evaluated: vUserType != qMetaTypeId<QDBusObjectPath>()
0
100 && vUserType != qMetaTypeId<QDBusArgument>())
never evaluated: vUserType != qMetaTypeId<QDBusArgument>()
0
101 out += QLatin1Char('(') + QLatin1String(v.typeName()) + QLatin1Char(')');
never executed: out += QLatin1Char('(') + QLatin1String(v.typeName()) + QLatin1Char(')');
0
102 out += QLatin1String(": "); -
103 if (!variantToString(v, out))
never evaluated: !variantToString(v, out)
0
104 return false;
never executed: return false;
0
105 out += QLatin1Char(']'); -
106 } else if (arg.canConvert(QVariant::String)) {
never evaluated: arg.canConvert(QVariant::String)
never executed: }
0
107 out += QLatin1Char('\"') + arg.toString() + QLatin1Char('\"'); -
108 } else {
never executed: }
0
109 out += QLatin1Char('['); -
110 out += QLatin1String(arg.typeName()); -
111 out += QLatin1Char(']'); -
112 }
never executed: }
0
113 -
114 return true;
never executed: return true;
0
115} -
116 -
117bool argToString(const QDBusArgument &busArg, QString &out) -
118{ -
119 QString busSig = busArg.currentSignature(); -
120 bool doIterate = false; -
121 QDBusArgument::ElementType elementType = busArg.currentType(); -
122 -
123 if (elementType != QDBusArgument::BasicType && elementType != QDBusArgument::VariantType
never evaluated: elementType != QDBusArgument::BasicType
never evaluated: elementType != QDBusArgument::VariantType
0
124 && elementType != QDBusArgument::MapEntryType)
never evaluated: elementType != QDBusArgument::MapEntryType
0
125 out += QLatin1String("[Argument: ") + busSig + QLatin1Char(' ');
never executed: out += QLatin1String("[Argument: ") + busSig + QLatin1Char(' ');
0
126 -
127 switch (elementType) { -
128 case QDBusArgument::BasicType: -
129 case QDBusArgument::VariantType: -
130 if (!variantToString(busArg.asVariant(), out))
never evaluated: !variantToString(busArg.asVariant(), out)
0
131 return false;
never executed: return false;
0
132 break;
never executed: break;
0
133 case QDBusArgument::StructureType: -
134 busArg.beginStructure(); -
135 doIterate = true; -
136 break;
never executed: break;
0
137 case QDBusArgument::ArrayType: -
138 busArg.beginArray(); -
139 out += QLatin1Char('{'); -
140 doIterate = true; -
141 break;
never executed: break;
0
142 case QDBusArgument::MapType: -
143 busArg.beginMap(); -
144 out += QLatin1Char('{'); -
145 doIterate = true; -
146 break;
never executed: break;
0
147 case QDBusArgument::MapEntryType: -
148 busArg.beginMapEntry(); -
149 if (!variantToString(busArg.asVariant(), out))
never evaluated: !variantToString(busArg.asVariant(), out)
0
150 return false;
never executed: return false;
0
151 out += QLatin1String(" = "); -
152 if (!argToString(busArg, out))
never evaluated: !argToString(busArg, out)
0
153 return false;
never executed: return false;
0
154 busArg.endMapEntry(); -
155 break;
never executed: break;
0
156 case QDBusArgument::UnknownType: -
157 default: -
158 out += QLatin1String("<ERROR - Unknown Type>"); -
159 return false;
never executed: return false;
0
160 } -
161 if (doIterate && !busArg.atEnd()) {
never evaluated: doIterate
never evaluated: !busArg.atEnd()
0
162 while (!busArg.atEnd()) {
never evaluated: !busArg.atEnd()
0
163 if (!argToString(busArg, out))
never evaluated: !argToString(busArg, out)
0
164 return false;
never executed: return false;
0
165 out += QLatin1String(", "); -
166 }
never executed: }
0
167 out.chop(2); -
168 }
never executed: }
0
169 switch (elementType) { -
170 case QDBusArgument::BasicType: -
171 case QDBusArgument::VariantType: -
172 case QDBusArgument::UnknownType: -
173 case QDBusArgument::MapEntryType: -
174 -
175 break;
never executed: break;
0
176 case QDBusArgument::StructureType: -
177 busArg.endStructure(); -
178 break;
never executed: break;
0
179 case QDBusArgument::ArrayType: -
180 out += QLatin1Char('}'); -
181 busArg.endArray(); -
182 break;
never executed: break;
0
183 case QDBusArgument::MapType: -
184 out += QLatin1Char('}'); -
185 busArg.endMap(); -
186 break;
never executed: break;
0
187 } -
188 -
189 if (elementType != QDBusArgument::BasicType && elementType != QDBusArgument::VariantType
never evaluated: elementType != QDBusArgument::BasicType
never evaluated: elementType != QDBusArgument::VariantType
0
190 && elementType != QDBusArgument::MapEntryType)
never evaluated: elementType != QDBusArgument::MapEntryType
0
191 out += QLatin1Char(']');
never executed: out += QLatin1Char(']');
0
192 -
193 return true;
never executed: return true;
0
194} -
195 -
196 -
197 -
198static const char oneLetterTypes[] = "vsogybnqiuxtdh"; -
199static const char basicTypes[] = "sogybnqiuxtdh"; -
200static const char fixedTypes[] = "ybnqiuxtdh"; -
201 -
202static bool isBasicType(int c) -
203{ -
204 return c != ((int) '\0') && strchr(basicTypes, c) != __null;
executed: return c != ((int) '\0') && strchr(basicTypes, c) != __null;
Execution Count:336
336
205} -
206 -
207static bool isFixedType(int c) -
208{ -
209 return c != ((int) '\0') && strchr(fixedTypes, c) != __null;
executed: return c != ((int) '\0') && strchr(fixedTypes, c) != __null;
Execution Count:31
31
210} -
211 -
212 -
213 -
214static const char *validateSingleType(const char *signature) -
215{ -
216 register char c = *signature; -
217 if (c == ((int) '\0'))
evaluated: c == ((int) '\0')
TRUEFALSE
yes
Evaluation Count:29
yes
Evaluation Count:3830
29-3830
218 return 0;
executed: return 0;
Execution Count:29
29
219 -
220 -
221 if (strchr(oneLetterTypes, c) != __null)
evaluated: strchr(oneLetterTypes, c) != __null
TRUEFALSE
yes
Evaluation Count:2781
yes
Evaluation Count:1049
1049-2781
222 return signature + 1;
executed: return signature + 1;
Execution Count:2781
2781
223 -
224 -
225 if (c == ((int) 'a')) {
evaluated: c == ((int) 'a')
TRUEFALSE
yes
Evaluation Count:655
yes
Evaluation Count:394
394-655
226 -
227 -
228 c = *++signature; -
229 if (c == ((int) '{')) {
evaluated: c == ((int) '{')
TRUEFALSE
yes
Evaluation Count:280
yes
Evaluation Count:375
280-375
230 -
231 -
232 -
233 c = *++signature; -
234 if (!isBasicType(c))
evaluated: !isBasicType(c)
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:264
16-264
235 return 0;
executed: return 0;
Execution Count:16
16
236 signature = validateSingleType(signature + 1); -
237 return signature && *signature == ((int) '}') ? signature + 1 : 0;
executed: return signature && *signature == ((int) '}') ? signature + 1 : 0;
Execution Count:264
264
238 } -
239 -
240 return validateSingleType(signature);
executed: return validateSingleType(signature);
Execution Count:375
375
241 } -
242 -
243 if (c == ((int) '(')) {
evaluated: c == ((int) '(')
TRUEFALSE
yes
Evaluation Count:354
yes
Evaluation Count:40
40-354
244 -
245 ++signature; -
246 while (true) {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:819
no
Evaluation Count:0
0-819
247 signature = validateSingleType(signature); -
248 if (!signature)
evaluated: !signature
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:785
34-785
249 return 0;
executed: return 0;
Execution Count:34
34
250 if (*signature == ((int) ')'))
evaluated: *signature == ((int) ')')
TRUEFALSE
yes
Evaluation Count:320
yes
Evaluation Count:465
320-465
251 return signature + 1;
executed: return signature + 1;
Execution Count:320
320
252 }
executed: }
Execution Count:465
465
253 }
never executed: }
0
254 -
255 -
256 return 0;
executed: return 0;
Execution Count:40
40
257} -
258namespace QDBusUtil -
259{ -
260 -
261 -
262 -
263 -
264 -
265 QString argumentToString(const QVariant &arg) -
266 { -
267 QString out; -
268 -
269 -
270 variantToString(arg, out); -
271 -
272 -
273 -
274 -
275 return out;
never executed: return out;
0
276 } -
277 -
278 -
279 -
280 -
281 -
282 -
283 bool isValidPartOfObjectPath(const QString &part) -
284 { -
285 if (part.isEmpty())
partially evaluated: part.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1895
0-1895
286 return false;
never executed: return false;
0
287 -
288 const QChar *c = part.unicode(); -
289 for (int i = 0; i < part.length(); ++i)
evaluated: i < part.length()
TRUEFALSE
yes
Evaluation Count:10708
yes
Evaluation Count:1895
1895-10708
290 if (!isValidCharacterNoDash(c[i]))
partially evaluated: !isValidCharacterNoDash(c[i])
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10708
0-10708
291 return false;
never executed: return false;
0
292 -
293 return true;
executed: return true;
Execution Count:1895
1895
294 } -
295 bool isValidInterfaceName(const QString& ifaceName) -
296 { -
297 if (ifaceName.isEmpty() || ifaceName.length() > 255)
partially evaluated: ifaceName.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1628
partially evaluated: ifaceName.length() > 255
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1628
0-1628
298 return false;
never executed: return false;
0
299 -
300 QStringList parts = ifaceName.split(QLatin1Char('.')); -
301 if (parts.count() < 2)
partially evaluated: parts.count() < 2
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1628
0-1628
302 return false;
never executed: return false;
0
303 -
304 for (int i = 0; i < parts.count(); ++i)
evaluated: i < parts.count()
TRUEFALSE
yes
Evaluation Count:5741
yes
Evaluation Count:1628
1628-5741
305 if (!isValidMemberName(parts.at(i)))
partially evaluated: !isValidMemberName(parts.at(i))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5741
0-5741
306 return false;
never executed: return false;
0
307 -
308 return true;
executed: return true;
Execution Count:1628
1628
309 } -
310 bool isValidUniqueConnectionName(const QString &connName) -
311 { -
312 if (connName.isEmpty() || connName.length() > 255 ||
partially evaluated: connName.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:347
partially evaluated: connName.length() > 255
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:347
0-347
313 !connName.startsWith(QLatin1Char(':')))
evaluated: !connName.startsWith(QLatin1Char(':'))
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:317
30-317
314 return false;
executed: return false;
Execution Count:30
30
315 -
316 QStringList parts = connName.mid(1).split(QLatin1Char('.')); -
317 if (parts.count() < 1)
partially evaluated: parts.count() < 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:317
0-317
318 return false;
never executed: return false;
0
319 -
320 for (int i = 0; i < parts.count(); ++i) {
evaluated: i < parts.count()
TRUEFALSE
yes
Evaluation Count:634
yes
Evaluation Count:317
317-634
321 const QString &part = parts.at(i); -
322 if (part.isEmpty())
partially evaluated: part.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:634
0-634
323 return false;
never executed: return false;
0
324 -
325 const QChar* c = part.unicode(); -
326 for (int j = 0; j < part.length(); ++j)
evaluated: j < part.length()
TRUEFALSE
yes
Evaluation Count:1585
yes
Evaluation Count:634
634-1585
327 if (!isValidCharacter(c[j]))
partially evaluated: !isValidCharacter(c[j])
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1585
0-1585
328 return false;
never executed: return false;
0
329 }
executed: }
Execution Count:634
634
330 -
331 return true;
executed: return true;
Execution Count:317
317
332 } -
333 bool isValidBusName(const QString &busName) -
334 { -
335 if (busName.isEmpty() || busName.length() > 255)
partially evaluated: busName.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:746
partially evaluated: busName.length() > 255
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:746
0-746
336 return false;
never executed: return false;
0
337 -
338 if (busName.startsWith(QLatin1Char(':')))
evaluated: busName.startsWith(QLatin1Char(':'))
TRUEFALSE
yes
Evaluation Count:208
yes
Evaluation Count:538
208-538
339 return isValidUniqueConnectionName(busName);
executed: return isValidUniqueConnectionName(busName);
Execution Count:208
208
340 -
341 QStringList parts = busName.split(QLatin1Char('.')); -
342 if (parts.count() < 1)
partially evaluated: parts.count() < 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:538
0-538
343 return false;
never executed: return false;
0
344 -
345 for (int i = 0; i < parts.count(); ++i) {
evaluated: i < parts.count()
TRUEFALSE
yes
Evaluation Count:2043
yes
Evaluation Count:531
531-2043
346 const QString &part = parts.at(i); -
347 if (part.isEmpty())
partially evaluated: part.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2043
0-2043
348 return false;
never executed: return false;
0
349 -
350 const QChar *c = part.unicode(); -
351 if (isValidNumber(c[0]))
partially evaluated: isValidNumber(c[0])
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2043
0-2043
352 return false;
never executed: return false;
0
353 for (int j = 0; j < part.length(); ++j)
evaluated: j < part.length()
TRUEFALSE
yes
Evaluation Count:14470
yes
Evaluation Count:2036
2036-14470
354 if (!isValidCharacter(c[j]))
evaluated: !isValidCharacter(c[j])
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:14463
7-14463
355 return false;
executed: return false;
Execution Count:7
7
356 }
executed: }
Execution Count:2036
2036
357 -
358 return true;
executed: return true;
Execution Count:531
531
359 } -
360 -
361 -
362 -
363 -
364 -
365 -
366 -
367 bool isValidMemberName(const QString &memberName) -
368 { -
369 if (memberName.isEmpty() || memberName.length() > 255)
partially evaluated: memberName.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8141
partially evaluated: memberName.length() > 255
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8141
0-8141
370 return false;
never executed: return false;
0
371 -
372 const QChar* c = memberName.unicode(); -
373 if (isValidNumber(c[0]))
partially evaluated: isValidNumber(c[0])
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8141
0-8141
374 return false;
never executed: return false;
0
375 for (int j = 0; j < memberName.length(); ++j)
evaluated: j < memberName.length()
TRUEFALSE
yes
Evaluation Count:62656
yes
Evaluation Count:8141
8141-62656
376 if (!isValidCharacterNoDash(c[j]))
partially evaluated: !isValidCharacterNoDash(c[j])
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62656
0-62656
377 return false;
never executed: return false;
0
378 return true;
executed: return true;
Execution Count:8141
8141
379 } -
380 -
381 -
382 -
383 -
384 -
385 -
386 bool isValidErrorName(const QString &errorName) -
387 { -
388 return isValidInterfaceName(errorName);
never executed: return isValidInterfaceName(errorName);
0
389 } -
390 bool isValidObjectPath(const QString &path) -
391 { -
392 if (path == QLatin1String("/"))
evaluated: path == QLatin1String("/")
TRUEFALSE
yes
Evaluation Count:613
yes
Evaluation Count:782
613-782
393 return true;
executed: return true;
Execution Count:613
613
394 -
395 if (!path.startsWith(QLatin1Char('/')) || path.indexOf(QLatin1String("//")) != -1 ||
evaluated: !path.startsWith(QLatin1Char('/'))
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:768
partially evaluated: path.indexOf(QLatin1String("//")) != -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:768
0-768
396 path.endsWith(QLatin1Char('/')))
partially evaluated: path.endsWith(QLatin1Char('/'))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:768
0-768
397 return false;
executed: return false;
Execution Count:14
14
398 -
399 QStringList parts = path.split(QLatin1Char('/')); -
400 qt_noop(); -
401 parts.removeFirst(); -
402 -
403 for (int i = 0; i < parts.count(); ++i)
evaluated: i < parts.count()
TRUEFALSE
yes
Evaluation Count:1895
yes
Evaluation Count:768
768-1895
404 if (!isValidPartOfObjectPath(parts.at(i)))
partially evaluated: !isValidPartOfObjectPath(parts.at(i))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1895
0-1895
405 return false;
never executed: return false;
0
406 -
407 return true;
executed: return true;
Execution Count:768
768
408 } -
409 -
410 -
411 -
412 -
413 -
414 bool isValidBasicType(int c) -
415 { -
416 return isBasicType(c);
executed: return isBasicType(c);
Execution Count:56
56
417 } -
418 -
419 -
420 -
421 -
422 -
423 bool isValidFixedType(int c) -
424 { -
425 return isFixedType(c);
executed: return isFixedType(c);
Execution Count:31
31
426 } -
427 bool isValidSignature(const QString &signature) -
428 { -
429 QByteArray ba = signature.toLatin1(); -
430 const char *data = ba.constData(); -
431 while (true) {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:96
no
Evaluation Count:0
0-96
432 data = validateSingleType(data); -
433 if (!data)
evaluated: !data
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:74
22-74
434 return false;
executed: return false;
Execution Count:22
22
435 if (*data == '\0')
evaluated: *data == '\0'
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:34
34-40
436 return true;
executed: return true;
Execution Count:40
40
437 }
executed: }
Execution Count:34
34
438 }
never executed: }
0
439 -
440 -
441 -
442 -
443 -
444 -
445 -
446 bool isValidSingleSignature(const QString &signature) -
447 { -
448 QByteArray ba = signature.toLatin1(); -
449 const char *data = validateSingleType(ba.constData()); -
450 return data && *data == '\0';
executed: return data && *data == '\0';
Execution Count:2305
2305
451 } -
452 -
453} -
454 -
455 -
456 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial