qdbusxmlparser.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData, -
5 QDBusIntrospection::Interface *ifaceData) -
6{ -
7 const QString argType = attributes.value(QLatin1String("type")).toString(); -
8 -
9 bool ok = QDBusUtil::isValidSingleSignature(argType); -
10 if (!ok) {
evaluated: !ok
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:1869
4-1869
11 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 69, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found while parsing introspection",
executed: }
Execution Count:4
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
12 QString(argType).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 69, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found while parsing introspection", QString(argType).toLocal8Bit().constData());
0
13 } -
14 -
15 argData.name = attributes.value(QLatin1String("name")).toString(); -
16 argData.type = argType; -
17 -
18 ifaceData->introspection += QLatin1String(" <arg"); -
19 if (attributes.hasAttribute(QLatin1String("direction"))) {
evaluated: attributes.hasAttribute(QLatin1String("direction"))
TRUEFALSE
yes
Evaluation Count:1846
yes
Evaluation Count:27
27-1846
20 const QString direction = attributes.value(QLatin1String("direction")).toString(); -
21 ifaceData->introspection += QLatin1String(" direction=\"") + direction + QLatin1String("\""); -
22 }
executed: }
Execution Count:1846
1846
23 ifaceData->introspection += QLatin1String(" type=\"") + argData.type + QLatin1String("\""); -
24 if (!argData.name.isEmpty())
evaluated: !argData.name.isEmpty()
TRUEFALSE
yes
Evaluation Count:1268
yes
Evaluation Count:605
605-1268
25 ifaceData->introspection += QLatin1String(" name=\"") + argData.name + QLatin1String("\"");
executed: ifaceData->introspection += QLatin1String(" name=\"") + argData.name + QLatin1String("\"");
Execution Count:1268
1268
26 ifaceData->introspection += QLatin1String("/>\n"); -
27 -
28 return ok;
executed: return ok;
Execution Count:1873
1873
29} -
30 -
31static bool parseAnnotation(const QXmlStreamReader &xml, QDBusIntrospection::Annotations &annotations, -
32 QDBusIntrospection::Interface *ifaceData, bool interfaceAnnotation = false) -
33{ -
34 qt_noop(); -
35 -
36 const QXmlStreamAttributes attributes = xml.attributes(); -
37 const QString name = attributes.value(QLatin1String("name")).toString(); -
38 -
39 if (!QDBusUtil::isValidInterfaceName(name)) {
partially evaluated: !QDBusUtil::isValidInterfaceName(name)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:261
0-261
40 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 98, __PRETTY_FUNCTION__).debug("Invalid D-BUS annotation '%s' found while parsing introspection",
never evaluated: true
never executed: }
0
41 QString(name).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 98, __PRETTY_FUNCTION__).debug("Invalid D-BUS annotation '%s' found while parsing introspection", QString(name).toLocal8Bit().constData());
0
42 return false;
never executed: return false;
0
43 } -
44 const QString value = attributes.value(QLatin1String("value")).toString(); -
45 annotations.insert(name, value); -
46 if (!interfaceAnnotation)
evaluated: !interfaceAnnotation
TRUEFALSE
yes
Evaluation Count:255
yes
Evaluation Count:6
6-255
47 ifaceData->introspection += QLatin1String(" ");
executed: ifaceData->introspection += QLatin1String(" ");
Execution Count:255
255
48 ifaceData->introspection += QLatin1String(" <annotation value=\"") + value + QLatin1String("\" name=\"") + name + QLatin1String("\"/>\n"); -
49 return true;
executed: return true;
Execution Count:261
261
50} -
51 -
52static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &propertyData, -
53 QDBusIntrospection::Interface *ifaceData) -
54{ -
55 qt_noop(); -
56 -
57 QXmlStreamAttributes attributes = xml.attributes(); -
58 const QString propertyName = attributes.value(QLatin1String("name")).toString(); -
59 if (!QDBusUtil::isValidMemberName(propertyName)) {
partially evaluated: !QDBusUtil::isValidMemberName(propertyName)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:206
0-206
60 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 118, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
never executed: }
never evaluated: true
0
61 QString(propertyName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 118, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(propertyName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData());
0
62 xml.skipCurrentElement(); -
63 return false;
never executed: return false;
0
64 } -
65 -
66 -
67 propertyData.name = propertyName; -
68 propertyData.type = attributes.value(QLatin1String("type")).toString(); -
69 -
70 if (!QDBusUtil::isValidSingleSignature(propertyData.type)) {
evaluated: !QDBusUtil::isValidSingleSignature(propertyData.type)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:205
1-205
71 -
72 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 130, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection",
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
executed: }
Execution Count:1
0-1
73 QString(propertyData.type).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), 0
74 QString(propertyName).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 130, __PRETTY_FUNCTION__).debug("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection", QString(propertyData.type).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData());
0
75 } -
76 -
77 const QString access = attributes.value(QLatin1String("access")).toString(); -
78 if (access == QLatin1String("read"))
evaluated: access == QLatin1String("read")
TRUEFALSE
yes
Evaluation Count:104
yes
Evaluation Count:102
102-104
79 propertyData.access = QDBusIntrospection::Property::Read;
executed: propertyData.access = QDBusIntrospection::Property::Read;
Execution Count:104
104
80 else if (access == QLatin1String("write"))
evaluated: access == QLatin1String("write")
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:97
5-97
81 propertyData.access = QDBusIntrospection::Property::Write;
executed: propertyData.access = QDBusIntrospection::Property::Write;
Execution Count:5
5
82 else if (access == QLatin1String("readwrite"))
partially evaluated: access == QLatin1String("readwrite")
TRUEFALSE
yes
Evaluation Count:97
no
Evaluation Count:0
0-97
83 propertyData.access = QDBusIntrospection::Property::ReadWrite;
executed: propertyData.access = QDBusIntrospection::Property::ReadWrite;
Execution Count:97
97
84 else { -
85 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 143, __PRETTY_FUNCTION__).debug("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection",
never evaluated: true
never executed: }
0
86 QString(access).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), 0
87 QString(propertyName).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 143, __PRETTY_FUNCTION__).debug("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection", QString(access).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData(), QString(propertyName).toLocal8Bit().constData());
0
88 return false;
never executed: return false;
0
89 } -
90 -
91 ifaceData->introspection += QLatin1String(" <property access=\"") + access + QLatin1String("\" type=\"") + propertyData.type + QLatin1String("\" name=\"") + propertyName + QLatin1String("\""); -
92 -
93 if (!xml.readNextStartElement()) {
evaluated: !xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:200
yes
Evaluation Count:6
6-200
94 ifaceData->introspection += QLatin1String("/>\n"); -
95 } else {
executed: }
Execution Count:200
200
96 ifaceData->introspection += QLatin1String(">\n"); -
97 -
98 do { -
99 if (xml.name() == QLatin1String("annotation")) {
partially evaluated: xml.name() == QLatin1String("annotation")
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
100 parseAnnotation(xml, propertyData.annotations, ifaceData); -
101 } else if (xml.prefix().isEmpty()) {
never evaluated: xml.prefix().isEmpty()
executed: }
Execution Count:8
0-8
102 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 160, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for annotations";
never evaluated: true
never executed: }
never executed: QMessageLogger("qdbusxmlparser.cpp", 160, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for annotations";
0
103 } -
104 xml.skipCurrentElement(); -
105 } while (xml.readNextStartElement());
evaluated: xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:6
executed: }
Execution Count:8
2-8
106 -
107 ifaceData->introspection += QLatin1String(" </property>\n"); -
108 }
executed: }
Execution Count:6
6
109 -
110 if (!xml.isEndElement() || xml.name() != QLatin1String("property")) {
partially evaluated: !xml.isEndElement()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:206
partially evaluated: xml.name() != QLatin1String("property")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:206
0-206
111 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 169, __PRETTY_FUNCTION__).debug() << "Invalid property specification" << xml.tokenString() << xml.name();
never evaluated: true
never executed: }
never executed: QMessageLogger("qdbusxmlparser.cpp", 169, __PRETTY_FUNCTION__).debug() << "Invalid property specification" << xml.tokenString() << xml.name();
0
112 return false;
never executed: return false;
0
113 } -
114 -
115 return true;
executed: return true;
Execution Count:206
206
116} -
117 -
118static bool parseMethod(QXmlStreamReader &xml, QDBusIntrospection::Method &methodData, -
119 QDBusIntrospection::Interface *ifaceData) -
120{ -
121 qt_noop(); -
122 -
123 const QXmlStreamAttributes attributes = xml.attributes(); -
124 const QString methodName = attributes.value(QLatin1String("name")).toString(); -
125 if (!QDBusUtil::isValidMemberName(methodName)) {
partially evaluated: !QDBusUtil::isValidMemberName(methodName)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1480
0-1480
126 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 184, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
never evaluated: true
never executed: }
0
127 QString(methodName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 184, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(methodName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData());
0
128 return false;
never executed: return false;
0
129 } -
130 -
131 methodData.name = methodName; -
132 ifaceData->introspection += QLatin1String(" <method name=\"") + methodName + QLatin1String("\""); -
133 -
134 QDBusIntrospection::Arguments outArguments; -
135 QDBusIntrospection::Arguments inArguments; -
136 QDBusIntrospection::Annotations annotations; -
137 -
138 if (!xml.readNextStartElement()) {
evaluated: !xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:197
yes
Evaluation Count:1283
197-1283
139 ifaceData->introspection += QLatin1String("/>\n"); -
140 } else {
executed: }
Execution Count:197
197
141 ifaceData->introspection += QLatin1String(">\n"); -
142 -
143 do { -
144 if (xml.name() == QLatin1String("annotation")) {
evaluated: xml.name() == QLatin1String("annotation")
TRUEFALSE
yes
Evaluation Count:238
yes
Evaluation Count:1770
238-1770
145 parseAnnotation(xml, annotations, ifaceData); -
146 } else if (xml.name() == QLatin1String("arg")) {
partially evaluated: xml.name() == QLatin1String("arg")
TRUEFALSE
yes
Evaluation Count:1770
no
Evaluation Count:0
executed: }
Execution Count:238
0-1770
147 const QXmlStreamAttributes attributes = xml.attributes(); -
148 const QString direction = attributes.value(QLatin1String("direction")).toString(); -
149 QDBusIntrospection::Argument argument; -
150 if (!attributes.hasAttribute(QLatin1String("direction"))
partially evaluated: !attributes.hasAttribute(QLatin1String("direction"))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1770
0-1770
151 || direction == QLatin1String("in")) {
evaluated: direction == QLatin1String("in")
TRUEFALSE
yes
Evaluation Count:972
yes
Evaluation Count:798
798-972
152 parseArg(attributes, argument, ifaceData); -
153 inArguments << argument; -
154 } else if (direction == QLatin1String("out")) {
partially evaluated: direction == QLatin1String("out")
TRUEFALSE
yes
Evaluation Count:798
no
Evaluation Count:0
executed: }
Execution Count:972
0-972
155 parseArg(attributes, argument, ifaceData); -
156 outArguments << argument; -
157 }
executed: }
Execution Count:798
798
158 } else if (xml.prefix().isEmpty()) {
never evaluated: xml.prefix().isEmpty()
0
159 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 217, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for method arguments";
never evaluated: true
never executed: }
never executed: QMessageLogger("qdbusxmlparser.cpp", 217, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for method arguments";
0
160 } -
161 xml.skipCurrentElement(); -
162 } while (xml.readNextStartElement());
evaluated: xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:725
yes
Evaluation Count:1283
executed: }
Execution Count:2008
725-2008
163 -
164 ifaceData->introspection += QLatin1String(" </method>\n"); -
165 }
executed: }
Execution Count:1283
1283
166 -
167 methodData.inputArgs = inArguments; -
168 methodData.outputArgs = outArguments; -
169 methodData.annotations = annotations; -
170 -
171 return true;
executed: return true;
Execution Count:1480
1480
172} -
173 -
174 -
175static bool parseSignal(QXmlStreamReader &xml, QDBusIntrospection::Signal &signalData, -
176 QDBusIntrospection::Interface *ifaceData) -
177{ -
178 qt_noop(); -
179 -
180 const QXmlStreamAttributes attributes = xml.attributes(); -
181 const QString signalName = attributes.value(QLatin1String("name")).toString(); -
182 -
183 if (!QDBusUtil::isValidMemberName(signalName)) {
partially evaluated: !QDBusUtil::isValidMemberName(signalName)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:180
0-180
184 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 242, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
never evaluated: true
never executed: }
0
185 QString(signalName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 242, __PRETTY_FUNCTION__).debug("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", QString(signalName).toLocal8Bit().constData(), QString(ifaceData->name).toLocal8Bit().constData());
0
186 return false;
never executed: return false;
0
187 } -
188 -
189 signalData.name = signalName; -
190 ifaceData->introspection += QLatin1String(" <signal name=\"") + signalName + QLatin1String("\""); -
191 -
192 QDBusIntrospection::Arguments arguments; -
193 QDBusIntrospection::Annotations annotations; -
194 -
195 if (!xml.readNextStartElement()) {
evaluated: !xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:79
yes
Evaluation Count:101
79-101
196 ifaceData->introspection += QLatin1String("/>\n"); -
197 } else {
executed: }
Execution Count:79
79
198 ifaceData->introspection += QLatin1String(">\n"); -
199 -
200 do { -
201 if (xml.name() == QLatin1String("annotation")) {
evaluated: xml.name() == QLatin1String("annotation")
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:103
9-103
202 parseAnnotation(xml, annotations, ifaceData); -
203 } else if (xml.name() == QLatin1String("arg")) {
partially evaluated: xml.name() == QLatin1String("arg")
TRUEFALSE
yes
Evaluation Count:103
no
Evaluation Count:0
executed: }
Execution Count:9
0-103
204 const QXmlStreamAttributes attributes = xml.attributes(); -
205 QDBusIntrospection::Argument argument; -
206 if (!attributes.hasAttribute(QLatin1String("direction")) ||
evaluated: !attributes.hasAttribute(QLatin1String("direction"))
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:76
27-76
207 attributes.value(QLatin1String("direction")) == QLatin1String("out")) {
partially evaluated: attributes.value(QLatin1String("direction")) == QLatin1String("out")
TRUEFALSE
yes
Evaluation Count:76
no
Evaluation Count:0
0-76
208 parseArg(attributes, argument, ifaceData); -
209 arguments << argument; -
210 }
executed: }
Execution Count:103
103
211 } else {
executed: }
Execution Count:103
103
212 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 270, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for signal arguments";
never evaluated: true
never executed: }
never executed: QMessageLogger("qdbusxmlparser.cpp", 270, __PRETTY_FUNCTION__).debug() << "Unknown element" << xml.name() << "while checking for signal arguments";
0
213 } -
214 xml.skipCurrentElement(); -
215 } while (xml.readNextStartElement());
evaluated: xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:101
executed: }
Execution Count:112
11-112
216 -
217 ifaceData->introspection += QLatin1String(" </signal>\n"); -
218 }
executed: }
Execution Count:101
101
219 -
220 signalData.outputArgs = arguments; -
221 signalData.annotations = annotations; -
222 -
223 return true;
executed: return true;
Execution Count:180
180
224} -
225 -
226static void readInterface(QXmlStreamReader &xml, QDBusIntrospection::Object *objData, -
227 QDBusIntrospection::Interfaces *interfaces) -
228{ -
229 const QString ifaceName = xml.attributes().value(QLatin1String("name")).toString(); -
230 if (!QDBusUtil::isValidInterfaceName(ifaceName)) {
partially evaluated: !QDBusUtil::isValidInterfaceName(ifaceName)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:460
0-460
231 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 289, __PRETTY_FUNCTION__).debug("Invalid D-BUS interface name '%s' found while parsing introspection",
never evaluated: true
never executed: }
0
232 QString(ifaceName).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 289, __PRETTY_FUNCTION__).debug("Invalid D-BUS interface name '%s' found while parsing introspection", QString(ifaceName).toLocal8Bit().constData());
0
233 return;
never executed: return;
0
234 } -
235 -
236 objData->interfaces.append(ifaceName); -
237 -
238 QDBusIntrospection::Interface *ifaceData = new QDBusIntrospection::Interface; -
239 ifaceData->name = ifaceName; -
240 ifaceData->introspection += QLatin1String(" <interface name=\"") + ifaceName + QLatin1String("\">\n"); -
241 -
242 while (xml.readNextStartElement()) {
evaluated: xml.readNextStartElement()
TRUEFALSE
yes
Evaluation Count:1878
yes
Evaluation Count:460
460-1878
243 if (xml.name() == QLatin1String("method")) {
evaluated: xml.name() == QLatin1String("method")
TRUEFALSE
yes
Evaluation Count:1480
yes
Evaluation Count:398
398-1480
244 QDBusIntrospection::Method methodData; -
245 if (parseMethod(xml, methodData, ifaceData))
partially evaluated: parseMethod(xml, methodData, ifaceData)
TRUEFALSE
yes
Evaluation Count:1480
no
Evaluation Count:0
0-1480
246 ifaceData->methods.insert(methodData.name, methodData);
executed: ifaceData->methods.insert(methodData.name, methodData);
Execution Count:1480
1480
247 } else if (xml.name() == QLatin1String("signal")) {
evaluated: xml.name() == QLatin1String("signal")
TRUEFALSE
yes
Evaluation Count:180
yes
Evaluation Count:218
executed: }
Execution Count:1480
180-1480
248 QDBusIntrospection::Signal signalData; -
249 if (parseSignal(xml, signalData, ifaceData))
partially evaluated: parseSignal(xml, signalData, ifaceData)
TRUEFALSE
yes
Evaluation Count:180
no
Evaluation Count:0
0-180
250 ifaceData->signals_.insert(signalData.name, signalData);
executed: ifaceData->signals_.insert(signalData.name, signalData);
Execution Count:180
180
251 } else if (xml.name() == QLatin1String("property")) {
evaluated: xml.name() == QLatin1String("property")
TRUEFALSE
yes
Evaluation Count:206
yes
Evaluation Count:12
executed: }
Execution Count:180
12-206
252 QDBusIntrospection::Property propertyData; -
253 if (parseProperty(xml, propertyData, ifaceData))
partially evaluated: parseProperty(xml, propertyData, ifaceData)
TRUEFALSE
yes
Evaluation Count:206
no
Evaluation Count:0
0-206
254 ifaceData->properties.insert(propertyData.name, propertyData);
executed: ifaceData->properties.insert(propertyData.name, propertyData);
Execution Count:206
206
255 } else if (xml.name() == QLatin1String("annotation")) {
evaluated: xml.name() == QLatin1String("annotation")
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
executed: }
Execution Count:206
6-206
256 parseAnnotation(xml, ifaceData->annotations, ifaceData, true); -
257 xml.skipCurrentElement(); -
258 } else {
executed: }
Execution Count:6
6
259 if (xml.prefix().isEmpty()) {
partially evaluated: xml.prefix().isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
260 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 318, __PRETTY_FUNCTION__).debug() << "Unknown element while parsing interface" << xml.name();
never evaluated: true
never executed: }
never executed: QMessageLogger("qdbusxmlparser.cpp", 318, __PRETTY_FUNCTION__).debug() << "Unknown element while parsing interface" << xml.name();
0
261 } -
262 xml.skipCurrentElement(); -
263 }
executed: }
Execution Count:6
6
264 } -
265 -
266 ifaceData->introspection += QLatin1String(" </interface>"); -
267 -
268 interfaces->insert(ifaceName, QSharedDataPointer<QDBusIntrospection::Interface>(ifaceData)); -
269 -
270 if (!xml.isEndElement() || xml.name() != QLatin1String("interface")) {
evaluated: !xml.isEndElement()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:454
partially evaluated: xml.name() != QLatin1String("interface")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:454
0-454
271 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 329, __PRETTY_FUNCTION__).debug() << "Invalid Interface specification";
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:6
no
Evaluation Count:0
executed: }
Execution Count:6
never executed: QMessageLogger("qdbusxmlparser.cpp", 329, __PRETTY_FUNCTION__).debug() << "Invalid Interface specification";
0-6
272 } -
273}
executed: }
Execution Count:460
460
274 -
275static void readNode(const QXmlStreamReader &xml, QDBusIntrospection::Object *objData, int nodeLevel) -
276{ -
277 const QString objName = xml.attributes().value(QLatin1String("name")).toString(); -
278 const QString fullName = objData->path.endsWith(QLatin1Char('/'))
evaluated: objData->path.endsWith(QLatin1Char('/'))
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:215
24-215
279 ? (objData->path + objName) -
280 : QString(objData->path + QLatin1Char('/') + objName); -
281 if (!QDBusUtil::isValidObjectPath(fullName)) {
partially evaluated: !QDBusUtil::isValidObjectPath(fullName)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:239
0-239
282 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 340, __PRETTY_FUNCTION__).debug("Invalid D-BUS object path '%s' found while parsing introspection",
never evaluated: true
never executed: }
0
283 QString(fullName).toLocal8Bit().constData());
never executed: QMessageLogger("qdbusxmlparser.cpp", 340, __PRETTY_FUNCTION__).debug("Invalid D-BUS object path '%s' found while parsing introspection", QString(fullName).toLocal8Bit().constData());
0
284 return;
never executed: return;
0
285 } -
286 -
287 if (nodeLevel > 0)
evaluated: nodeLevel > 0
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:215
24-215
288 objData->childObjects.append(objName);
executed: objData->childObjects.append(objName);
Execution Count:24
24
289}
executed: }
Execution Count:239
239
290 -
291QDBusXmlParser::QDBusXmlParser(const QString& service, const QString& path, -
292 const QString& xmlData) -
293 : m_service(service), m_path(path), m_object(new QDBusIntrospection::Object) -
294{ -
295 -
296 -
297 m_object->service = m_service; -
298 m_object->path = m_path; -
299 -
300 QXmlStreamReader xml(xmlData); -
301 -
302 int nodeLevel = -1; -
303 -
304 while (!xml.atEnd()) {
evaluated: !xml.atEnd()
TRUEFALSE
yes
Evaluation Count:1964
yes
Evaluation Count:245
245-1964
305 xml.readNext(); -
306 -
307 switch (xml.tokenType()) { -
308 case QXmlStreamReader::StartElement: -
309 if (xml.name() == QLatin1String("node")) {
evaluated: xml.name() == QLatin1String("node")
TRUEFALSE
yes
Evaluation Count:239
yes
Evaluation Count:478
239-478
310 readNode(xml, m_object, ++nodeLevel); -
311 } else if (xml.name() == QLatin1String("interface")) {
evaluated: xml.name() == QLatin1String("interface")
TRUEFALSE
yes
Evaluation Count:460
yes
Evaluation Count:18
executed: }
Execution Count:239
18-460
312 readInterface(xml, m_object, &m_interfaces); -
313 } else {
executed: }
Execution Count:460
460
314 if (xml.prefix().isEmpty()) {
partially evaluated: xml.prefix().isEmpty()
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
0-18
315 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 373, __PRETTY_FUNCTION__).debug() << "skipping unknown element" << xml.name();
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
executed: }
Execution Count:18
never executed: QMessageLogger("qdbusxmlparser.cpp", 373, __PRETTY_FUNCTION__).debug() << "skipping unknown element" << xml.name();
0-18
316 } -
317 xml.skipCurrentElement(); -
318 }
executed: }
Execution Count:18
18
319 break;
executed: break;
Execution Count:717
717
320 case QXmlStreamReader::EndElement: -
321 if (xml.name() == QLatin1String("node")) {
partially evaluated: xml.name() == QLatin1String("node")
TRUEFALSE
yes
Evaluation Count:233
no
Evaluation Count:0
0-233
322 --nodeLevel; -
323 } else {
executed: }
Execution Count:233
233
324 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 382, __PRETTY_FUNCTION__).debug() << "Invalid Node declaration" << xml.name();
never evaluated: true
never executed: }
never executed: QMessageLogger("qdbusxmlparser.cpp", 382, __PRETTY_FUNCTION__).debug() << "Invalid Node declaration" << xml.name();
0
325 } -
326 break;
executed: break;
Execution Count:233
233
327 case QXmlStreamReader::StartDocument: -
328 case QXmlStreamReader::EndDocument: -
329 case QXmlStreamReader::DTD: -
330 -
331 break;
executed: break;
Execution Count:585
585
332 case QXmlStreamReader::Comment: -
333 -
334 break;
never executed: break;
0
335 default: -
336 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 394, __PRETTY_FUNCTION__).debug() << "unknown token" << xml.name() << xml.tokenString();
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:429
no
Evaluation Count:0
executed: }
Execution Count:429
never executed: QMessageLogger("qdbusxmlparser.cpp", 394, __PRETTY_FUNCTION__).debug() << "unknown token" << xml.name() << xml.tokenString();
0-429
337 break;
executed: break;
Execution Count:429
429
338 } -
339 }
executed: }
Execution Count:1964
1964
340 -
341 if (xml.hasError()) {
evaluated: xml.hasError()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:227
18-227
342 if (true) {} else QMessageLogger("qdbusxmlparser.cpp", 400, __PRETTY_FUNCTION__).debug() << "xml error" << xml.errorString() << "doc" << xmlData;
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
executed: }
Execution Count:18
never executed: QMessageLogger("qdbusxmlparser.cpp", 400, __PRETTY_FUNCTION__).debug() << "xml error" << xml.errorString() << "doc" << xmlData;
0-18
343 } -
344}
executed: }
Execution Count:245
245
345 -
346 -
347 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial