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

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