qxmlstream.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/xml/qxmlstream.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "QtCore/qxmlstream.h"-
35-
36#ifndef QT_NO_XMLSTREAM-
37-
38#include "qxmlutils_p.h"-
39#include <qdebug.h>-
40#include <qfile.h>-
41#include <stdio.h>-
42#include <qtextcodec.h>-
43#include <qstack.h>-
44#include <qbuffer.h>-
45#ifndef QT_BOOTSTRAPPED-
46#include <qcoreapplication.h>-
47#else-
48// This specialization of Q_DECLARE_TR_FUNCTIONS is not in qcoreapplication.h,-
49// because that header depends on QObject being available, which is not the-
50// case for most bootstrapped applications.-
51#define Q_DECLARE_TR_FUNCTIONS(context) \-
52public: \-
53 static inline QString tr(const char *sourceText, const char *comment = 0) \-
54 { Q_UNUSED(comment); return QString::fromLatin1(sourceText); } \-
55 static inline QString trUtf8(const char *sourceText, const char *comment = 0) \-
56 { Q_UNUSED(comment); return QString::fromLatin1(sourceText); } \-
57 static inline QString tr(const char *sourceText, const char*, int) \-
58 { return QString::fromLatin1(sourceText); } \-
59 static inline QString trUtf8(const char *sourceText, const char*, int) \-
60 { return QString::fromLatin1(sourceText); } \-
61private:-
62#endif-
63QT_BEGIN_NAMESPACE-
64-
65#include "qxmlstream_p.h"-
66-
67enum { StreamEOF = ~0U };-
68-
69/*!-
70 \enum QXmlStreamReader::TokenType-
71-
72 This enum specifies the type of token the reader just read.-
73-
74 \value NoToken The reader has not yet read anything.-
75-
76 \value Invalid An error has occurred, reported in error() and-
77 errorString().-
78-
79 \value StartDocument The reader reports the XML version number in-
80 documentVersion(), and the encoding as specified in the XML-
81 document in documentEncoding(). If the document is declared-
82 standalone, isStandaloneDocument() returns \c true; otherwise it-
83 returns \c false.-
84-
85 \value EndDocument The reader reports the end of the document.-
86-
87 \value StartElement The reader reports the start of an element-
88 with namespaceUri() and name(). Empty elements are also reported-
89 as StartElement, followed directly by EndElement. The convenience-
90 function readElementText() can be called to concatenate all-
91 content until the corresponding EndElement. Attributes are-
92 reported in attributes(), namespace declarations in-
93 namespaceDeclarations().-
94-
95 \value EndElement The reader reports the end of an element with-
96 namespaceUri() and name().-
97-
98 \value Characters The reader reports characters in text(). If the-
99 characters are all white-space, isWhitespace() returns \c true. If-
100 the characters stem from a CDATA section, isCDATA() returns \c true.-
101-
102 \value Comment The reader reports a comment in text().-
103-
104 \value DTD The reader reports a DTD in text(), notation-
105 declarations in notationDeclarations(), and entity declarations in-
106 entityDeclarations(). Details of the DTD declaration are reported-
107 in in dtdName(), dtdPublicId(), and dtdSystemId().-
108-
109 \value EntityReference The reader reports an entity reference that-
110 could not be resolved. The name of the reference is reported in-
111 name(), the replacement text in text().-
112-
113 \value ProcessingInstruction The reader reports a processing-
114 instruction in processingInstructionTarget() and-
115 processingInstructionData().-
116*/-
117-
118/*!-
119 \enum QXmlStreamReader::ReadElementTextBehaviour-
120-
121 This enum specifies the different behaviours of readElementText().-
122-
123 \value ErrorOnUnexpectedElement Raise an UnexpectedElementError and return-
124 what was read so far when a child element is encountered.-
125-
126 \value IncludeChildElements Recursively include the text from child elements.-
127-
128 \value SkipChildElements Skip child elements.-
129-
130 \since 4.6-
131*/-
132-
133/*!-
134 \enum QXmlStreamReader::Error-
135-
136 This enum specifies different error cases-
137-
138 \value NoError No error has occurred.-
139-
140 \value CustomError A custom error has been raised with-
141 raiseError()-
142-
143 \value NotWellFormedError The parser internally raised an error-
144 due to the read XML not being well-formed.-
145-
146 \value PrematureEndOfDocumentError The input stream ended before a-
147 well-formed XML document was parsed. Recovery from this error is-
148 possible if more XML arrives in the stream, either by calling-
149 addData() or by waiting for it to arrive on the device().-
150-
151 \value UnexpectedElementError The parser encountered an element-
152 that was different to those it expected.-
153-
154*/-
155-
156/*!-
157 \class QXmlStreamEntityResolver-
158 \inmodule QtCore-
159 \reentrant-
160 \since 4.4-
161-
162 \brief The QXmlStreamEntityResolver class provides an entity-
163 resolver for a QXmlStreamReader.-
164-
165 \ingroup xml-tools-
166 */-
167-
168/*!-
169 Destroys the entity resolver.-
170 */-
171QXmlStreamEntityResolver::~QXmlStreamEntityResolver()-
172{-
173}-
174-
175/*!-
176 \internal-
177-
178This function is a stub for later functionality.-
179*/-
180QString QXmlStreamEntityResolver::resolveEntity(const QString& /*publicId*/, const QString& /*systemId*/)-
181{-
182 return QString();
never executed: return QString();
0
183}-
184-
185-
186/*!-
187 Resolves the undeclared entity \a name and returns its replacement-
188 text. If the entity is also unknown to the entity resolver, it-
189 returns an empty string.-
190-
191 The default implementation always returns an empty string.-
192*/-
193-
194QString QXmlStreamEntityResolver::resolveUndeclaredEntity(const QString &/*name*/)-
195{-
196 return QString();
never executed: return QString();
0
197}-
198-
199#ifndef QT_NO_XMLSTREAMREADER-
200-
201QString QXmlStreamReaderPrivate::resolveUndeclaredEntity(const QString &name)-
202{-
203 if (entityResolver)
entityResolverDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-2
204 return entityResolver->resolveUndeclaredEntity(name);
executed 2 times by 1 test: return entityResolver->resolveUndeclaredEntity(name);
Executed by:
  • tst_QXmlStream
2
205 return QString();
never executed: return QString();
0
206}-
207-
208-
209-
210/*!-
211 \since 4.4-
212-
213 Makes \a resolver the new entityResolver().-
214-
215 The stream reader does \e not take ownership of the resolver. It's-
216 the callers responsibility to ensure that the resolver is valid-
217 during the entire life-time of the stream reader object, or until-
218 another resolver or 0 is set.-
219-
220 \sa entityResolver()-
221 */-
222void QXmlStreamReader::setEntityResolver(QXmlStreamEntityResolver *resolver)-
223{-
224 Q_D(QXmlStreamReader);-
225 d->entityResolver = resolver;-
226}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QXmlStream
1
227-
228/*!-
229 \since 4.4-
230-
231 Returns the entity resolver, or 0 if there is no entity resolver.-
232-
233 \sa setEntityResolver()-
234 */-
235QXmlStreamEntityResolver *QXmlStreamReader::entityResolver() const-
236{-
237 Q_D(const QXmlStreamReader);-
238 return d->entityResolver;
never executed: return d->entityResolver;
0
239}-
240-
241-
242-
243/*!-
244 \class QXmlStreamReader-
245 \inmodule QtCore-
246 \reentrant-
247 \since 4.3-
248-
249 \brief The QXmlStreamReader class provides a fast parser for reading-
250 well-formed XML via a simple streaming API.-
251-
252-
253 \ingroup xml-tools-
254-
255 QXmlStreamReader is a faster and more convenient replacement for-
256 Qt's own SAX parser (see QXmlSimpleReader). In some cases it might-
257 also be a faster and more convenient alternative for use in-
258 applications that would otherwise use a DOM tree (see QDomDocument).-
259 QXmlStreamReader reads data either from a QIODevice (see-
260 setDevice()), or from a raw QByteArray (see addData()).-
261-
262 Qt provides QXmlStreamWriter for writing XML.-
263-
264 The basic concept of a stream reader is to report an XML document as-
265 a stream of tokens, similar to SAX. The main difference between-
266 QXmlStreamReader and SAX is \e how these XML tokens are reported.-
267 With SAX, the application must provide handlers (callback functions)-
268 that receive so-called XML \e events from the parser at the parser's-
269 convenience. With QXmlStreamReader, the application code itself-
270 drives the loop and pulls \e tokens from the reader, one after-
271 another, as it needs them. This is done by calling readNext(), where-
272 the reader reads from the input stream until it completes the next-
273 token, at which point it returns the tokenType(). A set of-
274 convenient functions including isStartElement() and text() can then-
275 be used to examine the token to obtain information about what has-
276 been read. The big advantage of this \e pulling approach is the-
277 possibility to build recursive descent parsers with it, meaning you-
278 can split your XML parsing code easily into different methods or-
279 classes. This makes it easy to keep track of the application's own-
280 state when parsing XML.-
281-
282 A typical loop with QXmlStreamReader looks like this:-
283-
284 \snippet code/src_corelib_xml_qxmlstream.cpp 0-
285-
286-
287 QXmlStreamReader is a well-formed XML 1.0 parser that does \e not-
288 include external parsed entities. As long as no error occurs, the-
289 application code can thus be assured that the data provided by the-
290 stream reader satisfies the W3C's criteria for well-formed XML. For-
291 example, you can be certain that all tags are indeed nested and-
292 closed properly, that references to internal entities have been-
293 replaced with the correct replacement text, and that attributes have-
294 been normalized or added according to the internal subset of the-
295 DTD.-
296-
297 If an error occurs while parsing, atEnd() and hasError() return-
298 true, and error() returns the error that occurred. The functions-
299 errorString(), lineNumber(), columnNumber(), and characterOffset()-
300 are for constructing an appropriate error or warning message. To-
301 simplify application code, QXmlStreamReader contains a raiseError()-
302 mechanism that lets you raise custom errors that trigger the same-
303 error handling described.-
304-
305 The \l{QXmlStream Bookmarks Example} illustrates how to use the-
306 recursive descent technique to read an XML bookmark file (XBEL) with-
307 a stream reader.-
308-
309 \section1 Namespaces-
310-
311 QXmlStream understands and resolves XML namespaces. E.g. in case of-
312 a StartElement, namespaceUri() returns the namespace the element is-
313 in, and name() returns the element's \e local name. The combination-
314 of namespaceUri and name uniquely identifies an element. If a-
315 namespace prefix was not declared in the XML entities parsed by the-
316 reader, the namespaceUri is empty.-
317-
318 If you parse XML data that does not utilize namespaces according to-
319 the XML specification or doesn't use namespaces at all, you can use-
320 the element's qualifiedName() instead. A qualified name is the-
321 element's prefix() followed by colon followed by the element's local-
322 name() - exactly like the element appears in the raw XML data. Since-
323 the mapping namespaceUri to prefix is neither unique nor universal,-
324 qualifiedName() should be avoided for namespace-compliant XML data.-
325-
326 In order to parse standalone documents that do use undeclared-
327 namespace prefixes, you can turn off namespace processing completely-
328 with the \l namespaceProcessing property.-
329-
330 \section1 Incremental Parsing-
331-
332 QXmlStreamReader is an incremental parser. It can handle the case-
333 where the document can't be parsed all at once because it arrives in-
334 chunks (e.g. from multiple files, or over a network connection).-
335 When the reader runs out of data before the complete document has-
336 been parsed, it reports a PrematureEndOfDocumentError. When more-
337 data arrives, either because of a call to addData() or because more-
338 data is available through the network device(), the reader recovers-
339 from the PrematureEndOfDocumentError error and continues parsing the-
340 new data with the next call to readNext().-
341-
342 For example, if your application reads data from the network using a-
343 \l{QNetworkAccessManager} {network access manager}, you would issue-
344 a \l{QNetworkRequest} {network request} to the manager and receive a-
345 \l{QNetworkReply} {network reply} in return. Since a QNetworkReply-
346 is a QIODevice, you connect its \l{QIODevice::readyRead()}-
347 {readyRead()} signal to a custom slot, e.g. \c{slotReadyRead()} in-
348 the code snippet shown in the discussion for QNetworkAccessManager.-
349 In this slot, you read all available data with-
350 \l{QIODevice::readAll()} {readAll()} and pass it to the XML-
351 stream reader using addData(). Then you call your custom parsing-
352 function that reads the XML events from the reader.-
353-
354 \section1 Performance and Memory Consumption-
355-
356 QXmlStreamReader is memory-conservative by design, since it doesn't-
357 store the entire XML document tree in memory, but only the current-
358 token at the time it is reported. In addition, QXmlStreamReader-
359 avoids the many small string allocations that it normally takes to-
360 map an XML document to a convenient and Qt-ish API. It does this by-
361 reporting all string data as QStringRef rather than real QString-
362 objects. QStringRef is a thin wrapper around QString substrings that-
363 provides a subset of the QString API without the memory allocation-
364 and reference-counting overhead. Calling-
365 \l{QStringRef::toString()}{toString()} on any of those objects-
366 returns an equivalent real QString object.-
367-
368*/-
369-
370-
371/*!-
372 Constructs a stream reader.-
373-
374 \sa setDevice(), addData()-
375 */-
376QXmlStreamReader::QXmlStreamReader()-
377 : d_ptr(new QXmlStreamReaderPrivate(this))-
378{-
379}
executed 3174 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
3174
380-
381/*! Creates a new stream reader that reads from \a device.-
382-
383\sa setDevice(), clear()-
384 */-
385QXmlStreamReader::QXmlStreamReader(QIODevice *device)-
386 : d_ptr(new QXmlStreamReaderPrivate(this))-
387{-
388 setDevice(device);-
389}
executed 519 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
519
390-
391/*!-
392 Creates a new stream reader that reads from \a data.-
393-
394 \sa addData(), clear(), setDevice()-
395 */-
396QXmlStreamReader::QXmlStreamReader(const QByteArray &data)-
397 : d_ptr(new QXmlStreamReaderPrivate(this))-
398{-
399 Q_D(QXmlStreamReader);-
400 d->dataBuffer = data;-
401}
executed 845 times by 2 tests: end of block
Executed by:
  • tst_QXmlStream
  • tst_Selftests
845
402-
403/*!-
404 Creates a new stream reader that reads from \a data.-
405-
406 \sa addData(), clear(), setDevice()-
407 */-
408QXmlStreamReader::QXmlStreamReader(const QString &data)-
409 : d_ptr(new QXmlStreamReaderPrivate(this))-
410{-
411 Q_D(QXmlStreamReader);-
412#ifdef QT_NO_TEXTCODEC-
413 d->dataBuffer = data.toLatin1();-
414#else-
415 d->dataBuffer = d->codec->fromUnicode(data);-
416 d->decoder = d->codec->makeDecoder();-
417#endif-
418 d->lockEncoding = true;-
419-
420}
executed 378 times by 13 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
378
421-
422/*!-
423 Creates a new stream reader that reads from \a data.-
424-
425 \sa addData(), clear(), setDevice()-
426 */-
427QXmlStreamReader::QXmlStreamReader(const char *data)-
428 : d_ptr(new QXmlStreamReaderPrivate(this))-
429{-
430 Q_D(QXmlStreamReader);-
431 d->dataBuffer = QByteArray(data);-
432}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
6
433-
434/*!-
435 Destructs the reader.-
436 */-
437QXmlStreamReader::~QXmlStreamReader()-
438{-
439 Q_D(QXmlStreamReader);-
440 if (d->deleteDevice)
d->deleteDeviceDescription
TRUEnever evaluated
FALSEevaluated 4922 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-4922
441 delete d->device;
never executed: delete d->device;
0
442}
executed 4922 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
4922
443-
444/*! \fn bool QXmlStreamReader::hasError() const-
445 Returns \c true if an error has occurred, otherwise \c false.-
446-
447 \sa errorString(), error()-
448 */-
449-
450/*!-
451 Sets the current device to \a device. Setting the device resets-
452 the stream to its initial state.-
453-
454 \sa device(), clear()-
455*/-
456void QXmlStreamReader::setDevice(QIODevice *device)-
457{-
458 Q_D(QXmlStreamReader);-
459 if (d->deleteDevice) {
d->deleteDeviceDescription
TRUEnever evaluated
FALSEevaluated 2240 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
0-2240
460 delete d->device;-
461 d->deleteDevice = false;-
462 }
never executed: end of block
0
463 d->device = device;-
464 d->init();-
465-
466}
executed 2240 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
2240
467-
468/*!-
469 Returns the current device associated with the QXmlStreamReader,-
470 or 0 if no device has been assigned.-
471-
472 \sa setDevice()-
473*/-
474QIODevice *QXmlStreamReader::device() const-
475{-
476 Q_D(const QXmlStreamReader);-
477 return d->device;
never executed: return d->device;
0
478}-
479-
480-
481/*!-
482 Adds more \a data for the reader to read. This function does-
483 nothing if the reader has a device().-
484-
485 \sa readNext(), clear()-
486 */-
487void QXmlStreamReader::addData(const QByteArray &data)-
488{-
489 Q_D(QXmlStreamReader);-
490 if (d->device) {
d->deviceDescription
TRUEnever evaluated
FALSEevaluated 57484 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-57484
491 qWarning("QXmlStreamReader: addData() with device()");-
492 return;
never executed: return;
0
493 }-
494 d->dataBuffer += data;-
495}
executed 57484 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
57484
496-
497/*!-
498 Adds more \a data for the reader to read. This function does-
499 nothing if the reader has a device().-
500-
501 \sa readNext(), clear()-
502 */-
503void QXmlStreamReader::addData(const QString &data)-
504{-
505 Q_D(QXmlStreamReader);-
506 d->lockEncoding = true;-
507#ifdef QT_NO_TEXTCODEC-
508 addData(data.toLatin1());-
509#else-
510 addData(d->codec->fromUnicode(data));-
511#endif-
512}
executed 4 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
4
513-
514/*!-
515 Adds more \a data for the reader to read. This function does-
516 nothing if the reader has a device().-
517-
518 \sa readNext(), clear()-
519 */-
520void QXmlStreamReader::addData(const char *data)-
521{-
522 addData(QByteArray(data));-
523}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2
524-
525/*!-
526 Removes any device() or data from the reader and resets its-
527 internal state to the initial state.-
528-
529 \sa addData()-
530 */-
531void QXmlStreamReader::clear()-
532{-
533 Q_D(QXmlStreamReader);-
534 d->init();-
535 if (d->device) {
d->deviceDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-3
536 if (d->deleteDevice)
d->deleteDeviceDescription
TRUEnever evaluated
FALSEnever evaluated
0
537 delete d->device;
never executed: delete d->device;
0
538 d->device = 0;-
539 }
never executed: end of block
0
540}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
3
541-
542/*!-
543 Returns \c true if the reader has read until the end of the XML-
544 document, or if an error() has occurred and reading has been-
545 aborted. Otherwise, it returns \c false.-
546-
547 When atEnd() and hasError() return true and error() returns-
548 PrematureEndOfDocumentError, it means the XML has been well-formed-
549 so far, but a complete XML document has not been parsed. The next-
550 chunk of XML can be added with addData(), if the XML is being read-
551 from a QByteArray, or by waiting for more data to arrive if the-
552 XML is being read from a QIODevice. Either way, atEnd() will-
553 return false once more data is available.-
554-
555 \sa hasError(), error(), device(), QIODevice::atEnd()-
556 */-
557bool QXmlStreamReader::atEnd() const-
558{-
559 Q_D(const QXmlStreamReader);-
560 if (d->atEnd
d->atEndDescription
TRUEevaluated 118570 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 690755 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
118570-690755
561 && ((d->type == QXmlStreamReader::Invalid && d->error == PrematureEndOfDocumentError)
d->type == QXm...eader::InvalidDescription
TRUEevaluated 115547 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEevaluated 3023 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->error == Pr...fDocumentErrorDescription
TRUEevaluated 115547 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEnever evaluated
0-115547
562 || (d->type == QXmlStreamReader::EndDocument))) {
(d->type == QX...::EndDocument)Description
TRUEevaluated 3023 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-3023
563 if (d->device)
d->deviceDescription
TRUEevaluated 551 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 118019 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
551-118019
564 return d->device->atEnd();
executed 551 times by 2 tests: return d->device->atEnd();
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
551
565 else-
566 return !d->dataBuffer.size();
executed 118019 times by 14 tests: return !d->dataBuffer.size();
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
118019
567 }-
568 return (d->atEnd || d->type == QXmlStreamReader::Invalid);
executed 690755 times by 15 tests: return (d->atEnd || d->type == QXmlStreamReader::Invalid);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->atEndDescription
TRUEnever evaluated
FALSEevaluated 690755 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->type == QXm...eader::InvalidDescription
TRUEevaluated 1227 times by 2 tests
Evaluated by:
  • tst_QDBusMetaObject
  • tst_QXmlStream
FALSEevaluated 689528 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-690755
569}-
570-
571-
572/*!-
573 Reads the next token and returns its type.-
574-
575 With one exception, once an error() is reported by readNext(),-
576 further reading of the XML stream is not possible. Then atEnd()-
577 returns \c true, hasError() returns \c true, and this function returns-
578 QXmlStreamReader::Invalid.-
579-
580 The exception is when error() returns PrematureEndOfDocumentError.-
581 This error is reported when the end of an otherwise well-formed-
582 chunk of XML is reached, but the chunk doesn't represent a complete-
583 XML document. In that case, parsing \e can be resumed by calling-
584 addData() to add the next chunk of XML, when the stream is being-
585 read from a QByteArray, or by waiting for more data to arrive when-
586 the stream is being read from a device().-
587-
588 \sa tokenType(), tokenString()-
589 */-
590QXmlStreamReader::TokenType QXmlStreamReader::readNext()-
591{-
592 Q_D(QXmlStreamReader);-
593 if (d->type != Invalid) {
d->type != InvalidDescription
TRUEevaluated 1035578 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 57494 times by 2 tests
Evaluated by:
  • tst_QDBusMetaObject
  • tst_QXmlStream
57494-1035578
594 if (!d->hasCheckedStartDocument)
!d->hasCheckedStartDocumentDescription
TRUEevaluated 5954 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 1029624 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
5954-1029624
595 if (!d->checkStartDocument())
!d->checkStartDocument()Description
TRUEevaluated 4669 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 1285 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1285-4669
596 return d->type; // synthetic StartDocument or error
executed 4669 times by 13 tests: return d->type;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
4669
597 d->parse();-
598 if (d->atEnd && d->type != EndDocument && d->type != Invalid)
d->atEndDescription
TRUEevaluated 58409 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 972500 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->type != EndDocumentDescription
TRUEevaluated 56038 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEevaluated 2371 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->type != InvalidDescription
TRUEevaluated 45171 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 10867 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
2371-972500
599 d->raiseError(PrematureEndOfDocumentError);
executed 45171 times by 1 test: d->raiseError(PrematureEndOfDocumentError);
Executed by:
  • tst_QXmlStream
45171
600 else if (!d->atEnd && d->type == EndDocument)
!d->atEndDescription
TRUEevaluated 972500 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 13238 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->type == EndDocumentDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 972495 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
5-972500
601 d->raiseWellFormedError(QXmlStream::tr("Extra content at end of document."));
executed 5 times by 1 test: d->raiseWellFormedError(QXmlStream::tr("Extra content at end of document."));
Executed by:
  • tst_QXmlStream
5
602 } else if (d->error == PrematureEndOfDocumentError) {
executed 1030909 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
d->error == Pr...fDocumentErrorDescription
TRUEevaluated 57482 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QDBusMetaObject
12-1030909
603 // resume error-
604 d->type = NoToken;-
605 d->atEnd = false;-
606 d->token = -1;-
607 return readNext();
executed 57482 times by 1 test: return readNext();
Executed by:
  • tst_QXmlStream
57482
608 }-
609 return d->type;
executed 1030921 times by 15 tests: return d->type;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1030921
610}-
611-
612-
613/*!-
614 Returns the type of the current token.-
615-
616 The current token can also be queried with the convenience functions-
617 isStartDocument(), isEndDocument(), isStartElement(),-
618 isEndElement(), isCharacters(), isComment(), isDTD(),-
619 isEntityReference(), and isProcessingInstruction().-
620-
621 \sa tokenString()-
622 */-
623QXmlStreamReader::TokenType QXmlStreamReader::tokenType() const-
624{-
625 Q_D(const QXmlStreamReader);-
626 return d->type;
executed 604486 times by 14 tests: return d->type;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
604486
627}-
628-
629/*!-
630 Reads until the next start element within the current element. Returns \c true-
631 when a start element was reached. When the end element was reached, or when-
632 an error occurred, false is returned.-
633-
634 The current element is the element matching the most recently parsed start-
635 element of which a matching end element has not yet been reached. When the-
636 parser has reached the end element, the current element becomes the parent-
637 element.-
638-
639 This is a convenience function for when you're only concerned with parsing-
640 XML elements. The \l{QXmlStream Bookmarks Example} makes extensive use of-
641 this function.-
642-
643 \since 4.6-
644 \sa readNext()-
645 */-
646bool QXmlStreamReader::readNextStartElement()-
647{-
648 while (readNext() != Invalid) {
readNext() != InvalidDescription
TRUEevaluated 15735 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QDBusMetaObject
12-15735
649 if (isEndElement())
isEndElement()Description
TRUEevaluated 2626 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 13109 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
2626-13109
650 return false;
executed 2626 times by 14 tests: return false;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
2626
651 else if (isStartElement())
isStartElement()Description
TRUEevaluated 5437 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 7672 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
5437-7672
652 return true;
executed 5437 times by 14 tests: return true;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
5437
653 }
executed 7672 times by 12 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
7672
654 return false;
executed 12 times by 1 test: return false;
Executed by:
  • tst_QDBusMetaObject
12
655}-
656-
657/*!-
658 Reads until the end of the current element, skipping any child nodes.-
659 This function is useful for skipping unknown elements.-
660-
661 The current element is the element matching the most recently parsed start-
662 element of which a matching end element has not yet been reached. When the-
663 parser has reached the end element, the current element becomes the parent-
664 element.-
665-
666 \since 4.6-
667 */-
668void QXmlStreamReader::skipCurrentElement()-
669{-
670 int depth = 1;-
671 while (depth && readNext() != Invalid) {
depthDescription
TRUEevaluated 2686 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 2642 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
readNext() != InvalidDescription
TRUEevaluated 2679 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QDBusMetaObject
  • tst_QXmlStream
7-2686
672 if (isEndElement())
isEndElement()Description
TRUEevaluated 2655 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
24-2655
673 --depth;
executed 2655 times by 14 tests: --depth;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
2655
674 else if (isStartElement())
isStartElement()Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
11-13
675 ++depth;
executed 13 times by 2 tests: ++depth;
Executed by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
13
676 }
executed 2679 times by 14 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
2679
677}
executed 2649 times by 14 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
2649
678-
679/*-
680 * Use the following Perl script to generate the error string index list:-
681===== PERL SCRIPT ====-
682print "static const char QXmlStreamReader_tokenTypeString_string[] =\n";-
683$counter = 0;-
684$i = 0;-
685while (<STDIN>) {-
686 chomp;-
687 print " \"$_\\0\"\n";-
688 $sizes[$i++] = $counter;-
689 $counter += length 1 + $_;-
690}-
691print " \"\\0\";\n\nstatic const short QXmlStreamReader_tokenTypeString_indices[] = {\n ";-
692for ($j = 0; $j < $i; ++$j) {-
693 printf "$sizes[$j], ";-
694}-
695print "0\n};\n";-
696===== PERL SCRIPT ====-
697-
698 * The input data is as follows (copied from qxmlstream.h):-
699NoToken-
700Invalid-
701StartDocument-
702EndDocument-
703StartElement-
704EndElement-
705Characters-
706Comment-
707DTD-
708EntityReference-
709ProcessingInstruction-
710*/-
711static const char QXmlStreamReader_tokenTypeString_string[] =-
712 "NoToken\0"-
713 "Invalid\0"-
714 "StartDocument\0"-
715 "EndDocument\0"-
716 "StartElement\0"-
717 "EndElement\0"-
718 "Characters\0"-
719 "Comment\0"-
720 "DTD\0"-
721 "EntityReference\0"-
722 "ProcessingInstruction\0";-
723-
724static const short QXmlStreamReader_tokenTypeString_indices[] = {-
725 0, 8, 16, 30, 42, 55, 66, 77, 85, 89, 105, 0-
726};-
727-
728-
729/*!-
730 \property QXmlStreamReader::namespaceProcessing-
731 The namespace-processing flag of the stream reader-
732-
733 This property controls whether or not the stream reader processes-
734 namespaces. If enabled, the reader processes namespaces, otherwise-
735 it does not.-
736-
737 By default, namespace-processing is enabled.-
738*/-
739-
740-
741void QXmlStreamReader::setNamespaceProcessing(bool enable)-
742{-
743 Q_D(QXmlStreamReader);-
744 d->namespaceProcessing = enable;-
745}
never executed: end of block
0
746-
747bool QXmlStreamReader::namespaceProcessing() const-
748{-
749 Q_D(const QXmlStreamReader);-
750 return d->namespaceProcessing;
never executed: return d->namespaceProcessing;
0
751}-
752-
753/*! Returns the reader's current token as string.-
754-
755\sa tokenType()-
756*/-
757QString QXmlStreamReader::tokenString() const-
758{-
759 Q_D(const QXmlStreamReader);-
760 return QLatin1String(QXmlStreamReader_tokenTypeString_string +
executed 1903 times by 1 test: return QLatin1String(QXmlStreamReader_tokenTypeString_string + QXmlStreamReader_tokenTypeString_indices[d->type]);
Executed by:
  • tst_QXmlStream
1903
761 QXmlStreamReader_tokenTypeString_indices[d->type]);
executed 1903 times by 1 test: return QLatin1String(QXmlStreamReader_tokenTypeString_string + QXmlStreamReader_tokenTypeString_indices[d->type]);
Executed by:
  • tst_QXmlStream
1903
762}-
763-
764#endif // QT_NO_XMLSTREAMREADER-
765-
766QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()-
767{-
768 tagStack.reserve(16);-
769 tagStackStringStorage.reserve(32);-
770 tagStackStringStorageSize = 0;-
771 NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();-
772 namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml"));-
773 namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace"));-
774 initialTagStackStringStorageSize = tagStackStringStorageSize;-
775}
executed 5757 times by 17 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
5757
776-
777#ifndef QT_NO_XMLSTREAMREADER-
778-
779QXmlStreamReaderPrivate::QXmlStreamReaderPrivate(QXmlStreamReader *q)-
780 :q_ptr(q)-
781{-
782 device = 0;-
783 deleteDevice = false;-
784#ifndef QT_NO_TEXTCODEC-
785 decoder = 0;-
786#endif-
787 stack_size = 64;-
788 sym_stack = 0;-
789 state_stack = 0;-
790 reallocateStack();-
791 entityResolver = 0;-
792 init();-
793 entityHash.insert(QLatin1String("lt"), Entity::createLiteral(QLatin1String("<")));-
794 entityHash.insert(QLatin1String("gt"), Entity::createLiteral(QLatin1String(">")));-
795 entityHash.insert(QLatin1String("amp"), Entity::createLiteral(QLatin1String("&")));-
796 entityHash.insert(QLatin1String("apos"), Entity::createLiteral(QLatin1String("'")));-
797 entityHash.insert(QLatin1String("quot"), Entity::createLiteral(QLatin1String("\"")));-
798}
executed 5013 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
5013
799-
800void QXmlStreamReaderPrivate::init()-
801{-
802 scanDtd = false;-
803 token = -1;-
804 token_char = 0;-
805 isEmptyElement = false;-
806 isWhitespace = true;-
807 isCDATA = false;-
808 standalone = false;-
809 tos = 0;-
810 resumeReduction = 0;-
811 state_stack[tos++] = 0;-
812 state_stack[tos] = 0;-
813 putStack.clear();-
814 putStack.reserve(32);-
815 textBuffer.clear();-
816 textBuffer.reserve(256);-
817 tagStack.clear();-
818 tagsDone = false;-
819 attributes.clear();-
820 attributes.reserve(16);-
821 lineNumber = lastLineStart = characterOffset = 0;-
822 readBufferPos = 0;-
823 nbytesread = 0;-
824#ifndef QT_NO_TEXTCODEC-
825 codec = QTextCodec::codecForMib(106); // utf8-
826 delete decoder;-
827 decoder = 0;-
828#endif-
829 attributeStack.clear();-
830 attributeStack.reserve(16);-
831 entityParser = 0;-
832 hasCheckedStartDocument = false;-
833 normalizeLiterals = false;-
834 hasSeenTag = false;-
835 atEnd = false;-
836 inParseEntity = false;-
837 referenceToUnparsedEntityDetected = false;-
838 referenceToParameterEntityDetected = false;-
839 hasExternalDtdSubset = false;-
840 lockEncoding = false;-
841 namespaceProcessing = true;-
842 rawReadBuffer.clear();-
843 dataBuffer.clear();-
844 readBuffer.clear();-
845 tagStackStringStorageSize = initialTagStackStringStorageSize;-
846-
847 type = QXmlStreamReader::NoToken;-
848 error = QXmlStreamReader::NoError;-
849}
executed 7289 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
7289
850-
851/*-
852 Well-formed requires that we verify entity values. We do this with a-
853 standard parser.-
854 */-
855void QXmlStreamReaderPrivate::parseEntity(const QString &value)-
856{-
857 Q_Q(QXmlStreamReader);-
858-
859 if (value.isEmpty())
value.isEmpty()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_QXmlStream
14-124
860 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_QXmlStream
14
861-
862-
863 if (!entityParser)
!entityParserDescription
TRUEevaluated 91 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_QXmlStream
33-91
864 entityParser = new QXmlStreamReaderPrivate(q);
executed 91 times by 1 test: entityParser = new QXmlStreamReaderPrivate(q);
Executed by:
  • tst_QXmlStream
91
865 else-
866 entityParser->init();
executed 33 times by 1 test: entityParser->init();
Executed by:
  • tst_QXmlStream
33
867 entityParser->inParseEntity = true;-
868 entityParser->readBuffer = value;-
869 entityParser->injectToken(PARSE_ENTITY);-
870 while (!entityParser->atEnd && entityParser->type != QXmlStreamReader::Invalid)
!entityParser->atEndDescription
TRUEevaluated 215 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 118 times by 1 test
Evaluated by:
  • tst_QXmlStream
entityParser->...eader::InvalidDescription
TRUEevaluated 209 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QXmlStream
6-215
871 entityParser->parse();
executed 209 times by 1 test: entityParser->parse();
Executed by:
  • tst_QXmlStream
209
872 if (entityParser->type == QXmlStreamReader::Invalid || entityParser->tagStack.size())
entityParser->...eader::InvalidDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QXmlStream
entityParser->tagStack.size()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 106 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-108
873 raiseWellFormedError(QXmlStream::tr("Invalid entity value."));
executed 18 times by 1 test: raiseWellFormedError(QXmlStream::tr("Invalid entity value."));
Executed by:
  • tst_QXmlStream
18
874-
875}
executed 124 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
124
876-
877inline void QXmlStreamReaderPrivate::reallocateStack()-
878{-
879 stack_size <<= 1;-
880 sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));-
881 Q_CHECK_PTR(sym_stack);
never executed: qBadAlloc();
!(sym_stack)Description
TRUEnever evaluated
FALSEevaluated 5014 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-5014
882 state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));-
883 Q_CHECK_PTR(state_stack);
never executed: qBadAlloc();
!(state_stack)Description
TRUEnever evaluated
FALSEevaluated 5014 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-5014
884}
executed 5014 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
5014
885-
886-
887QXmlStreamReaderPrivate::~QXmlStreamReaderPrivate()-
888{-
889#ifndef QT_NO_TEXTCODEC-
890 delete decoder;-
891#endif-
892 free(sym_stack);-
893 free(state_stack);-
894 delete entityParser;-
895}
executed 5013 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
5013
896-
897-
898inline uint QXmlStreamReaderPrivate::filterCarriageReturn()-
899{-
900 uint peekc = peekChar();-
901 if (peekc == '\n') {
peekc == '\n'Description
TRUEevaluated 8307 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2158 times by 1 test
Evaluated by:
  • tst_QXmlStream
2158-8307
902 if (putStack.size())
putStack.size()Description
TRUEnever evaluated
FALSEevaluated 8307 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-8307
903 putStack.pop();
never executed: putStack.pop();
0
904 else-
905 ++readBufferPos;
executed 8307 times by 1 test: ++readBufferPos;
Executed by:
  • tst_QXmlStream
8307
906 return peekc;
executed 8307 times by 1 test: return peekc;
Executed by:
  • tst_QXmlStream
8307
907 }-
908 if (peekc == StreamEOF) {
peekc == StreamEOFDescription
TRUEevaluated 2146 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QXmlStream
12-2146
909 putChar('\r');-
910 return 0;
executed 2146 times by 1 test: return 0;
Executed by:
  • tst_QXmlStream
2146
911 }-
912 return '\n';
executed 12 times by 1 test: return '\n';
Executed by:
  • tst_QXmlStream
12
913}-
914-
915/*!-
916 \internal-
917 If the end of the file is encountered, ~0 is returned.-
918 */-
919inline uint QXmlStreamReaderPrivate::getChar()-
920{-
921 uint c;-
922 if (putStack.size()) {
putStack.size()Description
TRUEevaluated 2030335 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 13769355 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
2030335-13769355
923 c = atEnd ? StreamEOF : putStack.pop();
atEndDescription
TRUEevaluated 4859 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2025476 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
4859-2025476
924 } else {
executed 2030335 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
2030335
925 if (readBufferPos < readBuffer.size())
readBufferPos ...dBuffer.size()Description
TRUEevaluated 13654700 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 114655 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
114655-13654700
926 c = readBuffer.at(readBufferPos++).unicode();
executed 13654700 times by 15 tests: c = readBuffer.at(readBufferPos++).unicode();
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
13654700
927 else-
928 c = getChar_helper();
executed 114655 times by 15 tests: c = getChar_helper();
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
114655
929 }-
930-
931 return c;
executed 15799690 times by 15 tests: return c;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
15799690
932}-
933-
934inline uint QXmlStreamReaderPrivate::peekChar()-
935{-
936 uint c;-
937 if (putStack.size()) {
putStack.size()Description
TRUEevaluated 14016 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 81284 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
14016-81284
938 c = putStack.top();-
939 } else if (readBufferPos < readBuffer.size()) {
executed 14016 times by 13 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
readBufferPos ...dBuffer.size()Description
TRUEevaluated 74602 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 6682 times by 1 test
Evaluated by:
  • tst_QXmlStream
6682-74602
940 c = readBuffer.at(readBufferPos).unicode();-
941 } else {
executed 74602 times by 14 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
74602
942 if ((c = getChar_helper()) != StreamEOF)
(c = getChar_h...) != StreamEOFDescription
TRUEevaluated 3331 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3351 times by 1 test
Evaluated by:
  • tst_QXmlStream
3331-3351
943 --readBufferPos;
executed 3331 times by 1 test: --readBufferPos;
Executed by:
  • tst_QXmlStream
3331
944 }
executed 6682 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
6682
945-
946 return c;
executed 95300 times by 14 tests: return c;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
95300
947}-
948-
949/*!-
950 \internal-
951-
952 Scans characters until \a str is encountered, and validates the characters-
953 as according to the Char[2] production and do the line-ending normalization.-
954 If any character is invalid, false is returned, otherwise true upon success.-
955-
956 If \a tokenToInject is not less than zero, injectToken() is called with-
957 \a tokenToInject when \a str is found.-
958-
959 If any error occurred, false is returned, otherwise true.-
960 */-
961bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject)-
962{-
963 int pos = textBuffer.size();-
964 int oldLineNumber = lineNumber;-
965-
966 uint c;-
967 while ((c = getChar()) != StreamEOF) {
(c = getChar()) != StreamEOFDescription
TRUEevaluated 1102147 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 5870 times by 1 test
Evaluated by:
  • tst_QXmlStream
5870-1102147
968 /* First, we do the validation & normalization. */-
969 switch (c) {-
970 case '\r':
executed 407 times by 1 test: case '\r':
Executed by:
  • tst_QXmlStream
407
971 if ((c = filterCarriageReturn()) == 0)
(c = filterCar...Return()) == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 404 times by 1 test
Evaluated by:
  • tst_QXmlStream
3-404
972 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_QXmlStream
3
973 // fall through-
974 case '\n':
code before this statement executed 404 times by 1 test: case '\n':
Executed by:
  • tst_QXmlStream
executed 1704 times by 3 tests: case '\n':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
404-1704
975 ++lineNumber;-
976 lastLineStart = characterOffset + readBufferPos;-
977 // fall through-
978 case '\t':
code before this statement executed 2108 times by 3 tests: case '\t':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
executed 723 times by 1 test: case '\t':
Executed by:
  • tst_QXmlStream
723-2108
979 textBuffer += QChar(c);-
980 continue;
executed 2831 times by 3 tests: continue;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
2831
981 default:
executed 1099313 times by 4 tests: default:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1099313
982 if (c < 0x20 || (c > 0xFFFD && c < 0x10000) || c > QChar::LastValidCodePoint ) {
c < 0x20Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1099277 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
c > 0xFFFDDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1099272 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
c < 0x10000Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
c > QChar::LastValidCodePointDescription
TRUEnever evaluated
FALSEevaluated 1099272 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-1099277
983 raiseWellFormedError(QXmlStream::tr("Invalid XML character."));-
984 lineNumber = oldLineNumber;-
985 return false;
executed 41 times by 1 test: return false;
Executed by:
  • tst_QXmlStream
41
986 }-
987 textBuffer += QChar(c);-
988 }
executed 1099272 times by 4 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1099272
989-
990-
991 /* Second, attempt to lookup str. */-
992 if (c == uint(*str)) {
c == uint(*str)Description
TRUEevaluated 64450 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 1034825 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
64450-1034825
993 if (!*(str + 1)) {
!*(str + 1)Description
TRUEnever evaluated
FALSEevaluated 64450 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-64450
994 if (tokenToInject >= 0)
tokenToInject >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
995 injectToken(tokenToInject);
never executed: injectToken(tokenToInject);
0
996 return true;
never executed: return true;
0
997 } else {-
998 if (scanString(str + 1, tokenToInject, false))
scanString(str...Inject, false)Description
TRUEevaluated 63556 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 894 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
894-63556
999 return true;
executed 63556 times by 4 tests: return true;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
63556
1000 }
executed 894 times by 3 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
894
1001 }-
1002 }
executed 1035719 times by 4 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1035719
1003 putString(textBuffer, pos);-
1004 textBuffer.resize(pos);-
1005 lineNumber = oldLineNumber;-
1006 return false;
executed 5870 times by 1 test: return false;
Executed by:
  • tst_QXmlStream
5870
1007}-
1008-
1009bool QXmlStreamReaderPrivate::scanString(const char *str, short tokenToInject, bool requireSpace)-
1010{-
1011 int n = 0;-
1012 while (str[n]) {
str[n]Description
TRUEevaluated 598096 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 125737 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
125737-598096
1013 uint c = getChar();-
1014 if (c != ushort(str[n])) {
c != ushort(str[n])Description
TRUEevaluated 24872 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 573224 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
24872-573224
1015 if (c != StreamEOF)
c != StreamEOFDescription
TRUEevaluated 6701 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 18171 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
6701-18171
1016 putChar(c);
executed 6701 times by 14 tests: putChar(c);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
6701
1017 while (n--) {
n--Description
TRUEevaluated 39487 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 24872 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
24872-39487
1018 putChar(ushort(str[n]));-
1019 }
executed 39487 times by 13 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
39487
1020 return false;
executed 24872 times by 14 tests: return false;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
24872
1021 }-
1022 ++n;-
1023 }
executed 573224 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
573224
1024 for (int i = 0; i < n; ++i)
i < nDescription
TRUEevaluated 533737 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 125737 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
125737-533737
1025 textBuffer += QChar(ushort(str[i]));
executed 533737 times by 14 tests: textBuffer += QChar(ushort(str[i]));
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
533737
1026 if (requireSpace) {
requireSpaceDescription
TRUEevaluated 11286 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 114451 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
11286-114451
1027 int s = fastScanSpace();-
1028 if (!s || atEnd) {
!sDescription
TRUEevaluated 1609 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 9677 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
atEndDescription
TRUEevaluated 1435 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 8242 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1435-9677
1029 int pos = textBuffer.size() - n - s;-
1030 putString(textBuffer, pos);-
1031 textBuffer.resize(pos);-
1032 return false;
executed 3044 times by 1 test: return false;
Executed by:
  • tst_QXmlStream
3044
1033 }-
1034 }
executed 8242 times by 14 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
8242
1035 if (tokenToInject >= 0)
tokenToInject >= 0Description
TRUEevaluated 59137 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 63556 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
59137-63556
1036 injectToken(tokenToInject);
executed 59137 times by 14 tests: injectToken(tokenToInject);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
59137
1037 return true;
executed 122693 times by 14 tests: return true;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
122693
1038}-
1039-
1040bool QXmlStreamReaderPrivate::scanAfterLangleBang()-
1041{-
1042 switch (peekChar()) {-
1043 case '[':
executed 46900 times by 2 tests: case '[':
Executed by:
  • tst_QXmlStream
  • tst_Selftests
46900
1044 return scanString(spell[CDATA_START], CDATA_START, false);
executed 46900 times by 2 tests: return scanString(spell[CDATA_START], CDATA_START, false);
Executed by:
  • tst_QXmlStream
  • tst_Selftests
46900
1045 case 'D':
executed 3815 times by 13 tests: case 'D':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
3815
1046 return scanString(spell[DOCTYPE], DOCTYPE);
executed 3815 times by 13 tests: return scanString(spell[DOCTYPE], DOCTYPE);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
3815
1047 case 'A':
executed 2355 times by 2 tests: case 'A':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
2355
1048 return scanString(spell[ATTLIST], ATTLIST);
executed 2355 times by 2 tests: return scanString(spell[ATTLIST], ATTLIST);
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
2355
1049 case 'N':
executed 382 times by 1 test: case 'N':
Executed by:
  • tst_QXmlStream
382
1050 return scanString(spell[NOTATION], NOTATION);
executed 382 times by 1 test: return scanString(spell[NOTATION], NOTATION);
Executed by:
  • tst_QXmlStream
382
1051 case 'E':
executed 6772 times by 2 tests: case 'E':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
6772
1052 if (scanString(spell[ELEMENT], ELEMENT))
scanString(spe...ENT], ELEMENT)Description
TRUEevaluated 2196 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 4576 times by 1 test
Evaluated by:
  • tst_QXmlStream
2196-4576
1053 return true;
executed 2196 times by 2 tests: return true;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
2196
1054 return scanString(spell[ENTITY], ENTITY);
executed 4576 times by 1 test: return scanString(spell[ENTITY], ENTITY);
Executed by:
  • tst_QXmlStream
4576
1055-
1056 default:
executed 17408 times by 4 tests: default:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
17408
1057 ;-
1058 };
executed 17408 times by 4 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
17408
1059 return false;
executed 17408 times by 4 tests: return false;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
17408
1060}-
1061-
1062bool QXmlStreamReaderPrivate::scanPublicOrSystem()-
1063{-
1064 switch (peekChar()) {-
1065 case 'S':
executed 440 times by 1 test: case 'S':
Executed by:
  • tst_QXmlStream
440
1066 return scanString(spell[SYSTEM], SYSTEM);
executed 440 times by 1 test: return scanString(spell[SYSTEM], SYSTEM);
Executed by:
  • tst_QXmlStream
440
1067 case 'P':
executed 386 times by 12 tests: case 'P':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
386
1068 return scanString(spell[PUBLIC], PUBLIC);
executed 386 times by 12 tests: return scanString(spell[PUBLIC], PUBLIC);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
386
1069 default:
executed 1864 times by 2 tests: default:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1864
1070 ;-
1071 }
executed 1864 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1864
1072 return false;
executed 1864 times by 2 tests: return false;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1864
1073}-
1074-
1075bool QXmlStreamReaderPrivate::scanNData()-
1076{-
1077 if (fastScanSpace()) {
fastScanSpace()Description
TRUEevaluated 150 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_QXmlStream
48-150
1078 if (scanString(spell[NDATA], NDATA))
scanString(spe...NDATA], NDATA)Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 103 times by 1 test
Evaluated by:
  • tst_QXmlStream
47-103
1079 return true;
executed 47 times by 1 test: return true;
Executed by:
  • tst_QXmlStream
47
1080 putChar(' ');-
1081 }
executed 103 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
103
1082 return false;
executed 151 times by 1 test: return false;
Executed by:
  • tst_QXmlStream
151
1083}-
1084-
1085bool QXmlStreamReaderPrivate::scanAfterDefaultDecl()-
1086{-
1087 switch (peekChar()) {-
1088 case 'R':
executed 615 times by 2 tests: case 'R':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
615
1089 return scanString(spell[REQUIRED], REQUIRED, false);
executed 615 times by 2 tests: return scanString(spell[REQUIRED], REQUIRED, false);
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
615
1090 case 'I':
executed 1387 times by 2 tests: case 'I':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1387
1091 return scanString(spell[IMPLIED], IMPLIED, false);
executed 1387 times by 2 tests: return scanString(spell[IMPLIED], IMPLIED, false);
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1387
1092 case 'F':
executed 77 times by 2 tests: case 'F':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
77
1093 return scanString(spell[FIXED], FIXED, false);
executed 77 times by 2 tests: return scanString(spell[FIXED], FIXED, false);
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
77
1094 default:
executed 200 times by 1 test: default:
Executed by:
  • tst_QXmlStream
200
1095 ;-
1096 }
executed 200 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
200
1097 return false;
executed 200 times by 1 test: return false;
Executed by:
  • tst_QXmlStream
200
1098}-
1099-
1100bool QXmlStreamReaderPrivate::scanAttType()-
1101{-
1102 switch (peekChar()) {-
1103 case 'C':
executed 1351 times by 2 tests: case 'C':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1351
1104 return scanString(spell[CDATA], CDATA);
executed 1351 times by 2 tests: return scanString(spell[CDATA], CDATA);
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
1351
1105 case 'I':
executed 272 times by 1 test: case 'I':
Executed by:
  • tst_QXmlStream
272
1106 if (scanString(spell[ID], ID))
scanString(spell[ID], ID)Description
TRUEevaluated 70 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 202 times by 1 test
Evaluated by:
  • tst_QXmlStream
70-202
1107 return true;
executed 70 times by 1 test: return true;
Executed by:
  • tst_QXmlStream
70
1108 if (scanString(spell[IDREF], IDREF))
scanString(spe...IDREF], IDREF)Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 179 times by 1 test
Evaluated by:
  • tst_QXmlStream
23-179
1109 return true;
executed 23 times by 1 test: return true;
Executed by:
  • tst_QXmlStream
23
1110 return scanString(spell[IDREFS], IDREFS);
executed 179 times by 1 test: return scanString(spell[IDREFS], IDREFS);
Executed by:
  • tst_QXmlStream
179
1111 case 'E':
executed 163 times by 1 test: case 'E':
Executed by:
  • tst_QXmlStream
163
1112 if (scanString(spell[ENTITY], ENTITY))
scanString(spe...TITY], ENTITY)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 137 times by 1 test
Evaluated by:
  • tst_QXmlStream
26-137
1113 return true;
executed 26 times by 1 test: return true;
Executed by:
  • tst_QXmlStream
26
1114 return scanString(spell[ENTITIES], ENTITIES);
executed 137 times by 1 test: return scanString(spell[ENTITIES], ENTITIES);
Executed by:
  • tst_QXmlStream
137
1115 case 'N':
executed 334 times by 1 test: case 'N':
Executed by:
  • tst_QXmlStream
334
1116 if (scanString(spell[NOTATION], NOTATION))
scanString(spe...ON], NOTATION)Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 292 times by 1 test
Evaluated by:
  • tst_QXmlStream
42-292
1117 return true;
executed 42 times by 1 test: return true;
Executed by:
  • tst_QXmlStream
42
1118 if (scanString(spell[NMTOKEN], NMTOKEN))
scanString(spe...KEN], NMTOKEN)Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 268 times by 1 test
Evaluated by:
  • tst_QXmlStream
24-268
1119 return true;
executed 24 times by 1 test: return true;
Executed by:
  • tst_QXmlStream
24
1120 return scanString(spell[NMTOKENS], NMTOKENS);
executed 268 times by 1 test: return scanString(spell[NMTOKENS], NMTOKENS);
Executed by:
  • tst_QXmlStream
268
1121 default:
executed 114 times by 2 tests: default:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
114
1122 ;-
1123 }
executed 114 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
114
1124 return false;
executed 114 times by 2 tests: return false;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
114
1125}-
1126-
1127/*!-
1128 \internal-
1129-
1130 Scan strings with quotes or apostrophes surround them. For instance,-
1131 attributes, the version and encoding field in the XML prolog and-
1132 entity declarations.-
1133-
1134 If normalizeLiterals is set to true, the function also normalizes-
1135 whitespace. It is set to true when the first start tag is-
1136 encountered.-
1137-
1138 */-
1139inline int QXmlStreamReaderPrivate::fastScanLiteralContent()-
1140{-
1141 int n = 0;-
1142 uint c;-
1143 while ((c = getChar()) != StreamEOF) {
(c = getChar()) != StreamEOFDescription
TRUEevaluated 1095169 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 2235 times by 1 test
Evaluated by:
  • tst_QXmlStream
2235-1095169
1144 switch (ushort(c)) {-
1145 case 0xfffe:
never executed: case 0xfffe:
0
1146 case 0xffff:
never executed: case 0xffff:
0
1147 case 0:
executed 82 times by 1 test: case 0:
Executed by:
  • tst_QXmlStream
82
1148 /* The putChar() call is necessary so the parser re-gets-
1149 * the character from the input source, when raising an error. */-
1150 putChar(c);-
1151 return n;
executed 82 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
82
1152 case '\r':
executed 24 times by 1 test: case '\r':
Executed by:
  • tst_QXmlStream
24
1153 if (filterCarriageReturn() == 0)
filterCarriageReturn() == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_QXmlStream
1-23
1154 return n;
executed 1 time by 1 test: return n;
Executed by:
  • tst_QXmlStream
1
1155 // fall through-
1156 case '\n':
code before this statement executed 23 times by 1 test: case '\n':
Executed by:
  • tst_QXmlStream
executed 478 times by 2 tests: case '\n':
Executed by:
  • tst_QXmlStream
  • tst_Selftests
23-478
1157 ++lineNumber;-
1158 lastLineStart = characterOffset + readBufferPos;-
1159 // fall through-
1160 case ' ':
code before this statement executed 501 times by 2 tests: case ' ':
Executed by:
  • tst_QXmlStream
  • tst_Selftests
executed 15480 times by 14 tests: case ' ':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
501-15480
1161 case '\t':
executed 18 times by 1 test: case '\t':
Executed by:
  • tst_QXmlStream
18
1162 if (normalizeLiterals)
normalizeLiteralsDescription
TRUEevaluated 14950 times by 4 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 1049 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
1049-14950
1163 textBuffer += QLatin1Char(' ');
executed 14950 times by 4 tests: textBuffer += QLatin1Char(' ');
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
14950
1164 else-
1165 textBuffer += QChar(c);
executed 1049 times by 12 tests: textBuffer += QChar(c);
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
1049
1166 ++n;-
1167 break;
executed 15999 times by 14 tests: break;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
15999
1168 case '&':
executed 1657 times by 4 tests: case '&':
Executed by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
1657
1169 case '<':
executed 19 times by 1 test: case '<':
Executed by:
  • tst_QXmlStream
19
1170 case '\"':
executed 244773 times by 15 tests: case '\"':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
244773
1171 case '\'':
executed 245 times by 2 tests: case '\'':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
245
1172 if (!(c & 0xff0000)) {
!(c & 0xff0000)Description
TRUEevaluated 246694 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-246694
1173 putChar(c);-
1174 return n;
executed 246694 times by 15 tests: return n;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
246694
1175 }-
1176 // fall through-
1177 default:
code before this statement never executed: default:
executed 832393 times by 15 tests: default:
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-832393
1178 if (c < 0x20) {
c < 0x20Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 832390 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
3-832390
1179 putChar(c);-
1180 return n;
executed 3 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
3
1181 }-
1182 textBuffer += QChar(c);-
1183 ++n;-
1184 }
executed 832390 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
832390
1185 }-
1186 return n;
executed 2235 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
2235
1187}-
1188-
1189inline int QXmlStreamReaderPrivate::fastScanSpace()-
1190{-
1191 int n = 0;-
1192 uint c;-
1193 while ((c = getChar()) != StreamEOF) {
(c = getChar()) != StreamEOFDescription
TRUEevaluated 309203 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 6683 times by 1 test
Evaluated by:
  • tst_QXmlStream
6683-309203
1194 switch (c) {-
1195 case '\r':
executed 323 times by 1 test: case '\r':
Executed by:
  • tst_QXmlStream
323
1196 if ((c = filterCarriageReturn()) == 0)
(c = filterCar...Return()) == 0Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 278 times by 1 test
Evaluated by:
  • tst_QXmlStream
45-278
1197 return n;
executed 45 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
45
1198 // fall through-
1199 case '\n':
code before this statement executed 278 times by 1 test: case '\n':
Executed by:
  • tst_QXmlStream
executed 135 times by 2 tests: case '\n':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
135-278
1200 ++lineNumber;-
1201 lastLineStart = characterOffset + readBufferPos;-
1202 // fall through-
1203 case ' ':
code before this statement executed 413 times by 2 tests: case ' ':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
executed 14003 times by 14 tests: case ' ':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
413-14003
1204 case '\t':
executed 562 times by 1 test: case '\t':
Executed by:
  • tst_QXmlStream
562
1205 textBuffer += QChar(c);-
1206 ++n;-
1207 break;
executed 14978 times by 14 tests: break;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
14978
1208 default:
executed 294180 times by 15 tests: default:
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
294180
1209 putChar(c);-
1210 return n;
executed 294180 times by 15 tests: return n;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
294180
1211 }-
1212 }-
1213 return n;
executed 6683 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
6683
1214}-
1215-
1216/*!-
1217 \internal-
1218-
1219 Used for text nodes essentially. That is, characters appearing-
1220 inside elements.-
1221 */-
1222inline int QXmlStreamReaderPrivate::fastScanContentCharList()-
1223{-
1224 int n = 0;-
1225 uint c;-
1226 while ((c = getChar()) != StreamEOF) {
(c = getChar()) != StreamEOFDescription
TRUEevaluated 3619062 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 8002 times by 1 test
Evaluated by:
  • tst_QXmlStream
8002-3619062
1227 switch (ushort(c)) {-
1228 case 0xfffe:
never executed: case 0xfffe:
0
1229 case 0xffff:
executed 1 time by 1 test: case 0xffff:
Executed by:
  • tst_QXmlStream
1
1230 case 0:
executed 60 times by 1 test: case 0:
Executed by:
  • tst_QXmlStream
60
1231 putChar(c);-
1232 return n;
executed 61 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
61
1233 case ']': {
executed 17 times by 1 test: case ']':
Executed by:
  • tst_QXmlStream
17
1234 isWhitespace = false;-
1235 int pos = textBuffer.size();-
1236 textBuffer += QChar(ushort(c));-
1237 ++n;-
1238 while ((c = getChar()) == ']') {
(c = getChar()) == ']'Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QXmlStream
11-17
1239 textBuffer += QChar(ushort(c));-
1240 ++n;-
1241 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
11
1242 if (c == 0) {
c == 0Description
TRUEnever evaluated
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-17
1243 putString(textBuffer, pos);-
1244 textBuffer.resize(pos);-
1245 } else if (c == '>' && textBuffer.at(textBuffer.size()-2) == QLatin1Char(']')) {
never executed: end of block
c == '>'Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QXmlStream
textBuffer.at(...atin1Char(']')Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
0-9
1246 raiseWellFormedError(QXmlStream::tr("Sequence ']]>' not allowed in content."));-
1247 } else {
executed 8 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
8
1248 putChar(c);-
1249 break;
executed 9 times by 1 test: break;
Executed by:
  • tst_QXmlStream
9
1250 }-
1251 return n;
executed 8 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
8
1252 } break;
dead code: break;
-
1253 case '\r':
executed 389 times by 1 test: case '\r':
Executed by:
  • tst_QXmlStream
389
1254 if ((c = filterCarriageReturn()) == 0)
(c = filterCar...Return()) == 0Description
TRUEevaluated 127 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 262 times by 1 test
Evaluated by:
  • tst_QXmlStream
127-262
1255 return n;
executed 127 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
127
1256 // fall through-
1257 case '\n':
code before this statement executed 262 times by 1 test: case '\n':
Executed by:
  • tst_QXmlStream
executed 439 times by 3 tests: case '\n':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
262-439
1258 ++lineNumber;-
1259 lastLineStart = characterOffset + readBufferPos;-
1260 // fall through-
1261 case ' ':
code before this statement executed 701 times by 3 tests: case ' ':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
executed 1097530 times by 13 tests: case ' ':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
701-1097530
1262 case '\t':
never executed: case '\t':
0
1263 textBuffer += QChar(ushort(c));-
1264 ++n;-
1265 break;
executed 1098231 times by 13 tests: break;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1098231
1266 case '&':
executed 967 times by 2 tests: case '&':
Executed by:
  • tst_QXmlStream
  • tst_Selftests
967
1267 case '<':
executed 440423 times by 13 tests: case '<':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
440423
1268 if (!(c & 0xff0000)) {
!(c & 0xff0000)Description
TRUEevaluated 441390 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-441390
1269 putChar(c);-
1270 return n;
executed 441390 times by 13 tests: return n;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
441390
1271 }-
1272 // fall through-
1273 default:
code before this statement never executed: default:
executed 2079236 times by 3 tests: default:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
0-2079236
1274 if (c < 0x20) {
c < 0x20Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2079231 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
5-2079231
1275 putChar(c);-
1276 return n;
executed 5 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
5
1277 }-
1278 isWhitespace = false;-
1279 textBuffer += QChar(ushort(c));-
1280 ++n;-
1281 }
executed 2079231 times by 3 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
2079231
1282 }-
1283 return n;
executed 8002 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
8002
1284}-
1285-
1286inline int QXmlStreamReaderPrivate::fastScanName(int *prefix)-
1287{-
1288 int n = 0;-
1289 uint c;-
1290 while ((c = getChar()) != StreamEOF) {
(c = getChar()) != StreamEOFDescription
TRUEevaluated 5104556 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 9761 times by 1 test
Evaluated by:
  • tst_QXmlStream
9761-5104556
1291 switch (c) {-
1292 case '\n':
executed 46 times by 1 test: case '\n':
Executed by:
  • tst_QXmlStream
46
1293 case ' ':
executed 199582 times by 15 tests: case ' ':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
199582
1294 case '\t':
executed 63 times by 1 test: case '\t':
Executed by:
  • tst_QXmlStream
63
1295 case '\r':
executed 300 times by 1 test: case '\r':
Executed by:
  • tst_QXmlStream
300
1296 case '&':
executed 1 time by 1 test: case '&':
Executed by:
  • tst_QXmlStream
1
1297 case '#':
executed 1 time by 1 test: case '#':
Executed by:
  • tst_QXmlStream
1
1298 case '\'':
executed 1 time by 1 test: case '\'':
Executed by:
  • tst_QXmlStream
1
1299 case '\"':
executed 13 times by 1 test: case '\"':
Executed by:
  • tst_QXmlStream
13
1300 case '<':
executed 2 times by 1 test: case '<':
Executed by:
  • tst_QXmlStream
2
1301 case '>':
executed 251479 times by 15 tests: case '>':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
251479
1302 case '[':
executed 1 time by 1 test: case '[':
Executed by:
  • tst_QXmlStream
1
1303 case ']':
executed 2 times by 1 test: case ']':
Executed by:
  • tst_QXmlStream
2
1304 case '=':
executed 270432 times by 15 tests: case '=':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
270432
1305 case '%':
never executed: case '%':
0
1306 case '/':
executed 374 times by 4 tests: case '/':
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
374
1307 case ';':
executed 2130 times by 4 tests: case ';':
Executed by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
2130
1308 case '?':
executed 61 times by 2 tests: case '?':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
61
1309 case '!':
executed 2 times by 1 test: case '!':
Executed by:
  • tst_QXmlStream
2
1310 case '^':
executed 2 times by 1 test: case '^':
Executed by:
  • tst_QXmlStream
2
1311 case '|':
executed 102 times by 1 test: case '|':
Executed by:
  • tst_QXmlStream
102
1312 case ',':
executed 97 times by 2 tests: case ',':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
97
1313 case '(':
executed 7 times by 1 test: case '(':
Executed by:
  • tst_QXmlStream
7
1314 case ')':
executed 227 times by 2 tests: case ')':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
227
1315 case '+':
executed 14 times by 2 tests: case '+':
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
14
1316 case '*':
executed 31 times by 1 test: case '*':
Executed by:
  • tst_QXmlStream
31
1317 putChar(c);-
1318 if (prefix && *prefix == n+1) {
prefixDescription
TRUEevaluated 721747 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 3223 times by 4 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
*prefix == n+1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 721743 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
4-721747
1319 *prefix = 0;-
1320 putChar(':');-
1321 --n;-
1322 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
4
1323 return n;
executed 724970 times by 15 tests: return n;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
724970
1324 case ':':
executed 132009 times by 3 tests: case ':':
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
132009
1325 if (prefix) {
prefixDescription
TRUEevaluated 132002 times by 3 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
7-132002
1326 if (*prefix == 0) {
*prefix == 0Description
TRUEevaluated 132000 times by 3 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-132000
1327 *prefix = n+2;-
1328 } else { // only one colon allowed according to the namespace spec.
executed 132000 times by 3 tests: end of block
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
132000
1329 putChar(c);-
1330 return n;
executed 2 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
2
1331 }-
1332 } else {-
1333 putChar(c);-
1334 return n;
executed 7 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
7
1335 }-
1336 // fall through-
1337 default:
code before this statement executed 132000 times by 3 tests: default:
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
executed 4247577 times by 15 tests: default:
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
132000-4247577
1338 textBuffer += QChar(c);-
1339 ++n;-
1340 }
executed 4379577 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
4379577
1341 }-
1342-
1343 if (prefix)
prefixDescription
TRUEevaluated 8770 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 991 times by 1 test
Evaluated by:
  • tst_QXmlStream
991-8770
1344 *prefix = 0;
executed 8770 times by 1 test: *prefix = 0;
Executed by:
  • tst_QXmlStream
8770
1345 int pos = textBuffer.size() - n;-
1346 putString(textBuffer, pos);-
1347 textBuffer.resize(pos);-
1348 return 0;
executed 9761 times by 1 test: return 0;
Executed by:
  • tst_QXmlStream
9761
1349}-
1350-
1351enum NameChar { NameBeginning, NameNotBeginning, NotName };-
1352-
1353static const char Begi = static_cast<char>(NameBeginning);-
1354static const char NtBg = static_cast<char>(NameNotBeginning);-
1355static const char NotN = static_cast<char>(NotName);-
1356-
1357static const char nameCharTable[128] =-
1358{-
1359// 0x00-
1360 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
1361 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
1362// 0x10-
1363 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
1364 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
1365// 0x20 (0x2D is '-', 0x2E is '.')-
1366 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
1367 NotN, NotN, NotN, NotN, NotN, NtBg, NtBg, NotN,-
1368// 0x30 (0x30..0x39 are '0'..'9', 0x3A is ':')-
1369 NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg,-
1370 NtBg, NtBg, Begi, NotN, NotN, NotN, NotN, NotN,-
1371// 0x40 (0x41..0x5A are 'A'..'Z')-
1372 NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
1373 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
1374// 0x50 (0x5F is '_')-
1375 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
1376 Begi, Begi, Begi, NotN, NotN, NotN, NotN, Begi,-
1377// 0x60 (0x61..0x7A are 'a'..'z')-
1378 NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
1379 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
1380// 0x70-
1381 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
1382 Begi, Begi, Begi, NotN, NotN, NotN, NotN, NotN-
1383};-
1384-
1385static inline NameChar fastDetermineNameChar(QChar ch)-
1386{-
1387 ushort uc = ch.unicode();-
1388 if (!(uc & ~0x7f)) // uc < 128
!(uc & ~0x7f)Description
TRUEevaluated 2874 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEnever evaluated
0-2874
1389 return static_cast<NameChar>(nameCharTable[uc]);
executed 2874 times by 2 tests: return static_cast<NameChar>(nameCharTable[uc]);
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
2874
1390-
1391 QChar::Category cat = ch.category();-
1392 // ### some these categories might be slightly wrong-
1393 if ((cat >= QChar::Letter_Uppercase && cat <= QChar::Letter_Other)
cat >= QChar::Letter_UppercaseDescription
TRUEnever evaluated
FALSEnever evaluated
cat <= QChar::Letter_OtherDescription
TRUEnever evaluated
FALSEnever evaluated
0
1394 || cat == QChar::Number_Letter)
cat == QChar::Number_LetterDescription
TRUEnever evaluated
FALSEnever evaluated
0
1395 return NameBeginning;
never executed: return NameBeginning;
0
1396 if ((cat >= QChar::Number_DecimalDigit && cat <= QChar::Number_Other)
cat >= QChar::...r_DecimalDigitDescription
TRUEnever evaluated
FALSEnever evaluated
cat <= QChar::Number_OtherDescription
TRUEnever evaluated
FALSEnever evaluated
0
1397 || (cat >= QChar::Mark_NonSpacing && cat <= QChar::Mark_Enclosing))
cat >= QChar::Mark_NonSpacingDescription
TRUEnever evaluated
FALSEnever evaluated
cat <= QChar::Mark_EnclosingDescription
TRUEnever evaluated
FALSEnever evaluated
0
1398 return NameNotBeginning;
never executed: return NameNotBeginning;
0
1399 return NotName;
never executed: return NotName;
0
1400}-
1401-
1402inline int QXmlStreamReaderPrivate::fastScanNMTOKEN()-
1403{-
1404 int n = 0;-
1405 uint c;-
1406 while ((c = getChar()) != StreamEOF) {
(c = getChar()) != StreamEOFDescription
TRUEevaluated 2874 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 229 times by 1 test
Evaluated by:
  • tst_QXmlStream
229-2874
1407 if (fastDetermineNameChar(c) == NotName) {
fastDetermineN...(c) == NotNameDescription
TRUEevaluated 350 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 2524 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
350-2524
1408 putChar(c);-
1409 return n;
executed 350 times by 2 tests: return n;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
350
1410 } else {-
1411 ++n;-
1412 textBuffer += QChar(c);-
1413 }
executed 2524 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
2524
1414 }-
1415-
1416 int pos = textBuffer.size() - n;-
1417 putString(textBuffer, pos);-
1418 textBuffer.resize(pos);-
1419-
1420 return n;
executed 229 times by 1 test: return n;
Executed by:
  • tst_QXmlStream
229
1421}-
1422-
1423void QXmlStreamReaderPrivate::putString(const QString &s, int from)-
1424{-
1425 putStack.reserve(s.size());-
1426 for (int i = s.size()-1; i >= from; --i)
i >= fromDescription
TRUEevaluated 205554 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 18909 times by 1 test
Evaluated by:
  • tst_QXmlStream
18909-205554
1427 putStack.rawPush() = s.at(i).unicode();
executed 205554 times by 1 test: putStack.rawPush() = s.at(i).unicode();
Executed by:
  • tst_QXmlStream
205554
1428}
executed 18909 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
18909
1429-
1430void QXmlStreamReaderPrivate::putStringLiteral(const QString &s)-
1431{-
1432 putStack.reserve(s.size());-
1433 for (int i = s.size()-1; i >= 0; --i)
i >= 0Description
TRUEevaluated 1805 times by 4 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 1792 times by 4 tests
Evaluated by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
1792-1805
1434 putStack.rawPush() = ((LETTER << 16) | s.at(i).unicode());
executed 1805 times by 4 tests: putStack.rawPush() = ((LETTER << 16) | s.at(i).unicode());
Executed by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
1805
1435}
executed 1792 times by 4 tests: end of block
Executed by:
  • tst_QDBusInterface
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
1792
1436-
1437void QXmlStreamReaderPrivate::putReplacement(const QString &s)-
1438{-
1439 putStack.reserve(s.size());-
1440 for (int i = s.size()-1; i >= 0; --i) {
i >= 0Description
TRUEevaluated 1077 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 117 times by 1 test
Evaluated by:
  • tst_QXmlStream
117-1077
1441 ushort c = s.at(i).unicode();-
1442 if (c == '\n' || c == '\r')
c == '\n'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1075 times by 1 test
Evaluated by:
  • tst_QXmlStream
c == '\r'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1073 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-1075
1443 putStack.rawPush() = ((LETTER << 16) | c);
executed 4 times by 1 test: putStack.rawPush() = ((LETTER << 16) | c);
Executed by:
  • tst_QXmlStream
4
1444 else-
1445 putStack.rawPush() = c;
executed 1073 times by 1 test: putStack.rawPush() = c;
Executed by:
  • tst_QXmlStream
1073
1446 }-
1447}
executed 117 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
117
1448void QXmlStreamReaderPrivate::putReplacementInAttributeValue(const QString &s)-
1449{-
1450 putStack.reserve(s.size());-
1451 for (int i = s.size()-1; i >= 0; --i) {
i >= 0Description
TRUEevaluated 990 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 98 times by 1 test
Evaluated by:
  • tst_QXmlStream
98-990
1452 ushort c = s.at(i).unicode();-
1453 if (c == '&' || c == ';')
c == '&'Description
TRUEevaluated 49 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 941 times by 1 test
Evaluated by:
  • tst_QXmlStream
c == ';'Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 881 times by 1 test
Evaluated by:
  • tst_QXmlStream
49-941
1454 putStack.rawPush() = c;
executed 109 times by 1 test: putStack.rawPush() = c;
Executed by:
  • tst_QXmlStream
109
1455 else if (c == '\n' || c == '\r')
c == '\n'Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 877 times by 1 test
Evaluated by:
  • tst_QXmlStream
c == '\r'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 875 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-877
1456 putStack.rawPush() = ' ';
executed 6 times by 1 test: putStack.rawPush() = ' ';
Executed by:
  • tst_QXmlStream
6
1457 else-
1458 putStack.rawPush() = ((LETTER << 16) | c);
executed 875 times by 1 test: putStack.rawPush() = ((LETTER << 16) | c);
Executed by:
  • tst_QXmlStream
875
1459 }-
1460}
executed 98 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
98
1461-
1462uint QXmlStreamReaderPrivate::getChar_helper()-
1463{-
1464 const int BUFFER_SIZE = 8192;-
1465 characterOffset += readBufferPos;-
1466 readBufferPos = 0;-
1467 readBuffer.resize(0);-
1468#ifndef QT_NO_TEXTCODEC-
1469 if (decoder)
decoderDescription
TRUEevaluated 116020 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 5317 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
5317-116020
1470#endif-
1471 nbytesread = 0;
executed 116020 times by 15 tests: nbytesread = 0;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
116020
1472 if (device) {
deviceDescription
TRUEevaluated 3400 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 117937 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
3400-117937
1473 rawReadBuffer.resize(BUFFER_SIZE);-
1474 int nbytesreadOrMinus1 = device->read(rawReadBuffer.data() + nbytesread, BUFFER_SIZE - nbytesread);-
1475 nbytesread += qMax(nbytesreadOrMinus1, 0);-
1476 } else {
executed 3400 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
3400
1477 if (nbytesread)
nbytesreadDescription
TRUEevaluated 780 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 117157 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
780-117157
1478 rawReadBuffer += dataBuffer;
executed 780 times by 1 test: rawReadBuffer += dataBuffer;
Executed by:
  • tst_QXmlStream
780
1479 else-
1480 rawReadBuffer = dataBuffer;
executed 117157 times by 14 tests: rawReadBuffer = dataBuffer;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
117157
1481 nbytesread = rawReadBuffer.size();-
1482 dataBuffer.clear();-
1483 }
executed 117937 times by 14 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
117937
1484 if (!nbytesread) {
!nbytesreadDescription
TRUEevaluated 59780 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 61557 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
59780-61557
1485 atEnd = true;-
1486 return StreamEOF;
executed 59780 times by 15 tests: return StreamEOF;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
59780
1487 }-
1488-
1489#ifndef QT_NO_TEXTCODEC-
1490 if (!decoder) {
!decoderDescription
TRUEevaluated 3679 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 57878 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
3679-57878
1491 if (nbytesread < 4) { // the 4 is to cover 0xef 0xbb 0xbf plus
nbytesread < 4Description
TRUEevaluated 782 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2897 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
782-2897
1492 // one extra for the utf8 codec-
1493 atEnd = true;-
1494 return StreamEOF;
executed 782 times by 1 test: return StreamEOF;
Executed by:
  • tst_QXmlStream
782
1495 }-
1496 int mib = 106; // UTF-8-
1497-
1498 // look for byte order mark-
1499 uchar ch1 = rawReadBuffer.at(0);-
1500 uchar ch2 = rawReadBuffer.at(1);-
1501 uchar ch3 = rawReadBuffer.at(2);-
1502 uchar ch4 = rawReadBuffer.at(3);-
1503-
1504 if ((ch1 == 0 && ch2 == 0 && ch3 == 0xfe && ch4 == 0xff) ||
ch1 == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2896 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch2 == 0Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
ch3 == 0xfeDescription
TRUEnever evaluated
FALSEnever evaluated
ch4 == 0xffDescription
TRUEnever evaluated
FALSEnever evaluated
0-2896
1505 (ch1 == 0xff && ch2 == 0xfe && ch3 == 0 && ch4 == 0))
ch1 == 0xffDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2857 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch2 == 0xfeDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
ch3 == 0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_QXmlStream
ch4 == 0Description
TRUEnever evaluated
FALSEnever evaluated
0-2857
1506 mib = 1017; // UTF-32 with byte order mark
never executed: mib = 1017;
0
1507 else if (ch1 == 0x3c && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x00)
ch1 == 0x3cDescription
TRUEevaluated 2819 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_QXmlStream
ch2 == 0x00Description
TRUEnever evaluated
FALSEevaluated 2819 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch3 == 0x00Description
TRUEnever evaluated
FALSEnever evaluated
ch4 == 0x00Description
TRUEnever evaluated
FALSEnever evaluated
0-2819
1508 mib = 1019; // UTF-32LE
never executed: mib = 1019;
0
1509 else if (ch1 == 0x00 && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x3c)
ch1 == 0x00Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2896 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch2 == 0x00Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
ch3 == 0x00Description
TRUEnever evaluated
FALSEnever evaluated
ch4 == 0x3cDescription
TRUEnever evaluated
FALSEnever evaluated
0-2896
1510 mib = 1018; // UTF-32BE
never executed: mib = 1018;
0
1511 else if ((ch1 == 0xfe && ch2 == 0xff) || (ch1 == 0xff && ch2 == 0xfe))
ch1 == 0xfeDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2896 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch2 == 0xffDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
ch1 == 0xffDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2856 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch2 == 0xfeDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-2896
1512 mib = 1015; // UTF-16 with byte order mark
executed 41 times by 1 test: mib = 1015;
Executed by:
  • tst_QXmlStream
41
1513 else if (ch1 == 0x3c && ch2 == 0x00)
ch1 == 0x3cDescription
TRUEevaluated 2819 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 37 times by 1 test
Evaluated by:
  • tst_QXmlStream
ch2 == 0x00Description
TRUEnever evaluated
FALSEevaluated 2819 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
0-2819
1514 mib = 1014; // UTF-16LE
never executed: mib = 1014;
0
1515 else if (ch1 == 0x00 && ch2 == 0x3c)
ch1 == 0x00Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2855 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
ch2 == 0x3cDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-2855
1516 mib = 1013; // UTF-16BE
executed 1 time by 1 test: mib = 1013;
Executed by:
  • tst_QXmlStream
1
1517 codec = QTextCodec::codecForMib(mib);-
1518 Q_ASSERT(codec);-
1519 decoder = codec->makeDecoder();-
1520 }
executed 2897 times by 3 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
2897
1521-
1522 decoder->toUnicode(&readBuffer, rawReadBuffer.constData(), nbytesread);-
1523-
1524 if(lockEncoding && decoder->hasFailure()) {
lockEncodingDescription
TRUEevaluated 55226 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 5549 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
decoder->hasFailure()Description
TRUEnever evaluated
FALSEevaluated 55226 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
0-55226
1525 raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content."));-
1526 readBuffer.clear();-
1527 return StreamEOF;
never executed: return StreamEOF;
0
1528 }-
1529#else-
1530 readBuffer = QString::fromLatin1(rawReadBuffer.data(), nbytesread);-
1531#endif // QT_NO_TEXTCODEC-
1532-
1533 readBuffer.reserve(1); // keep capacity when calling resize() next time-
1534-
1535 if (readBufferPos < readBuffer.size()) {
readBufferPos ...dBuffer.size()Description
TRUEevaluated 60532 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 243 times by 1 test
Evaluated by:
  • tst_QXmlStream
243-60532
1536 ushort c = readBuffer.at(readBufferPos++).unicode();-
1537 return c;
executed 60532 times by 15 tests: return c;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
60532
1538 }-
1539-
1540 atEnd = true;-
1541 return StreamEOF;
executed 243 times by 1 test: return StreamEOF;
Executed by:
  • tst_QXmlStream
243
1542}-
1543-
1544QStringRef QXmlStreamReaderPrivate::namespaceForPrefix(const QStringRef &prefix)-
1545{-
1546 for (int j = namespaceDeclarations.size() - 1; j >= 0; --j) {
j >= 0Description
TRUEevaluated 627652 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 78422 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
78422-627652
1547 const NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(j);-
1548 if (namespaceDeclaration.prefix == prefix) {
namespaceDecla...efix == prefixDescription
TRUEevaluated 286132 times by 3 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 341520 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
286132-341520
1549 return namespaceDeclaration.namespaceUri;
executed 286132 times by 3 tests: return namespaceDeclaration.namespaceUri;
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
286132
1550 }-
1551 }
executed 341520 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
341520
1552-
1553#if 1-
1554 if (namespaceProcessing && !prefix.isEmpty())
namespaceProcessingDescription
TRUEevaluated 78422 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
!prefix.isEmpty()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 78416 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-78422
1555 raiseWellFormedError(QXmlStream::tr("Namespace prefix '%1' not declared").arg(prefix.toString()));
executed 6 times by 1 test: raiseWellFormedError(QXmlStream::tr("Namespace prefix '%1' not declared").arg(prefix.toString()));
Executed by:
  • tst_QXmlStream
6
1556#endif-
1557-
1558 return QStringRef();
executed 78422 times by 14 tests: return QStringRef();
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
78422
1559}-
1560-
1561/*-
1562 uses namespaceForPrefix and builds the attribute vector-
1563 */-
1564void QXmlStreamReaderPrivate::resolveTag()-
1565{-
1566 int n = attributeStack.size();-
1567-
1568 if (namespaceProcessing) {
namespaceProcessingDescription
TRUEevaluated 232942 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-232942
1569 for (int a = 0; a < dtdAttributes.size(); ++a) {
a < dtdAttributes.size()Description
TRUEevaluated 3832797 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 232942 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
232942-3832797
1570 DtdAttribute &dtdAttribute = dtdAttributes[a];-
1571 if (!dtdAttribute.isNamespaceAttribute
!dtdAttribute....spaceAttributeDescription
TRUEevaluated 3679128 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 153669 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
153669-3679128
1572 || dtdAttribute.defaultValue.isNull()
dtdAttribute.d...Value.isNull()Description
TRUEevaluated 91 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 153578 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
91-153578
1573 || dtdAttribute.tagName != qualifiedName
dtdAttribute.t... qualifiedNameDescription
TRUEevaluated 153569 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
9-153569
1574 || dtdAttribute.attributeQualifiedName.isNull())
dtdAttribute.a...dName.isNull()Description
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
0-9
1575 continue;
executed 3832788 times by 2 tests: continue;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
3832788
1576 int i = 0;-
1577 while (i < n && symName(attributeStack[i].key) != dtdAttribute.attributeQualifiedName)
i < nDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
symName(attrib...eQualifiedNameDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-9
1578 ++i;
executed 3 times by 1 test: ++i;
Executed by:
  • tst_QXmlStream
3
1579 if (i != n)
i != nDescription
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
0-9
1580 continue;
never executed: continue;
0
1581 if (dtdAttribute.attributePrefix.isEmpty() && dtdAttribute.attributeName == QLatin1String("xmlns")) {
dtdAttribute.a...efix.isEmpty()Description
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
dtdAttribute.a...tring("xmlns")Description
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEnever evaluated
0-7
1582 NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();-
1583 namespaceDeclaration.prefix.clear();-
1584-
1585 const QStringRef ns(dtdAttribute.defaultValue);-
1586 if(ns == QLatin1String("http://www.w3.org/2000/xmlns/") ||
ns == QLatin1S.../2000/xmlns/")Description
TRUEnever evaluated
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
0-7
1587 ns == QLatin1String("http://www.w3.org/XML/1998/namespace"))
ns == QLatin1S...98/namespace")Description
TRUEnever evaluated
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
0-7
1588 raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration."));
never executed: raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration."));
0
1589 else-
1590 namespaceDeclaration.namespaceUri = ns;
executed 7 times by 2 tests: namespaceDeclaration.namespaceUri = ns;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
7
1591 } else if (dtdAttribute.attributePrefix == QLatin1String("xmlns")) {
dtdAttribute.a...tring("xmlns")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-2
1592 NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();-
1593 QStringRef namespacePrefix = dtdAttribute.attributeName;-
1594 QStringRef namespaceUri = dtdAttribute.defaultValue;-
1595 if (((namespacePrefix == QLatin1String("xml"))
((namespacePre.../namespace")))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-2
1596 ^ (namespaceUri == QLatin1String("http://www.w3.org/XML/1998/namespace")))
((namespacePre.../namespace")))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-2
1597 || namespaceUri == QLatin1String("http://www.w3.org/2000/xmlns/")
namespaceUri =.../2000/xmlns/")Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-2
1598 || namespaceUri.isEmpty()
namespaceUri.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-2
1599 || namespacePrefix == QLatin1String("xmlns"))
namespacePrefi...tring("xmlns")Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-2
1600 raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration."));
never executed: raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration."));
0
1601-
1602 namespaceDeclaration.prefix = namespacePrefix;-
1603 namespaceDeclaration.namespaceUri = namespaceUri;-
1604 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2
1605 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
9
1606 }
executed 232942 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
232942
1607-
1608 tagStack.top().namespaceDeclaration.namespaceUri = namespaceUri = namespaceForPrefix(prefix);-
1609-
1610 attributes.resize(n);-
1611-
1612 for (int i = 0; i < n; ++i) {
i < nDescription
TRUEevaluated 269638 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 232942 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
232942-269638
1613 QXmlStreamAttribute &attribute = attributes[i];-
1614 Attribute &attrib = attributeStack[i];-
1615 QStringRef prefix(symPrefix(attrib.key));-
1616 QStringRef name(symString(attrib.key));-
1617 QStringRef qualifiedName(symName(attrib.key));-
1618 QStringRef value(symString(attrib.value));-
1619-
1620 attribute.m_name = QXmlStreamStringRef(name);-
1621 attribute.m_qualifiedName = QXmlStreamStringRef(qualifiedName);-
1622 attribute.m_value = QXmlStreamStringRef(value);-
1623-
1624 if (!prefix.isEmpty()) {
!prefix.isEmpty()Description
TRUEevaluated 131612 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 138026 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
131612-138026
1625 QStringRef attributeNamespaceUri = namespaceForPrefix(prefix);-
1626 attribute.m_namespaceUri = QXmlStreamStringRef(attributeNamespaceUri);-
1627 }
executed 131612 times by 2 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
131612
1628-
1629 for (int j = 0; j < i; ++j) {
j < iDescription
TRUEevaluated 114354 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 269638 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
114354-269638
1630 if (attributes[j].name() == attribute.name()
attributes[j]....tribute.name()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 114316 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
38-114316
1631 && attributes[j].namespaceUri() == attribute.namespaceUri()
attributes[j]....namespaceUri()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QXmlStream
16-22
1632 && (namespaceProcessing || attributes[j].qualifiedName() == attribute.qualifiedName()))
namespaceProcessingDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
attributes[j]....ualifiedName()Description
TRUEnever evaluated
FALSEnever evaluated
0-16
1633 raiseWellFormedError(QXmlStream::tr("Attribute '%1' redefined.").arg(attribute.qualifiedName().toString()));
executed 16 times by 1 test: raiseWellFormedError(QXmlStream::tr("Attribute '%1' redefined.").arg(attribute.qualifiedName().toString()));
Executed by:
  • tst_QXmlStream
16
1634 }
executed 114354 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
114354
1635 }
executed 269638 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
269638
1636-
1637 for (int a = 0; a < dtdAttributes.size(); ++a) {
a < dtdAttributes.size()Description
TRUEevaluated 3832797 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 232942 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
232942-3832797
1638 DtdAttribute &dtdAttribute = dtdAttributes[a];-
1639 if (dtdAttribute.isNamespaceAttribute
dtdAttribute.i...spaceAttributeDescription
TRUEevaluated 153669 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 3679128 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
153669-3679128
1640 || dtdAttribute.defaultValue.isNull()
dtdAttribute.d...Value.isNull()Description
TRUEevaluated 3678960 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEevaluated 168 times by 1 test
Evaluated by:
  • tst_QXmlStream
168-3678960
1641 || dtdAttribute.tagName != qualifiedName
dtdAttribute.t... qualifiedNameDescription
TRUEevaluated 75 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 93 times by 1 test
Evaluated by:
  • tst_QXmlStream
75-93
1642 || dtdAttribute.attributeQualifiedName.isNull())
dtdAttribute.a...dName.isNull()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 91 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-91
1643 continue;
executed 3832706 times by 2 tests: continue;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
3832706
1644 int i = 0;-
1645 while (i < n && symName(attributeStack[i].key) != dtdAttribute.attributeQualifiedName)
i < nDescription
TRUEevaluated 117 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_QXmlStream
symName(attrib...eQualifiedNameDescription
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 55 times by 1 test
Evaluated by:
  • tst_QXmlStream
36-117
1646 ++i;
executed 62 times by 1 test: ++i;
Executed by:
  • tst_QXmlStream
62
1647 if (i != n)
i != nDescription
TRUEevaluated 55 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_QXmlStream
36-55
1648 continue;
executed 55 times by 1 test: continue;
Executed by:
  • tst_QXmlStream
55
1649-
1650-
1651-
1652 QXmlStreamAttribute attribute;-
1653 attribute.m_name = QXmlStreamStringRef(dtdAttribute.attributeName);-
1654 attribute.m_qualifiedName = QXmlStreamStringRef(dtdAttribute.attributeQualifiedName);-
1655 attribute.m_value = QXmlStreamStringRef(dtdAttribute.defaultValue);-
1656-
1657 if (!dtdAttribute.attributePrefix.isEmpty()) {
!dtdAttribute....efix.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 36 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-36
1658 QStringRef attributeNamespaceUri = namespaceForPrefix(dtdAttribute.attributePrefix);-
1659 attribute.m_namespaceUri = QXmlStreamStringRef(attributeNamespaceUri);-
1660 }
never executed: end of block
0
1661 attribute.m_isDefault = true;-
1662 attributes.append(attribute);-
1663 }
executed 36 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
36
1664-
1665 attributeStack.clear();-
1666}
executed 232942 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
232942
1667-
1668void QXmlStreamReaderPrivate::resolvePublicNamespaces()-
1669{-
1670 const Tag &tag = tagStack.top();-
1671 int n = namespaceDeclarations.size() - tag.namespaceDeclarationsSize;-
1672 publicNamespaceDeclarations.resize(n);-
1673 for (int i = 0; i < n; ++i) {
i < nDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 446 times by 1 test
Evaluated by:
  • tst_QXmlStream
54-446
1674 const NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(tag.namespaceDeclarationsSize + i);-
1675 QXmlStreamNamespaceDeclaration &publicNamespaceDeclaration = publicNamespaceDeclarations[i];-
1676 publicNamespaceDeclaration.m_prefix = QXmlStreamStringRef(namespaceDeclaration.prefix);-
1677 publicNamespaceDeclaration.m_namespaceUri = QXmlStreamStringRef(namespaceDeclaration.namespaceUri);-
1678 }
executed 54 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
54
1679}
executed 446 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
446
1680-
1681void QXmlStreamReaderPrivate::resolveDtd()-
1682{-
1683 publicNotationDeclarations.resize(notationDeclarations.size());-
1684 for (int i = 0; i < notationDeclarations.size(); ++i) {
i < notationDe...rations.size()Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QXmlStream
52-79
1685 const QXmlStreamReaderPrivate::NotationDeclaration &notationDeclaration = notationDeclarations.at(i);-
1686 QXmlStreamNotationDeclaration &publicNotationDeclaration = publicNotationDeclarations[i];-
1687 publicNotationDeclaration.m_name = QXmlStreamStringRef(notationDeclaration.name);-
1688 publicNotationDeclaration.m_systemId = QXmlStreamStringRef(notationDeclaration.systemId);-
1689 publicNotationDeclaration.m_publicId = QXmlStreamStringRef(notationDeclaration.publicId);-
1690-
1691 }
executed 79 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
79
1692 notationDeclarations.clear();-
1693 publicEntityDeclarations.resize(entityDeclarations.size());-
1694 for (int i = 0; i < entityDeclarations.size(); ++i) {
i < entityDeclarations.size()Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 52 times by 1 test
Evaluated by:
  • tst_QXmlStream
44-52
1695 const QXmlStreamReaderPrivate::EntityDeclaration &entityDeclaration = entityDeclarations.at(i);-
1696 QXmlStreamEntityDeclaration &publicEntityDeclaration = publicEntityDeclarations[i];-
1697 publicEntityDeclaration.m_name = QXmlStreamStringRef(entityDeclaration.name);-
1698 publicEntityDeclaration.m_notationName = QXmlStreamStringRef(entityDeclaration.notationName);-
1699 publicEntityDeclaration.m_systemId = QXmlStreamStringRef(entityDeclaration.systemId);-
1700 publicEntityDeclaration.m_publicId = QXmlStreamStringRef(entityDeclaration.publicId);-
1701 publicEntityDeclaration.m_value = QXmlStreamStringRef(entityDeclaration.value);-
1702 }
executed 44 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
44
1703 entityDeclarations.clear();-
1704 parameterEntityHash.clear();-
1705}
executed 52 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
52
1706-
1707uint QXmlStreamReaderPrivate::resolveCharRef(int symbolIndex)-
1708{-
1709 bool ok = true;-
1710 uint s;-
1711 // ### add toXShort to QStringRef?-
1712 if (sym(symbolIndex).c == 'x')
sym(symbolIndex).c == 'x'Description
TRUEevaluated 1284 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 143 times by 1 test
Evaluated by:
  • tst_QXmlStream
143-1284
1713 s = symString(symbolIndex, 1).toUInt(&ok, 16);
executed 1284 times by 2 tests: s = symString(symbolIndex, 1).toUInt(&ok, 16);
Executed by:
  • tst_QXmlStream
  • tst_Selftests
1284
1714 else-
1715 s = symString(symbolIndex).toUInt(&ok, 10);
executed 143 times by 1 test: s = symString(symbolIndex).toUInt(&ok, 10);
Executed by:
  • tst_QXmlStream
143
1716-
1717 ok &= (s == 0x9 || s == 0xa || s == 0xd || (s >= 0x20 && s <= 0xd7ff)
s == 0x9Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1413 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
s == 0xaDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1395 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
s == 0xdDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1382 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
s >= 0x20Description
TRUEevaluated 1362 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QXmlStream
s <= 0xd7ffDescription
TRUEevaluated 1339 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_QXmlStream
13-1413
1718 || (s >= 0xe000 && s <= 0xfffd) || (s >= 0x10000 && s <= QChar::LastValidCodePoint));
s >= 0xe000Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QXmlStream
s <= 0xfffdDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_QXmlStream
s >= 0x10000Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_QXmlStream
s <= QChar::LastValidCodePointDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
1-25
1719-
1720 return ok ? s : 0;
executed 1427 times by 2 tests: return ok ? s : 0;
Executed by:
  • tst_QXmlStream
  • tst_Selftests
okDescription
TRUEevaluated 1401 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_QXmlStream
26-1427
1721}-
1722-
1723-
1724void QXmlStreamReaderPrivate::checkPublicLiteral(const QStringRef &publicId)-
1725{-
1726//#x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]-
1727-
1728 const ushort *data = reinterpret_cast<const ushort *>(publicId.constData());-
1729 uchar c = 0;-
1730 int i;-
1731 for (i = publicId.size() - 1; i >= 0; --i) {
i >= 0Description
TRUEevaluated 13888 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 295 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
295-13888
1732 if (data[i] < 256)
data[i] < 256Description
TRUEevaluated 13888 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-13888
1733 switch ((c = data[i])) {-
1734 case ' ': case '\n': case '\r': case '-': case '(': case ')':
executed 987 times by 12 tests: case ' ':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
never executed: case '\n':
executed 1 time by 1 test: case '\r':
Executed by:
  • tst_QXmlStream
executed 501 times by 12 tests: case '-':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
executed 3 times by 1 test: case '(':
Executed by:
  • tst_QXmlStream
executed 3 times by 1 test: case ')':
Executed by:
  • tst_QXmlStream
0-987
1735 case '+': case ',': case '.': case '/': case ':': case '=':
executed 3 times by 1 test: case '+':
Executed by:
  • tst_QXmlStream
executed 3 times by 1 test: case ',':
Executed by:
  • tst_QXmlStream
executed 246 times by 12 tests: case '.':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
executed 1546 times by 12 tests: case '/':
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
executed 3 times by 1 test: case ':':
Executed by:
  • tst_QXmlStream
executed 3 times by 1 test: case '=':
Executed by:
  • tst_QXmlStream
3-1546
1736 case '?': case ';': case '!': case '*': case '#': case '@':
executed 3 times by 1 test: case '?':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case ';':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case '!':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case '*':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case '#':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case '@':
Executed by:
  • tst_QXmlStream
3-5
1737 case '$': case '_': case '%': case '\'': case '\"':
executed 5 times by 1 test: case '$':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case '_':
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: case '%':
Executed by:
  • tst_QXmlStream
executed 3 times by 1 test: case '\'':
Executed by:
  • tst_QXmlStream
never executed: case '\"':
0-5
1738 continue;
executed 3345 times by 12 tests: continue;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
3345
1739 default:
executed 10543 times by 12 tests: default:
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
10543
1740 if ((c >= 'a' && c <= 'z')
c >= 'a'Description
TRUEevaluated 7242 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 3301 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
c <= 'z'Description
TRUEevaluated 7242 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-7242
1741 || (c >= 'A' && c <= 'Z')
c >= 'A'Description
TRUEevaluated 2782 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 519 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
c <= 'Z'Description
TRUEevaluated 2782 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-2782
1742 || (c >= '0' && c <= '9'))
c >= '0'Description
TRUEevaluated 519 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
c <= '9'Description
TRUEevaluated 519 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
0-519
1743 continue;
executed 10543 times by 12 tests: continue;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
10543
1744 }
never executed: end of block
0
1745 break;
never executed: break;
0
1746 }-
1747 if (i >= 0)
i >= 0Description
TRUEnever evaluated
FALSEevaluated 295 times by 12 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
0-295
1748 raiseWellFormedError(QXmlStream::tr("Unexpected character '%1' in public id literal.").arg(QChar(QLatin1Char(c))));
never executed: raiseWellFormedError(QXmlStream::tr("Unexpected character '%1' in public id literal.").arg(QChar(QLatin1Char(c))));
0
1749}
executed 295 times by 12 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
295
1750-
1751/*-
1752 Checks whether the document starts with an xml declaration. If it-
1753 does, this function returns \c true; otherwise it sets up everything-
1754 for a synthetic start document event and returns \c false.-
1755 */-
1756bool QXmlStreamReaderPrivate::checkStartDocument()-
1757{-
1758 hasCheckedStartDocument = true;-
1759-
1760 if (scanString(spell[XML], XML))
scanString(spell[XML], XML)Description
TRUEevaluated 1285 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 4669 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
1285-4669
1761 return true;
executed 1285 times by 5 tests: return true;
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1285
1762-
1763 type = QXmlStreamReader::StartDocument;-
1764 if (atEnd) {
atEndDescription
TRUEevaluated 2685 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEevaluated 1984 times by 13 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
1984-2685
1765 hasCheckedStartDocument = false;-
1766 raiseError(QXmlStreamReader::PrematureEndOfDocumentError);-
1767 }
executed 2685 times by 2 tests: end of block
Executed by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
2685
1768 return false;
executed 4669 times by 13 tests: return false;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QXmlStream
  • tst_Selftests
4669
1769}-
1770-
1771void QXmlStreamReaderPrivate::startDocument()-
1772{-
1773 QString err;-
1774 if (documentVersion != QLatin1String("1.0")) {
documentVersio...1String("1.0")Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1237 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
4-1237
1775 if (documentVersion.contains(QLatin1Char(' ')))
documentVersio...tin1Char(' '))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
1-3
1776 err = QXmlStream::tr("Invalid XML version string.");
executed 1 time by 1 test: err = QXmlStream::tr("Invalid XML version string.");
Executed by:
  • tst_QXmlStream
1
1777 else-
1778 err = QXmlStream::tr("Unsupported XML version.");
executed 3 times by 1 test: err = QXmlStream::tr("Unsupported XML version.");
Executed by:
  • tst_QXmlStream
3
1779 }-
1780 int n = attributeStack.size();-
1781-
1782 /* We use this bool to ensure that the pesudo attributes are in the-
1783 * proper order:-
1784 *-
1785 * [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' */-
1786 bool hasStandalone = false;-
1787-
1788 for (int i = 0; err.isNull() && i < n; ++i) {
err.isNull()Description
TRUEevaluated 1902 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_QXmlStream
i < nDescription
TRUEevaluated 692 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 1210 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
31-1902
1789 Attribute &attrib = attributeStack[i];-
1790 QStringRef prefix(symPrefix(attrib.key));-
1791 QStringRef key(symString(attrib.key));-
1792 QStringRef value(symString(attrib.value));-
1793-
1794 if (prefix.isEmpty() && key == QLatin1String("encoding")) {
prefix.isEmpty()Description
TRUEevaluated 692 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEnever evaluated
key == QLatin1...ng("encoding")Description
TRUEevaluated 659 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-692
1795 const QString name(value.toString());-
1796 documentEncoding = value;-
1797-
1798 if(hasStandalone)
hasStandaloneDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 658 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1-658
1799 err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding.");
executed 1 time by 1 test: err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding.");
Executed by:
  • tst_QXmlStream
1
1800 if(!QXmlUtils::isEncName(name))
!QXmlUtils::isEncName(name)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 643 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
16-643
1801 err = QXmlStream::tr("%1 is an invalid encoding name.").arg(name);
executed 16 times by 1 test: err = QXmlStream::tr("%1 is an invalid encoding name.").arg(name);
Executed by:
  • tst_QXmlStream
16
1802 else {-
1803#ifdef QT_NO_TEXTCODEC-
1804 readBuffer = QString::fromLatin1(rawReadBuffer.data(), nbytesread);-
1805#else-
1806 QTextCodec *const newCodec = QTextCodec::codecForName(name.toLatin1());-
1807 if (!newCodec)
!newCodecDescription
TRUEnever evaluated
FALSEevaluated 643 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
0-643
1808 err = QXmlStream::tr("Encoding %1 is unsupported").arg(name);
never executed: err = QXmlStream::tr("Encoding %1 is unsupported").arg(name);
0
1809 else if (newCodec != codec && !lockEncoding) {
newCodec != codecDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 639 times by 4 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
!lockEncodingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-639
1810 codec = newCodec;-
1811 delete decoder;-
1812 decoder = codec->makeDecoder();-
1813 decoder->toUnicode(&readBuffer, rawReadBuffer.data(), nbytesread);-
1814 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
4
1815#endif // QT_NO_TEXTCODEC-
1816 }
executed 643 times by 4 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
643
1817 } else if (prefix.isEmpty() && key == QLatin1String("standalone")) {
prefix.isEmpty()Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
key == QLatin1...("standalone")Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-33
1818 hasStandalone = true;-
1819 if (value == QLatin1String("yes"))
value == QLatin1String("yes")Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QXmlStream
8-21
1820 standalone = true;
executed 21 times by 1 test: standalone = true;
Executed by:
  • tst_QXmlStream
21
1821 else if (value == QLatin1String("no"))
value == QLatin1String("no")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-6
1822 standalone = false;
executed 2 times by 1 test: standalone = false;
Executed by:
  • tst_QXmlStream
2
1823 else-
1824 err = QXmlStream::tr("Standalone accepts only yes or no.");
executed 6 times by 1 test: err = QXmlStream::tr("Standalone accepts only yes or no.");
Executed by:
  • tst_QXmlStream
6
1825 } else {-
1826 err = QXmlStream::tr("Invalid attribute in XML declaration.");-
1827 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
4
1828 }-
1829-
1830 if (!err.isNull())
!err.isNull()Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1210 times by 5 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
31-1210
1831 raiseWellFormedError(err);
executed 31 times by 1 test: raiseWellFormedError(err);
Executed by:
  • tst_QXmlStream
31
1832 attributeStack.clear();-
1833}
executed 1241 times by 5 tests: end of block
Executed by:
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
1241
1834-
1835-
1836void QXmlStreamReaderPrivate::raiseError(QXmlStreamReader::Error error, const QString& message)-
1837{-
1838 this->error = error;-
1839 errorString = message;-
1840 if (errorString.isNull()) {
errorString.isNull()Description
TRUEevaluated 58733 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEevaluated 1235 times by 2 tests
Evaluated by:
  • tst_QDBusMetaObject
  • tst_QXmlStream
1235-58733
1841 if (error == QXmlStreamReader::PrematureEndOfDocumentError)
error == QXmlS...fDocumentErrorDescription
TRUEevaluated 58733 times by 2 tests
Evaluated by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEnever evaluated
0-58733
1842 errorString = QXmlStream::tr("Premature end of document.");
executed 58733 times by 2 tests: errorString = QXmlStream::tr("Premature end of document.");
Executed by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
58733
1843 else if (error == QXmlStreamReader::CustomError)
error == QXmlS...r::CustomErrorDescription
TRUEnever evaluated
FALSEnever evaluated
0
1844 errorString = QXmlStream::tr("Invalid document.");
never executed: errorString = QXmlStream::tr("Invalid document.");
0
1845 }
executed 58733 times by 2 tests: end of block
Executed by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
58733
1846-
1847 type = QXmlStreamReader::Invalid;-
1848}
executed 59968 times by 3 tests: end of block
Executed by:
  • tst_QDBusMetaObject
  • tst_QDBusXmlParser
  • tst_QXmlStream
59968
1849-
1850void QXmlStreamReaderPrivate::raiseWellFormedError(const QString &message)-
1851{-
1852 raiseError(QXmlStreamReader::NotWellFormedError, message);-
1853}
executed 1196 times by 2 tests: end of block
Executed by:
  • tst_QDBusMetaObject
  • tst_QXmlStream
1196
1854-
1855void QXmlStreamReaderPrivate::parseError()-
1856{-
1857-
1858 if (token == EOF_SYMBOL) {
token == EOF_SYMBOLDescription
TRUEevaluated 6305 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 613 times by 1 test
Evaluated by:
  • tst_QXmlStream
613-6305
1859 raiseError(QXmlStreamReader::PrematureEndOfDocumentError);-
1860 return;
executed 6305 times by 1 test: return;
Executed by:
  • tst_QXmlStream
6305
1861 }-
1862 const int nmax = 4;-
1863 QString error_message;-
1864 int ers = state_stack[tos];-
1865 int nexpected = 0;-
1866 int expected[nmax];-
1867 if (token != ERROR)
token != ERRORDescription
TRUEevaluated 606 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
7-606
1868 for (int tk = 0; tk < TERMINAL_COUNT; ++tk) {
tk < TERMINAL_COUNTDescription
TRUEevaluated 34542 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 606 times by 1 test
Evaluated by:
  • tst_QXmlStream
606-34542
1869 int k = t_action(ers, tk);-
1870 if (k <= 0)
k <= 0Description
TRUEevaluated 31219 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3323 times by 1 test
Evaluated by:
  • tst_QXmlStream
3323-31219
1871 continue;
executed 31219 times by 1 test: continue;
Executed by:
  • tst_QXmlStream
31219
1872 if (spell[tk]) {
spell[tk]Description
TRUEevaluated 3227 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_QXmlStream
96-3227
1873 if (nexpected < nmax)
nexpected < nmaxDescription
TRUEevaluated 1391 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1836 times by 1 test
Evaluated by:
  • tst_QXmlStream
1391-1836
1874 expected[nexpected++] = tk;
executed 1391 times by 1 test: expected[nexpected++] = tk;
Executed by:
  • tst_QXmlStream
1391
1875 }
executed 3227 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
3227
1876 }
executed 3323 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
3323
1877-
1878 error_message.clear ();-
1879 if (nexpected && nexpected < nmax) {
nexpectedDescription
TRUEevaluated 606 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
nexpected < nmaxDescription
TRUEevaluated 448 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 158 times by 1 test
Evaluated by:
  • tst_QXmlStream
7-606
1880 bool first = true;-
1881-
1882 for (int s = 0; s < nexpected; ++s) {
s < nexpectedDescription
TRUEevaluated 759 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 448 times by 1 test
Evaluated by:
  • tst_QXmlStream
448-759
1883 if (first)
firstDescription
TRUEevaluated 448 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 311 times by 1 test
Evaluated by:
  • tst_QXmlStream
311-448
1884 error_message += QXmlStream::tr ("Expected ");
executed 448 times by 1 test: error_message += QXmlStream::tr ("Expected ");
Executed by:
  • tst_QXmlStream
448
1885 else if (s == nexpected - 1)
s == nexpected - 1Description
TRUEevaluated 222 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 89 times by 1 test
Evaluated by:
  • tst_QXmlStream
89-222
1886 error_message += QLatin1String (nexpected > 2 ? ", or " : " or ");
executed 222 times by 1 test: error_message += QLatin1String (nexpected > 2 ? ", or " : " or ");
Executed by:
  • tst_QXmlStream
222
1887 else-
1888 error_message += QLatin1String (", ");
executed 89 times by 1 test: error_message += QLatin1String (", ");
Executed by:
  • tst_QXmlStream
89
1889-
1890 first = false;-
1891 error_message += QLatin1String("\'");-
1892 error_message += QLatin1String (spell [expected[s]]);-
1893 error_message += QLatin1String("\'");-
1894 }
executed 759 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
759
1895 error_message += QXmlStream::tr(", but got \'");-
1896 error_message += QLatin1String(spell [token]);-
1897 error_message += QLatin1String("\'");-
1898 } else {
executed 448 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
448
1899 error_message += QXmlStream::tr("Unexpected \'");-
1900 error_message += QLatin1String(spell [token]);-
1901 error_message += QLatin1String("\'");-
1902 }
executed 165 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
165
1903 error_message += QLatin1Char('.');-
1904-
1905 raiseWellFormedError(error_message);-
1906}
executed 613 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
613
1907-
1908void QXmlStreamReaderPrivate::resume(int rule) {-
1909 resumeReduction = rule;-
1910 if (error == QXmlStreamReader::NoError)
error == QXmlS...eader::NoErrorDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 44571 times by 1 test
Evaluated by:
  • tst_QXmlStream
26-44571
1911 raiseError(QXmlStreamReader::PrematureEndOfDocumentError);
executed 26 times by 1 test: raiseError(QXmlStreamReader::PrematureEndOfDocumentError);
Executed by:
  • tst_QXmlStream
26
1912}
executed 44597 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
44597
1913-
1914/*! Returns the current line number, starting with 1.-
1915-
1916\sa columnNumber(), characterOffset()-
1917 */-
1918qint64 QXmlStreamReader::lineNumber() const-
1919{-
1920 Q_D(const QXmlStreamReader);-
1921 return d->lineNumber + 1; // in public we start with 1
executed 584 times by 1 test: return d->lineNumber + 1;
Executed by:
  • tst_Selftests
584
1922}-
1923-
1924/*! Returns the current column number, starting with 0.-
1925-
1926\sa lineNumber(), characterOffset()-
1927 */-
1928qint64 QXmlStreamReader::columnNumber() const-
1929{-
1930 Q_D(const QXmlStreamReader);-
1931 return d->characterOffset - d->lastLineStart + d->readBufferPos;
executed 584 times by 1 test: return d->characterOffset - d->lastLineStart + d->readBufferPos;
Executed by:
  • tst_Selftests
584
1932}-
1933-
1934/*! Returns the current character offset, starting with 0.-
1935-
1936\sa lineNumber(), columnNumber()-
1937*/-
1938qint64 QXmlStreamReader::characterOffset() const-
1939{-
1940 Q_D(const QXmlStreamReader);-
1941 return d->characterOffset + d->readBufferPos;
never executed: return d->characterOffset + d->readBufferPos;
0
1942}-
1943-
1944-
1945/*! Returns the text of \l Characters, \l Comment, \l DTD, or-
1946 EntityReference.-
1947 */-
1948QStringRef QXmlStreamReader::text() const-
1949{-
1950 Q_D(const QXmlStreamReader);-
1951 return d->text;
executed 3556 times by 1 test: return d->text;
Executed by:
  • tst_QXmlStream
3556
1952}-
1953-
1954-
1955/*! If the tokenType() is \l DTD, this function returns the DTD's-
1956 notation declarations. Otherwise an empty vector is returned.-
1957-
1958 The QXmlStreamNotationDeclarations class is defined to be a QVector-
1959 of QXmlStreamNotationDeclaration.-
1960 */-
1961QXmlStreamNotationDeclarations QXmlStreamReader::notationDeclarations() const-
1962{-
1963 Q_D(const QXmlStreamReader);-
1964 if (d->notationDeclarations.size())
d->notationDeclarations.size()Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2545 times by 1 test
Evaluated by:
  • tst_QXmlStream
47-2545
1965 const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();
executed 47 times by 1 test: const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();
Executed by:
  • tst_QXmlStream
47
1966 return d->publicNotationDeclarations;
executed 2592 times by 1 test: return d->publicNotationDeclarations;
Executed by:
  • tst_QXmlStream
2592
1967}-
1968-
1969-
1970/*! If the tokenType() is \l DTD, this function returns the DTD's-
1971 unparsed (external) entity declarations. Otherwise an empty vector is returned.-
1972-
1973 The QXmlStreamEntityDeclarations class is defined to be a QVector-
1974 of QXmlStreamEntityDeclaration.-
1975 */-
1976QXmlStreamEntityDeclarations QXmlStreamReader::entityDeclarations() const-
1977{-
1978 Q_D(const QXmlStreamReader);-
1979 if (d->entityDeclarations.size())
d->entityDeclarations.size()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1903 times by 1 test
Evaluated by:
  • tst_QXmlStream
5-1903
1980 const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();
executed 5 times by 1 test: const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();
Executed by:
  • tst_QXmlStream
5
1981 return d->publicEntityDeclarations;
executed 1908 times by 1 test: return d->publicEntityDeclarations;
Executed by:
  • tst_QXmlStream
1908
1982}-
1983-
1984/*!-
1985 \since 4.4-
1986-
1987 If the tokenType() is \l DTD, this function returns the DTD's-
1988 name. Otherwise an empty string is returned.-
1989-
1990 */-
1991QStringRef QXmlStreamReader::dtdName() const-
1992{-
1993 Q_D(const QXmlStreamReader);-
1994 if (d->type == QXmlStreamReader::DTD)
d->type == QXm...eamReader::DTDDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1878 times by 1 test
Evaluated by:
  • tst_QXmlStream
50-1878
1995 return d->dtdName;
executed 50 times by 1 test: return d->dtdName;
Executed by:
  • tst_QXmlStream
50
1996 return QStringRef();
executed 1878 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
1878
1997}-
1998-
1999/*!-
2000 \since 4.4-
2001-
2002 If the tokenType() is \l DTD, this function returns the DTD's-
2003 public identifier. Otherwise an empty string is returned.-
2004-
2005 */-
2006QStringRef QXmlStreamReader::dtdPublicId() const-
2007{-
2008 Q_D(const QXmlStreamReader);-
2009 if (d->type == QXmlStreamReader::DTD)
d->type == QXm...eamReader::DTDDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1878 times by 1 test
Evaluated by:
  • tst_QXmlStream
27-1878
2010 return d->dtdPublicId;
executed 27 times by 1 test: return d->dtdPublicId;
Executed by:
  • tst_QXmlStream
27
2011 return QStringRef();
executed 1878 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
1878
2012}-
2013-
2014/*!-
2015 \since 4.4-
2016-
2017 If the tokenType() is \l DTD, this function returns the DTD's-
2018 system identifier. Otherwise an empty string is returned.-
2019-
2020 */-
2021QStringRef QXmlStreamReader::dtdSystemId() const-
2022{-
2023 Q_D(const QXmlStreamReader);-
2024 if (d->type == QXmlStreamReader::DTD)
d->type == QXm...eamReader::DTDDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1878 times by 1 test
Evaluated by:
  • tst_QXmlStream
27-1878
2025 return d->dtdSystemId;
executed 27 times by 1 test: return d->dtdSystemId;
Executed by:
  • tst_QXmlStream
27
2026 return QStringRef();
executed 1878 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
1878
2027}-
2028-
2029/*! If the tokenType() is \l StartElement, this function returns the-
2030 element's namespace declarations. Otherwise an empty vector is-
2031 returned.-
2032-
2033 The QXmlStreamNamespaceDeclarations class is defined to be a QVector-
2034 of QXmlStreamNamespaceDeclaration.-
2035-
2036 \sa addExtraNamespaceDeclaration(), addExtraNamespaceDeclarations()-
2037 */-
2038QXmlStreamNamespaceDeclarations QXmlStreamReader::namespaceDeclarations() const-
2039{-
2040 Q_D(const QXmlStreamReader);-
2041 if (d->publicNamespaceDeclarations.isEmpty() && d->type == StartElement)
d->publicNames...ions.isEmpty()Description
TRUEevaluated 1907 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QXmlStream
d->type == StartElementDescription
TRUEevaluated 446 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1461 times by 1 test
Evaluated by:
  • tst_QXmlStream
38-1907
2042 const_cast<QXmlStreamReaderPrivate *>(d)->resolvePublicNamespaces();
executed 446 times by 1 test: const_cast<QXmlStreamReaderPrivate *>(d)->resolvePublicNamespaces();
Executed by:
  • tst_QXmlStream
446
2043 return d->publicNamespaceDeclarations;
executed 1945 times by 1 test: return d->publicNamespaceDeclarations;
Executed by:
  • tst_QXmlStream
1945
2044}-
2045-
2046-
2047/*!-
2048 \since 4.4-
2049-
2050 Adds an \a extraNamespaceDeclaration. The declaration will be-
2051 valid for children of the current element, or - should the function-
2052 be called before any elements are read - for the entire XML-
2053 document.-
2054-
2055 \sa namespaceDeclarations(), addExtraNamespaceDeclarations(), setNamespaceProcessing()-
2056 */-
2057void QXmlStreamReader::addExtraNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaration)-
2058{-
2059 Q_D(QXmlStreamReader);-
2060 QXmlStreamReaderPrivate::NamespaceDeclaration &namespaceDeclaration = d->namespaceDeclarations.push();-
2061 namespaceDeclaration.prefix = d->addToStringStorage(extraNamespaceDeclaration.prefix());-
2062 namespaceDeclaration.namespaceUri = d->addToStringStorage(extraNamespaceDeclaration.namespaceUri());-
2063}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2
2064-
2065/*!-
2066 \since 4.4-
2067-
2068 Adds a vector of declarations specified by \a extraNamespaceDeclarations.-
2069-
2070 \sa namespaceDeclarations(), addExtraNamespaceDeclaration()-
2071 */-
2072void QXmlStreamReader::addExtraNamespaceDeclarations(const QXmlStreamNamespaceDeclarations &extraNamespaceDeclarations)-
2073{-
2074 for (int i = 0; i < extraNamespaceDeclarations.size(); ++i)
i < extraNames...rations.size()Description
TRUEnever evaluated
FALSEnever evaluated
0
2075 addExtraNamespaceDeclaration(extraNamespaceDeclarations.at(i));
never executed: addExtraNamespaceDeclaration(extraNamespaceDeclarations.at(i));
0
2076}
never executed: end of block
0
2077-
2078-
2079/*! Convenience function to be called in case a StartElement was-
2080 read. Reads until the corresponding EndElement and returns all text-
2081 in-between. In case of no error, the current token (see tokenType())-
2082 after having called this function is EndElement.-
2083-
2084 The function concatenates text() when it reads either \l Characters-
2085 or EntityReference tokens, but skips ProcessingInstruction and \l-
2086 Comment. If the current token is not StartElement, an empty string is-
2087 returned.-
2088-
2089 The \a behaviour defines what happens in case anything else is-
2090 read before reaching EndElement. The function can include the text from-
2091 child elements (useful for example for HTML), ignore child elements, or-
2092 raise an UnexpectedElementError and return what was read so far (default).-
2093-
2094 \since 4.6-
2095 */-
2096QString QXmlStreamReader::readElementText(ReadElementTextBehaviour behaviour)-
2097{-
2098 Q_D(QXmlStreamReader);-
2099 if (isStartElement()) {
isStartElement()Description
TRUEevaluated 134858 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_QXmlStream
FALSEnever evaluated
0-134858
2100 QString result;-
2101 forever {-
2102 switch (readNext()) {-
2103 case Characters:
executed 134861 times by 2 tests: case Characters:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
134861
2104 case EntityReference:
never executed: case EntityReference:
0
2105 result.insert(result.size(), d->text.unicode(), d->text.size());-
2106 break;
executed 134861 times by 2 tests: break;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
134861
2107 case EndElement:
executed 134853 times by 2 tests: case EndElement:
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
134853
2108 return result;
executed 134853 times by 2 tests: return result;
Executed by:
  • tst_QMimeDatabase
  • tst_QXmlStream
134853
2109 case ProcessingInstruction:
never executed: case ProcessingInstruction:
0
2110 case Comment:
executed 2 times by 1 test: case Comment:
Executed by:
  • tst_QXmlStream
2
2111 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QXmlStream
2
2112 case StartElement:
executed 6 times by 1 test: case StartElement:
Executed by:
  • tst_QXmlStream
6
2113 if (behaviour == SkipChildElements) {
behaviour == SkipChildElementsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-4
2114 skipCurrentElement();-
2115 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QXmlStream
2
2116 } else if (behaviour == IncludeChildElements) {
behaviour == I...eChildElementsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
2
2117 result += readElementText(behaviour);-
2118 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QXmlStream
2
2119 }-
2120 // Fall through (for ErrorOnUnexpectedElement)-
2121 default:
code before this statement executed 2 times by 1 test: default:
Executed by:
  • tst_QXmlStream
executed 5 times by 1 test: default:
Executed by:
  • tst_QXmlStream
2-5
2122 if (d->error || behaviour == ErrorOnUnexpectedElement) {
behaviour == E...xpectedElementDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-2
2123 if (!d->error)
!d->errorDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-3
2124 d->raiseError(UnexpectedElementError, QXmlStream::tr("Expected character data."));
executed 2 times by 1 test: d->raiseError(UnexpectedElementError, QXmlStream::tr("Expected character data."));
Executed by:
  • tst_QXmlStream
2
2125 return result;
executed 5 times by 1 test: return result;
Executed by:
  • tst_QXmlStream
5
2126 }-
2127 }
never executed: end of block
0
2128 }-
2129 }
never executed: end of block
0
2130 return QString();
never executed: return QString();
0
2131}-
2132-
2133/*! Raises a custom error with an optional error \a message.-
2134-
2135 \sa error(), errorString()-
2136 */-
2137void QXmlStreamReader::raiseError(const QString& message)-
2138{-
2139 Q_D(QXmlStreamReader);-
2140 d->raiseError(CustomError, message);-
2141}
never executed: end of block
0
2142-
2143/*!-
2144 Returns the error message that was set with raiseError().-
2145-
2146 \sa error(), lineNumber(), columnNumber(), characterOffset()-
2147 */-
2148QString QXmlStreamReader::errorString() const-
2149{-
2150 Q_D(const QXmlStreamReader);-
2151 if (d->type == QXmlStreamReader::Invalid)
d->type == QXm...eader::InvalidDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 586 times by 2 tests
Evaluated by:
  • tst_QXmlStream
  • tst_Selftests
39-586
2152 return d->errorString;
executed 39 times by 1 test: return d->errorString;
Executed by:
  • tst_QXmlStream
39
2153 return QString();
executed 586 times by 2 tests: return QString();
Executed by:
  • tst_QXmlStream
  • tst_Selftests
586
2154}-
2155-
2156/*! Returns the type of the current error, or NoError if no error occurred.-
2157-
2158 \sa errorString(), raiseError()-
2159 */-
2160QXmlStreamReader::Error QXmlStreamReader::error() const-
2161{-
2162 Q_D(const QXmlStreamReader);-
2163 if (d->type == QXmlStreamReader::Invalid)
d->type == QXm...eader::InvalidDescription
TRUEevaluated 59946 times by 3 tests
Evaluated by:
  • tst_QDBusMetaObject
  • tst_QDBusXmlParser
  • tst_QXmlStream
FALSEevaluated 2921 times by 15 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
2921-59946
2164 return d->error;
executed 59946 times by 3 tests: return d->error;
Executed by:
  • tst_QDBusMetaObject
  • tst_QDBusXmlParser
  • tst_QXmlStream
59946
2165 return NoError;
executed 2921 times by 15 tests: return NoError;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
2921
2166}-
2167-
2168/*!-
2169 Returns the target of a ProcessingInstruction.-
2170 */-
2171QStringRef QXmlStreamReader::processingInstructionTarget() const-
2172{-
2173 Q_D(const QXmlStreamReader);-
2174 return d->processingInstructionTarget;
executed 1988 times by 1 test: return d->processingInstructionTarget;
Executed by:
  • tst_QXmlStream
1988
2175}-
2176-
2177/*!-
2178 Returns the data of a ProcessingInstruction.-
2179 */-
2180QStringRef QXmlStreamReader::processingInstructionData() const-
2181{-
2182 Q_D(const QXmlStreamReader);-
2183 return d->processingInstructionData;
executed 2024 times by 1 test: return d->processingInstructionData;
Executed by:
  • tst_QXmlStream
2024
2184}-
2185-
2186-
2187-
2188/*!-
2189 Returns the local name of a StartElement, EndElement, or an EntityReference.-
2190-
2191 \sa namespaceUri(), qualifiedName()-
2192 */-
2193QStringRef QXmlStreamReader::name() const-
2194{-
2195 Q_D(const QXmlStreamReader);-
2196 return d->name;
executed 190123 times by 14 tests: return d->name;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
190123
2197}-
2198-
2199/*!-
2200 Returns the namespaceUri of a StartElement or EndElement.-
2201-
2202 \sa name(), qualifiedName()-
2203 */-
2204QStringRef QXmlStreamReader::namespaceUri() const-
2205{-
2206 Q_D(const QXmlStreamReader);-
2207 return d->namespaceUri;
executed 3754 times by 1 test: return d->namespaceUri;
Executed by:
  • tst_QXmlStream
3754
2208}-
2209-
2210/*!-
2211 Returns the qualified name of a StartElement or EndElement;-
2212-
2213 A qualified name is the raw name of an element in the XML data. It-
2214 consists of the namespace prefix, followed by colon, followed by the-
2215 element's local name. Since the namespace prefix is not unique (the-
2216 same prefix can point to different namespaces and different prefixes-
2217 can point to the same namespace), you shouldn't use qualifiedName(),-
2218 but the resolved namespaceUri() and the attribute's local name().-
2219-
2220 \sa name(), prefix(), namespaceUri()-
2221 */-
2222QStringRef QXmlStreamReader::qualifiedName() const-
2223{-
2224 Q_D(const QXmlStreamReader);-
2225 return d->qualifiedName;
executed 3055 times by 1 test: return d->qualifiedName;
Executed by:
  • tst_QXmlStream
3055
2226}-
2227-
2228-
2229-
2230/*!-
2231 \since 4.4-
2232-
2233 Returns the prefix of a StartElement or EndElement.-
2234-
2235 \sa name(), qualifiedName()-
2236*/-
2237QStringRef QXmlStreamReader::prefix() const-
2238{-
2239 Q_D(const QXmlStreamReader);-
2240 return d->prefix;
executed 1943 times by 2 tests: return d->prefix;
Executed by:
  • tst_QDBusXmlParser
  • tst_QXmlStream
1943
2241}-
2242-
2243/*!-
2244 Returns the attributes of a StartElement.-
2245 */-
2246QXmlStreamAttributes QXmlStreamReader::attributes() const-
2247{-
2248 Q_D(const QXmlStreamReader);-
2249 return d->attributes;
executed 162995 times by 14 tests: return d->attributes;
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
162995
2250}-
2251-
2252#endif // QT_NO_XMLSTREAMREADER-
2253-
2254/*!-
2255 \class QXmlStreamAttribute-
2256 \inmodule QtCore-
2257 \since 4.3-
2258 \reentrant-
2259 \brief The QXmlStreamAttribute class represents a single XML attribute-
2260-
2261 \ingroup xml-tools-
2262-
2263 An attribute consists of an optionally empty namespaceUri(), a-
2264 name(), a value(), and an isDefault() attribute.-
2265-
2266 The raw XML attribute name is returned as qualifiedName().-
2267*/-
2268-
2269/*!-
2270 Creates an empty attribute.-
2271 */-
2272QXmlStreamAttribute::QXmlStreamAttribute()-
2273{-
2274 m_isDefault = false;-
2275}
executed 269674 times by 15 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_Selftests
  • tst_qdbusxml2cpp - unknown status
269674
2276-
2277/*!-
2278 Destructs an attribute.-
2279 */-
2280QXmlStreamAttribute::~QXmlStreamAttribute()-
2281{-
2282}-
2283-
2284/*! Constructs an attribute in the namespace described with \a-
2285 namespaceUri with \a name and value \a value.-
2286 */-
2287QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value)-
2288{-
2289 m_namespaceUri = QXmlStreamStringRef(QStringRef(&namespaceUri));-
2290 m_name = m_qualifiedName = QXmlStreamStringRef(QStringRef(&name));-
2291 m_value = QXmlStreamStringRef(QStringRef(&value));-
2292 m_namespaceUri = QXmlStreamStringRef(QStringRef(&namespaceUri));-
2293}
never executed: end of block
0
2294-
2295/*!-
2296 Constructs an attribute with qualified name \a qualifiedName and value \a value.-
2297 */-
2298QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value)-
2299{-
2300 int colon = qualifiedName.indexOf(QLatin1Char(':'));-
2301 m_name = QXmlStreamStringRef(QStringRef(&qualifiedName,-
2302 colon + 1,-
2303 qualifiedName.size() - (colon + 1)));-
2304 m_qualifiedName = QXmlStreamStringRef(QStringRef(&qualifiedName));-
2305 m_value = QXmlStreamStringRef(QStringRef(&value));-
2306}
never executed: end of block
0
2307-
2308/*! \fn QStringRef QXmlStreamAttribute::namespaceUri() const-
2309-
2310 Returns the attribute's resolved namespaceUri, or an empty string-
2311 reference if the attribute does not have a defined namespace.-
2312 */-
2313/*! \fn QStringRef QXmlStreamAttribute::name() const-
2314 Returns the attribute's local name.-
2315 */-
2316/*! \fn QStringRef QXmlStreamAttribute::qualifiedName() const-
2317 Returns the attribute's qualified name.-
2318-
2319 A qualified name is the raw name of an attribute in the XML-
2320 data. It consists of the namespace prefix(), followed by colon,-
2321 followed by the attribute's local name(). Since the namespace prefix-
2322 is not unique (the same prefix can point to different namespaces-
2323 and different prefixes can point to the same namespace), you-
2324 shouldn't use qualifiedName(), but the resolved namespaceUri() and-
2325 the attribute's local name().-
2326 */-
2327/*!-
2328 \fn QStringRef QXmlStreamAttribute::prefix() const-
2329 \since 4.4-
2330 Returns the attribute's namespace prefix.-
2331-
2332 \sa name(), qualifiedName()-
2333-
2334*/-
2335-
2336/*! \fn QStringRef QXmlStreamAttribute::value() const-
2337 Returns the attribute's value.-
2338 */-
2339-
2340/*! \fn bool QXmlStreamAttribute::isDefault() const-
2341-
2342 Returns \c true if the parser added this attribute with a default-
2343 value following an ATTLIST declaration in the DTD; otherwise-
2344 returns \c false.-
2345*/-
2346/*! \fn bool QXmlStreamAttribute::operator==(const QXmlStreamAttribute &other) const-
2347-
2348 Compares this attribute with \a other and returns \c true if they are-
2349 equal; otherwise returns \c false.-
2350 */-
2351/*! \fn bool QXmlStreamAttribute::operator!=(const QXmlStreamAttribute &other) const-
2352-
2353 Compares this attribute with \a other and returns \c true if they are-
2354 not equal; otherwise returns \c false.-
2355 */-
2356-
2357-
2358/*!-
2359 Creates a copy of \a other.-
2360 */-
2361QXmlStreamAttribute::QXmlStreamAttribute(const QXmlStreamAttribute &other)-
2362{-
2363 *this = other;-
2364}
executed 2543 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2543
2365-
2366/*!-
2367 Assigns \a other to this attribute.-
2368 */-
2369QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &other)-
2370{-
2371 m_name = other.m_name;-
2372 m_namespaceUri = other.m_namespaceUri;-
2373 m_qualifiedName = other.m_qualifiedName;-
2374 m_value = other.m_value;-
2375 m_isDefault = other.m_isDefault;-
2376 return *this;
executed 2552 times by 1 test: return *this;
Executed by:
  • tst_QXmlStream
2552
2377}-
2378-
2379-
2380/*!-
2381 \class QXmlStreamAttributes-
2382 \inmodule QtCore-
2383 \since 4.3-
2384 \reentrant-
2385 \brief The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.-
2386-
2387 Attributes are returned by a QXmlStreamReader in-
2388 \l{QXmlStreamReader::attributes()} {attributes()} when the reader-
2389 reports a \l {QXmlStreamReader::StartElement}{start element}. The-
2390 class can also be used with a QXmlStreamWriter as an argument to-
2391 \l {QXmlStreamWriter::writeAttributes()}{writeAttributes()}.-
2392-
2393 The convenience function value() loops over the vector and returns-
2394 an attribute value for a given namespaceUri and an attribute's-
2395 name.-
2396-
2397 New attributes can be added with append().-
2398-
2399 \ingroup xml-tools-
2400*/-
2401-
2402/*!-
2403 \fn QXmlStreamAttributes::QXmlStreamAttributes()-
2404-
2405 A constructor for QXmlStreamAttributes.-
2406*/-
2407-
2408/*!-
2409 \typedef QXmlStreamNotationDeclarations-
2410 \relates QXmlStreamNotationDeclaration-
2411-
2412 Synonym for QVector<QXmlStreamNotationDeclaration>.-
2413*/-
2414-
2415-
2416/*!-
2417 \class QXmlStreamNotationDeclaration-
2418 \inmodule QtCore-
2419 \since 4.3-
2420 \reentrant-
2421 \brief The QXmlStreamNotationDeclaration class represents a DTD notation declaration.-
2422-
2423 \ingroup xml-tools-
2424-
2425 An notation declaration consists of a name(), a systemId(), and a publicId().-
2426*/-
2427-
2428/*!-
2429 Creates an empty notation declaration.-
2430*/-
2431QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration()-
2432{-
2433}-
2434/*!-
2435 Creates a copy of \a other.-
2436 */-
2437QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration(const QXmlStreamNotationDeclaration &other)-
2438{-
2439 *this = other;-
2440}
executed 304 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
304
2441-
2442/*!-
2443 Assigns \a other to this notation declaration.-
2444 */-
2445QXmlStreamNotationDeclaration& QXmlStreamNotationDeclaration::operator=(const QXmlStreamNotationDeclaration &other)-
2446{-
2447 m_name = other.m_name;-
2448 m_systemId = other.m_systemId;-
2449 m_publicId = other.m_publicId;-
2450 return *this;
executed 304 times by 1 test: return *this;
Executed by:
  • tst_QXmlStream
304
2451}-
2452-
2453/*!-
2454Destructs this notation declaration.-
2455*/-
2456QXmlStreamNotationDeclaration::~QXmlStreamNotationDeclaration()-
2457{-
2458}-
2459-
2460/*! \fn QStringRef QXmlStreamNotationDeclaration::name() const-
2461-
2462Returns the notation name.-
2463*/-
2464/*! \fn QStringRef QXmlStreamNotationDeclaration::systemId() const-
2465-
2466Returns the system identifier.-
2467*/-
2468/*! \fn QStringRef QXmlStreamNotationDeclaration::publicId() const-
2469-
2470Returns the public identifier.-
2471*/-
2472-
2473/*! \fn inline bool QXmlStreamNotationDeclaration::operator==(const QXmlStreamNotationDeclaration &other) const-
2474-
2475 Compares this notation declaration with \a other and returns \c true-
2476 if they are equal; otherwise returns \c false.-
2477 */-
2478/*! \fn inline bool QXmlStreamNotationDeclaration::operator!=(const QXmlStreamNotationDeclaration &other) const-
2479-
2480 Compares this notation declaration with \a other and returns \c true-
2481 if they are not equal; otherwise returns \c false.-
2482 */-
2483-
2484/*!-
2485 \typedef QXmlStreamNamespaceDeclarations-
2486 \relates QXmlStreamNamespaceDeclaration-
2487-
2488 Synonym for QVector<QXmlStreamNamespaceDeclaration>.-
2489*/-
2490-
2491/*!-
2492 \class QXmlStreamNamespaceDeclaration-
2493 \inmodule QtCore-
2494 \since 4.3-
2495 \reentrant-
2496 \brief The QXmlStreamNamespaceDeclaration class represents a namespace declaration.-
2497-
2498 \ingroup xml-tools-
2499-
2500 An namespace declaration consists of a prefix() and a namespaceUri().-
2501*/-
2502/*! \fn inline bool QXmlStreamNamespaceDeclaration::operator==(const QXmlStreamNamespaceDeclaration &other) const-
2503-
2504 Compares this namespace declaration with \a other and returns \c true-
2505 if they are equal; otherwise returns \c false.-
2506 */-
2507/*! \fn inline bool QXmlStreamNamespaceDeclaration::operator!=(const QXmlStreamNamespaceDeclaration &other) const-
2508-
2509 Compares this namespace declaration with \a other and returns \c true-
2510 if they are not equal; otherwise returns \c false.-
2511 */-
2512-
2513/*!-
2514 Creates an empty namespace declaration.-
2515*/-
2516QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration()-
2517{-
2518}-
2519-
2520/*!-
2521 \since 4.4-
2522-
2523 Creates a namespace declaration with \a prefix and \a namespaceUri.-
2524*/-
2525QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QString &prefix, const QString &namespaceUri)-
2526{-
2527 m_prefix = prefix;-
2528 m_namespaceUri = namespaceUri;-
2529}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2
2530-
2531/*!-
2532 Creates a copy of \a other.-
2533 */-
2534QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &other)-
2535{-
2536 *this = other;-
2537}
executed 54 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
54
2538-
2539/*!-
2540 Assigns \a other to this namespace declaration.-
2541 */-
2542QXmlStreamNamespaceDeclaration& QXmlStreamNamespaceDeclaration::operator=(const QXmlStreamNamespaceDeclaration &other)-
2543{-
2544 m_prefix = other.m_prefix;-
2545 m_namespaceUri = other.m_namespaceUri;-
2546 return *this;
executed 54 times by 1 test: return *this;
Executed by:
  • tst_QXmlStream
54
2547}-
2548/*!-
2549Destructs this namespace declaration.-
2550*/-
2551QXmlStreamNamespaceDeclaration::~QXmlStreamNamespaceDeclaration()-
2552{-
2553}-
2554-
2555/*! \fn QStringRef QXmlStreamNamespaceDeclaration::prefix() const-
2556-
2557Returns the prefix.-
2558*/-
2559/*! \fn QStringRef QXmlStreamNamespaceDeclaration::namespaceUri() const-
2560-
2561Returns the namespaceUri.-
2562*/-
2563-
2564-
2565-
2566-
2567/*!-
2568 \typedef QXmlStreamEntityDeclarations-
2569 \relates QXmlStreamEntityDeclaration-
2570-
2571 Synonym for QVector<QXmlStreamEntityDeclaration>.-
2572*/-
2573-
2574/*!-
2575 \class QXmlStreamStringRef-
2576 \inmodule QtCore-
2577 \since 4.3-
2578 \internal-
2579*/-
2580-
2581/*!-
2582 \class QXmlStreamEntityDeclaration-
2583 \inmodule QtCore-
2584 \since 4.3-
2585 \reentrant-
2586 \brief The QXmlStreamEntityDeclaration class represents a DTD entity declaration.-
2587-
2588 \ingroup xml-tools-
2589-
2590 An entity declaration consists of a name(), a notationName(), a-
2591 systemId(), a publicId(), and a value().-
2592*/-
2593-
2594/*!-
2595 Creates an empty entity declaration.-
2596*/-
2597QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration()-
2598{-
2599}-
2600-
2601/*!-
2602 Creates a copy of \a other.-
2603 */-
2604QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration(const QXmlStreamEntityDeclaration &other)-
2605{-
2606 *this = other;-
2607}
executed 10 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
10
2608-
2609/*!-
2610 Assigns \a other to this entity declaration.-
2611 */-
2612QXmlStreamEntityDeclaration& QXmlStreamEntityDeclaration::operator=(const QXmlStreamEntityDeclaration &other)-
2613{-
2614 m_name = other.m_name;-
2615 m_notationName = other.m_notationName;-
2616 m_systemId = other.m_systemId;-
2617 m_publicId = other.m_publicId;-
2618 m_value = other.m_value;-
2619 return *this;
executed 10 times by 1 test: return *this;
Executed by:
  • tst_QXmlStream
10
2620}-
2621-
2622/*!-
2623 Destructs this entity declaration.-
2624*/-
2625QXmlStreamEntityDeclaration::~QXmlStreamEntityDeclaration()-
2626{-
2627}-
2628-
2629/*! \fn QXmlStreamStringRef::swap(QXmlStreamStringRef &other)-
2630 \since 5.6-
2631-
2632 Swaps this string reference's contents with \a other.-
2633 This function is very fast and never fails.-
2634*/-
2635-
2636/*! \fn QStringRef QXmlStreamEntityDeclaration::name() const-
2637-
2638Returns the entity name.-
2639*/-
2640/*! \fn QStringRef QXmlStreamEntityDeclaration::notationName() const-
2641-
2642Returns the notation name.-
2643*/-
2644/*! \fn QStringRef QXmlStreamEntityDeclaration::systemId() const-
2645-
2646Returns the system identifier.-
2647*/-
2648/*! \fn QStringRef QXmlStreamEntityDeclaration::publicId() const-
2649-
2650Returns the public identifier.-
2651*/-
2652/*! \fn QStringRef QXmlStreamEntityDeclaration::value() const-
2653-
2654Returns the entity's value.-
2655*/-
2656-
2657/*! \fn bool QXmlStreamEntityDeclaration::operator==(const QXmlStreamEntityDeclaration &other) const-
2658-
2659 Compares this entity declaration with \a other and returns \c true if-
2660 they are equal; otherwise returns \c false.-
2661 */-
2662/*! \fn bool QXmlStreamEntityDeclaration::operator!=(const QXmlStreamEntityDeclaration &other) const-
2663-
2664 Compares this entity declaration with \a other and returns \c true if-
2665 they are not equal; otherwise returns \c false.-
2666 */-
2667-
2668/*! Returns the value of the attribute \a name in the namespace-
2669 described with \a namespaceUri, or an empty string reference if the-
2670 attribute is not defined. The \a namespaceUri can be empty.-
2671 */-
2672QStringRef QXmlStreamAttributes::value(const QString &namespaceUri, const QString &name) const-
2673{-
2674 for (int i = 0; i < size(); ++i) {
i < size()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QXmlStream
6-28
2675 const QXmlStreamAttribute &attribute = at(i);-
2676 if (attribute.name() == name && attribute.namespaceUri() == namespaceUri)
attribute.name() == nameDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_QXmlStream
attribute.name...= namespaceUriDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-21
2677 return attribute.value();
executed 5 times by 1 test: return attribute.value();
Executed by:
  • tst_QXmlStream
5
2678 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
23
2679 return QStringRef();
executed 6 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
6
2680}-
2681-
2682/*!\overload-
2683 Returns the value of the attribute \a name in the namespace-
2684 described with \a namespaceUri, or an empty string reference if the-
2685 attribute is not defined. The \a namespaceUri can be empty.-
2686 */-
2687QStringRef QXmlStreamAttributes::value(const QString &namespaceUri, QLatin1String name) const-
2688{-
2689 for (int i = 0; i < size(); ++i) {
i < size()Description
TRUEnever evaluated
FALSEnever evaluated
0
2690 const QXmlStreamAttribute &attribute = at(i);-
2691 if (attribute.name() == name && attribute.namespaceUri() == namespaceUri)
attribute.name() == nameDescription
TRUEnever evaluated
FALSEnever evaluated
attribute.name...= namespaceUriDescription
TRUEnever evaluated
FALSEnever evaluated
0
2692 return attribute.value();
never executed: return attribute.value();
0
2693 }
never executed: end of block
0
2694 return QStringRef();
never executed: return QStringRef();
0
2695}-
2696-
2697/*!\overload-
2698 Returns the value of the attribute \a name in the namespace-
2699 described with \a namespaceUri, or an empty string reference if the-
2700 attribute is not defined. The \a namespaceUri can be empty.-
2701 */-
2702QStringRef QXmlStreamAttributes::value(QLatin1String namespaceUri, QLatin1String name) const-
2703{-
2704 for (int i = 0; i < size(); ++i) {
i < size()Description
TRUEnever evaluated
FALSEnever evaluated
0
2705 const QXmlStreamAttribute &attribute = at(i);-
2706 if (attribute.name() == name && attribute.namespaceUri() == namespaceUri)
attribute.name() == nameDescription
TRUEnever evaluated
FALSEnever evaluated
attribute.name...= namespaceUriDescription
TRUEnever evaluated
FALSEnever evaluated
0
2707 return attribute.value();
never executed: return attribute.value();
0
2708 }
never executed: end of block
0
2709 return QStringRef();
never executed: return QStringRef();
0
2710}-
2711-
2712/*!\overload-
2713-
2714 Returns the value of the attribute with qualified name \a-
2715 qualifiedName , or an empty string reference if the attribute is not-
2716 defined. A qualified name is the raw name of an attribute in the XML-
2717 data. It consists of the namespace prefix, followed by colon,-
2718 followed by the attribute's local name. Since the namespace prefix-
2719 is not unique (the same prefix can point to different namespaces and-
2720 different prefixes can point to the same namespace), you shouldn't-
2721 use qualified names, but a resolved namespaceUri and the attribute's-
2722 local name.-
2723 */-
2724QStringRef QXmlStreamAttributes::value(const QString &qualifiedName) const-
2725{-
2726 for (int i = 0; i < size(); ++i) {
i < size()Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
3-19
2727 const QXmlStreamAttribute &attribute = at(i);-
2728 if (attribute.qualifiedName() == qualifiedName)
attribute.qual... qualifiedNameDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QXmlStream
5-14
2729 return attribute.value();
executed 5 times by 1 test: return attribute.value();
Executed by:
  • tst_QXmlStream
5
2730 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
14
2731 return QStringRef();
executed 3 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
3
2732}-
2733-
2734/*!\overload-
2735-
2736 Returns the value of the attribute with qualified name \a-
2737 qualifiedName , or an empty string reference if the attribute is not-
2738 defined. A qualified name is the raw name of an attribute in the XML-
2739 data. It consists of the namespace prefix, followed by colon,-
2740 followed by the attribute's local name. Since the namespace prefix-
2741 is not unique (the same prefix can point to different namespaces and-
2742 different prefixes can point to the same namespace), you shouldn't-
2743 use qualified names, but a resolved namespaceUri and the attribute's-
2744 local name.-
2745 */-
2746QStringRef QXmlStreamAttributes::value(QLatin1String qualifiedName) const-
2747{-
2748 for (int i = 0; i < size(); ++i) {
i < size()Description
TRUEevaluated 224211 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 16832 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
16832-224211
2749 const QXmlStreamAttribute &attribute = at(i);-
2750 if (attribute.qualifiedName() == qualifiedName)
attribute.qual... qualifiedNameDescription
TRUEevaluated 173184 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 51027 times by 14 tests
Evaluated by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
51027-173184
2751 return attribute.value();
executed 173184 times by 14 tests: return attribute.value();
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
173184
2752 }
executed 51027 times by 14 tests: end of block
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
51027
2753 return QStringRef();
executed 16832 times by 14 tests: return QStringRef();
Executed by:
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_NoApplication
  • tst_QDBusConnection_SpyHook
  • tst_QDBusContext
  • tst_QDBusInterface
  • tst_QDBusMetaObject
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDBusXmlParser
  • tst_QMimeDatabase
  • tst_QXmlStream
  • tst_qdbusxml2cpp - unknown status
16832
2754}-
2755-
2756/*!Appends a new attribute with \a name in the namespace-
2757 described with \a namespaceUri, and value \a value. The \a-
2758 namespaceUri can be empty.-
2759 */-
2760void QXmlStreamAttributes::append(const QString &namespaceUri, const QString &name, const QString &value)-
2761{-
2762 append(QXmlStreamAttribute(namespaceUri, name, value));-
2763}
never executed: end of block
0
2764-
2765/*!\overload-
2766 Appends a new attribute with qualified name \a qualifiedName and-
2767 value \a value.-
2768 */-
2769void QXmlStreamAttributes::append(const QString &qualifiedName, const QString &value)-
2770{-
2771 append(QXmlStreamAttribute(qualifiedName, value));-
2772}
never executed: end of block
0
2773-
2774#ifndef QT_NO_XMLSTREAMREADER-
2775-
2776/*! \fn bool QXmlStreamReader::isStartDocument() const-
2777 Returns \c true if tokenType() equals \l StartDocument; otherwise returns \c false.-
2778*/-
2779/*! \fn bool QXmlStreamReader::isEndDocument() const-
2780 Returns \c true if tokenType() equals \l EndDocument; otherwise returns \c false.-
2781*/-
2782/*! \fn bool QXmlStreamReader::isStartElement() const-
2783 Returns \c true if tokenType() equals \l StartElement; otherwise returns \c false.-
2784*/-
2785/*! \fn bool QXmlStreamReader::isEndElement() const-
2786 Returns \c true if tokenType() equals \l EndElement; otherwise returns \c false.-
2787*/-
2788/*! \fn bool QXmlStreamReader::isCharacters() const-
2789 Returns \c true if tokenType() equals \l Characters; otherwise returns \c false.-
2790-
2791 \sa isWhitespace(), isCDATA()-
2792*/-
2793/*! \fn bool QXmlStreamReader::isComment() const-
2794 Returns \c true if tokenType() equals \l Comment; otherwise returns \c false.-
2795*/-
2796/*! \fn bool QXmlStreamReader::isDTD() const-
2797 Returns \c true if tokenType() equals \l DTD; otherwise returns \c false.-
2798*/-
2799/*! \fn bool QXmlStreamReader::isEntityReference() const-
2800 Returns \c true if tokenType() equals \l EntityReference; otherwise returns \c false.-
2801*/-
2802/*! \fn bool QXmlStreamReader::isProcessingInstruction() const-
2803 Returns \c true if tokenType() equals \l ProcessingInstruction; otherwise returns \c false.-
2804*/-
2805-
2806/*! Returns \c true if the reader reports characters that only consist-
2807 of white-space; otherwise returns \c false.-
2808-
2809 \sa isCharacters(), text()-
2810*/-
2811bool QXmlStreamReader::isWhitespace() const-
2812{-
2813 Q_D(const QXmlStreamReader);-
2814 return d->type == QXmlStreamReader::Characters && d->isWhitespace;
executed 1903 times by 1 test: return d->type == QXmlStreamReader::Characters && d->isWhitespace;
Executed by:
  • tst_QXmlStream
d->type == QXm...er::CharactersDescription
TRUEevaluated 695 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1208 times by 1 test
Evaluated by:
  • tst_QXmlStream
d->isWhitespaceDescription
TRUEevaluated 474 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 221 times by 1 test
Evaluated by:
  • tst_QXmlStream
221-1903
2815}-
2816-
2817/*! Returns \c true if the reader reports characters that stem from a-
2818 CDATA section; otherwise returns \c false.-
2819-
2820 \sa isCharacters(), text()-
2821*/-
2822bool QXmlStreamReader::isCDATA() const-
2823{-
2824 Q_D(const QXmlStreamReader);-
2825 return d->type == QXmlStreamReader::Characters && d->isCDATA;
executed 1903 times by 1 test: return d->type == QXmlStreamReader::Characters && d->isCDATA;
Executed by:
  • tst_QXmlStream
d->type == QXm...er::CharactersDescription
TRUEevaluated 695 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1208 times by 1 test
Evaluated by:
  • tst_QXmlStream
d->isCDATADescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 685 times by 1 test
Evaluated by:
  • tst_QXmlStream
10-1903
2826}-
2827-
2828-
2829-
2830/*!-
2831 Returns \c true if this document has been declared standalone in the-
2832 XML declaration; otherwise returns \c false.-
2833-
2834 If no XML declaration has been parsed, this function returns \c false.-
2835 */-
2836bool QXmlStreamReader::isStandaloneDocument() const-
2837{-
2838 Q_D(const QXmlStreamReader);-
2839 return d->standalone;
executed 77 times by 1 test: return d->standalone;
Executed by:
  • tst_QXmlStream
77
2840}-
2841-
2842-
2843/*!-
2844 \since 4.4-
2845-
2846 If the tokenType() is \l StartDocument, this function returns the-
2847 version string as specified in the XML declaration.-
2848 Otherwise an empty string is returned.-
2849 */-
2850QStringRef QXmlStreamReader::documentVersion() const-
2851{-
2852 Q_D(const QXmlStreamReader);-
2853 if (d->type == QXmlStreamReader::StartDocument)
d->type == QXm...:StartDocumentDescription
TRUEevaluated 133 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1826 times by 1 test
Evaluated by:
  • tst_QXmlStream
133-1826
2854 return d->documentVersion;
executed 133 times by 1 test: return d->documentVersion;
Executed by:
  • tst_QXmlStream
133
2855 return QStringRef();
executed 1826 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
1826
2856}-
2857-
2858/*!-
2859 \since 4.4-
2860-
2861 If the tokenType() is \l StartDocument, this function returns the-
2862 encoding string as specified in the XML declaration.-
2863 Otherwise an empty string is returned.-
2864 */-
2865QStringRef QXmlStreamReader::documentEncoding() const-
2866{-
2867 Q_D(const QXmlStreamReader);-
2868 if (d->type == QXmlStreamReader::StartDocument)
d->type == QXm...:StartDocumentDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1826 times by 1 test
Evaluated by:
  • tst_QXmlStream
83-1826
2869 return d->documentEncoding;
executed 83 times by 1 test: return d->documentEncoding;
Executed by:
  • tst_QXmlStream
83
2870 return QStringRef();
executed 1826 times by 1 test: return QStringRef();
Executed by:
  • tst_QXmlStream
1826
2871}-
2872-
2873#endif // QT_NO_XMLSTREAMREADER-
2874-
2875/*!-
2876 \class QXmlStreamWriter-
2877 \inmodule QtCore-
2878 \since 4.3-
2879 \reentrant-
2880-
2881 \brief The QXmlStreamWriter class provides an XML writer with a-
2882 simple streaming API.-
2883-
2884 \ingroup xml-tools-
2885-
2886 QXmlStreamWriter is the counterpart to QXmlStreamReader for writing-
2887 XML. Like its related class, it operates on a QIODevice specified-
2888 with setDevice(). The API is simple and straightforward: for every-
2889 XML token or event you want to write, the writer provides a-
2890 specialized function.-
2891-
2892 You start a document with writeStartDocument() and end it with-
2893 writeEndDocument(). This will implicitly close all remaining open-
2894 tags.-
2895-
2896 Element tags are opened with writeStartElement() followed by-
2897 writeAttribute() or writeAttributes(), element content, and then-
2898 writeEndElement(). A shorter form writeEmptyElement() can be used-
2899 to write empty elements, followed by writeAttributes().-
2900-
2901 Element content consists of either characters, entity references or-
2902 nested elements. It is written with writeCharacters(), which also-
2903 takes care of escaping all forbidden characters and character-
2904 sequences, writeEntityReference(), or subsequent calls to-
2905 writeStartElement(). A convenience method writeTextElement() can be-
2906 used for writing terminal elements that contain nothing but text.-
2907-
2908 The following abridged code snippet shows the basic use of the class-
2909 to write formatted XML with indentation:-
2910-
2911 \snippet qxmlstreamwriter/main.cpp start stream-
2912 \dots-
2913 \snippet qxmlstreamwriter/main.cpp write element-
2914 \dots-
2915 \snippet qxmlstreamwriter/main.cpp finish stream-
2916-
2917 QXmlStreamWriter takes care of prefixing namespaces, all you have to-
2918 do is specify the \c namespaceUri when writing elements or-
2919 attributes. If you must conform to certain prefixes, you can force-
2920 the writer to use them by declaring the namespaces manually with-
2921 either writeNamespace() or writeDefaultNamespace(). Alternatively,-
2922 you can bypass the stream writer's namespace support and use-
2923 overloaded methods that take a qualified name instead. The namespace-
2924 \e http://www.w3.org/XML/1998/namespace is implicit and mapped to the-
2925 prefix \e xml.-
2926-
2927 The stream writer can automatically format the generated XML data by-
2928 adding line-breaks and indentation to empty sections between-
2929 elements, making the XML data more readable for humans and easier to-
2930 work with for most source code management systems. The feature can-
2931 be turned on with the \l autoFormatting property, and customized-
2932 with the \l autoFormattingIndent property.-
2933-
2934 Other functions are writeCDATA(), writeComment(),-
2935 writeProcessingInstruction(), and writeDTD(). Chaining of XML-
2936 streams is supported with writeCurrentToken().-
2937-
2938 By default, QXmlStreamWriter encodes XML in UTF-8. Different-
2939 encodings can be enforced using setCodec().-
2940-
2941 If an error occurs while writing to the underlying device, hasError()-
2942 starts returning true and subsequent writes are ignored.-
2943-
2944 The \l{QXmlStream Bookmarks Example} illustrates how to use a-
2945 stream writer to write an XML bookmark file (XBEL) that-
2946 was previously read in by a QXmlStreamReader.-
2947-
2948*/-
2949-
2950#ifndef QT_NO_XMLSTREAMWRITER-
2951-
2952class QXmlStreamWriterPrivate : public QXmlStreamPrivateTagStack {-
2953 QXmlStreamWriter *q_ptr;-
2954 Q_DECLARE_PUBLIC(QXmlStreamWriter)-
2955public:-
2956 QXmlStreamWriterPrivate(QXmlStreamWriter *q);-
2957 ~QXmlStreamWriterPrivate() {-
2958 if (deleteDevice)
deleteDeviceDescription
TRUEevaluated 710 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 34 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
34-710
2959 delete device;
executed 710 times by 1 test: delete device;
Executed by:
  • tst_QXmlStream
710
2960#ifndef QT_NO_TEXTCODEC-
2961 delete encoder;-
2962#endif-
2963 }
executed 744 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
744
2964-
2965 void write(const QStringRef &);-
2966 void write(const QString &);-
2967 void writeEscaped(const QString &, bool escapeWhitespace = false);-
2968 void write(const char *s, int len);-
2969 template <int N> void write(const char (&s)[N]) { write(s, N - 1); }
executed 9934 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
9934
2970 bool finishStartElement(bool contents = true);-
2971 void writeStartElement(const QString &namespaceUri, const QString &name);-
2972 QIODevice *device;-
2973 QString *stringDevice;-
2974 uint deleteDevice :1;-
2975 uint inStartElement :1;-
2976 uint inEmptyElement :1;-
2977 uint lastWasStartElement :1;-
2978 uint wroteSomething :1;-
2979 uint hasError :1;-
2980 uint autoFormatting :1;-
2981 uint isCodecASCIICompatible :1;-
2982 QByteArray autoFormattingIndent;-
2983 NamespaceDeclaration emptyNamespace;-
2984 int lastNamespaceDeclaration;-
2985-
2986#ifndef QT_NO_TEXTCODEC-
2987 QTextCodec *codec;-
2988 QTextEncoder *encoder;-
2989#endif-
2990 void checkIfASCIICompatibleCodec();-
2991-
2992 NamespaceDeclaration &findNamespace(const QString &namespaceUri, bool writeDeclaration = false, bool noDefault = false);-
2993 void writeNamespaceDeclaration(const NamespaceDeclaration &namespaceDeclaration);-
2994-
2995 int namespacePrefixCount;-
2996-
2997 void indent(int level);-
2998};-
2999-
3000-
3001QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q)-
3002 :autoFormattingIndent(4, ' ')-
3003{-
3004 q_ptr = q;-
3005 device = 0;-
3006 stringDevice = 0;-
3007 deleteDevice = false;-
3008#ifndef QT_NO_TEXTCODEC-
3009 codec = QTextCodec::codecForMib(106); // utf8-
3010 encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8-
3011#endif-
3012 checkIfASCIICompatibleCodec();-
3013 inStartElement = inEmptyElement = false;-
3014 wroteSomething = false;-
3015 hasError = false;-
3016 lastWasStartElement = false;-
3017 lastNamespaceDeclaration = 1;-
3018 autoFormatting = false;-
3019 namespacePrefixCount = 0;-
3020}
executed 744 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
744
3021-
3022void QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec()-
3023{-
3024#ifndef QT_NO_TEXTCODEC-
3025 Q_ASSERT(encoder);-
3026 // test ASCII-compatibility using the letter 'a'-
3027 QChar letterA = QLatin1Char('a');-
3028 const QByteArray bytesA = encoder->fromUnicode(&letterA, 1);-
3029 const bool isCodecASCIICompatibleA = (bytesA.count() == 1) && (bytesA[0] == 0x61) ;
(bytesA.count() == 1)Description
TRUEevaluated 757 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
(bytesA[0] == 0x61)Description
TRUEevaluated 756 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
1-757
3030 QChar letterLess = QLatin1Char('<');-
3031 const QByteArray bytesLess = encoder->fromUnicode(&letterLess, 1);-
3032 const bool isCodecASCIICompatibleLess = (bytesLess.count() == 1) && (bytesLess[0] == 0x3C) ;
(bytesLess.count() == 1)Description
TRUEevaluated 757 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
(bytesLess[0] == 0x3C)Description
TRUEevaluated 756 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
1-757
3033 isCodecASCIICompatible = isCodecASCIICompatibleA && isCodecASCIICompatibleLess ;
isCodecASCIICompatibleADescription
TRUEevaluated 756 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
isCodecASCIICompatibleLessDescription
TRUEevaluated 756 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEnever evaluated
0-756
3034#else-
3035 isCodecASCIICompatible = true;-
3036#endif-
3037}
executed 758 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
758
3038-
3039void QXmlStreamWriterPrivate::write(const QStringRef &s)-
3040{-
3041 if (device) {
deviceDescription
TRUEevaluated 3151 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QXmlStream
8-3151
3042 if (hasError)
hasErrorDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3147 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
4-3147
3043 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_QXmlStream
4
3044#ifdef QT_NO_TEXTCODEC-
3045 QByteArray bytes = s.toLatin1();-
3046#else-
3047 QByteArray bytes = encoder->fromUnicode(s.constData(), s.size());-
3048#endif-
3049 if (device->write(bytes) != bytes.size())
device->write(...= bytes.size()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3146 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1-3146
3050 hasError = true;
executed 1 time by 1 test: hasError = true;
Executed by:
  • tst_QXmlStream
1
3051 }
executed 3147 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
3147
3052 else if (stringDevice)
stringDeviceDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-8
3053 s.appendTo(stringDevice);
executed 8 times by 1 test: s.appendTo(stringDevice);
Executed by:
  • tst_QXmlStream
8
3054 else-
3055 qWarning("QXmlStreamWriter: No device");
never executed: QMessageLogger(__FILE__, 3055, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: No device");
0
3056}-
3057-
3058void QXmlStreamWriterPrivate::write(const QString &s)-
3059{-
3060 if (device) {
deviceDescription
TRUEevaluated 5148 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_QXmlStream
72-5148
3061 if (hasError)
hasErrorDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 5147 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1-5147
3062 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QXmlStream
1
3063#ifdef QT_NO_TEXTCODEC-
3064 QByteArray bytes = s.toLatin1();-
3065#else-
3066 QByteArray bytes = encoder->fromUnicode(s);-
3067#endif-
3068 if (device->write(bytes) != bytes.size())
device->write(...= bytes.size()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 5146 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1-5146
3069 hasError = true;
executed 1 time by 1 test: hasError = true;
Executed by:
  • tst_QXmlStream
1
3070 }
executed 5147 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
5147
3071 else if (stringDevice)
stringDeviceDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-72
3072 stringDevice->append(s);
executed 72 times by 1 test: stringDevice->append(s);
Executed by:
  • tst_QXmlStream
72
3073 else-
3074 qWarning("QXmlStreamWriter: No device");
never executed: QMessageLogger(__FILE__, 3074, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: No device");
0
3075}-
3076-
3077void QXmlStreamWriterPrivate::writeEscaped(const QString &s, bool escapeWhitespace)-
3078{-
3079 QString escaped;-
3080 escaped.reserve(s.size());-
3081 for ( int i = 0; i < s.size(); ++i ) {
i < s.size()Description
TRUEevaluated 20852 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 3437 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
3437-20852
3082 QChar c = s.at(i);-
3083 if (c.unicode() == '<' )
c.unicode() == '<'Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 20802 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
50-20802
3084 escaped.append(QLatin1String("&lt;"));
executed 50 times by 1 test: escaped.append(QLatin1String("&lt;"));
Executed by:
  • tst_QXmlStream
50
3085 else if (c.unicode() == '>' )
c.unicode() == '>'Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 20750 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
52-20750
3086 escaped.append(QLatin1String("&gt;"));
executed 52 times by 1 test: escaped.append(QLatin1String("&gt;"));
Executed by:
  • tst_QXmlStream
52
3087 else if (c.unicode() == '&' )
c.unicode() == '&'Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 20721 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
29-20721
3088 escaped.append(QLatin1String("&amp;"));
executed 29 times by 1 test: escaped.append(QLatin1String("&amp;"));
Executed by:
  • tst_QXmlStream
29
3089 else if (c.unicode() == '\"' )
c.unicode() == '\"'Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 20700 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
21-20700
3090 escaped.append(QLatin1String("&quot;"));
executed 21 times by 1 test: escaped.append(QLatin1String("&quot;"));
Executed by:
  • tst_QXmlStream
21
3091 else if (escapeWhitespace && c.isSpace()) {
escapeWhitespaceDescription
TRUEevaluated 4056 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 16644 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
c.isSpace()Description
TRUEevaluated 173 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 3883 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
173-16644
3092 if (c.unicode() == '\n')
c.unicode() == '\n'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 171 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-171
3093 escaped.append(QLatin1String("&#10;"));
executed 2 times by 1 test: escaped.append(QLatin1String("&#10;"));
Executed by:
  • tst_QXmlStream
2
3094 else if (c.unicode() == '\r')
c.unicode() == '\r'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 169 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-169
3095 escaped.append(QLatin1String("&#13;"));
executed 2 times by 1 test: escaped.append(QLatin1String("&#13;"));
Executed by:
  • tst_QXmlStream
2
3096 else if (c.unicode() == '\t')
c.unicode() == '\t'Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 166 times by 1 test
Evaluated by:
  • tst_QXmlStream
3-166
3097 escaped.append(QLatin1String("&#9;"));
executed 3 times by 1 test: escaped.append(QLatin1String("&#9;"));
Executed by:
  • tst_QXmlStream
3
3098 else-
3099 escaped += c;
executed 166 times by 1 test: escaped += c;
Executed by:
  • tst_QXmlStream
166
3100 } else {-
3101 escaped += QChar(c);-
3102 }
executed 20527 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
20527
3103 }-
3104 write(escaped);-
3105}
executed 3437 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
3437
3106-
3107// Converts from ASCII to output encoding-
3108void QXmlStreamWriterPrivate::write(const char *s, int len)-
3109{-
3110 if (device) {
deviceDescription
TRUEevaluated 10239 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_QXmlStream
64-10239
3111 if (hasError)
hasErrorDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 10225 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14-10225
3112 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_QXmlStream
14
3113 if (isCodecASCIICompatible) {
isCodecASCIICompatibleDescription
TRUEevaluated 10211 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QXmlStream
14-10211
3114 if (device->write(s, len) != len)
device->write(s, len) != lenDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 10209 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
2-10209
3115 hasError = true;
executed 2 times by 1 test: hasError = true;
Executed by:
  • tst_QXmlStream
2
3116 return;
executed 10211 times by 3 tests: return;
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
10211
3117 }-
3118 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
14
3119-
3120 write(QString::fromLatin1(s, len));-
3121}
executed 78 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
78
3122-
3123void QXmlStreamWriterPrivate::writeNamespaceDeclaration(const NamespaceDeclaration &namespaceDeclaration) {-
3124 if (namespaceDeclaration.prefix.isEmpty()) {
namespaceDecla...efix.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 102 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
0-102
3125 write(" xmlns=\"");-
3126 write(namespaceDeclaration.namespaceUri);-
3127 write("\"");-
3128 } else {
never executed: end of block
0
3129 write(" xmlns:");-
3130 write(namespaceDeclaration.prefix);-
3131 write("=\"");-
3132 write(namespaceDeclaration.namespaceUri);-
3133 write("\"");-
3134 }
executed 102 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
102
3135}-
3136-
3137bool QXmlStreamWriterPrivate::finishStartElement(bool contents)-
3138{-
3139 bool hadSomethingWritten = wroteSomething;-
3140 wroteSomething = contents;-
3141 if (!inStartElement)
!inStartElementDescription
TRUEevaluated 5103 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1276 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1276-5103
3142 return hadSomethingWritten;
executed 5103 times by 3 tests: return hadSomethingWritten;
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
5103
3143-
3144 if (inEmptyElement) {
inEmptyElementDescription
TRUEevaluated 39 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1237 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
39-1237
3145 write("/>");-
3146 QXmlStreamWriterPrivate::Tag &tag = tagStack_pop();-
3147 lastNamespaceDeclaration = tag.namespaceDeclarationsSize;-
3148 lastWasStartElement = false;-
3149 } else {
executed 39 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
39
3150 write(">");-
3151 }
executed 1237 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1237
3152 inStartElement = inEmptyElement = false;-
3153 lastNamespaceDeclaration = namespaceDeclarations.size();-
3154 return hadSomethingWritten;
executed 1276 times by 3 tests: return hadSomethingWritten;
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1276
3155}-
3156-
3157QXmlStreamPrivateTagStack::NamespaceDeclaration &QXmlStreamWriterPrivate::findNamespace(const QString &namespaceUri, bool writeDeclaration, bool noDefault)-
3158{-
3159 for (int j = namespaceDeclarations.size() - 1; j >= 0; --j) {
j >= 0Description
TRUEevaluated 2565 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1162 times by 1 test
Evaluated by:
  • tst_QXmlStream
1162-2565
3160 NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations[j];-
3161 if (namespaceDeclaration.namespaceUri == namespaceUri) {
namespaceDecla...= namespaceUriDescription
TRUEevaluated 302 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 2263 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
302-2263
3162 if (!noDefault || !namespaceDeclaration.prefix.isEmpty())
!noDefaultDescription
TRUEevaluated 134 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 168 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
!namespaceDecl...efix.isEmpty()Description
TRUEevaluated 168 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEnever evaluated
0-168
3163 return namespaceDeclaration;
executed 302 times by 3 tests: return namespaceDeclaration;
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
302
3164 }
never executed: end of block
0
3165 }
executed 2263 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
2263
3166 if (namespaceUri.isEmpty())
namespaceUri.isEmpty()Description
TRUEevaluated 1143 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_QXmlStream
19-1143
3167 return emptyNamespace;
executed 1143 times by 1 test: return emptyNamespace;
Executed by:
  • tst_QXmlStream
1143
3168 NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();-
3169 if (namespaceUri.isEmpty()) {
namespaceUri.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-19
3170 namespaceDeclaration.prefix.clear();-
3171 } else {
never executed: end of block
0
3172 QString s;-
3173 int n = ++namespacePrefixCount;-
3174 forever {-
3175 s = QLatin1Char('n') + QString::number(n++);-
3176 int j = namespaceDeclarations.size() - 2;-
3177 while (j >= 0 && namespaceDeclarations.at(j).prefix != s)
j >= 0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_QXmlStream
namespaceDecla...j).prefix != sDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-22
3178 --j;
executed 22 times by 1 test: --j;
Executed by:
  • tst_QXmlStream
22
3179 if (j < 0)
j < 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-19
3180 break;
executed 19 times by 1 test: break;
Executed by:
  • tst_QXmlStream
19
3181 }
never executed: end of block
0
3182 namespaceDeclaration.prefix = addToStringStorage(s);-
3183 }
executed 19 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
19
3184 namespaceDeclaration.namespaceUri = addToStringStorage(namespaceUri);-
3185 if (writeDeclaration)
writeDeclarationDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_QXmlStream
4-15
3186 writeNamespaceDeclaration(namespaceDeclaration);
executed 4 times by 1 test: writeNamespaceDeclaration(namespaceDeclaration);
Executed by:
  • tst_QXmlStream
4
3187 return namespaceDeclaration;
executed 19 times by 1 test: return namespaceDeclaration;
Executed by:
  • tst_QXmlStream
19
3188}-
3189-
3190-
3191-
3192void QXmlStreamWriterPrivate::indent(int level)-
3193{-
3194 write("\n");-
3195 for (int i = level; i > 0; --i)
i > 0Description
TRUEevaluated 332 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 218 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
218-332
3196 write(autoFormattingIndent.constData(), autoFormattingIndent.length());
executed 332 times by 3 tests: write(autoFormattingIndent.constData(), autoFormattingIndent.length());
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
332
3197}
executed 218 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
218
3198-
3199-
3200/*!-
3201 Constructs a stream writer.-
3202-
3203 \sa setDevice()-
3204 */-
3205QXmlStreamWriter::QXmlStreamWriter()-
3206 : d_ptr(new QXmlStreamWriterPrivate(this))-
3207{-
3208}
never executed: end of block
0
3209-
3210/*!-
3211 Constructs a stream writer that writes into \a device;-
3212 */-
3213QXmlStreamWriter::QXmlStreamWriter(QIODevice *device)-
3214 : d_ptr(new QXmlStreamWriterPrivate(this))-
3215{-
3216 Q_D(QXmlStreamWriter);-
3217 d->device = device;-
3218}
executed 32 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
32
3219-
3220/*! Constructs a stream writer that writes into \a array. This is the-
3221 same as creating an xml writer that operates on a QBuffer device-
3222 which in turn operates on \a array.-
3223 */-
3224QXmlStreamWriter::QXmlStreamWriter(QByteArray *array)-
3225 : d_ptr(new QXmlStreamWriterPrivate(this))-
3226{-
3227 Q_D(QXmlStreamWriter);-
3228 d->device = new QBuffer(array);-
3229 d->device->open(QIODevice::WriteOnly);-
3230 d->deleteDevice = true;-
3231}
executed 710 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
710
3232-
3233-
3234/*! Constructs a stream writer that writes into \a string.-
3235 */-
3236QXmlStreamWriter::QXmlStreamWriter(QString *string)-
3237 : d_ptr(new QXmlStreamWriterPrivate(this))-
3238{-
3239 Q_D(QXmlStreamWriter);-
3240 d->stringDevice = string;-
3241}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2
3242-
3243/*!-
3244 Destructor.-
3245*/-
3246QXmlStreamWriter::~QXmlStreamWriter()-
3247{-
3248}-
3249-
3250-
3251/*!-
3252 Sets the current device to \a device. If you want the stream to-
3253 write into a QByteArray, you can create a QBuffer device.-
3254-
3255 \sa device()-
3256*/-
3257void QXmlStreamWriter::setDevice(QIODevice *device)-
3258{-
3259 Q_D(QXmlStreamWriter);-
3260 if (device == d->device)
device == d->deviceDescription
TRUEnever evaluated
FALSEnever evaluated
0
3261 return;
never executed: return;
0
3262 d->stringDevice = 0;-
3263 if (d->deleteDevice) {
d->deleteDeviceDescription
TRUEnever evaluated
FALSEnever evaluated
0
3264 delete d->device;-
3265 d->deleteDevice = false;-
3266 }
never executed: end of block
0
3267 d->device = device;-
3268}
never executed: end of block
0
3269-
3270/*!-
3271 Returns the current device associated with the QXmlStreamWriter,-
3272 or 0 if no device has been assigned.-
3273-
3274 \sa setDevice()-
3275*/-
3276QIODevice *QXmlStreamWriter::device() const-
3277{-
3278 Q_D(const QXmlStreamWriter);-
3279 return d->device;
never executed: return d->device;
0
3280}-
3281-
3282-
3283#ifndef QT_NO_TEXTCODEC-
3284/*!-
3285 Sets the codec for this stream to \a codec. The codec is used for-
3286 encoding any data that is written. By default, QXmlStreamWriter-
3287 uses UTF-8.-
3288-
3289 The encoding information is stored in the initial xml tag which-
3290 gets written when you call writeStartDocument(). Call this-
3291 function before calling writeStartDocument().-
3292-
3293 \sa codec()-
3294*/-
3295void QXmlStreamWriter::setCodec(QTextCodec *codec)-
3296{-
3297 Q_D(QXmlStreamWriter);-
3298 if (codec) {
codecDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEnever evaluated
0-14
3299 d->codec = codec;-
3300 delete d->encoder;-
3301 d->encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8-
3302 d->checkIfASCIICompatibleCodec();-
3303 }
executed 14 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14
3304}
executed 14 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14
3305-
3306/*!-
3307 Sets the codec for this stream to the QTextCodec for the encoding-
3308 specified by \a codecName. Common values for \c codecName include-
3309 "ISO 8859-1", "UTF-8", and "UTF-16". If the encoding isn't-
3310 recognized, nothing happens.-
3311-
3312 \sa QTextCodec::codecForName()-
3313*/-
3314void QXmlStreamWriter::setCodec(const char *codecName)-
3315{-
3316 setCodec(QTextCodec::codecForName(codecName));-
3317}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QXmlStream
1
3318-
3319/*!-
3320 Returns the codec that is currently assigned to the stream.-
3321-
3322 \sa setCodec()-
3323*/-
3324QTextCodec *QXmlStreamWriter::codec() const-
3325{-
3326 Q_D(const QXmlStreamWriter);-
3327 return d->codec;
never executed: return d->codec;
0
3328}-
3329#endif // QT_NO_TEXTCODEC-
3330-
3331/*!-
3332 \property QXmlStreamWriter::autoFormatting-
3333 \since 4.4-
3334 The auto-formatting flag of the stream writer-
3335-
3336 This property controls whether or not the stream writer-
3337 automatically formats the generated XML data. If enabled, the-
3338 writer automatically adds line-breaks and indentation to empty-
3339 sections between elements (ignorable whitespace). The main purpose-
3340 of auto-formatting is to split the data into several lines, and to-
3341 increase readability for a human reader. The indentation depth can-
3342 be controlled through the \l autoFormattingIndent property.-
3343-
3344 By default, auto-formatting is disabled.-
3345*/-
3346-
3347/*!-
3348 \since 4.4-
3349-
3350 Enables auto formatting if \a enable is \c true, otherwise-
3351 disables it.-
3352-
3353 The default value is \c false.-
3354 */-
3355void QXmlStreamWriter::setAutoFormatting(bool enable)-
3356{-
3357 Q_D(QXmlStreamWriter);-
3358 d->autoFormatting = enable;-
3359}
executed 28 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
28
3360-
3361/*!-
3362 \since 4.4-
3363-
3364 Returns \c true if auto formattting is enabled, otherwise \c false.-
3365 */-
3366bool QXmlStreamWriter::autoFormatting() const-
3367{-
3368 Q_D(const QXmlStreamWriter);-
3369 return d->autoFormatting;
never executed: return d->autoFormatting;
0
3370}-
3371-
3372/*!-
3373 \property QXmlStreamWriter::autoFormattingIndent-
3374 \since 4.4-
3375-
3376 \brief the number of spaces or tabs used for indentation when-
3377 auto-formatting is enabled. Positive numbers indicate spaces,-
3378 negative numbers tabs.-
3379-
3380 The default indentation is 4.-
3381-
3382 \sa autoFormatting-
3383*/-
3384-
3385-
3386void QXmlStreamWriter::setAutoFormattingIndent(int spacesOrTabs)-
3387{-
3388 Q_D(QXmlStreamWriter);-
3389 d->autoFormattingIndent = QByteArray(qAbs(spacesOrTabs), spacesOrTabs >= 0 ? ' ' : '\t');-
3390}
executed 21 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
21
3391-
3392int QXmlStreamWriter::autoFormattingIndent() const-
3393{-
3394 Q_D(const QXmlStreamWriter);-
3395 return d->autoFormattingIndent.count(' ') - d->autoFormattingIndent.count('\t');
executed 1 time by 1 test: return d->autoFormattingIndent.count(' ') - d->autoFormattingIndent.count('\t');
Executed by:
  • tst_QXmlStream
1
3396}-
3397-
3398/*!-
3399 Returns \c true if the stream failed to write to the underlying device.-
3400-
3401 The error status is never reset. Writes happening after the error-
3402 occurred are ignored, even if the error condition is cleared.-
3403 */-
3404bool QXmlStreamWriter::hasError() const-
3405{-
3406 Q_D(const QXmlStreamWriter);-
3407 return d->hasError;
executed 6 times by 1 test: return d->hasError;
Executed by:
  • tst_QXmlStream
6
3408}-
3409-
3410/*!-
3411 \overload-
3412 Writes an attribute with \a qualifiedName and \a value.-
3413-
3414-
3415 This function can only be called after writeStartElement() before-
3416 any content is written, or after writeEmptyElement().-
3417 */-
3418void QXmlStreamWriter::writeAttribute(const QString &qualifiedName, const QString &value)-
3419{-
3420 Q_D(QXmlStreamWriter);-
3421 Q_ASSERT(d->inStartElement);-
3422 Q_ASSERT(qualifiedName.count(QLatin1Char(':')) <= 1);-
3423 d->write(" ");-
3424 d->write(qualifiedName);-
3425 d->write("=\"");-
3426 d->writeEscaped(value, true);-
3427 d->write("\"");-
3428}
executed 440 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
440
3429-
3430/*! Writes an attribute with \a name and \a value, prefixed for-
3431 the specified \a namespaceUri. If the namespace has not been-
3432 declared yet, QXmlStreamWriter will generate a namespace declaration-
3433 for it.-
3434-
3435 This function can only be called after writeStartElement() before-
3436 any content is written, or after writeEmptyElement().-
3437 */-
3438void QXmlStreamWriter::writeAttribute(const QString &namespaceUri, const QString &name, const QString &value)-
3439{-
3440 Q_D(QXmlStreamWriter);-
3441 Q_ASSERT(d->inStartElement);-
3442 Q_ASSERT(!name.contains(QLatin1Char(':')));-
3443 QXmlStreamWriterPrivate::NamespaceDeclaration &namespaceDeclaration = d->findNamespace(namespaceUri, true, true);-
3444 d->write(" ");-
3445 if (!namespaceDeclaration.prefix.isEmpty()) {
!namespaceDecl...efix.isEmpty()Description
TRUEevaluated 172 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEnever evaluated
0-172
3446 d->write(namespaceDeclaration.prefix);-
3447 d->write(":");-
3448 }
executed 172 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
172
3449 d->write(name);-
3450 d->write("=\"");-
3451 d->writeEscaped(value, true);-
3452 d->write("\"");-
3453}
executed 172 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
172
3454-
3455/*!-
3456 \overload-
3457-
3458 Writes the \a attribute.-
3459-
3460 This function can only be called after writeStartElement() before-
3461 any content is written, or after writeEmptyElement().-
3462 */-
3463void QXmlStreamWriter::writeAttribute(const QXmlStreamAttribute& attribute)-
3464{-
3465 if (attribute.namespaceUri().isEmpty())
attribute.name...ri().isEmpty()Description
TRUEevaluated 433 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_QXmlStream
34-433
3466 writeAttribute(attribute.qualifiedName().toString(),
executed 433 times by 1 test: writeAttribute(attribute.qualifiedName().toString(), attribute.value().toString());
Executed by:
  • tst_QXmlStream
433
3467 attribute.value().toString());
executed 433 times by 1 test: writeAttribute(attribute.qualifiedName().toString(), attribute.value().toString());
Executed by:
  • tst_QXmlStream
433
3468 else-
3469 writeAttribute(attribute.namespaceUri().toString(),
executed 34 times by 1 test: writeAttribute(attribute.namespaceUri().toString(), attribute.name().toString(), attribute.value().toString());
Executed by:
  • tst_QXmlStream
34
3470 attribute.name().toString(),
executed 34 times by 1 test: writeAttribute(attribute.namespaceUri().toString(), attribute.name().toString(), attribute.value().toString());
Executed by:
  • tst_QXmlStream
34
3471 attribute.value().toString());
executed 34 times by 1 test: writeAttribute(attribute.namespaceUri().toString(), attribute.name().toString(), attribute.value().toString());
Executed by:
  • tst_QXmlStream
34
3472}-
3473-
3474-
3475/*! Writes the attribute vector \a attributes. If a namespace-
3476 referenced in an attribute not been declared yet, QXmlStreamWriter-
3477 will generate a namespace declaration for it.-
3478-
3479 This function can only be called after writeStartElement() before-
3480 any content is written, or after writeEmptyElement().-
3481-
3482 \sa writeAttribute(), writeNamespace()-
3483 */-
3484void QXmlStreamWriter::writeAttributes(const QXmlStreamAttributes& attributes)-
3485{-
3486 Q_D(QXmlStreamWriter);-
3487 Q_ASSERT(d->inStartElement);-
3488 Q_UNUSED(d);-
3489 for (int i = 0; i < attributes.size(); ++i)
i < attributes.size()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-4
3490 writeAttribute(attributes.at(i));
never executed: writeAttribute(attributes.at(i));
0
3491}
executed 4 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
4
3492-
3493-
3494/*! Writes \a text as CDATA section. If \a text contains the-
3495 forbidden character sequence "]]>", it is split into different CDATA-
3496 sections.-
3497-
3498 This function mainly exists for completeness. Normally you should-
3499 not need use it, because writeCharacters() automatically escapes all-
3500 non-content characters.-
3501 */-
3502void QXmlStreamWriter::writeCDATA(const QString &text)-
3503{-
3504 Q_D(QXmlStreamWriter);-
3505 d->finishStartElement();-
3506 QString copy(text);-
3507 copy.replace(QLatin1String("]]>"), QLatin1String("]]]]><![CDATA[>"));-
3508 d->write("<![CDATA[");-
3509 d->write(copy);-
3510 d->write("]]>");-
3511}
never executed: end of block
0
3512-
3513-
3514/*! Writes \a text. The characters "<", "&", and "\"" are escaped as entity-
3515 references "&lt;", "&amp;, and "&quot;". To avoid the forbidden sequence-
3516 "]]>", ">" is also escaped as "&gt;".-
3517-
3518 \sa writeEntityReference()-
3519 */-
3520void QXmlStreamWriter::writeCharacters(const QString &text)-
3521{-
3522 Q_D(QXmlStreamWriter);-
3523 d->finishStartElement();-
3524 d->writeEscaped(text);-
3525}
executed 2825 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
2825
3526-
3527-
3528/*! Writes \a text as XML comment, where \a text must not contain the-
3529 forbidden sequence "--" or end with "-". Note that XML does not-
3530 provide any way to escape "-" in a comment.-
3531 */-
3532void QXmlStreamWriter::writeComment(const QString &text)-
3533{-
3534 Q_D(QXmlStreamWriter);-
3535 Q_ASSERT(!text.contains(QLatin1String("--")) && !text.endsWith(QLatin1Char('-')));-
3536 if (!d->finishStartElement(false) && d->autoFormatting)
!d->finishStartElement(false)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
d->autoFormattingDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-7
3537 d->indent(d->tagStack.size());
executed 7 times by 1 test: d->indent(d->tagStack.size());
Executed by:
  • tst_QXmlStream
7
3538 d->write("<!--");-
3539 d->write(text);-
3540 d->write("-->");-
3541 d->inStartElement = d->lastWasStartElement = false;-
3542}
executed 7 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
7
3543-
3544-
3545/*! Writes a DTD section. The \a dtd represents the entire-
3546 doctypedecl production from the XML 1.0 specification.-
3547 */-
3548void QXmlStreamWriter::writeDTD(const QString &dtd)-
3549{-
3550 Q_D(QXmlStreamWriter);-
3551 d->finishStartElement();-
3552 if (d->autoFormatting)
d->autoFormattingDescription
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-46
3553 d->write("\n");
never executed: d->write("\n");
0
3554 d->write(dtd);-
3555 if (d->autoFormatting)
d->autoFormattingDescription
TRUEnever evaluated
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-46
3556 d->write("\n");
never executed: d->write("\n");
0
3557}
executed 46 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
46
3558-
3559-
3560-
3561/*! \overload-
3562 Writes an empty element with qualified name \a qualifiedName.-
3563 Subsequent calls to writeAttribute() will add attributes to this element.-
3564*/-
3565void QXmlStreamWriter::writeEmptyElement(const QString &qualifiedName)-
3566{-
3567 Q_D(QXmlStreamWriter);-
3568 Q_ASSERT(qualifiedName.count(QLatin1Char(':')) <= 1);-
3569 d->writeStartElement(QString(), qualifiedName);-
3570 d->inEmptyElement = true;-
3571}
executed 5 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
5
3572-
3573-
3574/*! Writes an empty element with \a name, prefixed for the specified-
3575 \a namespaceUri. If the namespace has not been declared,-
3576 QXmlStreamWriter will generate a namespace declaration for it.-
3577 Subsequent calls to writeAttribute() will add attributes to this element.-
3578-
3579 \sa writeNamespace()-
3580 */-
3581void QXmlStreamWriter::writeEmptyElement(const QString &namespaceUri, const QString &name)-
3582{-
3583 Q_D(QXmlStreamWriter);-
3584 Q_ASSERT(!name.contains(QLatin1Char(':')));-
3585 d->writeStartElement(namespaceUri, name);-
3586 d->inEmptyElement = true;-
3587}
executed 34 times by 2 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
34
3588-
3589-
3590/*!\overload-
3591 Writes a text element with \a qualifiedName and \a text.-
3592-
3593-
3594 This is a convenience function equivalent to:-
3595 \snippet code/src_corelib_xml_qxmlstream.cpp 1-
3596-
3597*/-
3598void QXmlStreamWriter::writeTextElement(const QString &qualifiedName, const QString &text)-
3599{-
3600 writeStartElement(qualifiedName);-
3601 writeCharacters(text);-
3602 writeEndElement();-
3603}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QXmlStream
1
3604-
3605/*! Writes a text element with \a name, prefixed for the specified \a-
3606 namespaceUri, and \a text. If the namespace has not been-
3607 declared, QXmlStreamWriter will generate a namespace declaration-
3608 for it.-
3609-
3610-
3611 This is a convenience function equivalent to:-
3612 \snippet code/src_corelib_xml_qxmlstream.cpp 2-
3613-
3614*/-
3615void QXmlStreamWriter::writeTextElement(const QString &namespaceUri, const QString &name, const QString &text)-
3616{-
3617 writeStartElement(namespaceUri, name);-
3618 writeCharacters(text);-
3619 writeEndElement();-
3620}
never executed: end of block
0
3621-
3622-
3623/*!-
3624 Closes all remaining open start elements and writes a newline.-
3625-
3626 \sa writeStartDocument()-
3627 */-
3628void QXmlStreamWriter::writeEndDocument()-
3629{-
3630 Q_D(QXmlStreamWriter);-
3631 while (d->tagStack.size())
d->tagStack.size()Description
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14-33
3632 writeEndElement();
executed 14 times by 3 tests: writeEndElement();
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14
3633 d->write("\n");-
3634}
executed 33 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
33
3635-
3636/*!-
3637 Closes the previous start element.-
3638-
3639 \sa writeStartElement()-
3640 */-
3641void QXmlStreamWriter::writeEndElement()-
3642{-
3643 Q_D(QXmlStreamWriter);-
3644 if (d->tagStack.isEmpty())
d->tagStack.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1255 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1-1255
3645 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QXmlStream
1
3646-
3647 // shortcut: if nothing was written, close as empty tag-
3648 if (d->inStartElement && !d->inEmptyElement) {
d->inStartElementDescription
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1213 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
!d->inEmptyElementDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 28 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14-1213
3649 d->write("/>");-
3650 d->lastWasStartElement = d->inStartElement = false;-
3651 QXmlStreamWriterPrivate::Tag &tag = d->tagStack_pop();-
3652 d->lastNamespaceDeclaration = tag.namespaceDeclarationsSize;-
3653 return;
executed 14 times by 3 tests: return;
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
14
3654 }-
3655-
3656 if (!d->finishStartElement(false) && !d->lastWasStartElement && d->autoFormatting)
!d->finishStartElement(false)Description
TRUEevaluated 145 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1096 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
!d->lastWasStartElementDescription
TRUEevaluated 138 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QXmlStream
d->autoFormattingDescription
TRUEevaluated 77 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 61 times by 1 test
Evaluated by:
  • tst_QXmlStream
7-1096
3657 d->indent(d->tagStack.size()-1);
executed 77 times by 3 tests: d->indent(d->tagStack.size()-1);
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
77
3658 if (d->tagStack.isEmpty())
d->tagStack.isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1237 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
4-1237
3659 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_QXmlStream
4
3660 d->lastWasStartElement = false;-
3661 QXmlStreamWriterPrivate::Tag &tag = d->tagStack_pop();-
3662 d->lastNamespaceDeclaration = tag.namespaceDeclarationsSize;-
3663 d->write("</");-
3664 if (!tag.namespaceDeclaration.prefix.isEmpty()) {
!tag.namespace...efix.isEmpty()Description
TRUEevaluated 105 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1132 times by 1 test
Evaluated by:
  • tst_QXmlStream
105-1132
3665 d->write(tag.namespaceDeclaration.prefix);-
3666 d->write(":");-
3667 }
executed 105 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
105
3668 d->write(tag.name);-
3669 d->write(">");-
3670}
executed 1237 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1237
3671-
3672-
3673-
3674/*!-
3675 Writes the entity reference \a name to the stream, as "&\a{name};".-
3676 */-
3677void QXmlStreamWriter::writeEntityReference(const QString &name)-
3678{-
3679 Q_D(QXmlStreamWriter);-
3680 d->finishStartElement();-
3681 d->write("&");-
3682 d->write(name);-
3683 d->write(";");-
3684}
executed 857 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
857
3685-
3686-
3687/*! Writes a namespace declaration for \a namespaceUri with \a-
3688 prefix. If \a prefix is empty, QXmlStreamWriter assigns a unique-
3689 prefix consisting of the letter 'n' followed by a number.-
3690-
3691 If writeStartElement() or writeEmptyElement() was called, the-
3692 declaration applies to the current element; otherwise it applies to-
3693 the next child element.-
3694-
3695 Note that the prefix \e xml is both predefined and reserved for-
3696 \e http://www.w3.org/XML/1998/namespace, which in turn cannot be-
3697 bound to any other prefix. The prefix \e xmlns and its URI-
3698 \e http://www.w3.org/2000/xmlns/ are used for the namespace mechanism-
3699 itself and thus completely forbidden in declarations.-
3700-
3701 */-
3702void QXmlStreamWriter::writeNamespace(const QString &namespaceUri, const QString &prefix)-
3703{-
3704 Q_D(QXmlStreamWriter);-
3705 Q_ASSERT(!namespaceUri.isEmpty());-
3706 Q_ASSERT(prefix != QLatin1String("xmlns"));-
3707 if (prefix.isEmpty()) {
prefix.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 83 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
0-83
3708 d->findNamespace(namespaceUri, d->inStartElement);-
3709 } else {
never executed: end of block
0
3710 Q_ASSERT(!((prefix == QLatin1String("xml")) ^ (namespaceUri == QLatin1String("http://www.w3.org/XML/1998/namespace"))));-
3711 Q_ASSERT(namespaceUri != QLatin1String("http://www.w3.org/2000/xmlns/"));-
3712 QXmlStreamWriterPrivate::NamespaceDeclaration &namespaceDeclaration = d->namespaceDeclarations.push();-
3713 namespaceDeclaration.prefix = d->addToStringStorage(prefix);-
3714 namespaceDeclaration.namespaceUri = d->addToStringStorage(namespaceUri);-
3715 if (d->inStartElement)
d->inStartElementDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 81 times by 2 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
2-81
3716 d->writeNamespaceDeclaration(namespaceDeclaration);
executed 2 times by 1 test: d->writeNamespaceDeclaration(namespaceDeclaration);
Executed by:
  • tst_QXmlStream
2
3717 }
executed 83 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
83
3718}-
3719-
3720-
3721/*! Writes a default namespace declaration for \a namespaceUri.-
3722-
3723 If writeStartElement() or writeEmptyElement() was called, the-
3724 declaration applies to the current element; otherwise it applies to-
3725 the next child element.-
3726-
3727 Note that the namespaces \e http://www.w3.org/XML/1998/namespace-
3728 (bound to \e xmlns) and \e http://www.w3.org/2000/xmlns/ (bound to-
3729 \e xml) by definition cannot be declared as default.-
3730 */-
3731void QXmlStreamWriter::writeDefaultNamespace(const QString &namespaceUri)-
3732{-
3733 Q_D(QXmlStreamWriter);-
3734 Q_ASSERT(namespaceUri != QLatin1String("http://www.w3.org/XML/1998/namespace"));-
3735 Q_ASSERT(namespaceUri != QLatin1String("http://www.w3.org/2000/xmlns/"));-
3736 QXmlStreamWriterPrivate::NamespaceDeclaration &namespaceDeclaration = d->namespaceDeclarations.push();-
3737 namespaceDeclaration.prefix.clear();-
3738 namespaceDeclaration.namespaceUri = d->addToStringStorage(namespaceUri);-
3739 if (d->inStartElement)
d->inStartElementDescription
TRUEnever evaluated
FALSEnever evaluated
0
3740 d->writeNamespaceDeclaration(namespaceDeclaration);
never executed: d->writeNamespaceDeclaration(namespaceDeclaration);
0
3741}
never executed: end of block
0
3742-
3743-
3744/*!-
3745 Writes an XML processing instruction with \a target and \a data,-
3746 where \a data must not contain the sequence "?>".-
3747 */-
3748void QXmlStreamWriter::writeProcessingInstruction(const QString &target, const QString &data)-
3749{-
3750 Q_D(QXmlStreamWriter);-
3751 Q_ASSERT(!data.contains(QLatin1String("?>")));-
3752 if (!d->finishStartElement(false) && d->autoFormatting)
!d->finishStartElement(false)Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QXmlStream
d->autoFormattingDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 60 times by 1 test
Evaluated by:
  • tst_QXmlStream
1-61
3753 d->indent(d->tagStack.size());
executed 1 time by 1 test: d->indent(d->tagStack.size());
Executed by:
  • tst_QXmlStream
1
3754 d->write("<?");-
3755 d->write(target);-
3756 if (!data.isNull()) {
!data.isNull()Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-72
3757 d->write(" ");-
3758 d->write(data);-
3759 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
72
3760 d->write("?>");-
3761}
executed 72 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
72
3762-
3763-
3764-
3765/*!\overload-
3766-
3767 Writes a document start with XML version number "1.0". This also-
3768 writes the encoding information.-
3769-
3770 \sa writeEndDocument(), setCodec()-
3771 \since 4.5-
3772 */-
3773void QXmlStreamWriter::writeStartDocument()-
3774{-
3775 writeStartDocument(QLatin1String("1.0"));-
3776}
executed 34 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
34
3777-
3778-
3779/*!-
3780 Writes a document start with the XML version number \a version.-
3781-
3782 \sa writeEndDocument()-
3783 */-
3784void QXmlStreamWriter::writeStartDocument(const QString &version)-
3785{-
3786 Q_D(QXmlStreamWriter);-
3787 d->finishStartElement(false);-
3788 d->write("<?xml version=\"");-
3789 d->write(version);-
3790 if (d->device) { // stringDevice does not get any encoding
d->deviceDescription
TRUEevaluated 35 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
2-35
3791 d->write("\" encoding=\"");-
3792#ifdef QT_NO_TEXTCODEC-
3793 d->write("iso-8859-1");-
3794#else-
3795 d->write(d->codec->name().constData(), d->codec->name().length());-
3796#endif-
3797 }
executed 35 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
35
3798 d->write("\"?>");-
3799}
executed 37 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
37
3800-
3801/*! Writes a document start with the XML version number \a version-
3802 and a standalone attribute \a standalone.-
3803-
3804 \sa writeEndDocument()-
3805 \since 4.5-
3806 */-
3807void QXmlStreamWriter::writeStartDocument(const QString &version, bool standalone)-
3808{-
3809 Q_D(QXmlStreamWriter);-
3810 d->finishStartElement(false);-
3811 d->write("<?xml version=\"");-
3812 d->write(version);-
3813 if (d->device) { // stringDevice does not get any encoding
d->deviceDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEnever evaluated
0-2
3814 d->write("\" encoding=\"");-
3815#ifdef QT_NO_TEXTCODEC-
3816 d->write("iso-8859-1");-
3817#else-
3818 d->write(d->codec->name().constData(), d->codec->name().length());-
3819#endif-
3820 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
2
3821 if (standalone)
standaloneDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QXmlStream
1
3822 d->write("\" standalone=\"yes\"?>");
executed 1 time by 1 test: d->write("\" standalone=\"yes\"?>");
Executed by:
  • tst_QXmlStream
1
3823 else-
3824 d->write("\" standalone=\"no\"?>");
executed 1 time by 1 test: d->write("\" standalone=\"no\"?>");
Executed by:
  • tst_QXmlStream
1
3825}-
3826-
3827-
3828/*!\overload-
3829-
3830 Writes a start element with \a qualifiedName. Subsequent calls to-
3831 writeAttribute() will add attributes to this element.-
3832-
3833 \sa writeEndElement(), writeEmptyElement()-
3834 */-
3835void QXmlStreamWriter::writeStartElement(const QString &qualifiedName)-
3836{-
3837 Q_D(QXmlStreamWriter);-
3838 Q_ASSERT(qualifiedName.count(QLatin1Char(':')) <= 1);-
3839 d->writeStartElement(QString(), qualifiedName);-
3840}
executed 10 times by 1 test: end of block
Executed by:
  • tst_QXmlStream
10
3841-
3842-
3843/*! Writes a start element with \a name, prefixed for the specified-
3844 \a namespaceUri. If the namespace has not been declared yet,-
3845 QXmlStreamWriter will generate a namespace declaration for-
3846 it. Subsequent calls to writeAttribute() will add attributes to this-
3847 element.-
3848-
3849 \sa writeNamespace(), writeEndElement(), writeEmptyElement()-
3850 */-
3851void QXmlStreamWriter::writeStartElement(const QString &namespaceUri, const QString &name)-
3852{-
3853 Q_D(QXmlStreamWriter);-
3854 Q_ASSERT(!name.contains(QLatin1Char(':')));-
3855 d->writeStartElement(namespaceUri, name);-
3856}
executed 1243 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1243
3857-
3858void QXmlStreamWriterPrivate::writeStartElement(const QString &namespaceUri, const QString &name)-
3859{-
3860 if (!finishStartElement(false) && autoFormatting)
!finishStartElement(false)Description
TRUEevaluated 845 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 447 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
autoFormattingDescription
TRUEevaluated 133 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 712 times by 1 test
Evaluated by:
  • tst_QXmlStream
133-845
3861 indent(tagStack.size());
executed 133 times by 3 tests: indent(tagStack.size());
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
133
3862-
3863 Tag &tag = tagStack_push();-
3864 tag.name = addToStringStorage(name);-
3865 tag.namespaceDeclaration = findNamespace(namespaceUri);-
3866 write("<");-
3867 if (!tag.namespaceDeclaration.prefix.isEmpty()) {
!tag.namespace...efix.isEmpty()Description
TRUEevaluated 149 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1143 times by 1 test
Evaluated by:
  • tst_QXmlStream
149-1143
3868 write(tag.namespaceDeclaration.prefix);-
3869 write(":");-
3870 }
executed 149 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
149
3871 write(tag.name);-
3872 inStartElement = lastWasStartElement = true;-
3873-
3874 for (int i = lastNamespaceDeclaration; i < namespaceDeclarations.size(); ++i)
i < namespaceD...rations.size()Description
TRUEevaluated 96 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
FALSEevaluated 1292 times by 3 tests
Evaluated by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
96-1292
3875 writeNamespaceDeclaration(namespaceDeclarations[i]);
executed 96 times by 3 tests: writeNamespaceDeclaration(namespaceDeclarations[i]);
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
96
3876 tag.namespaceDeclarationsSize = lastNamespaceDeclaration;-
3877}
executed 1292 times by 3 tests: end of block
Executed by:
  • tst_QPlainTextEdit
  • tst_QTextEdit
  • tst_QXmlStream
1292
3878-
3879#ifndef QT_NO_XMLSTREAMREADER-
3880/*! Writes the current state of the \a reader. All possible valid-
3881 states are supported.-
3882-
3883 The purpose of this function is to support chained processing of XML data.-
3884-
3885 \sa QXmlStreamReader::tokenType()-
3886 */-
3887void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader)-
3888{-
3889 switch (reader.tokenType()) {-
3890 case QXmlStreamReader::NoToken:
never executed: case QXmlStreamReader::NoToken:
0
3891 break;
never executed: break;
0
3892 case QXmlStreamReader::StartDocument:
executed 2 times by 1 test: case QXmlStreamReader::StartDocument:
Executed by:
  • tst_QXmlStream
2
3893 writeStartDocument();-
3894 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QXmlStream
2
3895 case QXmlStreamReader::EndDocument:
executed 2 times by 1 test: case QXmlStreamReader::EndDocument:
Executed by:
  • tst_QXmlStream
2
3896 writeEndDocument();-
3897 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QXmlStream
2
3898 case QXmlStreamReader::StartElement: {
executed 4 times by 1 test: case QXmlStreamReader::StartElement:
Executed by:
  • tst_QXmlStream
4
3899 QXmlStreamNamespaceDeclarations namespaceDeclarations = reader.namespaceDeclarations();-
3900 for (int i = 0; i < namespaceDeclarations.size(); ++i) {
i < namespaceD...rations.size()Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QXmlStream
0-4
3901 const QXmlStreamNamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(i);-
3902 writeNamespace(namespaceDeclaration.namespaceUri().toString(),-
3903 namespaceDeclaration.prefix().toString());-
3904 }
never executed: end of block
0
3905 writeStartElement(reader.namespaceUri().toString(), reader.name().toString());-
3906 writeAttributes(reader.attributes());-
3907 } break;
executed 4 times by 1 test: break;
Executed by:
  • tst_QXmlStream
4
3908 case QXmlStreamReader::EndElement:
executed 1144 times by 1 test: case QXmlStreamReader::EndElement:
Executed by:
  • tst_QXmlStream
1144
3909 writeEndElement();-
3910 break;
executed 1144 times by 1 test: break;
Executed by:
  • tst_QXmlStream
1144
3911 case QXmlStreamReader::Characters:
never executed: case QXmlStreamReader::Characters:
0
3912 if (reader.isCDATA())
reader.isCDATA()Description
TRUEnever evaluated
FALSEnever evaluated
0
3913 writeCDATA(reader.text().toString());
never executed: writeCDATA(reader.text().toString());
0
3914 else-
3915 writeCharacters(reader.text().toString());
never executed: writeCharacters(reader.text().toString());
0
3916 break;
never executed: break;
0
3917 case QXmlStreamReader::Comment:
executed 6 times by 1 test: case QXmlStreamReader::Comment:
Executed by:
  • tst_QXmlStream
6
3918 writeComment(reader.text().toString());-
3919 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_QXmlStream
6
3920 case QXmlStreamReader::DTD:
never executed: case QXmlStreamReader::DTD:
0
3921 writeDTD(reader.text().toString());-
3922 break;
never executed: break;
0
3923 case QXmlStreamReader::EntityReference:
executed 1 time by 1 test: case QXmlStreamReader::EntityReference:
Executed by:
  • tst_QXmlStream
1
3924 writeEntityReference(reader.name().toString());-
3925 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QXmlStream
1
3926 case QXmlStreamReader::ProcessingInstruction:
executed 48 times by 1 test: case QXmlStreamReader::ProcessingInstruction:
Executed by:
  • tst_QXmlStream
48
3927 writeProcessingInstruction(reader.processingInstructionTarget().toString(),-
3928 reader.processingInstructionData().toString());-
3929 break;
executed 48 times by 1 test: break;
Executed by:
  • tst_QXmlStream
48
3930 default:
never executed: default:
0
3931 Q_ASSERT(reader.tokenType() != QXmlStreamReader::Invalid);-
3932 qWarning("QXmlStreamWriter: writeCurrentToken() with invalid state.");-
3933 break;
never executed: break;
0
3934 }-
3935}-
3936-
3937/*!-
3938 \fn bool QXmlStreamAttributes::hasAttribute(const QString &qualifiedName) const-
3939 \since 4.5-
3940-
3941 Returns \c true if this QXmlStreamAttributes has an attribute whose-
3942 qualified name is \a qualifiedName; otherwise returns \c false.-
3943-
3944 Note that this is not namespace aware. For instance, if this-
3945 QXmlStreamAttributes contains an attribute whose lexical name is "xlink:href"-
3946 this doesn't tell that an attribute named \c href in the XLink namespace is-
3947 present, since the \c xlink prefix can be bound to any namespace. Use the-
3948 overload that takes a namespace URI and a local name as parameter, for-
3949 namespace aware code.-
3950*/-
3951-
3952/*!-
3953 \fn bool QXmlStreamAttributes::hasAttribute(QLatin1String qualifiedName) const-
3954 \overload-
3955 \since 4.5-
3956*/-
3957-
3958/*!-
3959 \fn bool QXmlStreamAttributes::hasAttribute(const QString &namespaceUri,-
3960 const QString &name) const-
3961 \overload-
3962 \since 4.5-
3963-
3964 Returns \c true if this QXmlStreamAttributes has an attribute whose-
3965 namespace URI and name correspond to \a namespaceUri and \a name;-
3966 otherwise returns \c false.-
3967*/-
3968-
3969#endif // QT_NO_XMLSTREAMREADER-
3970#endif // QT_NO_XMLSTREAMWRITER-
3971-
3972QT_END_NAMESPACE-
3973-
3974#endif // QT_NO_XMLSTREAM-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9