OpenCoverage

qxml.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/xml/sax/qxml.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 QtXml 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 "qxml.h"-
41#include "qxml_p.h"-
42#include "qtextcodec.h"-
43#include "qbuffer.h"-
44#include "qregexp.h"-
45#include "qmap.h"-
46#include "qhash.h"-
47#include "qstack.h"-
48#include <qdebug.h>-
49-
50-
51#ifdef Q_CC_BOR // borland 6 finds bogus warnings when building this file in uic3-
52# pragma warn -8080-
53#endif-
54-
55//#define QT_QXML_DEBUG-
56-
57// Error strings for the XML reader-
58#define XMLERR_OK QT_TRANSLATE_NOOP("QXml", "no error occurred")-
59#define XMLERR_ERRORBYCONSUMER QT_TRANSLATE_NOOP("QXml", "error triggered by consumer")-
60#define XMLERR_UNEXPECTEDEOF QT_TRANSLATE_NOOP("QXml", "unexpected end of file")-
61#define XMLERR_MORETHANONEDOCTYPE QT_TRANSLATE_NOOP("QXml", "more than one document type definition")-
62#define XMLERR_ERRORPARSINGELEMENT QT_TRANSLATE_NOOP("QXml", "error occurred while parsing element")-
63#define XMLERR_TAGMISMATCH QT_TRANSLATE_NOOP("QXml", "tag mismatch")-
64#define XMLERR_ERRORPARSINGCONTENT QT_TRANSLATE_NOOP("QXml", "error occurred while parsing content")-
65#define XMLERR_UNEXPECTEDCHARACTER QT_TRANSLATE_NOOP("QXml", "unexpected character")-
66#define XMLERR_INVALIDNAMEFORPI QT_TRANSLATE_NOOP("QXml", "invalid name for processing instruction")-
67#define XMLERR_VERSIONEXPECTED QT_TRANSLATE_NOOP("QXml", "version expected while reading the XML declaration")-
68#define XMLERR_WRONGVALUEFORSDECL QT_TRANSLATE_NOOP("QXml", "wrong value for standalone declaration")-
69#define XMLERR_EDECLORSDDECLEXPECTED QT_TRANSLATE_NOOP("QXml", "encoding declaration or standalone declaration expected while reading the XML declaration")-
70#define XMLERR_SDDECLEXPECTED QT_TRANSLATE_NOOP("QXml", "standalone declaration expected while reading the XML declaration")-
71#define XMLERR_ERRORPARSINGDOCTYPE QT_TRANSLATE_NOOP("QXml", "error occurred while parsing document type definition")-
72#define XMLERR_LETTEREXPECTED QT_TRANSLATE_NOOP("QXml", "letter is expected")-
73#define XMLERR_ERRORPARSINGCOMMENT QT_TRANSLATE_NOOP("QXml", "error occurred while parsing comment")-
74#define XMLERR_ERRORPARSINGREFERENCE QT_TRANSLATE_NOOP("QXml", "error occurred while parsing reference")-
75#define XMLERR_INTERNALGENERALENTITYINDTD QT_TRANSLATE_NOOP("QXml", "internal general entity reference not allowed in DTD")-
76#define XMLERR_EXTERNALGENERALENTITYINAV QT_TRANSLATE_NOOP("QXml", "external parsed general entity reference not allowed in attribute value")-
77#define XMLERR_EXTERNALGENERALENTITYINDTD QT_TRANSLATE_NOOP("QXml", "external parsed general entity reference not allowed in DTD")-
78#define XMLERR_UNPARSEDENTITYREFERENCE QT_TRANSLATE_NOOP("QXml", "unparsed entity reference in wrong context")-
79#define XMLERR_RECURSIVEENTITIES QT_TRANSLATE_NOOP("QXml", "recursive entities")-
80#define XMLERR_ERRORINTEXTDECL QT_TRANSLATE_NOOP("QXml", "error in the text declaration of an external entity")-
81-
82QT_BEGIN_NAMESPACE-
83-
84namespace {-
85-
86// work around missing std::stack::clear()-
87template <typename Container>-
88void clear(Container &c) { c = Container(); }
executed 2261 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2261
89-
90}-
91-
92// the constants for the lookup table-
93static const signed char cltWS = 0; // white space-
94static const signed char cltPer = 1; // %-
95static const signed char cltAmp = 2; // &-
96static const signed char cltGt = 3; // >-
97static const signed char cltLt = 4; // <-
98static const signed char cltSlash = 5; // /-
99static const signed char cltQm = 6; // ?-
100static const signed char cltEm = 7; // !-
101static const signed char cltDash = 8; // --
102static const signed char cltCB = 9; // ]-
103static const signed char cltOB = 10; // [-
104static const signed char cltEq = 11; // =-
105static const signed char cltDq = 12; // "-
106static const signed char cltSq = 13; // '-
107static const signed char cltUnknown = 14;-
108-
109// character lookup table-
110static const signed char charLookupTable[256]={-
111 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x00 - 0x07-
112 cltUnknown, // 0x08-
113 cltWS, // 0x09 \t-
114 cltWS, // 0x0A \n-
115 cltUnknown, // 0x0B-
116 cltUnknown, // 0x0C-
117 cltWS, // 0x0D \r-
118 cltUnknown, // 0x0E-
119 cltUnknown, // 0x0F-
120 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x17 - 0x16-
121 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x18 - 0x1F-
122 cltWS, // 0x20 Space-
123 cltEm, // 0x21 !-
124 cltDq, // 0x22 "-
125 cltUnknown, // 0x23-
126 cltUnknown, // 0x24-
127 cltPer, // 0x25 %-
128 cltAmp, // 0x26 &-
129 cltSq, // 0x27 '-
130 cltUnknown, // 0x28-
131 cltUnknown, // 0x29-
132 cltUnknown, // 0x2A-
133 cltUnknown, // 0x2B-
134 cltUnknown, // 0x2C-
135 cltDash, // 0x2D --
136 cltUnknown, // 0x2E-
137 cltSlash, // 0x2F /-
138 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x30 - 0x37-
139 cltUnknown, // 0x38-
140 cltUnknown, // 0x39-
141 cltUnknown, // 0x3A-
142 cltUnknown, // 0x3B-
143 cltLt, // 0x3C <-
144 cltEq, // 0x3D =-
145 cltGt, // 0x3E >-
146 cltQm, // 0x3F ?-
147 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x40 - 0x47-
148 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x48 - 0x4F-
149 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x50 - 0x57-
150 cltUnknown, // 0x58-
151 cltUnknown, // 0x59-
152 cltUnknown, // 0x5A-
153 cltOB, // 0x5B [-
154 cltUnknown, // 0x5C-
155 cltCB, // 0x5D]-
156 cltUnknown, // 0x5E-
157 cltUnknown, // 0x5F-
158 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x60 - 0x67-
159 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x68 - 0x6F-
160 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x70 - 0x77-
161 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x78 - 0x7F-
162 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x80 - 0x87-
163 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x88 - 0x8F-
164 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x90 - 0x97-
165 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x98 - 0x9F-
166 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xA0 - 0xA7-
167 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xA8 - 0xAF-
168 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xB0 - 0xB7-
169 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xB8 - 0xBF-
170 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xC0 - 0xC7-
171 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xC8 - 0xCF-
172 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xD0 - 0xD7-
173 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xD8 - 0xDF-
174 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xE0 - 0xE7-
175 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xE8 - 0xEF-
176 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xF0 - 0xF7-
177 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown // 0xF8 - 0xFF-
178};-
179-
180//-
181// local helper functions-
182//-
183-
184/*-
185 This function strips the TextDecl [77] ("<?xml ...?>") from the string \a-
186 str. The stripped version is stored in \a str. If this function finds an-
187 invalid TextDecl, it returns \c false, otherwise true.-
188-
189 This function is used for external entities since those can include an-
190 TextDecl that must be stripped before inserting the entity.-
191*/-
192static bool stripTextDecl(QString& str)-
193{-
194 QString textDeclStart(QLatin1String("<?xml"));-
195 if (str.startsWith(textDeclStart)) {
str.startsWith(textDeclStart)Description
TRUEnever evaluated
FALSEnever evaluated
0
196 QRegExp textDecl(QString::fromLatin1(-
197 "^<\\?xml\\s+"-
198 "(version\\s*=\\s*((['\"])[-a-zA-Z0-9_.:]+\\3))?"-
199 "\\s*"-
200 "(encoding\\s*=\\s*((['\"])[A-Za-z][-a-zA-Z0-9_.]*\\6))?"-
201 "\\s*\\?>"-
202 ));-
203 QString strTmp = str.replace(textDecl, QLatin1String(""));-
204 if (strTmp.length() != str.length())
strTmp.length(...= str.length()Description
TRUEnever evaluated
FALSEnever evaluated
0
205 return false; // external entity has wrong TextDecl
never executed: return false;
0
206 str = strTmp;-
207 }
never executed: end of block
0
208 return true;
never executed: return true;
0
209}-
210-
211-
212class QXmlAttributesPrivate-
213{-
214};-
215-
216/* \class QXmlInputSourcePrivate-
217 \internal-
218-
219 There's a slight misdesign in this class that can-
220 be worth to keep in mind: the `str' member is-
221 a buffer which QXmlInputSource::next() returns from,-
222 and which is populated from the input device or input-
223 stream. However, when the input is a QString(the user called-
224 QXmlInputSource::setData()), `str' has two roles: it's the-
225 buffer, but also the source. This /seems/ to be no problem-
226 because in the case of having no device or stream, the QString-
227 is read in one go.-
228 */-
229class QXmlInputSourcePrivate-
230{-
231public:-
232 QIODevice *inputDevice;-
233 QTextStream *inputStream;-
234-
235 QString str;-
236 const QChar *unicode;-
237 int pos;-
238 int length;-
239 bool nextReturnedEndOfData;-
240#ifndef QT_NO_TEXTCODEC-
241 QTextDecoder *encMapper;-
242#endif-
243-
244 QByteArray encodingDeclBytes;-
245 QString encodingDeclChars;-
246 bool lookingForEncodingDecl;-
247};-
248class QXmlParseExceptionPrivate-
249{-
250public:-
251 QXmlParseExceptionPrivate()-
252 : column(-1), line(-1)-
253 {-
254 }
executed 155 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
155
255 QXmlParseExceptionPrivate(const QXmlParseExceptionPrivate &other)-
256 : msg(other.msg), column(other.column), line(other.line),-
257 pub(other.pub), sys(other.sys)-
258 {-
259 }
never executed: end of block
0
260-
261 QString msg;-
262 int column;-
263 int line;-
264 QString pub;-
265 QString sys;-
266-
267};-
268-
269class QXmlLocatorPrivate-
270{-
271};-
272-
273class QXmlDefaultHandlerPrivate-
274{-
275};-
276-
277/*!-
278 \class QXmlParseException-
279 \reentrant-
280 \brief The QXmlParseException class is used to report errors with-
281 the QXmlErrorHandler interface.-
282-
283 \inmodule QtXml-
284 \ingroup xml-tools-
285-
286 The XML subsystem constructs an instance of this class when it-
287 detects an error. You can retrieve the place where the error-
288 occurred using systemId(), publicId(), lineNumber() and-
289 columnNumber(), along with the error message(). The possible error-
290 messages are:-
291-
292-
293 \list-
294 \li "no error occurred"-
295 \li "error triggered by consumer"-
296 \li "unexpected end of file"-
297 \li "more than one document type definition"-
298 \li "error occurred while parsing element"-
299 \li "tag mismatch"-
300 \li "error occurred while parsing content"-
301 \li "unexpected character"-
302 \li "invalid name for processing instruction"-
303 \li "version expected while reading the XML declaration"-
304 \li "wrong value for standalone declaration"-
305 \li "encoding declaration or standalone declaration expected while reading the XML declaration"-
306 \li "standalone declaration expected while reading the XML declaration"-
307 \li "error occurred while parsing document type definition"-
308 \li "letter is expected"-
309 \li "error occurred while parsing comment"-
310 \li "error occurred while parsing reference"-
311 \li "internal general entity reference not allowed in DTD"-
312 \li "external parsed general entity reference not allowed in attribute value"-
313 \li "external parsed general entity reference not allowed in DTD"-
314 \li "unparsed entity reference n wrong context"-
315 \li "recursive entities"-
316 \li "error in the text declaration of an external entity"-
317 \endlist-
318-
319 Note that, if you want to display these error messages to your-
320 application's users, they will be displayed in English unless-
321 they are explicitly translated.-
322-
323 \sa QXmlErrorHandler, QXmlReader-
324*/-
325-
326/*!-
327 Constructs a parse exception with the error string \a name for-
328 column \a c and line \a l for the public identifier \a p and the-
329 system identifier \a s.-
330*/-
331-
332QXmlParseException::QXmlParseException(const QString& name, int c, int l,-
333 const QString& p, const QString& s)-
334 : d(new QXmlParseExceptionPrivate)-
335{-
336 d->msg = name;-
337 d->column = c;-
338 d->line = l;-
339 d->pub = p;-
340 d->sys = s;-
341}
executed 155 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
155
342-
343/*!-
344 Creates a copy of \a other.-
345*/-
346QXmlParseException::QXmlParseException(const QXmlParseException& other) :-
347 d(new QXmlParseExceptionPrivate(*other.d))-
348{-
349-
350}
never executed: end of block
0
351-
352/*!-
353 Destroys the QXmlParseException.-
354*/-
355QXmlParseException::~QXmlParseException()-
356{-
357}-
358-
359/*!-
360 Returns the error message.-
361*/-
362QString QXmlParseException::message() const-
363{-
364 return d->msg;
executed 300 times by 1 test: return d->msg;
Executed by:
  • tst_qxmlsimplereader - unknown status
300
365}-
366/*!-
367 Returns the column number where the error occurred.-
368*/-
369int QXmlParseException::columnNumber() const-
370{-
371 return d->column;
executed 300 times by 1 test: return d->column;
Executed by:
  • tst_qxmlsimplereader - unknown status
300
372}-
373/*!-
374 Returns the line number where the error occurred.-
375*/-
376int QXmlParseException::lineNumber() const-
377{-
378 return d->line;
executed 300 times by 1 test: return d->line;
Executed by:
  • tst_qxmlsimplereader - unknown status
300
379}-
380/*!-
381 Returns the public identifier where the error occurred.-
382*/-
383QString QXmlParseException::publicId() const-
384{-
385 return d->pub;
executed 152 times by 1 test: return d->pub;
Executed by:
  • tst_qxmlsimplereader - unknown status
152
386}-
387/*!-
388 Returns the system identifier where the error occurred.-
389*/-
390QString QXmlParseException::systemId() const-
391{-
392 return d->sys;
executed 152 times by 1 test: return d->sys;
Executed by:
  • tst_qxmlsimplereader - unknown status
152
393}-
394-
395-
396/*!-
397 \class QXmlLocator-
398 \reentrant-
399 \brief The QXmlLocator class provides the XML handler classes with-
400 information about the parsing position within a file.-
401-
402 \inmodule QtXml-
403 \ingroup xml-tools-
404-
405 The reader reports a QXmlLocator to the content handler before it-
406 starts to parse the document. This is done with the-
407 QXmlContentHandler::setDocumentLocator() function. The handler-
408 classes can now use this locator to get the position (lineNumber()-
409 and columnNumber()) that the reader has reached.-
410*/-
411-
412/*!-
413 Constructor.-
414*/-
415QXmlLocator::QXmlLocator()-
416{-
417}-
418-
419/*!-
420 Destructor.-
421*/-
422QXmlLocator::~QXmlLocator()-
423{-
424}-
425-
426/*!-
427 \fn int QXmlLocator::columnNumber() const-
428-
429 Returns the column number (starting at 1) or -1 if there is no-
430 column number available.-
431*/-
432-
433/*!-
434 \fn int QXmlLocator::lineNumber() const-
435-
436 Returns the line number (starting at 1) or -1 if there is no line-
437 number available.-
438*/-
439-
440class QXmlSimpleReaderLocator : public QXmlLocator-
441{-
442public:-
443 QXmlSimpleReaderLocator(QXmlSimpleReader* parent)-
444 {-
445 reader = parent;-
446 }
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
447 ~QXmlSimpleReaderLocator()-
448 {-
449 }-
450-
451 int columnNumber() const Q_DECL_OVERRIDE-
452 {-
453 return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);
executed 2993 times by 5 tests: return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2993
454 }-
455 int lineNumber() const Q_DECL_OVERRIDE-
456 {-
457 return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);
executed 2993 times by 5 tests: return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2993
458 }-
459// QString getPublicId()-
460// QString getSystemId()-
461-
462private:-
463 QXmlSimpleReader *reader;-
464};-
465-
466/*********************************************-
467 *-
468 * QXmlNamespaceSupport-
469 *-
470 *********************************************/-
471-
472typedef QMap<QString, QString> NamespaceMap;-
473-
474class QXmlNamespaceSupportPrivate-
475{-
476public:-
477 QXmlNamespaceSupportPrivate()-
478 {-
479 ns.insert(QLatin1String("xml"), QLatin1String("http://www.w3.org/XML/1998/namespace")); // the XML namespace-
480 }
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
481-
482 ~QXmlNamespaceSupportPrivate()-
483 {-
484 }-
485-
486 QStack<NamespaceMap> nsStack;-
487 NamespaceMap ns;-
488};-
489-
490/*!-
491 \class QXmlNamespaceSupport-
492 \since 4.4-
493 \reentrant-
494 \brief The QXmlNamespaceSupport class is a helper class for XML-
495 readers which want to include namespace support.-
496-
497 \inmodule QtXml-
498 \ingroup xml-tools-
499-
500 You can set the prefix for the current namespace with setPrefix(),-
501 and get the list of current prefixes (or those for a given URI)-
502 with prefixes(). The namespace URI is available from uri(). Use-
503 pushContext() to start a new namespace context, and popContext()-
504 to return to the previous namespace context. Use splitName() or-
505 processName() to split a name into its prefix and local name.-
506-
507 \sa {Namespace Support via Features}-
508*/-
509-
510/*!-
511 Constructs a QXmlNamespaceSupport.-
512*/-
513QXmlNamespaceSupport::QXmlNamespaceSupport()-
514{-
515 d = new QXmlNamespaceSupportPrivate;-
516}
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
517-
518/*!-
519 Destroys a QXmlNamespaceSupport.-
520*/-
521QXmlNamespaceSupport::~QXmlNamespaceSupport()-
522{-
523 delete d;-
524}
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
525-
526/*!-
527 This function declares a prefix \a pre in the current namespace-
528 context to be the namespace URI \a uri. The prefix remains in-
529 force until this context is popped, unless it is shadowed in a-
530 descendant context.-
531-
532 Note that there is an asymmetry in this library. prefix() does not-
533 return the default "" prefix, even if you have declared one; to-
534 check for a default prefix, you must look it up explicitly using-
535 uri(). This asymmetry exists to make it easier to look up prefixes-
536 for attribute names, where the default prefix is not allowed.-
537*/-
538void QXmlNamespaceSupport::setPrefix(const QString& pre, const QString& uri)-
539{-
540 if(pre.isNull()) {
pre.isNull()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-4
541 d->ns.insert(QLatin1String(""), uri);-
542 } else {
executed 3 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
3
543 d->ns.insert(pre, uri);-
544 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4
545}-
546-
547/*!-
548 Returns one of the prefixes mapped to the namespace URI \a uri.-
549-
550 If more than one prefix is currently mapped to the same URI, this-
551 function makes an arbitrary selection; if you want all of the-
552 prefixes, use prefixes() instead.-
553-
554 Note: to check for a default prefix, use the uri() function with-
555 an argument of "".-
556*/-
557QString QXmlNamespaceSupport::prefix(const QString& uri) const-
558{-
559 NamespaceMap::const_iterator itc, it = d->ns.constBegin();-
560 while ((itc=it) != d->ns.constEnd()) {
(itc=it) != d->ns.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
0
561 ++it;-
562 if (*itc == uri && !itc.key().isEmpty())
*itc == uriDescription
TRUEnever evaluated
FALSEnever evaluated
!itc.key().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
563 return itc.key();
never executed: return itc.key();
0
564 }
never executed: end of block
0
565 return QLatin1String("");
never executed: return QLatin1String("");
0
566}-
567-
568/*!-
569 Looks up the prefix \a prefix in the current context and returns-
570 the currently-mapped namespace URI. Use the empty string ("") for-
571 the default namespace.-
572*/-
573QString QXmlNamespaceSupport::uri(const QString& prefix) const-
574{-
575 return d->ns[prefix];
executed 27 times by 2 tests: return d->ns[prefix];
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
27
576}-
577-
578/*!-
579 Splits the name \a qname at the ':' and returns the prefix in \a-
580 prefix and the local name in \a localname.-
581-
582 \sa processName()-
583*/-
584void QXmlNamespaceSupport::splitName(const QString& qname, QString& prefix,-
585 QString& localname) const-
586{-
587 int pos = qname.indexOf(QLatin1Char(':'));-
588 if (pos == -1)
pos == -1Description
TRUEevaluated 11998 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
30-11998
589 pos = qname.size();
executed 11998 times by 3 tests: pos = qname.size();
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
11998
590-
591 prefix = qname.left(pos);-
592 localname = qname.mid(pos+1);-
593}
executed 12028 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12028
594-
595/*!-
596 Processes a raw XML 1.0 name in the current context by removing-
597 the prefix and looking it up among the prefixes currently-
598 declared.-
599-
600 \a qname is the raw XML 1.0 name to be processed. \a isAttribute-
601 is true if the name is an attribute name.-
602-
603 This function stores the namespace URI in \a nsuri (which will be-
604 set to an empty string if the raw name has an undeclared prefix),-
605 and stores the local name (without prefix) in \a localname (which-
606 will be set to an empty string if no namespace is in use).-
607-
608 Note that attribute names are processed differently than element-
609 names: an unprefixed element name gets the default namespace (if-
610 any), while an unprefixed attribute name does not.-
611*/-
612void QXmlNamespaceSupport::processName(const QString& qname,-
613 bool isAttribute,-
614 QString& nsuri, QString& localname) const-
615{-
616 int len = qname.size();-
617 const QChar *data = qname.constData();-
618 for (int pos = 0; pos < len; ++pos) {
pos < lenDescription
TRUEevaluated 96470 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 21219 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21219-96470
619 if (data[pos] == QLatin1Char(':')) {
data[pos] == QLatin1Char(':')Description
TRUEevaluated 27 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 96443 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
27-96443
620 nsuri = uri(qname.left(pos));-
621 localname = qname.mid(pos + 1);-
622 return;
executed 27 times by 2 tests: return;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
27
623 }-
624 }
executed 96443 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
96443
625-
626 // there was no ':'-
627 nsuri.clear();-
628 // attributes don't take default namespace-
629 if (!isAttribute && !d->ns.isEmpty()) {
!isAttributeDescription
TRUEevaluated 9224 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 11995 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
!d->ns.isEmpty()Description
TRUEevaluated 9224 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-11995
630 /*-
631 We want to access d->ns.value(""), but as an optimization-
632 we use the fact that "" compares less than any other-
633 string, so it's either first in the map or not there.-
634 */-
635 NamespaceMap::const_iterator first = d->ns.constBegin();-
636 if (first.key().isEmpty())
first.key().isEmpty()Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9203 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21-9203
637 nsuri = first.value(); // get default namespace
executed 21 times by 1 test: nsuri = first.value();
Executed by:
  • tst_qxmlsimplereader - unknown status
21
638 }
executed 9224 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
9224
639 localname = qname;-
640}
executed 21219 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21219
641-
642/*!-
643 Returns a list of all the prefixes currently declared.-
644-
645 If there is a default prefix, this function does not return it in-
646 the list; check for the default prefix using uri() with an-
647 argument of "".-
648*/-
649QStringList QXmlNamespaceSupport::prefixes() const-
650{-
651 QStringList list;-
652-
653 NamespaceMap::const_iterator itc, it = d->ns.constBegin();-
654 while ((itc=it) != d->ns.constEnd()) {
(itc=it) != d->ns.constEnd()Description
TRUEevaluated 439 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 434 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
434-439
655 ++it;-
656 if (!itc.key().isEmpty())
!itc.key().isEmpty()Description
TRUEevaluated 438 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-438
657 list.append(itc.key());
executed 438 times by 2 tests: list.append(itc.key());
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
438
658 }
executed 439 times by 2 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
439
659 return list;
executed 434 times by 2 tests: return list;
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
434
660}-
661-
662/*!-
663 \overload-
664-
665 Returns a list of all prefixes currently declared for the-
666 namespace URI \a uri.-
667-
668 The "xml:" prefix is included. If you only want one prefix that is-
669 mapped to the namespace URI, and you don't care which one you get,-
670 use the prefix() function instead.-
671-
672 Note: The empty (default) prefix is never included in this list;-
673 to check for the presence of a default namespace, call uri() with-
674 "" as the argument.-
675*/-
676QStringList QXmlNamespaceSupport::prefixes(const QString& uri) const-
677{-
678 QStringList list;-
679-
680 NamespaceMap::const_iterator itc, it = d->ns.constBegin();-
681 while ((itc=it) != d->ns.constEnd()) {
(itc=it) != d->ns.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
0
682 ++it;-
683 if (*itc == uri && !itc.key().isEmpty())
*itc == uriDescription
TRUEnever evaluated
FALSEnever evaluated
!itc.key().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
684 list.append(itc.key());
never executed: list.append(itc.key());
0
685 }
never executed: end of block
0
686 return list;
never executed: return list;
0
687}-
688-
689/*!-
690 Starts a new namespace context.-
691-
692 Normally, you should push a new context at the beginning of each-
693 XML element: the new context automatically inherits the-
694 declarations of its parent context, and it also keeps track of-
695 which declarations were made within this context.-
696-
697 \sa popContext()-
698*/-
699void QXmlNamespaceSupport::pushContext()-
700{-
701 d->nsStack.push(d->ns);-
702}
executed 4781 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4781
703-
704/*!-
705 Reverts to the previous namespace context.-
706-
707 Normally, you should pop the context at the end of each XML-
708 element. After popping the context, all namespace prefix mappings-
709 that were previously in force are restored.-
710-
711 \sa pushContext()-
712*/-
713void QXmlNamespaceSupport::popContext()-
714{-
715 d->ns.clear();-
716 if(!d->nsStack.isEmpty())
!d->nsStack.isEmpty()Description
TRUEevaluated 4705 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-4705
717 d->ns = d->nsStack.pop();
executed 4705 times by 3 tests: d->ns = d->nsStack.pop();
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4705
718}
executed 4705 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4705
719-
720/*!-
721 Resets this namespace support object ready for reuse.-
722*/-
723void QXmlNamespaceSupport::reset()-
724{-
725 QXmlNamespaceSupportPrivate *newD = new QXmlNamespaceSupportPrivate;-
726 delete d;-
727 d = newD;-
728}
never executed: end of block
0
729-
730-
731-
732/*********************************************-
733 *-
734 * QXmlAttributes-
735 *-
736 *********************************************/-
737-
738/*!-
739 \class QXmlAttributes-
740 \reentrant-
741 \brief The QXmlAttributes class provides XML attributes.-
742-
743 \inmodule QtXml-
744 \ingroup xml-tools-
745-
746 If attributes are reported by QXmlContentHandler::startElement()-
747 this class is used to pass the attribute values.-
748-
749 Use index() to locate the position of an attribute in the list,-
750 count() to retrieve the number of attributes, and clear() to-
751 remove the attributes. New attributes can be added with append().-
752 Use type() to get an attribute's type and value() to get its-
753 value. The attribute's name is available from localName() or-
754 qName(), and its namespace URI from uri().-
755-
756*/-
757-
758/*!-
759 \fn QXmlAttributes::QXmlAttributes()-
760-
761 Constructs an empty attribute list.-
762*/-
763QXmlAttributes::QXmlAttributes()-
764{-
765 // ### In Qt 5.0, this function was inlined and d was not initialized-
766 // The member cannot be used until Qt 6.0-
767 Q_UNUSED(d);-
768}
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
769-
770/*!-
771 \fn QXmlAttributes::~QXmlAttributes()-
772-
773 Destroys the attributes object.-
774*/-
775QXmlAttributes::~QXmlAttributes()-
776{-
777}-
778-
779-
780/*!-
781 Looks up the index of an attribute by the qualified name \a qName.-
782-
783 Returns the index of the attribute or -1 if it wasn't found.-
784-
785 \sa {Namespace Support via Features}-
786*/-
787int QXmlAttributes::index(const QString& qName) const-
788{-
789 for (int i = 0; i < attList.size(); ++i) {
i < attList.size()Description
TRUEnever evaluated
FALSEnever evaluated
0
790 if (attList.at(i).qname == qName)
attList.at(i).qname == qNameDescription
TRUEnever evaluated
FALSEnever evaluated
0
791 return i;
never executed: return i;
0
792 }
never executed: end of block
0
793 return -1;
never executed: return -1;
0
794}-
795-
796/*! \overload-
797 */-
798int QXmlAttributes::index(QLatin1String qName) const-
799{-
800 for (int i = 0; i < attList.size(); ++i) {
i < attList.size()Description
TRUEevaluated 11810 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEevaluated 2589 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
2589-11810
801 if (attList.at(i).qname == qName)
attList.at(i).qname == qNameDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEevaluated 11786 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
24-11786
802 return i;
executed 24 times by 1 test: return i;
Executed by:
  • tst_qxmlstream - unknown status
24
803 }
executed 11786 times by 1 test: end of block
Executed by:
  • tst_qxmlstream - unknown status
11786
804 return -1;
executed 2589 times by 1 test: return -1;
Executed by:
  • tst_qxmlstream - unknown status
2589
805}-
806-
807/*!-
808 \overload-
809-
810 Looks up the index of an attribute by a namespace name.-
811-
812 \a uri specifies the namespace URI, or an empty string if the name-
813 has no namespace URI. \a localPart specifies the attribute's local-
814 name.-
815-
816 Returns the index of the attribute, or -1 if it wasn't found.-
817-
818 \sa {Namespace Support via Features}-
819*/-
820int QXmlAttributes::index(const QString& uri, const QString& localPart) const-
821{-
822 for (int i = 0; i < attList.size(); ++i) {
i < attList.size()Description
TRUEevaluated 51512 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEevaluated 5843 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
5843-51512
823 const Attribute &att = attList.at(i);-
824 if (att.uri == uri && att.localname == localPart)
att.uri == uriDescription
TRUEevaluated 51512 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEnever evaluated
att.localname == localPartDescription
TRUEevaluated 8130 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEevaluated 43382 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
0-51512
825 return i;
executed 8130 times by 1 test: return i;
Executed by:
  • tst_qxmlstream - unknown status
8130
826 }
executed 43382 times by 1 test: end of block
Executed by:
  • tst_qxmlstream - unknown status
43382
827 return -1;
executed 5843 times by 1 test: return -1;
Executed by:
  • tst_qxmlstream - unknown status
5843
828}-
829-
830/*!-
831 Returns the number of attributes in the list.-
832-
833 \sa count()-
834*/-
835int QXmlAttributes::length() const-
836{-
837 return attList.count();
executed 4017 times by 5 tests: return attList.count();
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
4017
838}-
839-
840/*!-
841 \fn int QXmlAttributes::count() const-
842-
843 Returns the number of attributes in the list. This function is-
844 equivalent to length().-
845*/-
846-
847/*!-
848 Looks up an attribute's local name for the attribute at position-
849 \a index. If no namespace processing is done, the local name is-
850 an empty string.-
851-
852 \sa {Namespace Support via Features}-
853*/-
854QString QXmlAttributes::localName(int index) const-
855{-
856 return attList.at(index).localname;
executed 407 times by 1 test: return attList.at(index).localname;
Executed by:
  • tst_qxmlsimplereader - unknown status
407
857}-
858-
859/*!-
860 Looks up an attribute's XML 1.0 qualified name for the attribute-
861 at position \a index.-
862-
863 \sa {Namespace Support via Features}-
864*/-
865QString QXmlAttributes::qName(int index) const-
866{-
867 return attList.at(index).qname;
executed 1275 times by 4 tests: return attList.at(index).qname;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
1275
868}-
869-
870/*!-
871 Looks up an attribute's namespace URI for the attribute at-
872 position \a index. If no namespace processing is done or if the-
873 attribute has no namespace, the namespace URI is an empty string.-
874-
875 \sa {Namespace Support via Features}-
876*/-
877QString QXmlAttributes::uri(int index) const-
878{-
879 return attList.at(index).uri;
executed 409 times by 1 test: return attList.at(index).uri;
Executed by:
  • tst_qxmlsimplereader - unknown status
409
880}-
881-
882/*!-
883 Looks up an attribute's type for the attribute at position \a-
884 index.-
885-
886 Currently only "CDATA" is returned.-
887*/-
888QString QXmlAttributes::type(int) const-
889{-
890 return QLatin1String("CDATA");
executed 407 times by 1 test: return QLatin1String("CDATA");
Executed by:
  • tst_qxmlsimplereader - unknown status
407
891}-
892-
893/*!-
894 \overload-
895-
896 Looks up an attribute's type for the qualified name \a qName.-
897-
898 Currently only "CDATA" is returned.-
899*/-
900QString QXmlAttributes::type(const QString&) const-
901{-
902 return QLatin1String("CDATA");
never executed: return QLatin1String("CDATA");
0
903}-
904-
905/*!-
906 \overload-
907-
908 Looks up an attribute's type by namespace name.-
909-
910 \a uri specifies the namespace URI and \a localName specifies the-
911 local name. If the name has no namespace URI, use an empty string-
912 for \a uri.-
913-
914 Currently only "CDATA" is returned.-
915*/-
916QString QXmlAttributes::type(const QString&, const QString&) const-
917{-
918 return QLatin1String("CDATA");
never executed: return QLatin1String("CDATA");
0
919}-
920-
921/*!-
922 Returns an attribute's value for the attribute at position \a-
923 index. The index must be a valid position-
924 (i.e., 0 <= \a index < count()).-
925*/-
926QString QXmlAttributes::value(int index) const-
927{-
928 return attList.at(index).value;
executed 1287 times by 5 tests: return attList.at(index).value;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1287
929}-
930-
931/*!-
932 \overload-
933-
934 Returns an attribute's value for the qualified name \a qName, or an-
935 empty string if no attribute exists for the name given.-
936-
937 \sa {Namespace Support via Features}-
938*/-
939QString QXmlAttributes::value(const QString& qName) const-
940{-
941 int i = index(qName);-
942 if (i == -1)
i == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
943 return QString();
never executed: return QString();
0
944 return attList.at(i).value;
never executed: return attList.at(i).value;
0
945}-
946-
947/*!-
948 \overload-
949-
950 Returns an attribute's value for the qualified name \a qName, or an-
951 empty string if no attribute exists for the name given.-
952-
953 \sa {Namespace Support via Features}-
954*/-
955QString QXmlAttributes::value(QLatin1String qName) const-
956{-
957 int i = index(qName);-
958 if (i == -1)
i == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
959 return QString();
never executed: return QString();
0
960 return attList.at(i).value;
never executed: return attList.at(i).value;
0
961}-
962-
963/*!-
964 \overload-
965-
966 Returns an attribute's value by namespace name.-
967-
968 \a uri specifies the namespace URI, or an empty string if the name-
969 has no namespace URI. \a localName specifies the attribute's local-
970 name.-
971*/-
972QString QXmlAttributes::value(const QString& uri, const QString& localName) const-
973{-
974 int i = index(uri, localName);-
975 if (i == -1)
i == -1Description
TRUEevaluated 4320 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEevaluated 7751 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
4320-7751
976 return QString();
executed 4320 times by 1 test: return QString();
Executed by:
  • tst_qxmlstream - unknown status
4320
977 return attList.at(i).value;
executed 7751 times by 1 test: return attList.at(i).value;
Executed by:
  • tst_qxmlstream - unknown status
7751
978}-
979-
980/*!-
981 Clears the list of attributes.-
982-
983 \sa append()-
984*/-
985void QXmlAttributes::clear()-
986{-
987 attList.clear();-
988}
executed 5802 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5802
989-
990/*!-
991 Appends a new attribute entry to the list of attributes. The-
992 qualified name of the attribute is \a qName, the namespace URI is-
993 \a uri and the local name is \a localPart. The value of the-
994 attribute is \a value.-
995-
996 \sa qName(), uri(), localName(), value()-
997*/-
998void QXmlAttributes::append(const QString &qName, const QString &uri, const QString &localPart, const QString &value)-
999{-
1000 Attribute att;-
1001 att.qname = qName;-
1002 att.uri = uri;-
1003 att.localname = localPart;-
1004 att.value = value;-
1005-
1006 attList.append(att);-
1007}
executed 12887 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12887
1008-
1009-
1010/*********************************************-
1011 *-
1012 * QXmlInputSource-
1013 *-
1014 *********************************************/-
1015-
1016/*!-
1017 \class QXmlInputSource-
1018 \reentrant-
1019 \brief The QXmlInputSource class provides the input data for the-
1020 QXmlReader subclasses.-
1021-
1022 \inmodule QtXml-
1023 \ingroup xml-tools-
1024-
1025 All subclasses of QXmlReader read the input XML document from this-
1026 class.-
1027-
1028 This class recognizes the encoding of the data by reading the-
1029 encoding declaration in the XML file if it finds one, and reading-
1030 the data using the corresponding encoding. If it does not find an-
1031 encoding declaration, then it assumes that the data is either in-
1032 UTF-8 or UTF-16, depending on whether it can find a byte-order-
1033 mark.-
1034-
1035 There are two ways to populate the input source with data: you can-
1036 construct it with a QIODevice* so that the input source reads the-
1037 data from that device. Or you can set the data explicitly with one-
1038 of the setData() functions.-
1039-
1040 Usually you either construct a QXmlInputSource that works on a-
1041 QIODevice* or you construct an empty QXmlInputSource and set the-
1042 data with setData(). There are only rare occasions where you would-
1043 want to mix both methods.-
1044-
1045 The QXmlReader subclasses use the next() function to read the-
1046 input character by character. If you want to start from the-
1047 beginning again, use reset().-
1048-
1049 The functions data() and fetchData() are useful if you want to do-
1050 something with the data other than parsing, e.g. displaying the-
1051 raw XML file. The benefit of using the QXmlInputClass in such-
1052 cases is that it tries to use the correct encoding.-
1053-
1054 \sa QXmlReader, QXmlSimpleReader-
1055*/-
1056-
1057// the following two are guaranteed not to be a character-
1058const ushort QXmlInputSource::EndOfData = 0xfffe;-
1059const ushort QXmlInputSource::EndOfDocument = 0xffff;-
1060-
1061/*-
1062 Common part of the constructors.-
1063*/-
1064void QXmlInputSource::init()-
1065{-
1066 d = new QXmlInputSourcePrivate;-
1067-
1068 QT_TRY {-
1069 d->inputDevice = 0;-
1070 d->inputStream = 0;-
1071-
1072 setData(QString());-
1073#ifndef QT_NO_TEXTCODEC-
1074 d->encMapper = 0;-
1075#endif-
1076 d->nextReturnedEndOfData = true; // first call to next() will call fetchData()-
1077-
1078 d->encodingDeclBytes.clear();-
1079 d->encodingDeclChars.clear();-
1080 d->lookingForEncodingDecl = true;-
1081 } QT_CATCH(...) {
executed 2106 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
dead code: { delete(d); qt_noop(); }
-
1082 delete(d);
dead code: { delete(d); qt_noop(); }
-
1083 QT_RETHROW;
dead code: { delete(d); qt_noop(); }
-
1084 }
dead code: { delete(d); qt_noop(); }
-
1085}-
1086-
1087/*!-
1088 Constructs an input source which contains no data.-
1089-
1090 \sa setData()-
1091*/-
1092QXmlInputSource::QXmlInputSource()-
1093{-
1094 init();-
1095}
executed 1734 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
1734
1096-
1097/*!-
1098 Constructs an input source and gets the data from device \a dev.-
1099 If \a dev is not open, it is opened in read-only mode. If \a dev-
1100 is 0 or it is not possible to read from the device, the input-
1101 source will contain no data.-
1102-
1103 \sa setData(), fetchData(), QIODevice-
1104*/-
1105QXmlInputSource::QXmlInputSource(QIODevice *dev)-
1106{-
1107 init();-
1108 d->inputDevice = dev;-
1109 if (dev->isOpen())
dev->isOpen()Description
TRUEevaluated 363 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
9-363
1110 d->inputDevice->setTextModeEnabled(false);
executed 363 times by 2 tests: d->inputDevice->setTextModeEnabled(false);
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
363
1111}
executed 372 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
372
1112-
1113/*!-
1114 Destructor.-
1115*/-
1116QXmlInputSource::~QXmlInputSource()-
1117{-
1118 // ### close the input device.-
1119#ifndef QT_NO_TEXTCODEC-
1120 delete d->encMapper;-
1121#endif-
1122 delete d;-
1123}
executed 2106 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2106
1124-
1125/*!-
1126Returns the next character of the input source. If this function-
1127reaches the end of available data, it returns-
1128QXmlInputSource::EndOfData. If you call next() after that, it-
1129tries to fetch more data by calling fetchData(). If the-
1130fetchData() call results in new data, this function returns the-
1131first character of that data; otherwise it returns-
1132QXmlInputSource::EndOfDocument.-
1133-
1134Readers, such as QXmlSimpleReader, will assume that the end of-
1135the XML document has been reached if the this function returns-
1136QXmlInputSource::EndOfDocument, and will check that the-
1137supplied input is well-formed. Therefore, when reimplementing-
1138this function, it is important to ensure that this behavior is-
1139duplicated.-
1140-
1141\sa reset(), fetchData(), QXmlSimpleReader::parse(),-
1142 QXmlSimpleReader::parseContinue()-
1143*/-
1144QChar QXmlInputSource::next()-
1145{-
1146 if (d->pos >= d->length) {
d->pos >= d->lengthDescription
TRUEevaluated 48748 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 744723 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
48748-744723
1147 if (d->nextReturnedEndOfData) {
d->nextReturnedEndOfDataDescription
TRUEevaluated 2851 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 45897 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2851-45897
1148 d->nextReturnedEndOfData = false;-
1149 fetchData();-
1150 if (d->pos >= d->length) {
d->pos >= d->lengthDescription
TRUEevaluated 1961 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 890 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
890-1961
1151 return EndOfDocument;
executed 1961 times by 6 tests: return EndOfDocument;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1961
1152 }-
1153 return next();
executed 890 times by 3 tests: return next();
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
890
1154 }-
1155 d->nextReturnedEndOfData = true;-
1156 return EndOfData;
executed 45897 times by 6 tests: return EndOfData;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
45897
1157 }-
1158-
1159 // QXmlInputSource has no way to signal encoding errors. The best we can do-
1160 // is return EndOfDocument. We do *not* return EndOfData, because the reader-
1161 // will then just call this function again to get the next char.-
1162 QChar c = d->unicode[d->pos++];-
1163 if (c.unicode() == EndOfData)
c.unicode() == EndOfDataDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 744722 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1-744722
1164 c = EndOfDocument;
executed 1 time by 1 test: c = EndOfDocument;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
1165 return c;
executed 744723 times by 6 tests: return c;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
744723
1166}-
1167-
1168/*!-
1169 This function sets the position used by next() to the beginning of-
1170 the data returned by data(). This is useful if you want to use the-
1171 input source for more than one parse.-
1172-
1173 \note In the case that the underlying data source is a QIODevice,-
1174 the current position in the device is not automatically set to the-
1175 start of input. Call QIODevice::seek(0) on the device to do this.-
1176-
1177 \sa next()-
1178*/-
1179void QXmlInputSource::reset()-
1180{-
1181 d->nextReturnedEndOfData = false;-
1182 d->pos = 0;-
1183}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
4
1184-
1185/*!-
1186 Returns the data the input source contains or an empty string if the-
1187 input source does not contain any data.-
1188-
1189 \sa setData(), QXmlInputSource(), fetchData()-
1190*/-
1191QString QXmlInputSource::data() const-
1192{-
1193 if (d->nextReturnedEndOfData) {
d->nextReturnedEndOfDataDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlinputsource - unknown status
0-4
1194 QXmlInputSource *that = const_cast<QXmlInputSource*>(this);-
1195 that->d->nextReturnedEndOfData = false;-
1196 that->fetchData();-
1197 }
never executed: end of block
0
1198 return d->str;
executed 4 times by 1 test: return d->str;
Executed by:
  • tst_qxmlinputsource - unknown status
4
1199}-
1200-
1201/*!-
1202 Sets the data of the input source to \a dat.-
1203-
1204 If the input source already contains data, this function deletes-
1205 that data first.-
1206-
1207 \sa data()-
1208*/-
1209void QXmlInputSource::setData(const QString& dat)-
1210{-
1211 d->str = dat;-
1212 d->unicode = dat.unicode();-
1213 d->pos = 0;-
1214 d->length = d->str.length();-
1215 d->nextReturnedEndOfData = false;-
1216}
executed 48375 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
48375
1217-
1218/*!-
1219 \overload-
1220-
1221 The data \a dat is passed through the correct text-codec, before-
1222 it is set.-
1223*/-
1224void QXmlInputSource::setData(const QByteArray& dat)-
1225{-
1226 setData(fromRawData(dat));-
1227}
executed 44908 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
44908
1228-
1229/*!-
1230 This function reads more data from the device that was set during-
1231 construction. If the input source already contained data, this-
1232 function deletes that data first.-
1233-
1234 This object contains no data after a call to this function if the-
1235 object was constructed without a device to read data from or if-
1236 this function was not able to get more data from the device.-
1237-
1238 There are two occasions where a fetch is done implicitly by-
1239 another function call: during construction (so that the object-
1240 starts out with some initial data where available), and during a-
1241 call to next() (if the data had run out).-
1242-
1243 You don't normally need to use this function if you use next().-
1244-
1245 \sa data(), next(), QXmlInputSource()-
1246*/-
1247-
1248void QXmlInputSource::fetchData()-
1249{-
1250 enum-
1251 {-
1252 BufferSize = 1024-
1253 };-
1254-
1255 QByteArray rawData;-
1256-
1257 if (d->inputDevice || d->inputStream) {
d->inputDeviceDescription
TRUEevaluated 1117 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1734 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
d->inputStreamDescription
TRUEnever evaluated
FALSEevaluated 1734 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
0-1734
1258 QIODevice *device = d->inputDevice ? d->inputDevice : d->inputStream->device();
d->inputDeviceDescription
TRUEevaluated 1117 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-1117
1259-
1260 if (!device) {
!deviceDescription
TRUEnever evaluated
FALSEevaluated 1117 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-1117
1261 if (d->inputStream && d->inputStream->string()) {
d->inputStreamDescription
TRUEnever evaluated
FALSEnever evaluated
d->inputStream->string()Description
TRUEnever evaluated
FALSEnever evaluated
0
1262 QString *s = d->inputStream->string();-
1263 rawData = QByteArray((const char *) s->constData(), s->size() * sizeof(QChar));-
1264 }
never executed: end of block
0
1265 } else if (device->isOpen() || device->open(QIODevice::ReadOnly)) {
never executed: end of block
device->isOpen()Description
TRUEevaluated 1108 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
device->open(Q...ice::ReadOnly)Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1108
1266 rawData.resize(BufferSize);-
1267 qint64 size = device->read(rawData.data(), BufferSize);-
1268-
1269 if (size != -1) {
size != -1Description
TRUEevaluated 1117 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-1117
1270 // We don't want to give fromRawData() less than four bytes if we can avoid it.-
1271 while (size < 4) {
size < 4Description
TRUEevaluated 235 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 890 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
235-890
1272 if (!device->waitForReadyRead(-1))
!device->waitForReadyRead(-1)Description
TRUEevaluated 227 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
8-227
1273 break;
executed 227 times by 3 tests: break;
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
227
1274 int ret = device->read(rawData.data() + size, BufferSize - size);-
1275 if (ret <= 0)
ret <= 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-8
1276 break;
never executed: break;
0
1277 size += ret;-
1278 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
8
1279 }
executed 1117 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1117
1280-
1281 rawData.resize(qMax(qint64(0), size));-
1282 }
executed 1117 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1117
1283-
1284 /* We do this inside the "if (d->inputDevice ..." scope-
1285 * because if we're not using a stream or device, that is,-
1286 * the user set a QString manually, we don't want to set-
1287 * d->str. */-
1288 setData(fromRawData(rawData));-
1289 }
executed 1117 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1117
1290}
executed 2851 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2851
1291-
1292#ifndef QT_NO_TEXTCODEC-
1293static QString extractEncodingDecl(const QString &text, bool *needMoreText)-
1294{-
1295 *needMoreText = false;-
1296-
1297 int l = text.length();-
1298 const QLatin1String snip("<?xml", std::min(l, 5));-
1299 if (l > 0 && !text.startsWith(snip))
l > 0Description
TRUEevaluated 3097 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
!text.startsWith(snip)Description
TRUEevaluated 1742 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1355 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6-3097
1300 return QString();
executed 1742 times by 2 tests: return QString();
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
1742
1301-
1302 int endPos = text.indexOf(QLatin1Char('>'));-
1303 if (endPos == -1) {
endPos == -1Description
TRUEevaluated 1242 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 119 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
119-1242
1304 *needMoreText = l < 255; // we won't look forever-
1305 return QString();
executed 1242 times by 1 test: return QString();
Executed by:
  • tst_qxmlsimplereader - unknown status
1242
1306 }-
1307-
1308 int pos = text.indexOf(QLatin1String("encoding"));-
1309 if (pos == -1 || pos >= endPos)
pos == -1Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
pos >= endPosDescription
TRUEnever evaluated
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-67
1310 return QString();
executed 52 times by 1 test: return QString();
Executed by:
  • tst_qxmlsimplereader - unknown status
52
1311-
1312 while (pos < endPos) {
pos < endPosDescription
TRUEevaluated 670 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-670
1313 ushort uc = text.at(pos).unicode();-
1314 if (uc == '\'' || uc == '"')
uc == '\''Description
TRUEnever evaluated
FALSEevaluated 670 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
uc == '"'Description
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 603 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-670
1315 break;
executed 67 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
67
1316 ++pos;-
1317 }
executed 603 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
603
1318-
1319 if (pos == endPos)
pos == endPosDescription
TRUEnever evaluated
FALSEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-67
1320 return QString();
never executed: return QString();
0
1321-
1322 QString encoding;-
1323 ++pos;-
1324 while (pos < endPos) {
pos < endPosDescription
TRUEevaluated 404 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-404
1325 ushort uc = text.at(pos).unicode();-
1326 if (uc == '\'' || uc == '"')
uc == '\''Description
TRUEnever evaluated
FALSEevaluated 404 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
uc == '"'Description
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 337 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-404
1327 break;
executed 67 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
67
1328 encoding.append(uc);-
1329 ++pos;-
1330 }
executed 337 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
337
1331-
1332 return encoding;
executed 67 times by 2 tests: return encoding;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
67
1333}-
1334#endif // QT_NO_TEXTCODEC-
1335-
1336/*!-
1337 This function reads the XML file from \a data and tries to-
1338 recognize the encoding. It converts the raw data \a data into a-
1339 QString and returns it. It tries its best to get the correct-
1340 encoding for the XML file.-
1341-
1342 If \a beginning is true, this function assumes that the data-
1343 starts at the beginning of a new XML document and looks for an-
1344 encoding declaration. If \a beginning is false, it converts the-
1345 raw data using the encoding determined from prior calls.-
1346*/-
1347QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning)-
1348{-
1349#ifdef QT_NO_TEXTCODEC-
1350 Q_UNUSED(beginning);-
1351 return QString::fromLatin1(data.constData(), data.size());-
1352#else-
1353 if (data.size() == 0)
data.size() == 0Description
TRUEevaluated 227 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 45798 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
227-45798
1354 return QString();
executed 227 times by 3 tests: return QString();
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
227
1355 if (beginning) {
beginningDescription
TRUEnever evaluated
FALSEevaluated 45798 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-45798
1356 delete d->encMapper;-
1357 d->encMapper = 0;-
1358 }
never executed: end of block
0
1359-
1360 int mib = 106; // UTF-8-
1361-
1362 // This is the initial UTF codec we will read the encoding declaration with-
1363 if (d->encMapper == 0) {
d->encMapper == 0Description
TRUEevaluated 1861 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 43937 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1861-43937
1364 d->encodingDeclBytes.clear();-
1365 d->encodingDeclChars.clear();-
1366 d->lookingForEncodingDecl = true;-
1367-
1368 // look for byte order mark and read the first 5 characters-
1369 if (data.size() >= 4) {
data.size() >= 4Description
TRUEevaluated 1367 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 494 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
494-1367
1370 uchar ch1 = data.at(0);-
1371 uchar ch2 = data.at(1);-
1372 uchar ch3 = data.at(2);-
1373 uchar ch4 = data.at(3);-
1374-
1375 if ((ch1 == 0 && ch2 == 0 && ch3 == 0xfe && ch4 == 0xff) ||
ch1 == 0Description
TRUEnever evaluated
FALSEevaluated 1367 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch2 == 0Description
TRUEnever evaluated
FALSEnever evaluated
ch3 == 0xfeDescription
TRUEnever evaluated
FALSEnever evaluated
ch4 == 0xffDescription
TRUEnever evaluated
FALSEnever evaluated
0-1367
1376 (ch1 == 0xff && ch2 == 0xfe && ch3 == 0 && ch4 == 0))
ch1 == 0xffDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1345 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch2 == 0xfeDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
ch3 == 0Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
ch4 == 0Description
TRUEnever evaluated
FALSEnever evaluated
0-1345
1377 mib = 1017; // UTF-32 with byte order mark
never executed: mib = 1017;
0
1378 else if (ch1 == 0x3c && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x00)
ch1 == 0x3cDescription
TRUEevaluated 1343 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
ch2 == 0x00Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1342 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch3 == 0x00Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
ch4 == 0x00Description
TRUEnever evaluated
FALSEnever evaluated
0-1343
1379 mib = 1019; // UTF-32LE
never executed: mib = 1019;
0
1380 else if (ch1 == 0x00 && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x3c)
ch1 == 0x00Description
TRUEnever evaluated
FALSEevaluated 1367 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch2 == 0x00Description
TRUEnever evaluated
FALSEnever evaluated
ch3 == 0x00Description
TRUEnever evaluated
FALSEnever evaluated
ch4 == 0x3cDescription
TRUEnever evaluated
FALSEnever evaluated
0-1367
1381 mib = 1018; // UTF-32BE
never executed: mib = 1018;
0
1382 }
executed 1367 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1367
1383 if (mib == 106 && data.size() >= 2) {
mib == 106Description
TRUEevaluated 1861 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
data.size() >= 2Description
TRUEevaluated 1699 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 162 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-1861
1384 uchar ch1 = data.at(0);-
1385 uchar ch2 = data.at(1);-
1386-
1387 if ((ch1 == 0xfe && ch2 == 0xff) || (ch1 == 0xff && ch2 == 0xfe))
ch1 == 0xfeDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1698 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch2 == 0xffDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
ch1 == 0xffDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1670 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch2 == 0xfeDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1698
1388 mib = 1015; // UTF-16 with byte order mark
executed 29 times by 1 test: mib = 1015;
Executed by:
  • tst_qxmlsimplereader - unknown status
29
1389 else if (ch1 == 0x3c && ch2 == 0x00)
ch1 == 0x3cDescription
TRUEevaluated 1669 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
ch2 == 0x00Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1668 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1-1669
1390 mib = 1014; // UTF-16LE
executed 1 time by 1 test: mib = 1014;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
1391 else if (ch1 == 0x00 && ch2 == 0x3c)
ch1 == 0x00Description
TRUEnever evaluated
FALSEevaluated 1669 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
ch2 == 0x3cDescription
TRUEnever evaluated
FALSEnever evaluated
0-1669
1392 mib = 1013; // UTF-16BE
never executed: mib = 1013;
0
1393 }
executed 1699 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1699
1394-
1395 QTextCodec *codec = QTextCodec::codecForMib(mib);-
1396 Q_ASSERT(codec);-
1397-
1398 d->encMapper = codec->makeDecoder();-
1399 }
executed 1861 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1861
1400-
1401 QString input = d->encMapper->toUnicode(data.constData(), data.size());-
1402-
1403 if (d->lookingForEncodingDecl) {
d->lookingForEncodingDeclDescription
TRUEevaluated 3103 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 42695 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
3103-42695
1404 d->encodingDeclChars += input;-
1405-
1406 bool needMoreText;-
1407 QString encoding = extractEncodingDecl(d->encodingDeclChars, &needMoreText);-
1408-
1409 if (!encoding.isEmpty()) {
!encoding.isEmpty()Description
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3036 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
67-3036
1410 if (QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1())) {
QTextCodec *co...ng.toLatin1())Description
TRUEevaluated 67 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-67
1411 /* If the encoding is the same, we don't have to do toUnicode() all over again. */-
1412 if(codec->mibEnum() != mib) {
codec->mibEnum() != mibDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 66 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1-66
1413 delete d->encMapper;-
1414 d->encMapper = codec->makeDecoder();-
1415-
1416 /* The variable input can potentially be large, so we deallocate-
1417 * it before calling toUnicode() in order to avoid having two-
1418 * large QStrings in memory simultaneously. */-
1419 input.clear();-
1420-
1421 // prime the decoder with the data so far-
1422 d->encMapper->toUnicode(d->encodingDeclBytes.constData(), d->encodingDeclBytes.size());-
1423 // now feed it the new data-
1424 input = d->encMapper->toUnicode(data.constData(), data.size());-
1425 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1
1426 }
executed 67 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
67
1427 }
executed 67 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
67
1428-
1429 d->encodingDeclBytes += data;-
1430 d->lookingForEncodingDecl = needMoreText;-
1431 }
executed 3103 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
3103
1432-
1433 return input;
executed 45798 times by 3 tests: return input;
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
45798
1434#endif-
1435}-
1436-
1437-
1438/*********************************************-
1439 *-
1440 * QXmlDefaultHandler-
1441 *-
1442 *********************************************/-
1443-
1444/*!-
1445 \class QXmlContentHandler-
1446 \reentrant-
1447 \brief The QXmlContentHandler class provides an interface to-
1448 report the logical content of XML data.-
1449-
1450 \inmodule QtXml-
1451 \ingroup xml-tools-
1452-
1453 If the application needs to be informed of basic parsing events,-
1454 it can implement this interface and activate it using-
1455 QXmlReader::setContentHandler(). The reader can then report basic-
1456 document-related events like the start and end of elements and-
1457 character data through this interface.-
1458-
1459 The order of events in this interface is very important, and-
1460 mirrors the order of information in the document itself. For-
1461 example, all of an element's content (character data, processing-
1462 instructions, and sub-elements) appears, in order, between the-
1463 startElement() event and the corresponding endElement() event.-
1464-
1465 The class QXmlDefaultHandler provides a default implementation for-
1466 this interface; subclassing from the QXmlDefaultHandler class is-
1467 very convenient if you only want to be informed of some parsing-
1468 events.-
1469-
1470 The startDocument() function is called at the start of the-
1471 document, and endDocument() is called at the end. Before parsing-
1472 begins setDocumentLocator() is called. For each element-
1473 startElement() is called, with endElement() being called at the-
1474 end of each element. The characters() function is called with-
1475 chunks of character data; ignorableWhitespace() is called with-
1476 chunks of whitespace and processingInstruction() is called with-
1477 processing instructions. If an entity is skipped skippedEntity()-
1478 is called. At the beginning of prefix-URI scopes-
1479 startPrefixMapping() is called.-
1480-
1481 \sa QXmlDTDHandler, QXmlDeclHandler, QXmlEntityResolver, QXmlErrorHandler,-
1482 QXmlLexicalHandler, {Introduction to SAX2}-
1483*/-
1484-
1485/*!-
1486 \fn QXmlContentHandler::~QXmlContentHandler()-
1487-
1488 Destroys the content handler.-
1489*/-
1490-
1491/*!-
1492 \fn void QXmlContentHandler::setDocumentLocator(QXmlLocator* locator)-
1493-
1494 The reader calls this function before it starts parsing the-
1495 document. The argument \a locator is a pointer to a QXmlLocator-
1496 which allows the application to get the parsing position within-
1497 the document.-
1498-
1499 Do not destroy the \a locator; it is destroyed when the reader is-
1500 destroyed. (Do not use the \a locator after the reader is-
1501 destroyed).-
1502*/-
1503-
1504/*!-
1505 \fn bool QXmlContentHandler::startDocument()-
1506-
1507 The reader calls this function when it starts parsing the-
1508 document. The reader calls this function just once, after the call-
1509 to setDocumentLocator(), and before any other functions in this-
1510 class or in the QXmlDTDHandler class are called.-
1511-
1512 If this function returns \c false the reader stops parsing and-
1513 reports an error. The reader uses the function errorString() to-
1514 get the error message.-
1515-
1516 \sa endDocument()-
1517*/-
1518-
1519/*!-
1520 \fn bool QXmlContentHandler::endDocument()-
1521-
1522 The reader calls this function after it has finished parsing. It-
1523 is called just once, and is the last handler function called. It-
1524 is called after the reader has read all input or has abandoned-
1525 parsing because of a fatal error.-
1526-
1527 If this function returns \c false the reader stops parsing and-
1528 reports an error. The reader uses the function errorString() to-
1529 get the error message.-
1530-
1531 \sa startDocument()-
1532*/-
1533-
1534/*!-
1535 \fn bool QXmlContentHandler::startPrefixMapping(const QString& prefix, const QString& uri)-
1536-
1537 The reader calls this function to signal the begin of a prefix-URI-
1538 namespace mapping scope. This information is not necessary for-
1539 normal namespace processing since the reader automatically-
1540 replaces prefixes for element and attribute names.-
1541-
1542 Note that startPrefixMapping() and endPrefixMapping() calls are-
1543 not guaranteed to be properly nested relative to each other: all-
1544 startPrefixMapping() events occur before the corresponding-
1545 startElement() event, and all endPrefixMapping() events occur-
1546 after the corresponding endElement() event, but their order is not-
1547 otherwise guaranteed.-
1548-
1549 The argument \a prefix is the namespace prefix being declared and-
1550 the argument \a uri is the namespace URI the prefix is mapped to.-
1551-
1552 If this function returns \c false the reader stops parsing and-
1553 reports an error. The reader uses the function errorString() to-
1554 get the error message.-
1555-
1556 \sa endPrefixMapping(), {Namespace Support via Features}-
1557*/-
1558-
1559/*!-
1560 \fn bool QXmlContentHandler::endPrefixMapping(const QString& prefix)-
1561-
1562 The reader calls this function to signal the end of a prefix-
1563 mapping for the prefix \a prefix.-
1564-
1565 If this function returns \c false the reader stops parsing and-
1566 reports an error. The reader uses the function errorString() to-
1567 get the error message.-
1568-
1569 \sa startPrefixMapping(), {Namespace Support via Features}-
1570*/-
1571-
1572/*!-
1573 \fn bool QXmlContentHandler::startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts)-
1574-
1575 The reader calls this function when it has parsed a start element-
1576 tag.-
1577-
1578 There is a corresponding endElement() call when the corresponding-
1579 end element tag is read. The startElement() and endElement() calls-
1580 are always nested correctly. Empty element tags (e.g. \c{<x/>})-
1581 cause a startElement() call to be immediately followed by an-
1582 endElement() call.-
1583-
1584 The attribute list provided only contains attributes with explicit-
1585 values. The attribute list contains attributes used for namespace-
1586 declaration (i.e. attributes starting with xmlns) only if the-
1587 namespace-prefix property of the reader is true.-
1588-
1589 The argument \a namespaceURI is the namespace URI, or-
1590 an empty string if the element has no namespace URI or if no-
1591 namespace processing is done. \a localName is the local name-
1592 (without prefix), or an empty string if no namespace processing is-
1593 done, \a qName is the qualified name (with prefix) and \a atts are-
1594 the attributes attached to the element. If there are no-
1595 attributes, \a atts is an empty attributes object.-
1596-
1597 If this function returns \c false the reader stops parsing and-
1598 reports an error. The reader uses the function errorString() to-
1599 get the error message.-
1600-
1601 \sa endElement(), {Namespace Support via Features}-
1602*/-
1603-
1604/*!-
1605 \fn bool QXmlContentHandler::endElement(const QString& namespaceURI, const QString& localName, const QString& qName)-
1606-
1607 The reader calls this function when it has parsed an end element-
1608 tag with the qualified name \a qName, the local name \a localName-
1609 and the namespace URI \a namespaceURI.-
1610-
1611 If this function returns \c false the reader stops parsing and-
1612 reports an error. The reader uses the function errorString() to-
1613 get the error message.-
1614-
1615 \sa startElement(), {Namespace Support via Features}-
1616*/-
1617-
1618/*!-
1619 \fn bool QXmlContentHandler::characters(const QString& ch)-
1620-
1621 The reader calls this function when it has parsed a chunk of-
1622 character data (either normal character data or character data-
1623 inside a CDATA section; if you need to distinguish between those-
1624 two types you must use QXmlLexicalHandler::startCDATA() and-
1625 QXmlLexicalHandler::endCDATA()). The character data is reported in-
1626 \a ch.-
1627-
1628 Some readers report whitespace in element content using the-
1629 ignorableWhitespace() function rather than using this one.-
1630-
1631 A reader may report the character data of an element in more than-
1632 one chunk; e.g. a reader might want to report "a\<b" in three-
1633 characters() events ("a ", "\<" and " b").-
1634-
1635 If this function returns \c false the reader stops parsing and-
1636 reports an error. The reader uses the function errorString() to-
1637 get the error message.-
1638*/-
1639-
1640/*!-
1641 \fn bool QXmlContentHandler::ignorableWhitespace(const QString& ch)-
1642-
1643 Some readers may use this function to report each chunk of-
1644 whitespace in element content. The whitespace is reported in \a ch.-
1645-
1646 If this function returns \c false the reader stops parsing and-
1647 reports an error. The reader uses the function errorString() to-
1648 get the error message.-
1649*/-
1650-
1651/*!-
1652 \fn bool QXmlContentHandler::processingInstruction(const QString& target, const QString& data)-
1653-
1654 The reader calls this function when it has parsed a processing-
1655 instruction.-
1656-
1657 \a target is the target name of the processing instruction and \a-
1658 data is the data in the processing instruction.-
1659-
1660 If this function returns \c false the reader stops parsing and-
1661 reports an error. The reader uses the function errorString() to-
1662 get the error message.-
1663*/-
1664-
1665/*!-
1666 \fn bool QXmlContentHandler::skippedEntity(const QString& name)-
1667-
1668 Some readers may skip entities if they have not seen the-
1669 declarations (e.g. because they are in an external DTD). If they-
1670 do so they report that they skipped the entity called \a name by-
1671 calling this function.-
1672-
1673 If this function returns \c false the reader stops parsing and-
1674 reports an error. The reader uses the function errorString() to-
1675 get the error message.-
1676*/-
1677-
1678/*!-
1679 \fn QString QXmlContentHandler::errorString() const-
1680-
1681 The reader calls this function to get an error string, e.g. if any-
1682 of the handler functions returns \c false.-
1683*/-
1684-
1685-
1686/*!-
1687 \class QXmlErrorHandler-
1688 \reentrant-
1689 \brief The QXmlErrorHandler class provides an interface to report-
1690 errors in XML data.-
1691-
1692 \inmodule QtXml-
1693 \ingroup xml-tools-
1694-
1695 If you want your application to report errors to the user or to-
1696 perform customized error handling, you should subclass this class.-
1697-
1698 You can set the error handler with QXmlReader::setErrorHandler().-
1699-
1700 Errors can be reported using warning(), error() and fatalError(),-
1701 with the error text being reported with errorString().-
1702-
1703 \sa QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver,-
1704 QXmlLexicalHandler, {Introduction to SAX2}-
1705*/-
1706-
1707/*!-
1708 \fn QXmlErrorHandler::~QXmlErrorHandler()-
1709-
1710 Destroys the error handler.-
1711*/-
1712-
1713/*!-
1714 \fn bool QXmlErrorHandler::warning(const QXmlParseException& exception)-
1715-
1716 A reader might use this function to report a warning. Warnings are-
1717 conditions that are not errors or fatal errors as defined by the-
1718 XML 1.0 specification. Details of the warning are stored in \a-
1719 exception.-
1720-
1721 If this function returns \c false the reader stops parsing and-
1722 reports an error. The reader uses the function errorString() to-
1723 get the error message.-
1724*/-
1725-
1726/*!-
1727 \fn bool QXmlErrorHandler::error(const QXmlParseException& exception)-
1728-
1729 A reader might use this function to report a recoverable error. A-
1730 recoverable error corresponds to the definiton of "error" in-
1731 section 1.2 of the XML 1.0 specification. Details of the error are-
1732 stored in \a exception.-
1733-
1734 The reader must continue to provide normal parsing events after-
1735 invoking this function.-
1736-
1737 If this function returns \c false the reader stops parsing and-
1738 reports an error. The reader uses the function errorString() to-
1739 get the error message.-
1740*/-
1741-
1742/*!-
1743\fn bool QXmlErrorHandler::fatalError(const QXmlParseException& exception)-
1744-
1745A reader must use this function to report a non-recoverable error.-
1746Details of the error are stored in \a exception.-
1747-
1748If this function returns \c true the reader might try to go on-
1749parsing and reporting further errors, but no regular parsing-
1750events are reported.-
1751*/-
1752-
1753/*!-
1754 \fn QString QXmlErrorHandler::errorString() const-
1755-
1756 The reader calls this function to get an error string if any of-
1757 the handler functions returns \c false.-
1758*/-
1759-
1760-
1761/*!-
1762 \class QXmlDTDHandler-
1763 \reentrant-
1764 \brief The QXmlDTDHandler class provides an interface to report-
1765 DTD content of XML data.-
1766-
1767 \inmodule QtXml-
1768 \ingroup xml-tools-
1769-
1770 If an application needs information about notations and unparsed-
1771 entities, it can implement this interface and register an instance-
1772 with QXmlReader::setDTDHandler().-
1773-
1774 Note that this interface includes only those DTD events that the-
1775 XML recommendation requires processors to report, i.e. notation-
1776 and unparsed entity declarations using notationDecl() and-
1777 unparsedEntityDecl() respectively.-
1778-
1779 \sa QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler,-
1780 QXmlLexicalHandler, {Introduction to SAX2}-
1781*/-
1782-
1783/*!-
1784 \fn QXmlDTDHandler::~QXmlDTDHandler()-
1785-
1786 Destroys the DTD handler.-
1787*/-
1788-
1789/*!-
1790 \fn bool QXmlDTDHandler::notationDecl(const QString& name, const QString& publicId, const QString& systemId)-
1791-
1792 The reader calls this function when it has parsed a notation-
1793 declaration.-
1794-
1795 The argument \a name is the notation name, \a publicId is the-
1796 notation's public identifier and \a systemId is the notation's-
1797 system identifier.-
1798-
1799 If this function returns \c false the reader stops parsing and-
1800 reports an error. The reader uses the function errorString() to-
1801 get the error message.-
1802*/-
1803-
1804/*!-
1805 \fn bool QXmlDTDHandler::unparsedEntityDecl(const QString& name, const QString& publicId, const QString& systemId, const QString& notationName)-
1806-
1807 The reader calls this function when it finds an unparsed entity-
1808 declaration.-
1809-
1810 The argument \a name is the unparsed entity's name, \a publicId is-
1811 the entity's public identifier, \a systemId is the entity's system-
1812 identifier and \a notationName is the name of the associated-
1813 notation.-
1814-
1815 If this function returns \c false the reader stops parsing and-
1816 reports an error. The reader uses the function errorString() to-
1817 get the error message.-
1818*/-
1819-
1820/*!-
1821 \fn QString QXmlDTDHandler::errorString() const-
1822-
1823 The reader calls this function to get an error string if any of-
1824 the handler functions returns \c false.-
1825*/-
1826-
1827-
1828/*!-
1829 \class QXmlEntityResolver-
1830 \reentrant-
1831 \brief The QXmlEntityResolver class provides an interface to-
1832 resolve external entities contained in XML data.-
1833-
1834 \inmodule QtXml-
1835 \ingroup xml-tools-
1836-
1837 If an application needs to implement customized handling for-
1838 external entities, it must implement this interface, i.e.-
1839 resolveEntity(), and register it with-
1840 QXmlReader::setEntityResolver().-
1841-
1842 \sa QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlErrorHandler,-
1843 QXmlLexicalHandler, {Introduction to SAX2}-
1844*/-
1845-
1846/*!-
1847 \fn QXmlEntityResolver::~QXmlEntityResolver()-
1848-
1849 Destroys the entity resolver.-
1850*/-
1851-
1852/*!-
1853 \fn bool QXmlEntityResolver::resolveEntity(const QString& publicId, const QString& systemId, QXmlInputSource*& ret)-
1854-
1855 The reader calls this function before it opens any external-
1856 entity, except the top-level document entity. The application may-
1857 request the reader to resolve the entity itself (\a ret is 0) or-
1858 to use an entirely different input source (\a ret points to the-
1859 input source).-
1860-
1861 The reader deletes the input source \a ret when it no longer needs-
1862 it, so you should allocate it on the heap with \c new.-
1863-
1864 The argument \a publicId is the public identifier of the external-
1865 entity, \a systemId is the system identifier of the external-
1866 entity and \a ret is the return value of this function. If \a ret-
1867 is 0 the reader should resolve the entity itself, if it is-
1868 non-zero it must point to an input source which the reader uses-
1869 instead.-
1870-
1871 If this function returns \c false the reader stops parsing and-
1872 reports an error. The reader uses the function errorString() to-
1873 get the error message.-
1874*/-
1875-
1876/*!-
1877 \fn QString QXmlEntityResolver::errorString() const-
1878-
1879 The reader calls this function to get an error string if any of-
1880 the handler functions returns \c false.-
1881*/-
1882-
1883-
1884/*!-
1885 \class QXmlLexicalHandler-
1886 \reentrant-
1887 \brief The QXmlLexicalHandler class provides an interface to-
1888 report the lexical content of XML data.-
1889-
1890 \inmodule QtXml-
1891 \ingroup xml-tools-
1892-
1893 The events in the lexical handler apply to the entire document,-
1894 not just to the document element, and all lexical handler events-
1895 appear between the content handler's startDocument and endDocument-
1896 events.-
1897-
1898 You can set the lexical handler with-
1899 QXmlReader::setLexicalHandler().-
1900-
1901 This interface's design is based on the SAX2 extension-
1902 LexicalHandler.-
1903-
1904 The interface provides the startDTD(), endDTD(), startEntity(),-
1905 endEntity(), startCDATA(), endCDATA() and comment() functions.-
1906-
1907 \sa QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver,-
1908 QXmlErrorHandler, {Introduction to SAX2}-
1909*/-
1910-
1911/*!-
1912 \fn QXmlLexicalHandler::~QXmlLexicalHandler()-
1913-
1914 Destroys the lexical handler.-
1915*/-
1916-
1917/*!-
1918 \fn bool QXmlLexicalHandler::startDTD(const QString& name, const QString& publicId, const QString& systemId)-
1919-
1920 The reader calls this function to report the start of a DTD-
1921 declaration, if any. It reports the name of the document type in-
1922 \a name, the public identifier in \a publicId and the system-
1923 identifier in \a systemId.-
1924-
1925 If the public identifier is missing, \a publicId is set to-
1926 an empty string. If the system identifier is missing, \a systemId is-
1927 set to an empty string. Note that it is not valid XML to have a-
1928 public identifier but no system identifier; in such cases a parse-
1929 error will occur.-
1930-
1931 All declarations reported through QXmlDTDHandler or-
1932 QXmlDeclHandler appear between the startDTD() and endDTD() calls.-
1933-
1934 If this function returns \c false the reader stops parsing and-
1935 reports an error. The reader uses the function errorString() to-
1936 get the error message.-
1937-
1938 \sa endDTD()-
1939*/-
1940-
1941/*!-
1942 \fn bool QXmlLexicalHandler::endDTD()-
1943-
1944 The reader calls this function to report the end of a DTD-
1945 declaration, if any.-
1946-
1947 If this function returns \c false the reader stops parsing and-
1948 reports an error. The reader uses the function errorString() to-
1949 get the error message.-
1950-
1951 \sa startDTD()-
1952*/-
1953-
1954/*!-
1955 \fn bool QXmlLexicalHandler::startEntity(const QString& name)-
1956-
1957 The reader calls this function to report the start of an entity-
1958 called \a name.-
1959-
1960 Note that if the entity is unknown, the reader reports it through-
1961 QXmlContentHandler::skippedEntity() and not through this-
1962 function.-
1963-
1964 If this function returns \c false the reader stops parsing and-
1965 reports an error. The reader uses the function errorString() to-
1966 get the error message.-
1967-
1968 \sa endEntity(), QXmlSimpleReader::setFeature()-
1969*/-
1970-
1971/*!-
1972 \fn bool QXmlLexicalHandler::endEntity(const QString& name)-
1973-
1974 The reader calls this function to report the end of an entity-
1975 called \a name.-
1976-
1977 For every startEntity() call, there is a corresponding endEntity()-
1978 call. The calls to startEntity() and endEntity() are properly-
1979 nested.-
1980-
1981 If this function returns \c false the reader stops parsing and-
1982 reports an error. The reader uses the function errorString() to-
1983 get the error message.-
1984-
1985 \sa startEntity(), QXmlContentHandler::skippedEntity(), QXmlSimpleReader::setFeature()-
1986*/-
1987-
1988/*!-
1989 \fn bool QXmlLexicalHandler::startCDATA()-
1990-
1991 The reader calls this function to report the start of a CDATA-
1992 section. The content of the CDATA section is reported through the-
1993 QXmlContentHandler::characters() function. This function is-
1994 intended only to report the boundary.-
1995-
1996 If this function returns \c false the reader stops parsing and-
1997 reports an error. The reader uses the function errorString() to-
1998 get the error message.-
1999-
2000 \sa endCDATA()-
2001*/-
2002-
2003/*!-
2004 \fn bool QXmlLexicalHandler::endCDATA()-
2005-
2006 The reader calls this function to report the end of a CDATA-
2007 section.-
2008-
2009 If this function returns \c false the reader stops parsing and reports-
2010 an error. The reader uses the function errorString() to get the error-
2011 message.-
2012-
2013 \sa startCDATA(), QXmlContentHandler::characters()-
2014*/-
2015-
2016/*!-
2017 \fn bool QXmlLexicalHandler::comment(const QString& ch)-
2018-
2019 The reader calls this function to report an XML comment anywhere-
2020 in the document. It reports the text of the comment in \a ch.-
2021-
2022 If this function returns \c false the reader stops parsing and-
2023 reports an error. The reader uses the function errorString() to-
2024 get the error message.-
2025*/-
2026-
2027/*!-
2028 \fn QString QXmlLexicalHandler::errorString() const-
2029-
2030 The reader calls this function to get an error string if any of-
2031 the handler functions returns \c false.-
2032*/-
2033-
2034-
2035/*!-
2036 \class QXmlDeclHandler-
2037 \reentrant-
2038 \brief The QXmlDeclHandler class provides an interface to report declaration-
2039 content of XML data.-
2040-
2041 \inmodule QtXml-
2042 \ingroup xml-tools-
2043-
2044 You can set the declaration handler with-
2045 QXmlReader::setDeclHandler().-
2046-
2047 This interface is based on the SAX2 extension DeclHandler.-
2048-
2049 The interface provides attributeDecl(), internalEntityDecl() and-
2050 externalEntityDecl() functions.-
2051-
2052 \sa QXmlDTDHandler, QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler,-
2053 QXmlLexicalHandler, {Introduction to SAX2}-
2054*/-
2055-
2056/*!-
2057 \fn QXmlDeclHandler::~QXmlDeclHandler()-
2058-
2059 Destroys the declaration handler.-
2060*/-
2061-
2062/*!-
2063 \fn bool QXmlDeclHandler::attributeDecl(const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value)-
2064-
2065 The reader calls this function to report an attribute type-
2066 declaration. Only the effective (first) declaration for an-
2067 attribute is reported.-
2068-
2069 The reader passes the name of the associated element in \a eName-
2070 and the name of the attribute in \a aName. It passes a string that-
2071 represents the attribute type in \a type and a string that-
2072 represents the attribute default in \a valueDefault. This string-
2073 is one of "#IMPLIED", "#REQUIRED", "#FIXED" or an empty string (if-
2074 none of the others applies). The reader passes the attribute's-
2075 default value in \a value. If no default value is specified in the-
2076 XML file, \a value is an empty string.-
2077-
2078 If this function returns \c false the reader stops parsing and-
2079 reports an error. The reader uses the function errorString() to-
2080 get the error message.-
2081*/-
2082-
2083/*!-
2084 \fn bool QXmlDeclHandler::internalEntityDecl(const QString& name, const QString& value)-
2085-
2086 The reader calls this function to report an internal entity-
2087 declaration. Only the effective (first) declaration is reported.-
2088-
2089 The reader passes the name of the entity in \a name and the value-
2090 of the entity in \a value.-
2091-
2092 If this function returns \c false the reader stops parsing and-
2093 reports an error. The reader uses the function errorString() to-
2094 get the error message.-
2095*/-
2096-
2097/*!-
2098 \fn bool QXmlDeclHandler::externalEntityDecl(const QString& name, const QString& publicId, const QString& systemId)-
2099-
2100 The reader calls this function to report a parsed external entity-
2101 declaration. Only the effective (first) declaration for each-
2102 entity is reported.-
2103-
2104 The reader passes the name of the entity in \a name, the public-
2105 identifier in \a publicId and the system identifier in \a-
2106 systemId. If there is no public identifier specified, it passes-
2107 an empty string in \a publicId.-
2108-
2109 If this function returns \c false the reader stops parsing and-
2110 reports an error. The reader uses the function errorString() to-
2111 get the error message.-
2112*/-
2113-
2114/*!-
2115 \fn QString QXmlDeclHandler::errorString() const-
2116-
2117 The reader calls this function to get an error string if any of-
2118 the handler functions returns \c false.-
2119*/-
2120-
2121-
2122/*!-
2123 \class QXmlDefaultHandler-
2124 \reentrant-
2125 \brief The QXmlDefaultHandler class provides a default implementation of all-
2126 the XML handler classes.-
2127-
2128 \inmodule QtXml-
2129 \ingroup xml-tools-
2130-
2131 This class gathers together the features of-
2132 the specialized handler classes, making it a convenient-
2133 starting point when implementing custom handlers for-
2134 subclasses of QXmlReader, particularly QXmlSimpleReader.-
2135 The virtual functions from each of the base classes are-
2136 reimplemented in this class, providing sensible default behavior-
2137 for many common cases. By subclassing this class, and-
2138 overriding these functions, you can concentrate-
2139 on implementing the parts of the handler relevant to your-
2140 application.-
2141-
2142 The XML reader must be told which handler to use for different-
2143 kinds of events during parsing. This means that, although-
2144 QXmlDefaultHandler provides default implementations of functions-
2145 inherited from all its base classes, we can still use specialized-
2146 handlers for particular kinds of events.-
2147-
2148 For example, QXmlDefaultHandler subclasses both-
2149 QXmlContentHandler and QXmlErrorHandler, so by subclassing-
2150 it we can use the same handler for both of the following-
2151 reader functions:-
2152-
2153 \snippet rsslisting/listing.cpp 0-
2154-
2155 Since the reader will inform the handler of parsing errors, it is-
2156 necessary to reimplement QXmlErrorHandler::fatalError() if, for-
2157 example, we want to stop parsing when such an error occurs:-
2158-
2159 \snippet rsslisting/handler.cpp 0-
2160-
2161 The above function returns \c false, which tells the reader to stop-
2162 parsing. To continue to use the same reader,-
2163 it is necessary to create a new handler instance, and set up the-
2164 reader to use it in the manner described above.-
2165-
2166 It is useful to examine some of the functions inherited by-
2167 QXmlDefaultHandler, and consider why they might be-
2168 reimplemented in a custom handler.-
2169 Custom handlers will typically reimplement-
2170 QXmlContentHandler::startDocument() to prepare the handler for-
2171 new content. Document elements and the text within them can be-
2172 processed by reimplementing QXmlContentHandler::startElement(),-
2173 QXmlContentHandler::endElement(), and-
2174 QXmlContentHandler::characters().-
2175 You may want to reimplement QXmlContentHandler::endDocument()-
2176 to perform some finalization or validation on the content once the-
2177 document has been read completely.-
2178-
2179 \sa QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver,-
2180 QXmlErrorHandler, QXmlLexicalHandler, {Introduction to SAX2}-
2181*/-
2182-
2183/*!-
2184 \fn QXmlDefaultHandler::QXmlDefaultHandler()-
2185-
2186 Constructs a handler for use with subclasses of QXmlReader.-
2187*/-
2188QXmlDefaultHandler::QXmlDefaultHandler()-
2189{-
2190 // ### In Qt 5.0, this function was inlined and d was not initialized-
2191 // The member cannot be used until Qt 6.0-
2192 Q_UNUSED(d);-
2193}
executed 2103 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2103
2194-
2195/*!-
2196 \fn QXmlDefaultHandler::~QXmlDefaultHandler()-
2197-
2198 Destroys the handler.-
2199*/-
2200QXmlDefaultHandler::~QXmlDefaultHandler()-
2201{-
2202}-
2203-
2204/*!-
2205 \reimp-
2206-
2207 This reimplementation does nothing.-
2208*/-
2209void QXmlDefaultHandler::setDocumentLocator(QXmlLocator*)-
2210{-
2211}-
2212-
2213/*!-
2214 \reimp-
2215-
2216 This reimplementation does nothing.-
2217*/-
2218bool QXmlDefaultHandler::startDocument()-
2219{-
2220 return true;
executed 255 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
255
2221}-
2222-
2223/*!-
2224 \reimp-
2225-
2226 This reimplementation does nothing.-
2227*/-
2228bool QXmlDefaultHandler::endDocument()-
2229{-
2230 return true;
executed 11 times by 3 tests: return true;
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
11
2231}-
2232-
2233/*!-
2234 \reimp-
2235-
2236 This reimplementation does nothing.-
2237*/-
2238bool QXmlDefaultHandler::startPrefixMapping(const QString&, const QString&)-
2239{-
2240 return true;
executed 5 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
2241}-
2242-
2243/*!-
2244 \reimp-
2245-
2246 This reimplementation does nothing.-
2247*/-
2248bool QXmlDefaultHandler::endPrefixMapping(const QString&)-
2249{-
2250 return true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
2251}-
2252-
2253/*!-
2254 \reimp-
2255-
2256 This reimplementation does nothing.-
2257*/-
2258bool QXmlDefaultHandler::startElement(const QString&, const QString&,-
2259 const QString&, const QXmlAttributes&)-
2260{-
2261 return true;
executed 206 times by 2 tests: return true;
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
206
2262}-
2263-
2264/*!-
2265 \reimp-
2266-
2267 This reimplementation does nothing.-
2268*/-
2269bool QXmlDefaultHandler::endElement(const QString&, const QString&,-
2270 const QString&)-
2271{-
2272 return true;
executed 206 times by 2 tests: return true;
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
206
2273}-
2274-
2275/*!-
2276 \reimp-
2277-
2278 This reimplementation does nothing.-
2279*/-
2280bool QXmlDefaultHandler::characters(const QString&)-
2281{-
2282 return true;
executed 394 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
394
2283}-
2284-
2285/*!-
2286 \reimp-
2287-
2288 This reimplementation does nothing.-
2289*/-
2290bool QXmlDefaultHandler::ignorableWhitespace(const QString&)-
2291{-
2292 return true;
never executed: return true;
0
2293}-
2294-
2295/*!-
2296 \reimp-
2297-
2298 This reimplementation does nothing.-
2299*/-
2300bool QXmlDefaultHandler::processingInstruction(const QString&,-
2301 const QString&)-
2302{-
2303 return true;
executed 6 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6
2304}-
2305-
2306/*!-
2307 \reimp-
2308-
2309 This reimplementation does nothing.-
2310*/-
2311bool QXmlDefaultHandler::skippedEntity(const QString&)-
2312{-
2313 return true;
never executed: return true;
0
2314}-
2315-
2316/*!-
2317 \reimp-
2318-
2319 This reimplementation does nothing.-
2320*/-
2321bool QXmlDefaultHandler::warning(const QXmlParseException&)-
2322{-
2323 return true;
never executed: return true;
0
2324}-
2325-
2326/*!-
2327 \reimp-
2328-
2329 This reimplementation does nothing.-
2330*/-
2331bool QXmlDefaultHandler::error(const QXmlParseException&)-
2332{-
2333 return true;
never executed: return true;
0
2334}-
2335-
2336/*!-
2337 \reimp-
2338-
2339 This reimplementation does nothing.-
2340*/-
2341bool QXmlDefaultHandler::fatalError(const QXmlParseException&)-
2342{-
2343 return true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
2344}-
2345-
2346/*!-
2347 \reimp-
2348-
2349 This reimplementation does nothing.-
2350*/-
2351bool QXmlDefaultHandler::notationDecl(const QString&, const QString&,-
2352 const QString&)-
2353{-
2354 return true;
never executed: return true;
0
2355}-
2356-
2357/*!-
2358 \reimp-
2359-
2360 This reimplementation does nothing.-
2361*/-
2362bool QXmlDefaultHandler::unparsedEntityDecl(const QString&, const QString&,-
2363 const QString&, const QString&)-
2364{-
2365 return true;
never executed: return true;
0
2366}-
2367-
2368/*!-
2369 \reimp-
2370-
2371 Sets \a ret to 0, so that the reader uses the system identifier-
2372 provided in the XML document.-
2373*/-
2374bool QXmlDefaultHandler::resolveEntity(const QString&, const QString&,-
2375 QXmlInputSource*& ret)-
2376{-
2377 ret = 0;-
2378 return true;
never executed: return true;
0
2379}-
2380-
2381/*!-
2382 \reimp-
2383-
2384 Returns the default error string.-
2385*/-
2386QString QXmlDefaultHandler::errorString() const-
2387{-
2388 return QString::fromLatin1(XMLERR_ERRORBYCONSUMER);
never executed: return QString::fromLatin1("error triggered by consumer");
0
2389}-
2390-
2391/*!-
2392 \reimp-
2393-
2394 This reimplementation does nothing.-
2395*/-
2396bool QXmlDefaultHandler::startDTD(const QString&, const QString&, const QString&)-
2397{-
2398 return true;
never executed: return true;
0
2399}-
2400-
2401/*!-
2402 \reimp-
2403-
2404 This reimplementation does nothing.-
2405*/-
2406bool QXmlDefaultHandler::endDTD()-
2407{-
2408 return true;
executed 157 times by 2 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
157
2409}-
2410-
2411/*!-
2412 \reimp-
2413-
2414 This reimplementation does nothing.-
2415*/-
2416bool QXmlDefaultHandler::startEntity(const QString&)-
2417{-
2418 return true;
never executed: return true;
0
2419}-
2420-
2421/*!-
2422 \reimp-
2423-
2424 This reimplementation does nothing.-
2425*/-
2426bool QXmlDefaultHandler::endEntity(const QString&)-
2427{-
2428 return true;
never executed: return true;
0
2429}-
2430-
2431/*!-
2432 \reimp-
2433-
2434 This reimplementation does nothing.-
2435*/-
2436bool QXmlDefaultHandler::startCDATA()-
2437{-
2438 return true;
never executed: return true;
0
2439}-
2440-
2441/*!-
2442 \reimp-
2443-
2444 This reimplementation does nothing.-
2445*/-
2446bool QXmlDefaultHandler::endCDATA()-
2447{-
2448 return true;
never executed: return true;
0
2449}-
2450-
2451/*!-
2452 \reimp-
2453-
2454 This reimplementation does nothing.-
2455*/-
2456bool QXmlDefaultHandler::comment(const QString&)-
2457{-
2458 return true;
never executed: return true;
0
2459}-
2460-
2461/*!-
2462 \reimp-
2463-
2464 This reimplementation does nothing.-
2465*/-
2466bool QXmlDefaultHandler::attributeDecl(const QString&, const QString&, const QString&, const QString&, const QString&)-
2467{-
2468 return true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
2469}-
2470-
2471/*!-
2472 \reimp-
2473-
2474 This reimplementation does nothing.-
2475*/-
2476bool QXmlDefaultHandler::internalEntityDecl(const QString&, const QString&)-
2477{-
2478 return true;
executed 5 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
2479}-
2480-
2481/*!-
2482 \reimp-
2483-
2484 This reimplementation does nothing.-
2485*/-
2486bool QXmlDefaultHandler::externalEntityDecl(const QString&, const QString&, const QString&)-
2487{-
2488 return true;
never executed: return true;
0
2489}-
2490-
2491-
2492/*********************************************-
2493 *-
2494 * QXmlSimpleReaderPrivate-
2495 *-
2496 *********************************************/-
2497-
2498inline bool QXmlSimpleReaderPrivate::atEnd()-
2499{-
2500 return (c.unicode()|0x0001) == 0xffff;
executed 1050513 times by 6 tests: return (c.unicode()|0x0001) == 0xffff;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1050513
2501}-
2502-
2503inline void QXmlSimpleReaderPrivate::stringClear()-
2504{-
2505 stringValueLen = 0; stringArrayPos = 0;-
2506}
executed 21975 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21975
2507inline void QXmlSimpleReaderPrivate::nameClear()-
2508{-
2509 nameValueLen = 0; nameArrayPos = 0;-
2510}
executed 30021 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
30021
2511-
2512inline void QXmlSimpleReaderPrivate::refClear()-
2513{-
2514 refValueLen = 0; refArrayPos = 0;-
2515}
executed 2957 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2957
2516-
2517QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader)-
2518{-
2519 q_ptr = reader;-
2520 parseStack = 0;-
2521-
2522 locator.reset(new QXmlSimpleReaderLocator(reader));-
2523 entityRes = 0;-
2524 dtdHnd = 0;-
2525 contentHnd = 0;-
2526 errorHnd = 0;-
2527 lexicalHnd = 0;-
2528 declHnd = 0;-
2529-
2530 // default feature settings-
2531 useNamespaces = true;-
2532 useNamespacePrefixes = false;-
2533 reportWhitespaceCharData = true;-
2534 reportEntities = false;-
2535}
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
2536-
2537QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate()-
2538{-
2539 delete parseStack;-
2540}
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
2541-
2542void QXmlSimpleReaderPrivate::initIncrementalParsing()-
2543{-
2544 if(parseStack)
parseStackDescription
TRUEnever evaluated
FALSEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-1490
2545 parseStack->clear();
never executed: parseStack->clear();
0
2546 else-
2547 parseStack = new QStack<ParseState>;
executed 1490 times by 1 test: parseStack = new QStack<ParseState>;
Executed by:
  • tst_qxmlsimplereader - unknown status
1490
2548}-
2549-
2550/*********************************************-
2551 *-
2552 * QXmlSimpleReader-
2553 *-
2554 *********************************************/-
2555-
2556/*!-
2557 \class QXmlReader-
2558 \reentrant-
2559 \brief The QXmlReader class provides an interface for XML readers (i.e.-
2560 parsers).-
2561-
2562 \inmodule QtXml-
2563 \ingroup xml-tools-
2564-
2565 This abstract class provides an interface for all of Qt's XML-
2566 readers. Currently there is only one implementation of a reader-
2567 included in Qt's XML module: QXmlSimpleReader. In future releases-
2568 there might be more readers with different properties available-
2569 (e.g. a validating parser).-
2570-
2571 The design of the XML classes follows the \l{SAX2 Java interface}, with-
2572 the names adapted to fit Qt naming conventions. It should be very-
2573 easy for anybody who has worked with SAX2 to get started with the-
2574 Qt XML classes.-
2575-
2576 All readers use the class QXmlInputSource to read the input-
2577 document. Since you are normally interested in particular content-
2578 in the XML document, the reader reports the content through-
2579 special handler classes (QXmlDTDHandler, QXmlDeclHandler,-
2580 QXmlContentHandler, QXmlEntityResolver, QXmlErrorHandler and-
2581 QXmlLexicalHandler), which you must subclass, if you want to-
2582 process the contents.-
2583-
2584 Since the handler classes only describe interfaces you must-
2585 implement all the functions. We provide the QXmlDefaultHandler-
2586 class to make this easier: it implements a default behavior (do-
2587 nothing) for all functions, so you can subclass it and just-
2588 implement the functions you are interested in.-
2589-
2590 Features and properties of the reader can be set with setFeature()-
2591 and setProperty() respectively. You can set the reader to use your-
2592 own subclasses with setEntityResolver(), setDTDHandler(),-
2593 setContentHandler(), setErrorHandler(), setLexicalHandler() and-
2594 setDeclHandler(). The parse itself is started with a call to-
2595 parse().-
2596-
2597 \sa QXmlSimpleReader-
2598*/-
2599-
2600/*!-
2601 \fn QXmlReader::~QXmlReader()-
2602-
2603 Destroys the reader.-
2604*/-
2605-
2606/*!-
2607 \fn bool QXmlReader::feature(const QString& name, bool *ok) const-
2608-
2609 If the reader has the feature called \a name, the feature's value-
2610 is returned. If no such feature exists the return value is-
2611 undefined.-
2612-
2613 If \a ok is not 0: \c{*}\a{ok} is set to true if the reader has the-
2614 feature called \a name; otherwise \c{*}\a{ok} is set to false.-
2615-
2616 \sa setFeature(), hasFeature()-
2617*/-
2618-
2619/*!-
2620 \fn void QXmlReader::setFeature(const QString& name, bool value)-
2621-
2622 Sets the feature called \a name to the given \a value. If the-
2623 reader doesn't have the feature nothing happens.-
2624-
2625 \sa feature(), hasFeature()-
2626*/-
2627-
2628/*!-
2629 \fn bool QXmlReader::hasFeature(const QString& name) const-
2630-
2631 Returns \c true if the reader has the feature called \a name;-
2632 otherwise returns \c false.-
2633-
2634 \sa feature(), setFeature()-
2635*/-
2636-
2637/*!-
2638 \fn void* QXmlReader::property(const QString& name, bool *ok) const-
2639-
2640 If the reader has the property \a name, this function returns the-
2641 value of the property; otherwise the return value is undefined.-
2642-
2643 If \a ok is not 0: if the reader has the \a name property-
2644 \c{*}\a{ok} is set to true; otherwise \c{*}\a{ok} is set to false.-
2645-
2646 \sa setProperty(), hasProperty()-
2647*/-
2648-
2649/*!-
2650 \fn void QXmlReader::setProperty(const QString& name, void* value)-
2651-
2652 Sets the property \a name to \a value. If the reader doesn't have-
2653 the property nothing happens.-
2654-
2655 \sa property(), hasProperty()-
2656*/-
2657-
2658/*!-
2659 \fn bool QXmlReader::hasProperty(const QString& name) const-
2660-
2661 Returns \c true if the reader has the property \a name; otherwise-
2662 returns \c false.-
2663-
2664 \sa property(), setProperty()-
2665*/-
2666-
2667/*!-
2668 \fn void QXmlReader::setEntityResolver(QXmlEntityResolver* handler)-
2669-
2670 Sets the entity resolver to \a handler.-
2671-
2672 \sa entityResolver()-
2673*/-
2674-
2675/*!-
2676 \fn QXmlEntityResolver* QXmlReader::entityResolver() const-
2677-
2678 Returns the entity resolver or 0 if none was set.-
2679-
2680 \sa setEntityResolver()-
2681*/-
2682-
2683/*!-
2684 \fn void QXmlReader::setDTDHandler(QXmlDTDHandler* handler)-
2685-
2686 Sets the DTD handler to \a handler.-
2687-
2688 \sa DTDHandler()-
2689*/-
2690-
2691/*!-
2692 \fn QXmlDTDHandler* QXmlReader::DTDHandler() const-
2693-
2694 Returns the DTD handler or 0 if none was set.-
2695-
2696 \sa setDTDHandler()-
2697*/-
2698-
2699/*!-
2700 \fn void QXmlReader::setContentHandler(QXmlContentHandler* handler)-
2701-
2702 Sets the content handler to \a handler.-
2703-
2704 \sa contentHandler()-
2705*/-
2706-
2707/*!-
2708 \fn QXmlContentHandler* QXmlReader::contentHandler() const-
2709-
2710 Returns the content handler or 0 if none was set.-
2711-
2712 \sa setContentHandler()-
2713*/-
2714-
2715/*!-
2716 \fn void QXmlReader::setErrorHandler(QXmlErrorHandler* handler)-
2717-
2718 Sets the error handler to \a handler. Clears the error handler if-
2719 \a handler is 0.-
2720-
2721 \sa errorHandler()-
2722*/-
2723-
2724/*!-
2725 \fn QXmlErrorHandler* QXmlReader::errorHandler() const-
2726-
2727 Returns the error handler or 0 if none is set.-
2728-
2729 \sa setErrorHandler()-
2730*/-
2731-
2732/*!-
2733 \fn void QXmlReader::setLexicalHandler(QXmlLexicalHandler* handler)-
2734-
2735 Sets the lexical handler to \a handler.-
2736-
2737 \sa lexicalHandler()-
2738*/-
2739-
2740/*!-
2741 \fn QXmlLexicalHandler* QXmlReader::lexicalHandler() const-
2742-
2743 Returns the lexical handler or 0 if none was set.-
2744-
2745 \sa setLexicalHandler()-
2746*/-
2747-
2748/*!-
2749 \fn void QXmlReader::setDeclHandler(QXmlDeclHandler* handler)-
2750-
2751 Sets the declaration handler to \a handler.-
2752-
2753 \sa declHandler()-
2754*/-
2755-
2756/*!-
2757 \fn QXmlDeclHandler* QXmlReader::declHandler() const-
2758-
2759 Returns the declaration handler or 0 if none was set.-
2760-
2761 \sa setDeclHandler()-
2762*/-
2763-
2764/*!-
2765 \fn bool QXmlReader::parse(const QXmlInputSource &input)-
2766-
2767 \obsolete-
2768-
2769 Parses the given \a input.-
2770*/-
2771-
2772/*!-
2773 \fn bool QXmlReader::parse(const QXmlInputSource *input)-
2774-
2775 Reads an XML document from \a input and parses it. Returns \c true if-
2776 the parsing was successful; otherwise returns \c false.-
2777*/-
2778-
2779-
2780/*!-
2781 \class QXmlSimpleReader-
2782 \nonreentrant-
2783 \brief The QXmlSimpleReader class provides an implementation of a-
2784 simple XML parser.-
2785-
2786 \inmodule QtXml-
2787 \ingroup xml-tools-
2788-
2789-
2790 This XML reader is suitable for a wide range of applications. It-
2791 is able to parse well-formed XML and can report the namespaces of-
2792 elements to a content handler; however, it does not parse any-
2793 external entities. For historical reasons, Attribute Value-
2794 Normalization and End-of-Line Handling as described in the XML 1.0-
2795 specification is not performed.-
2796-
2797 The easiest pattern of use for this class is to create a reader-
2798 instance, define an input source, specify the handlers to be used-
2799 by the reader, and parse the data.-
2800-
2801 For example, we could use a QFile to supply the input. Here, we-
2802 create a reader, and define an input source to be used by the-
2803 reader:-
2804-
2805 \snippet simpleparse/main.cpp 0-
2806-
2807 A handler lets us perform actions when the reader encounters-
2808 certain types of content, or if errors in the input are found. The-
2809 reader must be told which handler to use for each type of-
2810 event. For many common applications, we can create a custom-
2811 handler by subclassing QXmlDefaultHandler, and use this to handle-
2812 both error and content events:-
2813-
2814 \snippet simpleparse/main.cpp 1-
2815-
2816 If you don't set at least the content and error handlers, the-
2817 parser will fall back on its default behavior---and will do-
2818 nothing.-
2819-
2820 The most convenient way to handle the input is to read it in a-
2821 single pass using the parse() function with an argument that-
2822 specifies the input source:-
2823-
2824 \snippet simpleparse/main.cpp 2-
2825-
2826 If you can't parse the entire input in one go (for example, it is-
2827 huge, or is being delivered over a network connection), data can-
2828 be fed to the parser in pieces. This is achieved by telling-
2829 parse() to work incrementally, and making subsequent calls to the-
2830 parseContinue() function, until all the data has been processed.-
2831-
2832 A common way to perform incremental parsing is to connect the \c-
2833 readyRead() signal of a \l{QNetworkReply} {network reply} a slot,-
2834 and handle the incoming data there. See QNetworkAccessManager.-
2835-
2836 Aspects of the parsing behavior can be adapted using setFeature()-
2837 and setProperty().-
2838-
2839 \snippet code/src_xml_sax_qxml.cpp 0-
2840-
2841 QXmlSimpleReader is not reentrant. If you want to use the class-
2842 in threaded code, lock the code using QXmlSimpleReader with a-
2843 locking mechanism, such as a QMutex.-
2844*/-
2845-
2846static inline bool is_S(QChar ch)-
2847{-
2848 ushort uc = ch.unicode();-
2849 return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');
executed 187992 times by 6 tests: return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
187992
2850}-
2851-
2852enum NameChar { NameBeginning, NameNotBeginning, NotName };-
2853-
2854static const char Begi = (char)NameBeginning;-
2855static const char NtBg = (char)NameNotBeginning;-
2856static const char NotN = (char)NotName;-
2857-
2858static const char nameCharTable[128] =-
2859{-
2860// 0x00-
2861 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
2862 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
2863// 0x10-
2864 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
2865 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
2866// 0x20 (0x2D is '-', 0x2E is '.')-
2867 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN,-
2868 NotN, NotN, NotN, NotN, NotN, NtBg, NtBg, NotN,-
2869// 0x30 (0x30..0x39 are '0'..'9', 0x3A is ':')-
2870 NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg,-
2871 NtBg, NtBg, Begi, NotN, NotN, NotN, NotN, NotN,-
2872// 0x40 (0x41..0x5A are 'A'..'Z')-
2873 NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
2874 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
2875// 0x50 (0x5F is '_')-
2876 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
2877 Begi, Begi, Begi, NotN, NotN, NotN, NotN, Begi,-
2878// 0x60 (0x61..0x7A are 'a'..'z')-
2879 NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
2880 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
2881// 0x70-
2882 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi,-
2883 Begi, Begi, Begi, NotN, NotN, NotN, NotN, NotN-
2884};-
2885-
2886static inline NameChar fastDetermineNameChar(QChar ch)-
2887{-
2888 ushort uc = ch.unicode();-
2889 if (!(uc & ~0x7f)) // uc < 128
!(uc & ~0x7f)Description
TRUEevaluated 258018 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2385 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2385-258018
2890 return (NameChar)nameCharTable[uc];
executed 258018 times by 6 tests: return (NameChar)nameCharTable[uc];
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
258018
2891-
2892 QChar::Category cat = ch.category();-
2893 // ### some these categories might be slightly wrong-
2894 if ((cat >= QChar::Letter_Uppercase && cat <= QChar::Letter_Other)
cat >= QChar::Letter_UppercaseDescription
TRUEevaluated 2297 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 88 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
cat <= QChar::Letter_OtherDescription
TRUEevaluated 2285 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
12-2297
2895 || cat == QChar::Number_Letter)
cat == QChar::Number_LetterDescription
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-100
2896 return NameBeginning;
executed 2285 times by 1 test: return NameBeginning;
Executed by:
  • tst_qxmlsimplereader - unknown status
2285
2897 if ((cat >= QChar::Number_DecimalDigit && cat <= QChar::Number_Other)
cat >= QChar::...r_DecimalDigitDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 77 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
cat <= QChar::Number_OtherDescription
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-77
2898 || (cat >= QChar::Mark_NonSpacing && cat <= QChar::Mark_Enclosing))
cat >= QChar::Mark_NonSpacingDescription
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
cat <= QChar::Mark_EnclosingDescription
TRUEevaluated 77 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-100
2899 return NameNotBeginning;
executed 77 times by 1 test: return NameNotBeginning;
Executed by:
  • tst_qxmlsimplereader - unknown status
77
2900 return NotName;
executed 23 times by 1 test: return NotName;
Executed by:
  • tst_qxmlsimplereader - unknown status
23
2901}-
2902-
2903static NameChar determineNameChar(QChar ch)-
2904{-
2905 return fastDetermineNameChar(ch);
executed 40888 times by 6 tests: return fastDetermineNameChar(ch);
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
40888
2906}-
2907-
2908/*!-
2909 Constructs a simple XML reader.-
2910-
2911*/-
2912QXmlSimpleReader::QXmlSimpleReader()-
2913 : d_ptr(new QXmlSimpleReaderPrivate(this))-
2914{-
2915}
executed 2104 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2104
2916-
2917/*!-
2918 Destroys the simple XML reader.-
2919*/-
2920QXmlSimpleReader::~QXmlSimpleReader()-
2921{-
2922}-
2923-
2924/*!-
2925 \reimp-
2926*/-
2927bool QXmlSimpleReader::feature(const QString& name, bool *ok) const-
2928{-
2929 const QXmlSimpleReaderPrivate *d = d_func();-
2930-
2931 if (ok != 0)
ok != 0Description
TRUEnever evaluated
FALSEevaluated 246 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
0-246
2932 *ok = true;
never executed: *ok = true;
0
2933 if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
name == QLatin...s/namespaces")Description
TRUEevaluated 244 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-244
2934 return d->useNamespaces;
executed 244 times by 5 tests: return d->useNamespaces;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
244
2935 } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) {
name == QLatin...ace-prefixes")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-2
2936 return d->useNamespacePrefixes;
executed 2 times by 1 test: return d->useNamespacePrefixes;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
2937 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4
name == QLatin...nly-CharData")Description
TRUEnever evaluated
FALSEnever evaluated
0
2938 || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) {
name == QLatin...nly-CharData")Description
TRUEnever evaluated
FALSEnever evaluated
0
2939 return d->reportWhitespaceCharData;
never executed: return d->reportWhitespaceCharData;
0
2940 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4
name == QLatin...t-end-entity")Description
TRUEnever evaluated
FALSEnever evaluated
0
2941 || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) {
name == QLatin...t-end-entity")Description
TRUEnever evaluated
FALSEnever evaluated
0
2942 return d->reportEntities;
never executed: return d->reportEntities;
0
2943 } else {-
2944 qWarning("Unknown feature %s", name.toLatin1().data());-
2945 if (ok != 0)
ok != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
2946 *ok = false;
never executed: *ok = false;
0
2947 }
never executed: end of block
0
2948 return false;
never executed: return false;
0
2949}-
2950-
2951/*!-
2952 Turns on the feature \a name if \a enable is true; otherwise turns it off.-
2953-
2954 The \a name parameter must be one of the following strings:-
2955 \table-
2956 \header \li Feature \li Default \li Notes-
2957 \row \li \e http://xml.org/sax/features/namespaces-
2958 \li true-
2959 \li If enabled, namespaces are reported to the content handler.-
2960 \row \li \e http://xml.org/sax/features/namespace-prefixes-
2961 \li false-
2962 \li If enabled, the original prefixed names-
2963 and attributes used for namespace declarations are-
2964 reported.-
2965 \row \li \e http://qt-project.org/xml/features/report-whitespace-only-CharData-
2966 \li true-
2967 \li If enabled, CharData that consist of-
2968 only whitespace characters are reported-
2969 using QXmlContentHandler::characters(). If disabled, whitespace is silently-
2970 discarded.-
2971 \row \li \e http://qt-project.org/xml/features/report-start-end-entity-
2972 \li false-
2973 \li If enabled, the parser reports-
2974 QXmlContentHandler::startEntity() and-
2975 QXmlContentHandler::endEntity() events, so character data-
2976 might be reported in chunks.-
2977 If disabled, the parser does not report these events, but-
2978 silently substitutes the entities, and reports the character-
2979 data in one chunk.-
2980 \endtable-
2981-
2982 \sa feature(), hasFeature(), {SAX2 Features}-
2983*/-
2984void QXmlSimpleReader::setFeature(const QString& name, bool enable)-
2985{-
2986 Q_D(QXmlSimpleReader);-
2987 if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
name == QLatin...s/namespaces")Description
TRUEevaluated 244 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 488 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
244-488
2988 d->useNamespaces = enable;-
2989 } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) {
executed 244 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
name == QLatin...ace-prefixes")Description
TRUEevaluated 244 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 244 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
244
2990 d->useNamespacePrefixes = enable;-
2991 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4
executed 244 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
name == QLatin...nly-CharData")Description
TRUEevaluated 244 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-244
2992 || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) {
name == QLatin...nly-CharData")Description
TRUEnever evaluated
FALSEnever evaluated
0
2993 d->reportWhitespaceCharData = enable;-
2994 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4
executed 244 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
name == QLatin...t-end-entity")Description
TRUEnever evaluated
FALSEnever evaluated
0-244
2995 || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) {
name == QLatin...t-end-entity")Description
TRUEnever evaluated
FALSEnever evaluated
0
2996 d->reportEntities = enable;-
2997 } else {
never executed: end of block
0
2998 qWarning("Unknown feature %s", name.toLatin1().data());-
2999 }
never executed: end of block
0
3000}-
3001-
3002/*! \reimp-
3003*/-
3004bool QXmlSimpleReader::hasFeature(const QString& name) const-
3005{-
3006 if (name == QLatin1String("http://xml.org/sax/features/namespaces")
name == QLatin...s/namespaces")Description
TRUEnever evaluated
FALSEnever evaluated
0
3007 || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
name == QLatin...ace-prefixes")Description
TRUEnever evaluated
FALSEnever evaluated
0
3008 || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4
name == QLatin...nly-CharData")Description
TRUEnever evaluated
FALSEnever evaluated
0
3009 || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
name == QLatin...nly-CharData")Description
TRUEnever evaluated
FALSEnever evaluated
0
3010 || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4
name == QLatin...t-end-entity")Description
TRUEnever evaluated
FALSEnever evaluated
0
3011 || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) {
name == QLatin...t-end-entity")Description
TRUEnever evaluated
FALSEnever evaluated
0
3012 return true;
never executed: return true;
0
3013 } else {-
3014 return false;
never executed: return false;
0
3015 }-
3016}-
3017-
3018/*! \reimp-
3019*/-
3020void* QXmlSimpleReader::property(const QString&, bool *ok) const-
3021{-
3022 if (ok != 0)
ok != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
3023 *ok = false;
never executed: *ok = false;
0
3024 return 0;
never executed: return 0;
0
3025}-
3026-
3027/*! \reimp-
3028*/-
3029void QXmlSimpleReader::setProperty(const QString&, void*)-
3030{-
3031}-
3032-
3033/*!-
3034 \reimp-
3035*/-
3036bool QXmlSimpleReader::hasProperty(const QString&) const-
3037{-
3038 return false;
never executed: return false;
0
3039}-
3040-
3041/*!-
3042 \reimp-
3043*/-
3044void QXmlSimpleReader::setEntityResolver(QXmlEntityResolver* handler)-
3045{-
3046 Q_D(QXmlSimpleReader);-
3047 d->entityRes = handler;-
3048}
executed 1845 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1845
3049-
3050/*!-
3051 \reimp-
3052*/-
3053QXmlEntityResolver* QXmlSimpleReader::entityResolver() const-
3054{-
3055 const QXmlSimpleReaderPrivate *d = d_func();-
3056 return d->entityRes;
never executed: return d->entityRes;
0
3057}-
3058-
3059/*!-
3060 \reimp-
3061*/-
3062void QXmlSimpleReader::setDTDHandler(QXmlDTDHandler* handler)-
3063{-
3064 Q_D(QXmlSimpleReader);-
3065 d->dtdHnd = handler;-
3066}
executed 2089 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2089
3067-
3068/*!-
3069 \reimp-
3070*/-
3071QXmlDTDHandler* QXmlSimpleReader::DTDHandler() const-
3072{-
3073 const QXmlSimpleReaderPrivate *d = d_func();-
3074 return d->dtdHnd;
never executed: return d->dtdHnd;
0
3075}-
3076-
3077/*!-
3078 \reimp-
3079*/-
3080void QXmlSimpleReader::setContentHandler(QXmlContentHandler* handler)-
3081{-
3082 Q_D(QXmlSimpleReader);-
3083 d->contentHnd = handler;-
3084}
executed 2100 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2100
3085-
3086/*!-
3087 \reimp-
3088*/-
3089QXmlContentHandler* QXmlSimpleReader::contentHandler() const-
3090{-
3091 const QXmlSimpleReaderPrivate *d = d_func();-
3092 return d->contentHnd;
never executed: return d->contentHnd;
0
3093}-
3094-
3095/*!-
3096 \reimp-
3097*/-
3098void QXmlSimpleReader::setErrorHandler(QXmlErrorHandler* handler)-
3099{-
3100 Q_D(QXmlSimpleReader);-
3101 d->errorHnd = handler;-
3102}
executed 2094 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2094
3103-
3104/*!-
3105 \reimp-
3106*/-
3107QXmlErrorHandler* QXmlSimpleReader::errorHandler() const-
3108{-
3109 const QXmlSimpleReaderPrivate *d = d_func();-
3110 return d->errorHnd;
never executed: return d->errorHnd;
0
3111}-
3112-
3113/*!-
3114 \reimp-
3115*/-
3116void QXmlSimpleReader::setLexicalHandler(QXmlLexicalHandler* handler)-
3117{-
3118 Q_D(QXmlSimpleReader);-
3119 d->lexicalHnd = handler;-
3120}
executed 2089 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2089
3121-
3122/*!-
3123 \reimp-
3124*/-
3125QXmlLexicalHandler* QXmlSimpleReader::lexicalHandler() const-
3126{-
3127 const QXmlSimpleReaderPrivate *d = d_func();-
3128 return d->lexicalHnd;
never executed: return d->lexicalHnd;
0
3129}-
3130-
3131/*!-
3132 \reimp-
3133*/-
3134void QXmlSimpleReader::setDeclHandler(QXmlDeclHandler* handler)-
3135{-
3136 Q_D(QXmlSimpleReader);-
3137 d->declHnd = handler;-
3138}
executed 2092 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2092
3139-
3140/*!-
3141 \reimp-
3142*/-
3143QXmlDeclHandler* QXmlSimpleReader::declHandler() const-
3144{-
3145 const QXmlSimpleReaderPrivate *d = d_func();-
3146 return d->declHnd;
never executed: return d->declHnd;
0
3147}-
3148-
3149-
3150-
3151/*!-
3152 \reimp-
3153*/-
3154bool QXmlSimpleReader::parse(const QXmlInputSource& input)-
3155{-
3156 return parse(&input, false);
executed 359 times by 2 tests: return parse(&input, false);
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
359
3157}-
3158-
3159/*!-
3160 Reads an XML document from \a input and parses it in one pass (non-incrementally).-
3161 Returns \c true if the parsing was successful; otherwise returns \c false.-
3162*/-
3163bool QXmlSimpleReader::parse(const QXmlInputSource* input)-
3164{-
3165 return parse(input, false);
executed 252 times by 5 tests: return parse(input, false);
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
252
3166}-
3167-
3168/*!-
3169 Reads an XML document from \a input and parses it. Returns \c true-
3170 if the parsing is completed successfully; otherwise returns \c false,-
3171 indicating that an error occurred.-
3172-
3173 If \a incremental is false, this function will return false if the XML-
3174 file is not read completely. The parsing cannot be continued in this-
3175 case.-
3176-
3177 If \a incremental is true, the parser does not return false if-
3178 it reaches the end of the \a input before reaching the end-
3179 of the XML file. Instead, it stores the state of the parser so that-
3180 parsing can be continued later when more data is available.-
3181 In such a case, you can use the function parseContinue() to-
3182 continue with parsing. This class stores a pointer to the input-
3183 source \a input and the parseContinue() function tries to read from-
3184 that input source. Therefore, you should not delete the input-
3185 source \a input until you no longer need to call parseContinue().-
3186-
3187 If this function is called with \a incremental set to true-
3188 while an incremental parse is in progress, a new parsing-
3189 session will be started, and the previous session will be lost.-
3190-
3191 \sa parseContinue(), QTcpSocket-
3192*/-
3193bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental)-
3194{-
3195 Q_D(QXmlSimpleReader);-
3196-
3197 d->literalEntitySizes.clear();-
3198 d->referencesToOtherEntities.clear();-
3199 d->expandedSizes.clear();-
3200-
3201 if (incremental) {
incrementalDescription
TRUEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 616 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
616-1490
3202 d->initIncrementalParsing();-
3203 } else {
executed 1490 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1490
3204 delete d->parseStack;-
3205 d->parseStack = 0;-
3206 }
executed 616 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
616
3207 d->init(input);-
3208-
3209 // call the handler-
3210 if (d->contentHnd) {
d->contentHndDescription
TRUEevaluated 2100 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
6-2100
3211 d->contentHnd->setDocumentLocator(d->locator.data());-
3212 if (!d->contentHnd->startDocument()) {
!d->contentHnd...tartDocument()Description
TRUEnever evaluated
FALSEevaluated 2100 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-2100
3213 d->reportParseError(d->contentHnd->errorString());-
3214 clear(d->tags);-
3215 return false;
never executed: return false;
0
3216 }-
3217 }
executed 2100 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2100
3218 d->skipped_entity_in_content = false;-
3219 return d->parseBeginOrContinue(0, incremental);
executed 2106 times by 6 tests: return d->parseBeginOrContinue(0, incremental);
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2106
3220}-
3221-
3222/*!-
3223 Continues incremental parsing, taking input from the-
3224 QXmlInputSource that was specified with the most recent-
3225 call to parse(). To use this function, you \e must have called-
3226 parse() with the incremental argument set to true.-
3227-
3228 Returns \c false if a parsing error occurs; otherwise returns \c true,-
3229 even if the end of the XML file has not been reached. You can-
3230 continue parsing at a later stage by calling this function again-
3231 when there is more data available to parse.-
3232-
3233 Calling this function when there is no data available in the input-
3234 source indicates to the reader that the end of the XML file has-
3235 been reached. If the input supplied up to this point was-
3236 not well-formed then a parsing error occurs, and false is returned.-
3237 If the input supplied was well-formed, true is returned.-
3238 It is important to end the input in this way because it allows you-
3239 to reuse the reader to parse other XML files.-
3240-
3241 Calling this function after the end of file has been reached, but-
3242 without available data will cause false to be returned whether the-
3243 previous input was well-formed or not.-
3244-
3245 \sa parse(), QXmlInputSource::data(), QXmlInputSource::next()-
3246*/-
3247bool QXmlSimpleReader::parseContinue()-
3248{-
3249 Q_D(QXmlSimpleReader);-
3250 if (d->parseStack == 0 || d->parseStack->isEmpty())
d->parseStack == 0Description
TRUEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 44908 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
d->parseStack->isEmpty()Description
TRUEnever evaluated
FALSEevaluated 44908 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-44908
3251 return false;
executed 1490 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1490
3252 d->initData();-
3253 int state = d->parseStack->pop().state;-
3254 return d->parseBeginOrContinue(state, true);
executed 44908 times by 1 test: return d->parseBeginOrContinue(state, true);
Executed by:
  • tst_qxmlsimplereader - unknown status
44908
3255}-
3256-
3257/*-
3258 Common part of parse() and parseContinue()-
3259*/-
3260bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)-
3261{-
3262 bool atEndOrig = atEnd();-
3263-
3264 if (state==0) {
state==0Description
TRUEevaluated 36047 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10967 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10967-36047
3265 if (!parseProlog()) {
!parseProlog()Description
TRUEevaluated 34018 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2029 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2029-34018
3266 if (incremental && error.isNull()) {
incrementalDescription
TRUEevaluated 33941 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 77 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
error.isNull()Description
TRUEevaluated 33941 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-33941
3267 pushParseState(0, 0);-
3268 return true;
executed 33941 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
33941
3269 } else {-
3270 clear(tags);-
3271 return false;
executed 77 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
77
3272 }-
3273 }-
3274 state = 1;-
3275 }
executed 2029 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2029
3276 if (state==1) {
state==1Description
TRUEevaluated 10482 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2514 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2514-10482
3277 if (!parseElement()) {
!parseElement()Description
TRUEevaluated 8521 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1961 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1961-8521
3278 if (incremental && error.isNull()) {
incrementalDescription
TRUEevaluated 8453 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 68 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
error.isNull()Description
TRUEevaluated 8453 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-8453
3279 pushParseState(0, 1);-
3280 return true;
executed 8453 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
8453
3281 } else {-
3282 clear(tags);-
3283 return false;
executed 68 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
68
3284 }-
3285 }-
3286 state = 2;-
3287 }
executed 1961 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1961
3288 // parse Misc*-
3289 while (!atEnd()) {
!atEnd()Description
TRUEevaluated 2340 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2392 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2340-2392
3290 if (!parseMisc()) {
!parseMisc()Description
TRUEevaluated 2083 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 257 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
257-2083
3291 if (incremental && error.isNull()) {
incrementalDescription
TRUEevaluated 2073 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
error.isNull()Description
TRUEevaluated 2073 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-2073
3292 pushParseState(0, 2);-
3293 return true;
executed 2073 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
2073
3294 } else {-
3295 clear(tags);-
3296 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
3297 }-
3298 }-
3299 }
executed 257 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
257
3300 if (!atEndOrig && incremental) {
!atEndOrigDescription
TRUEevaluated 902 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
incrementalDescription
TRUEevaluated 441 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 461 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
441-1490
3301 // we parsed something at all, so be prepared to come back later-
3302 pushParseState(0, 2);-
3303 return true;
executed 441 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
441
3304 }-
3305 // is stack empty?-
3306 if (!tags.empty() && !error.isNull()) {
!tags.empty()Description
TRUEnever evaluated
FALSEevaluated 1951 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
!error.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
0-1951
3307 reportParseError(QLatin1String(XMLERR_UNEXPECTEDEOF));-
3308 clear(tags);-
3309 return false;
never executed: return false;
0
3310 }-
3311 // call the handler-
3312 if (contentHnd) {
contentHndDescription
TRUEevaluated 1950 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlinputsource - unknown status
1-1950
3313 delete parseStack;-
3314 parseStack = 0;-
3315 if (!contentHnd->endDocument()) {
!contentHnd->endDocument()Description
TRUEnever evaluated
FALSEevaluated 1950 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-1950
3316 reportParseError(contentHnd->errorString());-
3317 return false;
never executed: return false;
0
3318 }-
3319 }
executed 1950 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1950
3320 return true;
executed 1951 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1951
3321}-
3322-
3323//-
3324// The following private parse functions have another semantics for the return-
3325// value: They return true iff parsing has finished successfully (i.e. the end-
3326// of the XML file must be reached!). If one of these functions return false,-
3327// there is only an error when d->error.isNULL() is also false.-
3328//-
3329-
3330/*-
3331 For the incremental parsing, it is very important that the parse...()-
3332 functions have a certain structure. Since it might be hard to understand how-
3333 they work, here is a description of the layout of these functions:-
3334-
3335 bool QXmlSimpleReader::parse...()-
3336 {-
3337(1) const signed char Init = 0;-
3338 ...-
3339-
3340(2) const signed char Inp... = 0;-
3341 ...-
3342-
3343(3) static const signed char table[3][2] = {-
3344 ...-
3345 };-
3346 signed char state;-
3347 signed char input;-
3348-
3349(4) if (d->parseStack == 0 || d->parseStack->isEmpty()) {-
3350(4a) ...-
3351 } else {-
3352(4b) ...-
3353 }-
3354-
3355 for (; ;) {-
3356(5) switch (state) {-
3357 ...-
3358 }-
3359-
3360(6)-
3361(6a) if (atEnd()) {-
3362 unexpectedEof(&QXmlSimpleReader::parseNmtoken, state);-
3363 return false;-
3364 }-
3365(6b) if (determineNameChar(c) != NotName) {-
3366 ...-
3367 }-
3368(7) state = table[state][input];-
3369-
3370(8) switch (state) {-
3371 ...-
3372 }-
3373 }-
3374 }-
3375-
3376 Explanation:-
3377 ad 1: constants for the states (used in the transition table)-
3378 ad 2: constants for the input (used in the transition table)-
3379 ad 3: the transition table for the state machine-
3380 ad 4: test if we are in a parseContinue() step-
3381 a) if no, do inititalizations-
3382 b) if yes, restore the state and call parse functions recursively-
3383 ad 5: Do some actions according to the state; from the logical execution-
3384 order, this code belongs after 8 (see there for an explanation)-
3385 ad 6: Check the character that is at the actual "cursor" position:-
3386 a) If we reached the EOF, report either error or push the state (in the-
3387 case of incremental parsing).-
3388 b) Otherwise, set the input character constant for the transition-
3389 table.-
3390 ad 7: Get the new state according to the input that was read.-
3391 ad 8: Do some actions according to the state. The last line in every case-
3392 statement reads new data (i.e. it move the cursor). This can also be-
3393 done by calling another parse...() function. If you need processing for-
3394 this state after that, you have to put it into the switch statement 5.-
3395 This ensures that you have a well defined re-entry point, when you ran-
3396 out of data.-
3397*/-
3398-
3399/*-
3400 Parses the prolog [22].-
3401*/-
3402-
3403bool QXmlSimpleReaderPrivate::parseProlog()-
3404{-
3405 const signed char Init = 0;-
3406 const signed char EatWS = 1; // eat white spaces-
3407 const signed char Lt = 2; // '<' read-
3408 const signed char Em = 3; // '!' read-
3409 const signed char DocType = 4; // read doctype-
3410 const signed char Comment = 5; // read comment-
3411 const signed char CommentR = 6; // same as Comment, but already reported-
3412 const signed char PInstr = 7; // read PI-
3413 const signed char PInstrR = 8; // same as PInstr, but already reported-
3414 const signed char Done = 9;-
3415-
3416 const signed char InpWs = 0;-
3417 const signed char InpLt = 1; // <-
3418 const signed char InpQm = 2; // ?-
3419 const signed char InpEm = 3; // !-
3420 const signed char InpD = 4; // D-
3421 const signed char InpDash = 5; // --
3422 const signed char InpUnknown = 6;-
3423-
3424 static const signed char table[9][7] = {-
3425 /* InpWs InpLt InpQm InpEm InpD InpDash InpUnknown */-
3426 { EatWS, Lt, -1, -1, -1, -1, -1 }, // Init-
3427 { -1, Lt, -1, -1, -1, -1, -1 }, // EatWS-
3428 { -1, -1, PInstr,Em, Done, -1, Done }, // Lt-
3429 { -1, -1, -1, -1, DocType, Comment, -1 }, // Em-
3430 { EatWS, Lt, -1, -1, -1, -1, -1 }, // DocType-
3431 { EatWS, Lt, -1, -1, -1, -1, -1 }, // Comment-
3432 { EatWS, Lt, -1, -1, -1, -1, -1 }, // CommentR-
3433 { EatWS, Lt, -1, -1, -1, -1, -1 }, // PInstr-
3434 { EatWS, Lt, -1, -1, -1, -1, -1 } // PInstrR-
3435 };-
3436 signed char state;-
3437 signed char input;-
3438-
3439 if (parseStack == 0 || parseStack->isEmpty()) {
parseStack == 0Description
TRUEevaluated 616 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 35431 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 33941 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
616-35431
3440 xmldecl_possible = true;-
3441 doctype_read = false;-
3442 state = Init;-
3443 } else {
executed 2106 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2106
3444 state = parseStack->pop().state;-
3445#if defined(QT_QXML_DEBUG)-
3446 qDebug("QXmlSimpleReader: parseProlog (cont) in state %d", state);-
3447#endif-
3448 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 32278 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1663 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1663-32278
3449 ParseFunction function = parseStack->top().function;-
3450 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 923 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 31355 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
923-31355
3451 parseStack->pop();-
3452#if defined(QT_QXML_DEBUG)-
3453 qDebug("QXmlSimpleReader: eat_ws (cont)");-
3454#endif-
3455 }
executed 923 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
923
3456 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 29925 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2353 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2353-29925
3457 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state);-
3458 return false;
executed 29925 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
29925
3459 }-
3460 }
executed 2353 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2353
3461 }
executed 4016 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4016
3462-
3463 for (;;) {-
3464 switch (state) {-
3465 case DocType:
executed 2370 times by 4 tests: case DocType:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2370
3466 if (doctype_read) {
doctype_readDescription
TRUEnever evaluated
FALSEevaluated 2370 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-2370
3467 reportParseError(QLatin1String(XMLERR_MORETHANONEDOCTYPE));-
3468 return false;
never executed: return false;
0
3469 } else {-
3470 doctype_read = false;-
3471 }
executed 2370 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2370
3472 break;
executed 2370 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2370
3473 case Comment:
executed 21 times by 2 tests: case Comment:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21
3474 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8-13
3475 if (!lexicalHnd->comment(string())) {
!lexicalHnd->comment(string())Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-13
3476 reportParseError(lexicalHnd->errorString());-
3477 return false;
never executed: return false;
0
3478 }-
3479 }
executed 13 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
13
3480 state = CommentR;-
3481 break;
executed 21 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21
3482 case PInstr:
executed 134 times by 2 tests: case PInstr:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
134
3483 // call the handler-
3484 if (contentHnd) {
contentHndDescription
TRUEevaluated 131 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-131
3485 if (xmldecl_possible && !xmlVersion.isEmpty()) {
xmldecl_possibleDescription
TRUEevaluated 120 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
!xmlVersion.isEmpty()Description
TRUEevaluated 108 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-120
3486 QString value(QLatin1String("version='"));-
3487 value += xmlVersion;-
3488 value += QLatin1Char('\'');-
3489 if (!encoding.isEmpty()) {
!encoding.isEmpty()Description
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 45 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
45-63
3490 value += QLatin1String(" encoding='");-
3491 value += encoding;-
3492 value += QLatin1Char('\'');-
3493 }
executed 63 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
63
3494 if (standalone == QXmlSimpleReaderPrivate::Yes) {
standalone == ...erPrivate::YesDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 87 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21-87
3495 value += QLatin1String(" standalone='yes'");-
3496 } else if (standalone == QXmlSimpleReaderPrivate::No) {
executed 21 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
standalone == ...derPrivate::NoDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 57 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21-57
3497 value += QLatin1String(" standalone='no'");-
3498 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
30
3499 if (!contentHnd->processingInstruction(QLatin1String("xml"), value)) {
!contentHnd->p..."xml"), value)Description
TRUEnever evaluated
FALSEevaluated 108 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-108
3500 reportParseError(contentHnd->errorString());-
3501 return false;
never executed: return false;
0
3502 }-
3503 } else {
executed 108 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
108
3504 if (!contentHnd->processingInstruction(name(), string())) {
!contentHnd->p...e(), string())Description
TRUEnever evaluated
FALSEevaluated 23 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-23
3505 reportParseError(contentHnd->errorString());-
3506 return false;
never executed: return false;
0
3507 }-
3508 }
executed 23 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
23
3509 }-
3510 // XML declaration only on first position possible-
3511 xmldecl_possible = false;-
3512 state = PInstrR;-
3513 break;
executed 134 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
134
3514 case Done:
executed 2029 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2029
3515 return true;
executed 2029 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2029
3516 case -1:
executed 6 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
6
3517 reportParseError(QLatin1String(XMLERR_ERRORPARSINGELEMENT));-
3518 return false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
3519 }-
3520-
3521 if (atEnd()) {
atEnd()Description
TRUEevaluated 1664 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12160 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1664-12160
3522 unexpectedEof(&QXmlSimpleReaderPrivate::parseProlog, state);-
3523 return false;
executed 1664 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1664
3524 }-
3525 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 1960 times by 4 tests
Evaluated by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10200 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1960-10200
3526 input = InpWs;-
3527 } else if (c == QLatin1Char('<')) {
executed 1960 times by 4 tests: end of block
Executed by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('<')Description
TRUEevaluated 4124 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 6076 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1960-6076
3528 input = InpLt;-
3529 } else if (c == QLatin1Char('?')) {
executed 4124 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('?')Description
TRUEevaluated 147 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 5929 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
147-5929
3530 input = InpQm;-
3531 } else if (c == QLatin1Char('!')) {
executed 147 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('!')Description
TRUEevaluated 1948 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3981 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
147-3981
3532 input = InpEm;-
3533 } else if (c == QLatin1Char('D')) {
executed 1948 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('D')Description
TRUEevaluated 1923 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2058 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923-2058
3534 input = InpD;-
3535 } else if (c == QLatin1Char('-')) {
executed 1923 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('-')Description
TRUEevaluated 23 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2035 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
23-2035
3536 input = InpDash;-
3537 } else {
executed 23 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
23
3538 input = InpUnknown;-
3539 }
executed 2035 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2035
3540 state = table[state][input];-
3541-
3542 switch (state) {-
3543 case EatWS:
executed 1960 times by 4 tests: case EatWS:
Executed by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1960
3544 // XML declaration only on first position possible-
3545 xmldecl_possible = false;-
3546 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 746 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1214 times by 4 tests
Evaluated by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
746-1214
3547 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state);-
3548 return false;
executed 746 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
746
3549 }-
3550 break;
executed 1214 times by 4 tests: break;
Executed by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1214
3551 case Lt:
executed 4124 times by 6 tests: case Lt:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4124
3552 next();-
3553 break;
executed 4124 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4124
3554 case Em:
executed 1948 times by 4 tests: case Em:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1948
3555 // XML declaration only on first position possible-
3556 xmldecl_possible = false;-
3557 next();-
3558 break;
executed 1948 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1948
3559 case DocType:
executed 1923 times by 4 tests: case DocType:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
3560 if (!parseDoctype()) {
!parseDoctype()Description
TRUEevaluated 1545 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 378 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
378-1545
3561 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state);-
3562 return false;
executed 1545 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1545
3563 }-
3564 break;
executed 378 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
378
3565 case Comment:
executed 23 times by 2 tests: case Comment:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
23
3566 case CommentR:
never executed: case CommentR:
0
3567 if (!parseComment()) {
!parseComment()Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
11-12
3568 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state);-
3569 return false;
executed 11 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
11
3570 }-
3571 break;
executed 12 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12
3572 case PInstr:
executed 147 times by 2 tests: case PInstr:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
147
3573 case PInstrR:
never executed: case PInstrR:
0
3574 parsePI_xmldecl = xmldecl_possible;-
3575 if (!parsePI()) {
!parsePI()Description
TRUEevaluated 121 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
26-121
3576 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state);-
3577 return false;
executed 121 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
121
3578 }-
3579 break;
executed 26 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
26
3580 }-
3581 }
executed 9737 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
9737
3582 return false;
never executed: return false;
0
3583}-
3584-
3585/*-
3586 Parse an element [39].-
3587-
3588 Precondition: the opening '<' is already read.-
3589*/-
3590bool QXmlSimpleReaderPrivate::parseElement()-
3591{-
3592 const int Init = 0;-
3593 const int ReadName = 1;-
3594 const int Ws1 = 2;-
3595 const int STagEnd = 3;-
3596 const int STagEnd2 = 4;-
3597 const int ETagBegin = 5;-
3598 const int ETagBegin2 = 6;-
3599 const int Ws2 = 7;-
3600 const int EmptyTag = 8;-
3601 const int Attrib = 9;-
3602 const int AttribPro = 10; // like Attrib, but processAttribute was already called-
3603 const int Ws3 = 11;-
3604 const int Done = 12;-
3605-
3606 const int InpWs = 0; // whitespace-
3607 const int InpNameBe = 1; // NameBeginning-
3608 const int InpGt = 2; // >-
3609 const int InpSlash = 3; // /-
3610 const int InpUnknown = 4;-
3611-
3612 static const int table[12][5] = {-
3613 /* InpWs InpNameBe InpGt InpSlash InpUnknown */-
3614 { -1, ReadName, -1, -1, -1 }, // Init-
3615 { Ws1, Attrib, STagEnd, EmptyTag, -1 }, // ReadName-
3616 { -1, Attrib, STagEnd, EmptyTag, -1 }, // Ws1-
3617 { STagEnd2, STagEnd2, STagEnd2, STagEnd2, STagEnd2 }, // STagEnd-
3618 { -1, -1, -1, ETagBegin, -1 }, // STagEnd2-
3619 { -1, ETagBegin2, -1, -1, -1 }, // ETagBegin-
3620 { Ws2, -1, Done, -1, -1 }, // ETagBegin2-
3621 { -1, -1, Done, -1, -1 }, // Ws2-
3622 { -1, -1, Done, -1, -1 }, // EmptyTag-
3623 { Ws3, Attrib, STagEnd, EmptyTag, -1 }, // Attrib-
3624 { Ws3, Attrib, STagEnd, EmptyTag, -1 }, // AttribPro-
3625 { -1, Attrib, STagEnd, EmptyTag, -1 } // Ws3-
3626 };-
3627 int state;-
3628 int input;-
3629-
3630 if (parseStack == 0 || parseStack->isEmpty()) {
parseStack == 0Description
TRUEevaluated 3992 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 11462 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1814 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9648 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1814-11462
3631 state = Init;-
3632 } else {
executed 5806 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5806
3633 state = parseStack->pop().state;-
3634#if defined(QT_QXML_DEBUG)-
3635 qDebug("QXmlSimpleReader: parseElement (cont) in state %d", state);-
3636#endif-
3637 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 8425 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1223 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1223-8425
3638 ParseFunction function = parseStack->top().function;-
3639 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 136 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8289 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
136-8289
3640 parseStack->pop();-
3641#if defined(QT_QXML_DEBUG)-
3642 qDebug("QXmlSimpleReader: eat_ws (cont)");-
3643#endif-
3644 }
executed 136 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
136
3645 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 4859 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3566 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3566-4859
3646 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state);-
3647 return false;
executed 4859 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4859
3648 }-
3649 }
executed 3566 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
3566
3650 }
executed 4789 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4789
3651-
3652 for (;;) {-
3653 switch (state) {-
3654 case ReadName:
executed 5802 times by 6 tests: case ReadName:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5802
3655 // store it on the stack-
3656 tags.push(name());-
3657 // empty the attributes-
3658 attList.clear();-
3659 if (useNamespaces)
useNamespacesDescription
TRUEevaluated 4781 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1021 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
1021-4781
3660 namespaceSupport.pushContext();
executed 4781 times by 3 tests: namespaceSupport.pushContext();
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4781
3661 break;
executed 5802 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5802
3662 case ETagBegin2:
executed 5180 times by 6 tests: case ETagBegin2:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5180
3663 if (!processElementETagBegin2())
!processElementETagBegin2()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5176 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4-5176
3664 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
3665 break;
executed 5176 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5176
3666 case Attrib:
executed 12894 times by 6 tests: case Attrib:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12894
3667 if (!processElementAttribute())
!processElementAttribute()Description
TRUEnever evaluated
FALSEevaluated 12894 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-12894
3668 return false;
never executed: return false;
0
3669 state = AttribPro;-
3670 break;
executed 12894 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12894
3671 case Done:
executed 5723 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5723
3672 return true;
executed 5723 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5723
3673 case -1:
executed 14 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
14
3674 reportParseError(QLatin1String(XMLERR_ERRORPARSINGELEMENT));-
3675 return false;
executed 14 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
14
3676 }-
3677-
3678 if (atEnd()) {
atEnd()Description
TRUEevaluated 1225 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 58942 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1225-58942
3679 unexpectedEof(&QXmlSimpleReaderPrivate::parseElement, state);-
3680 return false;
executed 1225 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1225
3681 }-
3682 if (fastDetermineNameChar(c) == NameBeginning) {
fastDetermineN... NameBeginningDescription
TRUEevaluated 24149 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 34793 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
24149-34793
3683 input = InpNameBe;-
3684 } else if (c == QLatin1Char('>')) {
executed 24149 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 10954 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 23839 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10954-24149
3685 input = InpGt;-
3686 } else if (is_S(c)) {
executed 10954 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
is_S(c)Description
TRUEevaluated 15969 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 7870 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7870-15969
3687 input = InpWs;-
3688 } else if (c == QLatin1Char('/')) {
executed 15969 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('/')Description
TRUEevaluated 5731 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2139 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2139-15969
3689 input = InpSlash;-
3690 } else {
executed 5731 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5731
3691 input = InpUnknown;-
3692 }
executed 2139 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2139
3693 state = table[state][input];-
3694-
3695 switch (state) {-
3696 case ReadName:
executed 5802 times by 6 tests: case ReadName:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5802
3697 parseName_useRef = false;-
3698 if (!parseName()) {
!parseName()Description
TRUEevaluated 1145 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4657 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1145-4657
3699 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state);-
3700 return false;
executed 1145 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1145
3701 }-
3702 break;
executed 4657 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4657
3703 case Ws1:
executed 3442 times by 6 tests: case Ws1:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
3442
3704 case Ws2:
executed 20 times by 1 test: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
20
3705 case Ws3:
executed 9662 times by 6 tests: case Ws3:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
9662
3706 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 134 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12990 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
134-12990
3707 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state);-
3708 return false;
executed 134 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
134
3709 }-
3710 break;
executed 12990 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12990
3711 case STagEnd:
executed 5230 times by 6 tests: case STagEnd:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5230
3712 // call the handler-
3713 if (contentHnd) {
contentHndDescription
TRUEevaluated 5226 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-5226
3714 if (useNamespaces) {
useNamespacesDescription
TRUEevaluated 4529 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 697 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
697-4529
3715 QString uri, lname;-
3716 namespaceSupport.processName(tags.top(), false, uri, lname);-
3717 if (!contentHnd->startElement(uri, lname, tags.top(), attList)) {
!contentHnd->s...op(), attList)Description
TRUEnever evaluated
FALSEevaluated 4529 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-4529
3718 reportParseError(contentHnd->errorString());-
3719 return false;
never executed: return false;
0
3720 }-
3721 } else {
executed 4529 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4529
3722 if (!contentHnd->startElement(QString(), QString(), tags.top(), attList)) {
!contentHnd->s...op(), attList)Description
TRUEnever evaluated
FALSEevaluated 697 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
0-697
3723 reportParseError(contentHnd->errorString());-
3724 return false;
never executed: return false;
0
3725 }-
3726 }
executed 697 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
697
3727 }-
3728 next();-
3729 break;
executed 5230 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5230
3730 case STagEnd2:
executed 5228 times by 6 tests: case STagEnd2:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5228
3731 if (!parseContent()) {
!parseContent()Description
TRUEevaluated 921 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4307 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
921-4307
3732 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state);-
3733 return false;
executed 921 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
921
3734 }-
3735 break;
executed 4307 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4307
3736 case ETagBegin:
executed 5181 times by 6 tests: case ETagBegin:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5181
3737 next();-
3738 break;
executed 5181 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5181
3739 case ETagBegin2:
executed 5180 times by 6 tests: case ETagBegin2:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5180
3740 // get the name of the tag-
3741 parseName_useRef = false;-
3742 if (!parseName()) {
!parseName()Description
TRUEevaluated 1072 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4108 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1072-4108
3743 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state);-
3744 return false;
executed 1072 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1072
3745 }-
3746 break;
executed 4108 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4108
3747 case EmptyTag:
executed 550 times by 5 tests: case EmptyTag:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
550
3748 if (tags.empty()) {
tags.empty()Description
TRUEnever evaluated
FALSEevaluated 550 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
0-550
3749 reportParseError(QLatin1String(XMLERR_TAGMISMATCH));-
3750 return false;
never executed: return false;
0
3751 }-
3752 if (!processElementEmptyTag())
!processElementEmptyTag()Description
TRUEnever evaluated
FALSEevaluated 550 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
0-550
3753 return false;
never executed: return false;
0
3754 next();-
3755 break;
executed 550 times by 5 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
550
3756 case Attrib:
executed 12910 times by 6 tests: case Attrib:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12910
3757 case AttribPro:
never executed: case AttribPro:
0
3758 // get name and value of attribute-
3759 if (!parseAttribute()) {
!parseAttribute()Description
TRUEevaluated 357 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12553 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
357-12553
3760 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state);-
3761 return false;
executed 357 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
357
3762 }-
3763 break;
executed 12553 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12553
3764 case Done:
executed 5723 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5723
3765 next();-
3766 break;
executed 5723 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5723
3767 }-
3768 }
executed 55313 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
55313
3769 return false;
never executed: return false;
0
3770}-
3771-
3772/*-
3773 Helper to break down the size of the code in the case statement.-
3774 Return false on error, otherwise true.-
3775*/-
3776bool QXmlSimpleReaderPrivate::processElementEmptyTag()-
3777{-
3778 QString uri, lname;-
3779 // pop the stack and call the handler-
3780 if (contentHnd) {
contentHndDescription
TRUEevaluated 541 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
9-541
3781 if (useNamespaces) {
useNamespacesDescription
TRUEevaluated 217 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 324 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
217-324
3782 // report startElement first...-
3783 namespaceSupport.processName(tags.top(), false, uri, lname);-
3784 if (!contentHnd->startElement(uri, lname, tags.top(), attList)) {
!contentHnd->s...op(), attList)Description
TRUEnever evaluated
FALSEevaluated 217 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
0-217
3785 reportParseError(contentHnd->errorString());-
3786 return false;
never executed: return false;
0
3787 }-
3788 // ... followed by endElement...-
3789 const bool endElementReturnedFalse = !contentHnd->endElement(uri, lname, tags.top());-
3790 tags.pop();-
3791 if (endElementReturnedFalse) {
endElementReturnedFalseDescription
TRUEnever evaluated
FALSEevaluated 217 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
0-217
3792 reportParseError(contentHnd->errorString());-
3793 return false;
never executed: return false;
0
3794 }-
3795 // ... followed by endPrefixMapping-
3796 QStringList prefixesBefore, prefixesAfter;-
3797 if (contentHnd) {
contentHndDescription
TRUEevaluated 217 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-217
3798 prefixesBefore = namespaceSupport.prefixes();-
3799 }
executed 217 times by 2 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
217
3800 namespaceSupport.popContext();-
3801 // call the handler for prefix mapping-
3802 prefixesAfter = namespaceSupport.prefixes();-
3803 for (QStringList::Iterator it = prefixesBefore.begin(); it != prefixesBefore.end(); ++it) {
it != prefixesBefore.end()Description
TRUEevaluated 221 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 217 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
217-221
3804 if (!prefixesAfter.contains(*it)) {
!prefixesAfter.contains(*it)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 217 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
4-217
3805 if (!contentHnd->endPrefixMapping(*it)) {
!contentHnd->e...ixMapping(*it)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-4
3806 reportParseError(contentHnd->errorString());-
3807 return false;
never executed: return false;
0
3808 }-
3809 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4
3810 }
executed 221 times by 2 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
221
3811 } else {
executed 217 times by 2 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
217
3812 // report startElement first...-
3813 if (!contentHnd->startElement(QString(), QString(), tags.top(), attList)) {
!contentHnd->s...op(), attList)Description
TRUEnever evaluated
FALSEevaluated 324 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
0-324
3814 reportParseError(contentHnd->errorString());-
3815 return false;
never executed: return false;
0
3816 }-
3817 // ... followed by endElement-
3818 const bool endElementReturnedFalse = !contentHnd->endElement(QString(), QString(), tags.top());-
3819 tags.pop();-
3820 if (endElementReturnedFalse) {
endElementReturnedFalseDescription
TRUEnever evaluated
FALSEevaluated 324 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
0-324
3821 reportParseError(contentHnd->errorString());-
3822 return false;
never executed: return false;
0
3823 }-
3824 }
executed 324 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
324
3825 } else {-
3826 tags.pop();-
3827 namespaceSupport.popContext();-
3828 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
9
3829 return true;
executed 550 times by 5 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
550
3830}-
3831/*-
3832 Helper to break down the size of the code in the case statement.-
3833 Return false on error, otherwise true.-
3834*/-
3835bool QXmlSimpleReaderPrivate::processElementETagBegin2()-
3836{-
3837 const QString &name = QXmlSimpleReaderPrivate::name();-
3838-
3839 // pop the stack and compare it with the name-
3840 const bool nameIsTagsTop = tags.top() == name;-
3841 tags.pop();-
3842 if (!nameIsTagsTop) {
!nameIsTagsTopDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5176 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4-5176
3843 reportParseError(QLatin1String(XMLERR_TAGMISMATCH));-
3844 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
3845 }-
3846 // call the handler-
3847 if (contentHnd) {
contentHndDescription
TRUEevaluated 5176 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-5176
3848 QString uri, lname;-
3849-
3850 if (useNamespaces)
useNamespacesDescription
TRUEevaluated 4479 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 697 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
697-4479
3851 namespaceSupport.processName(name, false, uri, lname);
executed 4479 times by 2 tests: namespaceSupport.processName(name, false, uri, lname);
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4479
3852 if (!contentHnd->endElement(uri, lname, name)) {
!contentHnd->e..., lname, name)Description
TRUEnever evaluated
FALSEevaluated 5176 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-5176
3853 reportParseError(contentHnd->errorString());-
3854 return false;
never executed: return false;
0
3855 }-
3856 }
executed 5176 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5176
3857 if (useNamespaces) {
useNamespacesDescription
TRUEevaluated 4479 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 697 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
697-4479
3858 NamespaceMap prefixesBefore, prefixesAfter;-
3859 if (contentHnd)
contentHndDescription
TRUEevaluated 4479 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-4479
3860 prefixesBefore = namespaceSupport.d->ns;
executed 4479 times by 2 tests: prefixesBefore = namespaceSupport.d->ns;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4479
3861-
3862 namespaceSupport.popContext();-
3863 // call the handler for prefix mapping-
3864 if (contentHnd) {
contentHndDescription
TRUEevaluated 4479 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-4479
3865 prefixesAfter = namespaceSupport.d->ns;-
3866 if (prefixesBefore.size() != prefixesAfter.size()) {
prefixesBefore...esAfter.size()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4469 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10-4469
3867 for (NamespaceMap::const_iterator it = prefixesBefore.constBegin(); it != prefixesBefore.constEnd(); ++it) {
it != prefixes...ore.constEnd()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-20
3868 if (!it.key().isEmpty() && !prefixesAfter.contains(it.key())) {
!it.key().isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
!prefixesAfter...ains(it.key())Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-10
3869 if (!contentHnd->endPrefixMapping(it.key())) {
!contentHnd->e...ping(it.key())Description
TRUEnever evaluated
FALSEnever evaluated
0
3870 reportParseError(contentHnd->errorString());-
3871 return false;
never executed: return false;
0
3872 }-
3873 }
never executed: end of block
0
3874 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
20
3875 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10
3876 }
executed 4479 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4479
3877 }
executed 4479 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4479
3878 return true;
executed 5176 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5176
3879}-
3880/*-
3881 Helper to break down the size of the code in the case statement.-
3882 Return false on error, otherwise true.-
3883*/-
3884bool QXmlSimpleReaderPrivate::processElementAttribute()-
3885{-
3886 QString uri, lname, prefix;-
3887 const QString &name = QXmlSimpleReaderPrivate::name();-
3888 const QString &string = QXmlSimpleReaderPrivate::string();-
3889-
3890 // add the attribute to the list-
3891 if (useNamespaces) {
useNamespacesDescription
TRUEevaluated 12028 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 866 times by 3 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
866-12028
3892 // is it a namespace declaration?-
3893 namespaceSupport.splitName(name, prefix, lname);-
3894 if (prefix == QLatin1String("xmlns")) {
prefix == QLat...tring("xmlns")Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12021 times by 3 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7-12021
3895 // namespace declaration-
3896 namespaceSupport.setPrefix(lname, string);-
3897 if (useNamespacePrefixes) {
useNamespacePrefixesDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-7
3898 // according to http://www.w3.org/2000/xmlns/, the "prefix"-
3899 // xmlns maps to the namespace name-
3900 // http://www.w3.org/2000/xmlns/-
3901 attList.append(name, QLatin1String("http://www.w3.org/2000/xmlns/"), lname, string);-
3902 }
never executed: end of block
0
3903 // call the handler for prefix mapping-
3904 if (contentHnd) {
contentHndDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-5
3905 if (!contentHnd->startPrefixMapping(lname, string)) {
!contentHnd->s...lname, string)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-5
3906 reportParseError(contentHnd->errorString());-
3907 return false;
never executed: return false;
0
3908 }-
3909 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
5
3910 } else {
executed 7 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
7
3911 // no namespace delcaration-
3912 namespaceSupport.processName(name, true, uri, lname);-
3913 attList.append(name, uri, lname, string);-
3914 }
executed 12021 times by 3 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12021
3915 } else {-
3916 // no namespace support-
3917 attList.append(name, uri, lname, string);-
3918 }
executed 866 times by 3 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
866
3919 return true;
executed 12894 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12894
3920}-
3921-
3922/*-
3923 Parse a content [43].-
3924-
3925 A content is only used between tags. If a end tag is found the < is already-
3926 read and the head stand on the '/' of the end tag '</name>'.-
3927*/-
3928bool QXmlSimpleReaderPrivate::parseContent()-
3929{-
3930 const signed char Init = 0;-
3931 const signed char ChD = 1; // CharData-
3932 const signed char ChD1 = 2; // CharData help state-
3933 const signed char ChD2 = 3; // CharData help state-
3934 const signed char Ref = 4; // Reference-
3935 const signed char Lt = 5; // '<' read-
3936 const signed char PInstr = 6; // PI-
3937 const signed char PInstrR = 7; // same as PInstr, but already reported-
3938 const signed char Elem = 8; // Element-
3939 const signed char Em = 9; // '!' read-
3940 const signed char Com = 10; // Comment-
3941 const signed char ComR = 11; // same as Com, but already reported-
3942 const signed char CDS = 12; // CDSect-
3943 const signed char CDS1 = 13; // read a CDSect-
3944 const signed char CDS2 = 14; // read a CDSect (help state)-
3945 const signed char CDS3 = 15; // read a CDSect (help state)-
3946 const signed char Done = 16; // finished reading content-
3947-
3948 const signed char InpLt = 0; // <-
3949 const signed char InpGt = 1; // >-
3950 const signed char InpSlash = 2; // /-
3951 const signed char InpQMark = 3; // ?-
3952 const signed char InpEMark = 4; // !-
3953 const signed char InpAmp = 5; // &-
3954 const signed char InpDash = 6; // --
3955 const signed char InpOpenB = 7; // [-
3956 const signed char InpCloseB = 8; //]-
3957 const signed char InpUnknown = 9;-
3958-
3959 static const signed char mapCLT2FSMChar[] = {-
3960 InpUnknown, // white space-
3961 InpUnknown, // %-
3962 InpAmp, // &-
3963 InpGt, // >-
3964 InpLt, // <-
3965 InpSlash, // /-
3966 InpQMark, // ?-
3967 InpEMark, // !-
3968 InpDash, // --
3969 InpCloseB, //]-
3970 InpOpenB, // [-
3971 InpUnknown, // =-
3972 InpUnknown, // "-
3973 InpUnknown, // '-
3974 InpUnknown // unknown-
3975 };-
3976-
3977 static const signed char table[16][10] = {-
3978 /* InpLt InpGt InpSlash InpQMark InpEMark InpAmp InpDash InpOpenB InpCloseB InpUnknown */-
3979 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, // Init-
3980 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, // ChD-
3981 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, // ChD1-
3982 { Lt, -1, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, // ChD2-
3983 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // Ref (same as Init)-
3984 { -1, -1, Done, PInstr, Em, -1, -1, -1, -1, Elem }, // Lt-
3985 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // PInstr (same as Init)-
3986 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // PInstrR-
3987 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // Elem (same as Init)-
3988 { -1, -1, -1, -1, -1, -1, Com, CDS, -1, -1 }, // Em-
3989 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // Com (same as Init)-
3990 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // ComR-
3991 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, // CDS-
3992 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, // CDS1-
3993 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 }, // CDS2-
3994 { CDS1, Init, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 } // CDS3-
3995 };-
3996 signed char state;-
3997 signed char input;-
3998-
3999 if (parseStack == 0 || parseStack->isEmpty()) {
parseStack == 0Description
TRUEevaluated 3594 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 5718 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1634 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4084 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1634-5718
4000 contentCharDataRead = false;-
4001 state = Init;-
4002 } else {
executed 5228 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5228
4003 state = parseStack->pop().state;-
4004#if defined(QT_QXML_DEBUG)-
4005 qDebug("QXmlSimpleReader: parseContent (cont) in state %d", state);-
4006#endif-
4007 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 2638 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1446 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1446-2638
4008 ParseFunction function = parseStack->top().function;-
4009 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEevaluated 2638 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-2638
4010 parseStack->pop();-
4011#if defined(QT_QXML_DEBUG)-
4012 qDebug("QXmlSimpleReader: eat_ws (cont)");-
4013#endif-
4014 }
never executed: end of block
0
4015 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 1813 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 825 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
825-1813
4016 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4017 return false;
executed 1813 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1813
4018 }-
4019 }
executed 825 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
825
4020 }
executed 2271 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2271
4021-
4022 for (;;) {-
4023 switch (state) {-
4024 case Ref:
executed 1137 times by 3 tests: case Ref:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1137
4025 if (!contentCharDataRead)
!contentCharDataReadDescription
TRUEevaluated 765 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 372 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
372-765
4026 contentCharDataRead = parseReference_charDataRead;
executed 765 times by 3 tests: contentCharDataRead = parseReference_charDataRead;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
765
4027 break;
executed 1137 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1137
4028 case PInstr:
executed 31 times by 1 test: case PInstr:
Executed by:
  • tst_qxmlsimplereader - unknown status
31
4029 if (contentHnd) {
contentHndDescription
TRUEevaluated 31 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-31
4030 if (!contentHnd->processingInstruction(name(),string())) {
!contentHnd->p...me(),string())Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-31
4031 reportParseError(contentHnd->errorString());-
4032 return false;
never executed: return false;
0
4033 }-
4034 }
executed 31 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
31
4035 state = PInstrR;-
4036 break;
executed 31 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
31
4037 case Com:
executed 98 times by 2 tests: case Com:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
98
4038 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
42-56
4039 if (!lexicalHnd->comment(string())) {
!lexicalHnd->comment(string())Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-42
4040 reportParseError(lexicalHnd->errorString());-
4041 return false;
never executed: return false;
0
4042 }-
4043 }
executed 42 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
42
4044 state = ComR;-
4045 break;
executed 98 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
98
4046 case CDS:
executed 59 times by 1 test: case CDS:
Executed by:
  • tst_qxmlsimplereader - unknown status
59
4047 stringClear();-
4048 break;
executed 59 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
59
4049 case CDS2:
executed 80 times by 1 test: case CDS2:
Executed by:
  • tst_qxmlsimplereader - unknown status
80
4050 if (!atEnd() && c != QLatin1Char(']'))
!atEnd()Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
c != QLatin1Char(']')Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-63
4051 stringAddC(QLatin1Char(']'));
executed 10 times by 1 test: stringAddC(QLatin1Char(']'));
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4052 break;
executed 80 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
80
4053 case CDS3:
executed 75 times by 1 test: case CDS3:
Executed by:
  • tst_qxmlsimplereader - unknown status
75
4054 // test if this skipping was legal-
4055 if (!atEnd()) {
!atEnd()Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-64
4056 if (c == QLatin1Char('>')) {
c == QLatin1Char('>')Description
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-53
4057 // the end of the CDSect-
4058 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-53
4059 if (!lexicalHnd->startCDATA()) {
!lexicalHnd->startCDATA()Description
TRUEnever evaluated
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-53
4060 reportParseError(lexicalHnd->errorString());-
4061 return false;
never executed: return false;
0
4062 }-
4063 }
executed 53 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
53
4064 if (contentHnd) {
contentHndDescription
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-53
4065 if (!contentHnd->characters(string())) {
!contentHnd->c...ters(string())Description
TRUEnever evaluated
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-53
4066 reportParseError(contentHnd->errorString());-
4067 return false;
never executed: return false;
0
4068 }-
4069 }
executed 53 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
53
4070 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-53
4071 if (!lexicalHnd->endCDATA()) {
!lexicalHnd->endCDATA()Description
TRUEnever evaluated
FALSEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-53
4072 reportParseError(lexicalHnd->errorString());-
4073 return false;
never executed: return false;
0
4074 }-
4075 }
executed 53 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
53
4076 } else if (c == QLatin1Char(']')) {
executed 53 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char(']')Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-53
4077 // three or more ']'-
4078 stringAddC(QLatin1Char(']'));-
4079 } else {
executed 11 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
11
4080 // after ']]' comes another character-
4081 stringAddC(QLatin1Char(']'));-
4082 stringAddC(QLatin1Char(']'));-
4083 }
never executed: end of block
0
4084 }-
4085 break;
executed 75 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
75
4086 case Done:
executed 5181 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5181
4087 // call the handler for CharData-
4088 if (contentHnd) {
contentHndDescription
TRUEevaluated 5181 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-5181
4089 if (contentCharDataRead) {
contentCharDataReadDescription
TRUEnever evaluated
FALSEevaluated 5181 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-5181
4090 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
reportWhitespaceCharDataDescription
TRUEnever evaluated
FALSEnever evaluated
!string().simp...ed().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
4091 if (!contentHnd->characters(string())) {
!contentHnd->c...ters(string())Description
TRUEnever evaluated
FALSEnever evaluated
0
4092 reportParseError(contentHnd->errorString());-
4093 return false;
never executed: return false;
0
4094 }-
4095 }
never executed: end of block
0
4096 }
never executed: end of block
0
4097 }
executed 5181 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5181
4098 // Done-
4099 return true;
executed 5181 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5181
4100 case -1:
executed 3 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
4101 // Error-
4102 reportParseError(QLatin1String(XMLERR_ERRORPARSINGCONTENT));-
4103 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
4104 }-
4105-
4106 // get input (use lookup-table instead of nested ifs for performance-
4107 // reasons)-
4108 if (atEnd()) {
atEnd()Description
TRUEevaluated 1453 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 261643 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1453-261643
4109 unexpectedEof(&QXmlSimpleReaderPrivate::parseContent, state);-
4110 return false;
executed 1453 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1453
4111 }-
4112 if (c.row()) {
c.row()Description
TRUEevaluated 877 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 260766 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
877-260766
4113 input = InpUnknown;-
4114 } else {
executed 877 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
877
4115 input = mapCLT2FSMChar[charLookupTable[c.cell()]];-
4116 }
executed 260766 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
260766
4117 state = table[state][input];-
4118-
4119 switch (state) {-
4120 case Init:
executed 53 times by 1 test: case Init:
Executed by:
  • tst_qxmlsimplereader - unknown status
53
4121 // skip the ending '>' of a CDATASection-
4122 next();-
4123 break;
executed 53 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
53
4124 case ChD:
executed 241738 times by 6 tests: case ChD:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
241738
4125 // on first call: clear string-
4126 if (!contentCharDataRead) {
!contentCharDataReadDescription
TRUEevaluated 6401 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 235337 times by 5 tests
Evaluated by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6401-235337
4127 contentCharDataRead = true;-
4128 stringClear();-
4129 }
executed 6401 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6401
4130 stringAddC();-
4131 if (reportEntities) {
reportEntitiesDescription
TRUEnever evaluated
FALSEevaluated 241738 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-241738
4132 if (!reportEndEntities())
!reportEndEntities()Description
TRUEnever evaluated
FALSEnever evaluated
0
4133 return false;
never executed: return false;
0
4134 }
never executed: end of block
0
4135 next();-
4136 break;
executed 241738 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
241738
4137 case ChD1:
executed 43 times by 2 tests: case ChD1:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
43
4138 // on first call: clear string-
4139 if (!contentCharDataRead) {
!contentCharDataReadDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 31 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12-31
4140 contentCharDataRead = true;-
4141 stringClear();-
4142 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
12
4143 stringAddC();-
4144 if (reportEntities) {
reportEntitiesDescription
TRUEnever evaluated
FALSEevaluated 43 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-43
4145 if (!reportEndEntities())
!reportEndEntities()Description
TRUEnever evaluated
FALSEnever evaluated
0
4146 return false;
never executed: return false;
0
4147 }
never executed: end of block
0
4148 next();-
4149 break;
executed 43 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
43
4150 case ChD2:
executed 16 times by 2 tests: case ChD2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
16
4151 stringAddC();-
4152 if (reportEntities) {
reportEntitiesDescription
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-16
4153 if (!reportEndEntities())
!reportEndEntities()Description
TRUEnever evaluated
FALSEnever evaluated
0
4154 return false;
never executed: return false;
0
4155 }
never executed: end of block
0
4156 next();-
4157 break;
executed 16 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
16
4158 case Ref:
executed 1014 times by 3 tests: case Ref:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1014
4159 if (!contentCharDataRead) {
!contentCharDataReadDescription
TRUEevaluated 589 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 425 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
425-589
4160 // reference may be CharData; so clear string to be safe-
4161 stringClear();-
4162 parseReference_context = InContent;-
4163 if (!parseReference()) {
!parseReference()Description
TRUEevaluated 292 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 297 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
292-297
4164 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4165 return false;
executed 292 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
292
4166 }-
4167 } else {
executed 297 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
297
4168 if (reportEntities) {
reportEntitiesDescription
TRUEnever evaluated
FALSEevaluated 425 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-425
4169 // report character data in chunks-
4170 if (contentHnd) {
contentHndDescription
TRUEnever evaluated
FALSEnever evaluated
0
4171 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
reportWhitespaceCharDataDescription
TRUEnever evaluated
FALSEnever evaluated
!string().simp...ed().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
4172 if (!contentHnd->characters(string())) {
!contentHnd->c...ters(string())Description
TRUEnever evaluated
FALSEnever evaluated
0
4173 reportParseError(contentHnd->errorString());-
4174 return false;
never executed: return false;
0
4175 }-
4176 }
never executed: end of block
0
4177 }
never executed: end of block
0
4178 stringClear();-
4179 }
never executed: end of block
0
4180 parseReference_context = InContent;-
4181 if (!parseReference()) {
!parseReference()Description
TRUEevaluated 180 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 245 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
180-245
4182 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4183 return false;
executed 180 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
180
4184 }-
4185 }
executed 245 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
245
4186 break;
executed 542 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
542
4187 case Lt:
executed 9155 times by 6 tests: case Lt:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
9155
4188 // call the handler for CharData-
4189 if (contentHnd) {
contentHndDescription
TRUEevaluated 9145 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-9145
4190 if (contentCharDataRead) {
contentCharDataReadDescription
TRUEevaluated 6427 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2718 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2718-6427
4191 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
reportWhitespaceCharDataDescription
TRUEevaluated 5910 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 517 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
!string().simp...ed().isEmpty()Description
TRUEevaluated 125 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
FALSEevaluated 392 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
125-5910
4192 if (!contentHnd->characters(string())) {
!contentHnd->c...ters(string())Description
TRUEnever evaluated
FALSEevaluated 6035 times by 4 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-6035
4193 reportParseError(contentHnd->errorString());-
4194 return false;
never executed: return false;
0
4195 }-
4196 }
executed 6035 times by 4 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6035
4197 }
executed 6427 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6427
4198 }
executed 9145 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
9145
4199 contentCharDataRead = false;-
4200 next();-
4201 break;
executed 9155 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
9155
4202 case PInstr:
executed 39 times by 1 test: case PInstr:
Executed by:
  • tst_qxmlsimplereader - unknown status
39
4203 case PInstrR:
never executed: case PInstrR:
0
4204 parsePI_xmldecl = false;-
4205 if (!parsePI()) {
!parsePI()Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-35
4206 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4207 return false;
executed 35 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
35
4208 }-
4209 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
4210 case Elem:
executed 3777 times by 6 tests: case Elem:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
3777
4211 if (!parseElement()) {
!parseElement()Description
TRUEevaluated 282 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3495 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
282-3495
4212 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4213 return false;
executed 282 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
282
4214 }-
4215 break;
executed 3495 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
3495
4216 case Em:
executed 158 times by 2 tests: case Em:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
158
4217 next();-
4218 break;
executed 158 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
158
4219 case Com:
executed 100 times by 2 tests: case Com:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
100
4220 case ComR:
never executed: case ComR:
0
4221 if (!parseComment()) {
!parseComment()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
38-62
4222 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4223 return false;
executed 38 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
38
4224 }-
4225 break;
executed 62 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
62
4226 case CDS:
executed 58 times by 1 test: case CDS:
Executed by:
  • tst_qxmlsimplereader - unknown status
58
4227 parseString_s = QLatin1String("[CDATA[");-
4228 if (!parseString()) {
!parseString()Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
23-35
4229 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state);-
4230 return false;
executed 35 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
35
4231 }-
4232 break;
executed 23 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
23
4233 case CDS1:
executed 181 times by 1 test: case CDS1:
Executed by:
  • tst_qxmlsimplereader - unknown status
181
4234 stringAddC();-
4235 next();-
4236 break;
executed 181 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
181
4237 case CDS2:
executed 63 times by 1 test: case CDS2:
Executed by:
  • tst_qxmlsimplereader - unknown status
63
4238 // skip ']'-
4239 next();-
4240 break;
executed 63 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
63
4241 case CDS3:
executed 64 times by 1 test: case CDS3:
Executed by:
  • tst_qxmlsimplereader - unknown status
64
4242 // skip ']'...-
4243 next();-
4244 break;
executed 64 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
64
4245 }-
4246 }
executed 260781 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
260781
4247 return false;
never executed: return false;
0
4248}-
4249-
4250bool QXmlSimpleReaderPrivate::reportEndEntities()-
4251{-
4252 int count = (int)xmlRefStack.count();-
4253 while (count != 0 && xmlRefStack.top().isEmpty()) {
count != 0Description
TRUEnever evaluated
FALSEnever evaluated
xmlRefStack.top().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
4254 if (contentHnd) {
contentHndDescription
TRUEnever evaluated
FALSEnever evaluated
0
4255 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
reportWhitespaceCharDataDescription
TRUEnever evaluated
FALSEnever evaluated
!string().simp...ed().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
4256 if (!contentHnd->characters(string())) {
!contentHnd->c...ters(string())Description
TRUEnever evaluated
FALSEnever evaluated
0
4257 reportParseError(contentHnd->errorString());-
4258 return false;
never executed: return false;
0
4259 }-
4260 }
never executed: end of block
0
4261 }
never executed: end of block
0
4262 stringClear();-
4263 if (lexicalHnd) {
lexicalHndDescription
TRUEnever evaluated
FALSEnever evaluated
0
4264 if (!lexicalHnd->endEntity(xmlRefStack.top().name)) {
!lexicalHnd->e...ck.top().name)Description
TRUEnever evaluated
FALSEnever evaluated
0
4265 reportParseError(lexicalHnd->errorString());-
4266 return false;
never executed: return false;
0
4267 }-
4268 }
never executed: end of block
0
4269 xmlRefStack.pop_back();-
4270 count--;-
4271 }
never executed: end of block
0
4272 return true;
never executed: return true;
0
4273}-
4274-
4275/*-
4276 Parse Misc [27].-
4277*/-
4278bool QXmlSimpleReaderPrivate::parseMisc()-
4279{-
4280 const signed char Init = 0;-
4281 const signed char Lt = 1; // '<' was read-
4282 const signed char Comment = 2; // read comment-
4283 const signed char eatWS = 3; // eat whitespaces-
4284 const signed char PInstr = 4; // read PI-
4285 const signed char Comment2 = 5; // read comment-
4286-
4287 const signed char InpWs = 0; // S-
4288 const signed char InpLt = 1; // <-
4289 const signed char InpQm = 2; // ?-
4290 const signed char InpEm = 3; // !-
4291 const signed char InpUnknown = 4;-
4292-
4293 static const signed char table[3][5] = {-
4294 /* InpWs InpLt InpQm InpEm InpUnknown */-
4295 { eatWS, Lt, -1, -1, -1 }, // Init-
4296 { -1, -1, PInstr,Comment, -1 }, // Lt-
4297 { -1, -1, -1, -1, Comment2 } // Comment-
4298 };-
4299 signed char state;-
4300 signed char input;-
4301-
4302 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 231 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2109 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1526 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 583 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
231-2109
4303 state = Init;-
4304 } else {
executed 1757 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1757
4305 state = parseStack->pop().state;-
4306#if defined(QT_QXML_DEBUG)-
4307 qDebug("QXmlSimpleReader: parseMisc (cont) in state %d", state);-
4308#endif-
4309 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 579 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-579
4310 ParseFunction function = parseStack->top().function;-
4311 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 515 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 64 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
64-515
4312 parseStack->pop();-
4313#if defined(QT_QXML_DEBUG)-
4314 qDebug("QXmlSimpleReader: eat_ws (cont)");-
4315#endif-
4316 }
executed 515 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
515
4317 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
30-549
4318 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state);-
4319 return false;
executed 549 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
549
4320 }-
4321 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
30
4322 }
executed 34 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
34
4323-
4324 for (;;) {-
4325 switch (state) {-
4326 case eatWS:
executed 237 times by 2 tests: case eatWS:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
237
4327 return true;
executed 237 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
237
4328 case PInstr:
executed 10 times by 1 test: case PInstr:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4329 if (contentHnd) {
contentHndDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-10
4330 if (!contentHnd->processingInstruction(name(),string())) {
!contentHnd->p...me(),string())Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-10
4331 reportParseError(contentHnd->errorString());-
4332 return false;
never executed: return false;
0
4333 }-
4334 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4335 return true;
executed 10 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4336 case Comment2:
executed 10 times by 1 test: case Comment2:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4337 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-10
4338 if (!lexicalHnd->comment(string())) {
!lexicalHnd->comment(string())Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-10
4339 reportParseError(lexicalHnd->errorString());-
4340 return false;
never executed: return false;
0
4341 }-
4342 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4343 return true;
executed 10 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4344 case -1:
executed 8 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
8
4345 // Error-
4346 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
4347 return false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
4348 }-
4349-
4350 if (atEnd()) {
atEnd()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1794 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4-1794
4351 unexpectedEof(&QXmlSimpleReaderPrivate::parseMisc, state);-
4352 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
4353 }-
4354 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 1727 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 67 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
67-1727
4355 input = InpWs;-
4356 } else if (c == QLatin1Char('<')) {
executed 1727 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('<')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 41 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
26-1727
4357 input = InpLt;-
4358 } else if (c == QLatin1Char('?')) {
executed 26 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('?')Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-30
4359 input = InpQm;-
4360 } else if (c == QLatin1Char('!')) {
executed 11 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('!')Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-19
4361 input = InpEm;-
4362 } else {
executed 11 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
11
4363 input = InpUnknown;-
4364 }
executed 19 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
19
4365 state = table[state][input];-
4366-
4367 switch (state) {-
4368 case eatWS:
executed 1727 times by 2 tests: case eatWS:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1727
4369 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 1502 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 225 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
225-1502
4370 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state);-
4371 return false;
executed 1502 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1502
4372 }-
4373 break;
executed 225 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
225
4374 case Lt:
executed 26 times by 1 test: case Lt:
Executed by:
  • tst_qxmlsimplereader - unknown status
26
4375 next();-
4376 break;
executed 26 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
26
4377 case PInstr:
executed 11 times by 1 test: case PInstr:
Executed by:
  • tst_qxmlsimplereader - unknown status
11
4378 parsePI_xmldecl = false;-
4379 if (!parsePI()) {
!parsePI()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-10
4380 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state);-
4381 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4382 }-
4383 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
4384 case Comment:
executed 11 times by 1 test: case Comment:
Executed by:
  • tst_qxmlsimplereader - unknown status
11
4385 next();-
4386 break;
executed 11 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
11
4387 case Comment2:
executed 11 times by 1 test: case Comment2:
Executed by:
  • tst_qxmlsimplereader - unknown status
11
4388 if (!parseComment()) {
!parseComment()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-10
4389 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state);-
4390 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4391 }-
4392 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
4393 }-
4394 }
executed 272 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
272
4395 return false;
never executed: return false;
0
4396}-
4397-
4398/*-
4399 Parse a processing instruction [16].-
4400-
4401 If xmldec is true, it tries to parse a PI or a XML declaration [23].-
4402-
4403 Precondition: the beginning '<' of the PI is already read and the head stand-
4404 on the '?' of '<?'.-
4405-
4406 If this funktion was successful, the head-position is on the first-
4407 character after the PI.-
4408*/-
4409bool QXmlSimpleReaderPrivate::parsePI()-
4410{-
4411 const signed char Init = 0;-
4412 const signed char QmI = 1; // ? was read-
4413 const signed char Name = 2; // read Name-
4414 const signed char XMLDecl = 3; // read XMLDecl-
4415 const signed char Ws1 = 4; // eat ws after "xml" of XMLDecl-
4416 const signed char PInstr = 5; // read PI-
4417 const signed char Ws2 = 6; // eat ws after Name of PI-
4418 const signed char Version = 7; // read versionInfo-
4419 const signed char Ws3 = 8; // eat ws after versionInfo-
4420 const signed char EorSD = 9; // read EDecl or SDDecl-
4421 const signed char Ws4 = 10; // eat ws after EDecl or SDDecl-
4422 const signed char SD = 11; // read SDDecl-
4423 const signed char Ws5 = 12; // eat ws after SDDecl-
4424 const signed char ADone = 13; // almost done-
4425 const signed char Char = 14; // Char was read-
4426 const signed char Qm = 15; // Qm was read-
4427 const signed char Done = 16; // finished reading content-
4428-
4429 const signed char InpWs = 0; // whitespace-
4430 const signed char InpNameBe = 1; // NameBeginning-
4431 const signed char InpGt = 2; // >-
4432 const signed char InpQm = 3; // ?-
4433 const signed char InpUnknown = 4;-
4434-
4435 static const signed char table[16][5] = {-
4436 /* InpWs, InpNameBe InpGt InpQm InpUnknown */-
4437 { -1, -1, -1, QmI, -1 }, // Init-
4438 { -1, Name, -1, -1, -1 }, // QmI-
4439 { -1, -1, -1, -1, -1 }, // Name (this state is left not through input)-
4440 { Ws1, -1, -1, -1, -1 }, // XMLDecl-
4441 { -1, Version, -1, -1, -1 }, // Ws1-
4442 { Ws2, -1, -1, Qm, -1 }, // PInstr-
4443 { Char, Char, Char, Qm, Char }, // Ws2-
4444 { Ws3, -1, -1, ADone, -1 }, // Version-
4445 { -1, EorSD, -1, ADone, -1 }, // Ws3-
4446 { Ws4, -1, -1, ADone, -1 }, // EorSD-
4447 { -1, SD, -1, ADone, -1 }, // Ws4-
4448 { Ws5, -1, -1, ADone, -1 }, // SD-
4449 { -1, -1, -1, ADone, -1 }, // Ws5-
4450 { -1, -1, Done, -1, -1 }, // ADone-
4451 { Char, Char, Char, Qm, Char }, // Char-
4452 { Char, Char, Done, Qm, Char }, // Qm-
4453 };-
4454 signed char state;-
4455 signed char input;-
4456-
4457 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 54 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1386 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 144 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1242 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
54-1386
4458 state = Init;-
4459 } else {
executed 198 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
198
4460 state = parseStack->pop().state;-
4461#if defined(QT_QXML_DEBUG)-
4462 qDebug("QXmlSimpleReader: parsePI (cont) in state %d", state);-
4463#endif-
4464 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 997 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 245 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
245-997
4465 ParseFunction function = parseStack->top().function;-
4466 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 87 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 910 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
87-910
4467 parseStack->pop();-
4468#if defined(QT_QXML_DEBUG)-
4469 qDebug("QXmlSimpleReader: eat_ws (cont)");-
4470#endif-
4471 }
executed 87 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
87
4472 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 639 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 358 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
358-639
4473 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state);-
4474 return false;
executed 639 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
639
4475 }-
4476 }
executed 358 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
358
4477 }
executed 603 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
603
4478-
4479 for (;;) {-
4480 switch (state) {-
4481 case Name:
executed 197 times by 2 tests: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
197
4482 // test what name was read and determine the next state-
4483 // (not very beautiful, I admit)-
4484 if (name().toLower() == QLatin1String("xml")) {
name().toLower...1String("xml")Description
TRUEevaluated 129 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 68 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
68-129
4485 if (parsePI_xmldecl && name() == QLatin1String("xml")) {
parsePI_xmldeclDescription
TRUEevaluated 121 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
name() == QLatin1String("xml")Description
TRUEevaluated 119 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-121
4486 state = XMLDecl;-
4487 } else {
executed 119 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
119
4488 reportParseError(QLatin1String(XMLERR_INVALIDNAMEFORPI));-
4489 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4490 }-
4491 } else {-
4492 state = PInstr;-
4493 stringClear();-
4494 }
executed 68 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
68
4495 break;
executed 187 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
187
4496 case Version:
executed 131 times by 2 tests: case Version:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
131
4497 // get version (syntax like an attribute)-
4498 if (name() != QLatin1String("version")) {
name() != QLat...ing("version")Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 128 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
3-128
4499 reportParseError(QLatin1String(XMLERR_VERSIONEXPECTED));-
4500 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
4501 }-
4502 xmlVersion = string();-
4503 break;
executed 128 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
128
4504 case EorSD:
executed 119 times by 2 tests: case EorSD:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
119
4505 // get the EDecl or SDDecl (syntax like an attribute)-
4506 if (name() == QLatin1String("standalone")) {
name() == QLat...("standalone")Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 101 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
18-101
4507 if (string()== QLatin1String("yes")) {
string()== QLa...1String("yes")Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-17
4508 standalone = QXmlSimpleReaderPrivate::Yes;-
4509 } else if (string() == QLatin1String("no")) {
executed 17 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
string() == QL...n1String("no")Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-17
4510 standalone = QXmlSimpleReaderPrivate::No;-
4511 } else {
never executed: end of block
0
4512 reportParseError(QLatin1String(XMLERR_WRONGVALUEFORSDECL));-
4513 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
4514 }-
4515 } else if (name() == QLatin1String("encoding")) {
name() == QLat...ng("encoding")Description
TRUEevaluated 99 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-99
4516 encoding = string();-
4517 } else {
executed 99 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
99
4518 reportParseError(QLatin1String(XMLERR_EDECLORSDDECLEXPECTED));-
4519 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
4520 }-
4521 break;
executed 116 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
116
4522 case SD:
executed 50 times by 1 test: case SD:
Executed by:
  • tst_qxmlsimplereader - unknown status
50
4523 if (name() != QLatin1String("standalone")) {
name() != QLat...("standalone")Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-50
4524 reportParseError(QLatin1String(XMLERR_SDDECLEXPECTED));-
4525 return false;
never executed: return false;
0
4526 }-
4527 if (string() == QLatin1String("yes")) {
string() == QL...1String("yes")Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 39 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-39
4528 standalone = QXmlSimpleReaderPrivate::Yes;-
4529 } else if (string() == QLatin1String("no")) {
executed 11 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
string() == QL...n1String("no")Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-39
4530 standalone = QXmlSimpleReaderPrivate::No;-
4531 } else {
executed 39 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
39
4532 reportParseError(QLatin1String(XMLERR_WRONGVALUEFORSDECL));-
4533 return false;
never executed: return false;
0
4534 }-
4535 break;
executed 50 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
50
4536 case Qm:
executed 104 times by 2 tests: case Qm:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
104
4537 // test if the skipping was legal-
4538 if (!atEnd() && c != QLatin1Char('>'))
!atEnd()Description
TRUEevaluated 85 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
c != QLatin1Char('>')Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 64 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
19-85
4539 stringAddC(QLatin1Char('?'));
executed 21 times by 1 test: stringAddC(QLatin1Char('?'));
Executed by:
  • tst_qxmlsimplereader - unknown status
21
4540 break;
executed 104 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
104
4541 case Done:
executed 175 times by 2 tests: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
175
4542 return true;
executed 175 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
175
4543 case -1:
executed 3 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
4544 // Error-
4545 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
4546 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
4547 }-
4548-
4549 if (atEnd()) {
atEnd()Description
TRUEevaluated 249 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1786 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
249-1786
4550 unexpectedEof(&QXmlSimpleReaderPrivate::parsePI, state);-
4551 return false;
executed 249 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
249
4552 }-
4553 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 412 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1374 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
412-1374
4554 input = InpWs;-
4555 } else if (determineNameChar(c) == NameBeginning) {
executed 412 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
determineNameC... NameBeginningDescription
TRUEevaluated 764 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 610 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
412-764
4556 input = InpNameBe;-
4557 } else if (c == QLatin1Char('>')) {
executed 764 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 189 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 421 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
189-764
4558 input = InpGt;-
4559 } else if (c == QLatin1Char('?')) {
executed 189 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('?')Description
TRUEevaluated 394 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 27 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
27-394
4560 input = InpQm;-
4561 } else {
executed 394 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
394
4562 input = InpUnknown;-
4563 }
executed 27 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
27
4564 state = table[state][input];-
4565-
4566 switch (state) {-
4567 case QmI:
executed 198 times by 2 tests: case QmI:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
198
4568 next();-
4569 break;
executed 198 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
198
4570 case Name:
executed 197 times by 2 tests: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
197
4571 parseName_useRef = false;-
4572 if (!parseName()) {
!parseName()Description
TRUEevaluated 83 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 114 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
83-114
4573 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state);-
4574 return false;
executed 83 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
83
4575 }-
4576 break;
executed 114 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
114
4577 case Ws1:
executed 119 times by 2 tests: case Ws1:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
119
4578 case Ws2:
executed 58 times by 2 tests: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
58
4579 case Ws3:
executed 78 times by 2 tests: case Ws3:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
78
4580 case Ws4:
executed 40 times by 1 test: case Ws4:
Executed by:
  • tst_qxmlsimplereader - unknown status
40
4581 case Ws5:
executed 30 times by 1 test: case Ws5:
Executed by:
  • tst_qxmlsimplereader - unknown status
30
4582 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 86 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 239 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
86-239
4583 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state);-
4584 return false;
executed 86 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
86
4585 }-
4586 break;
executed 239 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
239
4587 case Version:
executed 119 times by 2 tests: case Version:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
119
4588 if (!parseAttribute()) {
!parseAttribute()Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 29 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
29-90
4589 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state);-
4590 return false;
executed 90 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
90
4591 }-
4592 break;
executed 29 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
29
4593 case EorSD:
executed 77 times by 2 tests: case EorSD:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
77
4594 if (!parseAttribute()) {
!parseAttribute()Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
14-63
4595 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state);-
4596 return false;
executed 63 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
63
4597 }-
4598 break;
executed 14 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
14
4599 case SD:
executed 40 times by 1 test: case SD:
Executed by:
  • tst_qxmlsimplereader - unknown status
40
4600 // get the SDDecl (syntax like an attribute)-
4601 if (standalone != QXmlSimpleReaderPrivate::Unknown) {
standalone != ...ivate::UnknownDescription
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-40
4602 // already parsed the standalone declaration-
4603 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
4604 return false;
never executed: return false;
0
4605 }-
4606 if (!parseAttribute()) {
!parseAttribute()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-36
4607 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state);-
4608 return false;
executed 36 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
36
4609 }-
4610 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
4611 case ADone:
executed 111 times by 2 tests: case ADone:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
111
4612 next();-
4613 break;
executed 111 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
111
4614 case Char:
executed 456 times by 2 tests: case Char:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
456
4615 stringAddC();-
4616 next();-
4617 break;
executed 456 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
456
4618 case Qm:
executed 85 times by 2 tests: case Qm:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
85
4619 // skip the '?'-
4620 next();-
4621 break;
executed 85 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
85
4622 case Done:
executed 175 times by 2 tests: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
175
4623 next();-
4624 break;
executed 175 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
175
4625 }-
4626 }
executed 1428 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1428
4627 return false;
never executed: return false;
0
4628}-
4629-
4630/*-
4631 Parse a document type definition (doctypedecl [28]).-
4632-
4633 Precondition: the beginning '<!' of the doctype is already read the head-
4634 stands on the 'D' of '<!DOCTYPE'.-
4635-
4636 If this function was successful, the head-position is on the first-
4637 character after the document type definition.-
4638*/-
4639bool QXmlSimpleReaderPrivate::parseDoctype()-
4640{-
4641 const signed char Init = 0;-
4642 const signed char Doctype = 1; // read the doctype-
4643 const signed char Ws1 = 2; // eat_ws-
4644 const signed char Doctype2 = 3; // read the doctype, part 2-
4645 const signed char Ws2 = 4; // eat_ws-
4646 const signed char Sys = 5; // read SYSTEM or PUBLIC-
4647 const signed char Ws3 = 6; // eat_ws-
4648 const signed char MP = 7; // markupdecl or PEReference-
4649 const signed char MPR = 8; // same as MP, but already reported-
4650 const signed char PER = 9; // PERReference-
4651 const signed char Mup = 10; // markupdecl-
4652 const signed char Ws4 = 11; // eat_ws-
4653 const signed char MPE = 12; // end of markupdecl or PEReference-
4654 const signed char Done = 13;-
4655-
4656 const signed char InpWs = 0;-
4657 const signed char InpD = 1; // 'D'-
4658 const signed char InpS = 2; // 'S' or 'P'-
4659 const signed char InpOB = 3; // [-
4660 const signed char InpCB = 4; //]-
4661 const signed char InpPer = 5; // %-
4662 const signed char InpGt = 6; // >-
4663 const signed char InpUnknown = 7;-
4664-
4665 static const signed char table[13][8] = {-
4666 /* InpWs, InpD InpS InpOB InpCB InpPer InpGt InpUnknown */-
4667 { -1, Doctype, -1, -1, -1, -1, -1, -1 }, // Init-
4668 { Ws1, -1, -1, -1, -1, -1, -1, -1 }, // Doctype-
4669 { -1, Doctype2, Doctype2, -1, -1, -1, -1, Doctype2 }, // Ws1-
4670 { Ws2, -1, Sys, MP, -1, -1, Done, -1 }, // Doctype2-
4671 { -1, -1, Sys, MP, -1, -1, Done, -1 }, // Ws2-
4672 { Ws3, -1, -1, MP, -1, -1, Done, -1 }, // Sys-
4673 { -1, -1, -1, MP, -1, -1, Done, -1 }, // Ws3-
4674 { -1, -1, -1, -1, MPE, PER, -1, Mup }, // MP-
4675 { -1, -1, -1, -1, MPE, PER, -1, Mup }, // MPR-
4676 { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, // PER-
4677 { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, // Mup-
4678 { -1, -1, -1, -1, MPE, PER, -1, Mup }, // Ws4-
4679 { -1, -1, -1, -1, -1, -1, Done, -1 } // MPE-
4680 };-
4681 signed char state;-
4682 signed char input;-
4683-
4684 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 433 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 31694 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 30204 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
433-31694
4685 startDTDwasReported = false;-
4686 systemId.clear();-
4687 publicId.clear();-
4688 state = Init;-
4689 } else {
executed 1923 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
4690 state = parseStack->pop().state;-
4691#if defined(QT_QXML_DEBUG)-
4692 qDebug("QXmlSimpleReader: parseDoctype (cont) in state %d", state);-
4693#endif-
4694 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 28944 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1260 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1260-28944
4695 ParseFunction function = parseStack->top().function;-
4696 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 4229 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 24715 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4229-24715
4697 parseStack->pop();-
4698#if defined(QT_QXML_DEBUG)-
4699 qDebug("QXmlSimpleReader: eat_ws (cont)");-
4700#endif-
4701 }
executed 4229 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4229
4702 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 20449 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8495 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
8495-20449
4703 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4704 return false;
executed 20449 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
20449
4705 }-
4706 }
executed 8495 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
8495
4707 }
executed 9755 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
9755
4708-
4709 for (;;) {-
4710 switch (state) {-
4711 case Doctype2:
executed 1923 times by 4 tests: case Doctype2:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
4712 doctype = name();-
4713 break;
executed 1923 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
4714 case MP:
executed 1558 times by 2 tests: case MP:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1558
4715 if (!startDTDwasReported && lexicalHnd ) {
!startDTDwasReportedDescription
TRUEevaluated 1558 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
lexicalHndDescription
TRUEevaluated 1554 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-1558
4716 startDTDwasReported = true;-
4717 if (!lexicalHnd->startDTD(doctype, publicId, systemId)) {
!lexicalHnd->s...cId, systemId)Description
TRUEnever evaluated
FALSEevaluated 1554 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-1554
4718 reportParseError(lexicalHnd->errorString());-
4719 return false;
never executed: return false;
0
4720 }-
4721 }
executed 1554 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1554
4722 state = MPR;-
4723 break;
executed 1558 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1558
4724 case Done:
executed 1868 times by 4 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1868
4725 return true;
executed 1868 times by 4 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1868
4726 case -1:
executed 2 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
2
4727 // Error-
4728 reportParseError(QLatin1String(XMLERR_ERRORPARSINGDOCTYPE));-
4729 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
4730 }-
4731-
4732 if (atEnd()) {
atEnd()Description
TRUEevaluated 1260 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 18800 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1260-18800
4733 unexpectedEof(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4734 return false;
executed 1260 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1260
4735 }-
4736 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 6715 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 12085 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6715-12085
4737 input = InpWs;-
4738 } else if (c == QLatin1Char('D')) {
executed 6715 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('D')Description
TRUEevaluated 1923 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10162 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923-10162
4739 input = InpD;-
4740 } else if (c == QLatin1Char('S')) {
executed 1923 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('S')Description
TRUEevaluated 296 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 9866 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
296-9866
4741 input = InpS;-
4742 } else if (c == QLatin1Char('P')) {
executed 296 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('P')Description
TRUEevaluated 87 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9779 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
87-9779
4743 input = InpS;-
4744 } else if (c == QLatin1Char('[')) {
executed 87 times by 2 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('[')Description
TRUEevaluated 1558 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 8221 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
87-8221
4745 input = InpOB;-
4746 } else if (c == QLatin1Char(']')) {
executed 1558 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char(']')Description
TRUEevaluated 1505 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 6716 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1505-6716
4747 input = InpCB;-
4748 } else if (c == QLatin1Char('%')) {
executed 1505 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('%')Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6665 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
51-6665
4749 input = InpPer;-
4750 } else if (c == QLatin1Char('>')) {
executed 51 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 1868 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 4797 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
51-4797
4751 input = InpGt;-
4752 } else {
executed 1868 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1868
4753 input = InpUnknown;-
4754 }
executed 4797 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4797
4755 state = table[state][input];-
4756-
4757 switch (state) {-
4758 case Doctype:
executed 1923 times by 4 tests: case Doctype:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
4759 parseString_s = QLatin1String("DOCTYPE");-
4760 if (!parseString()) {
!parseString()Description
TRUEevaluated 1332 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 591 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
591-1332
4761 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4762 return false;
executed 1332 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1332
4763 }-
4764 break;
executed 591 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
591
4765 case Ws1:
executed 1923 times by 4 tests: case Ws1:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
4766 case Ws2:
executed 1831 times by 3 tests: case Ws2:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1831
4767 case Ws3:
executed 111 times by 2 tests: case Ws3:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
111
4768 case Ws4:
executed 2850 times by 2 tests: case Ws4:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2850
4769 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 2308 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4407 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2308-4407
4770 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4771 return false;
executed 2308 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2308
4772 }-
4773 break;
executed 4407 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4407
4774 case Doctype2:
executed 1923 times by 4 tests: case Doctype2:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1923
4775 parseName_useRef = false;-
4776 if (!parseName()) {
!parseName()Description
TRUEevaluated 846 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1077 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
846-1077
4777 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4778 return false;
executed 846 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
846
4779 }-
4780 break;
executed 1077 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1077
4781 case Sys:
executed 383 times by 3 tests: case Sys:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
383
4782 parseExternalID_allowPublicID = false;-
4783 if (!parseExternalID()) {
!parseExternalID()Description
TRUEevaluated 279 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 104 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
104-279
4784 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4785 return false;
executed 279 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
279
4786 }-
4787 thisPublicId = publicId;-
4788 thisSystemId = systemId;-
4789 break;
executed 104 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
104
4790 case MP:
executed 1558 times by 2 tests: case MP:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1558
4791 case MPR:
never executed: case MPR:
0
4792 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 885 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 673 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
673-885
4793 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4794 return false;
executed 885 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
885
4795 }-
4796 break;
executed 673 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
673
4797 case PER:
executed 50 times by 1 test: case PER:
Executed by:
  • tst_qxmlsimplereader - unknown status
50
4798 parsePEReference_context = InDTD;-
4799 if (!parsePEReference()) {
!parsePEReference()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-30
4800 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4801 return false;
executed 20 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
20
4802 }-
4803 break;
executed 30 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
30
4804 case Mup:
executed 2873 times by 2 tests: case Mup:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2873
4805 if (dtdRecursionLimit > 0 && parameterEntities.size() > dtdRecursionLimit) {
dtdRecursionLimit > 0Description
TRUEevaluated 2873 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
parameterEntit...RecursionLimitDescription
TRUEnever evaluated
FALSEevaluated 2873 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-2873
4806 reportParseError(QString::fromLatin1(-
4807 "DTD parsing exceeded recursion limit of %1.").arg(dtdRecursionLimit));-
4808 return false;
never executed: return false;
0
4809 }-
4810 if (!parseMarkupdecl()) {
!parseMarkupdecl()Description
TRUEevaluated 2461 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 412 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
412-2461
4811 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4812 return false;
executed 2461 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2461
4813 }-
4814 break;
executed 412 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
412
4815 case MPE:
executed 1505 times by 2 tests: case MPE:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1505
4816 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 417 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1088 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
417-1088
4817 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state);-
4818 return false;
executed 417 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
417
4819 }-
4820 break;
executed 1088 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1088
4821 case Done:
executed 1868 times by 4 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1868
4822 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 1862 times by 3 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6-1862
4823 if (!startDTDwasReported) {
!startDTDwasReportedDescription
TRUEevaluated 359 times by 3 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1503 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
359-1503
4824 startDTDwasReported = true;-
4825 if (!lexicalHnd->startDTD(doctype, publicId, systemId)) {
!lexicalHnd->s...cId, systemId)Description
TRUEnever evaluated
FALSEevaluated 359 times by 3 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
0-359
4826 reportParseError(lexicalHnd->errorString());-
4827 return false;
never executed: return false;
0
4828 }-
4829 }
executed 359 times by 3 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
359
4830 if (!lexicalHnd->endDTD()) {
!lexicalHnd->endDTD()Description
TRUEnever evaluated
FALSEevaluated 1862 times by 3 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
0-1862
4831 reportParseError(lexicalHnd->errorString());-
4832 return false;
never executed: return false;
0
4833 }-
4834 }
executed 1862 times by 3 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
1862
4835 next();-
4836 break;
executed 1868 times by 4 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1868
4837 }-
4838 }
executed 10252 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10252
4839 return false;
never executed: return false;
0
4840}-
4841-
4842/*-
4843 Parse a ExternalID [75].-
4844-
4845 If allowPublicID is true parse ExternalID [75] or PublicID [83].-
4846*/-
4847bool QXmlSimpleReaderPrivate::parseExternalID()-
4848{-
4849 const signed char Init = 0;-
4850 const signed char Sys = 1; // parse 'SYSTEM'-
4851 const signed char SysWS = 2; // parse the whitespace after 'SYSTEM'-
4852 const signed char SysSQ = 3; // parse SystemLiteral with '-
4853 const signed char SysSQ2 = 4; // parse SystemLiteral with '-
4854 const signed char SysDQ = 5; // parse SystemLiteral with "-
4855 const signed char SysDQ2 = 6; // parse SystemLiteral with "-
4856 const signed char Pub = 7; // parse 'PUBLIC'-
4857 const signed char PubWS = 8; // parse the whitespace after 'PUBLIC'-
4858 const signed char PubSQ = 9; // parse PubidLiteral with '-
4859 const signed char PubSQ2 = 10; // parse PubidLiteral with '-
4860 const signed char PubDQ = 11; // parse PubidLiteral with "-
4861 const signed char PubDQ2 = 12; // parse PubidLiteral with "-
4862 const signed char PubE = 13; // finished parsing the PubidLiteral-
4863 const signed char PubWS2 = 14; // parse the whitespace after the PubidLiteral-
4864 const signed char PDone = 15; // done if allowPublicID is true-
4865 const signed char Done = 16;-
4866-
4867 const signed char InpSQ = 0; // '-
4868 const signed char InpDQ = 1; // "-
4869 const signed char InpS = 2; // S-
4870 const signed char InpP = 3; // P-
4871 const signed char InpWs = 4; // white space-
4872 const signed char InpUnknown = 5;-
4873-
4874 static const signed char table[15][6] = {-
4875 /* InpSQ InpDQ InpS InpP InpWs InpUnknown */-
4876 { -1, -1, Sys, Pub, -1, -1 }, // Init-
4877 { -1, -1, -1, -1, SysWS, -1 }, // Sys-
4878 { SysSQ, SysDQ, -1, -1, -1, -1 }, // SysWS-
4879 { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, // SysSQ-
4880 { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, // SysSQ2-
4881 { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, // SysDQ-
4882 { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, // SysDQ2-
4883 { -1, -1, -1, -1, PubWS, -1 }, // Pub-
4884 { PubSQ, PubDQ, -1, -1, -1, -1 }, // PubWS-
4885 { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, // PubSQ-
4886 { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, // PubSQ2-
4887 { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, // PubDQ-
4888 { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, // PubDQ2-
4889 { PDone, PDone, PDone, PDone, PubWS2, PDone }, // PubE-
4890 { SysSQ, SysDQ, PDone, PDone, PDone, PDone } // PubWS2-
4891 };-
4892 signed char state;-
4893 signed char input;-
4894-
4895 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 164 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3322 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 522 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2800 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
164-3322
4896 systemId.clear();-
4897 publicId.clear();-
4898 state = Init;-
4899 } else {
executed 686 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
686
4900 state = parseStack->pop().state;-
4901#if defined(QT_QXML_DEBUG)-
4902 qDebug("QXmlSimpleReader: parseExternalID (cont) in state %d", state);-
4903#endif-
4904 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 956 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1844 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
956-1844
4905 ParseFunction function = parseStack->top().function;-
4906 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 173 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 783 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
173-783
4907 parseStack->pop();-
4908#if defined(QT_QXML_DEBUG)-
4909 qDebug("QXmlSimpleReader: eat_ws (cont)");-
4910#endif-
4911 }
executed 173 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
173
4912 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 341 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 615 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
341-615
4913 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state);-
4914 return false;
executed 341 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
341
4915 }-
4916 }
executed 615 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
615
4917 }
executed 2459 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2459
4918-
4919 for (;;) {-
4920 switch (state) {-
4921 case PDone:
executed 22 times by 1 test: case PDone:
Executed by:
  • tst_qxmlsimplereader - unknown status
22
4922 if (parseExternalID_allowPublicID) {
parseExternalID_allowPublicIDDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-20
4923 publicId = string();-
4924 return true;
executed 20 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
20
4925 } else {-
4926 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
4927 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
4928 }-
4929 case Done:
executed 664 times by 3 tests: case Done:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
664
4930 return true;
executed 664 times by 3 tests: return true;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
664
4931 case -1:
never executed: case -1:
0
4932 // Error-
4933 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
4934 return false;
never executed: return false;
0
4935 }-
4936-
4937 if (atEnd()) {
atEnd()Description
TRUEevaluated 1844 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 13326 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1844-13326
4938 unexpectedEof(&QXmlSimpleReaderPrivate::parseExternalID, state);-
4939 return false;
executed 1844 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1844
4940 }-
4941 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 981 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 12345 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
981-12345
4942 input = InpWs;-
4943 } else if (c == QLatin1Char('\'')) {
executed 981 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('\'')Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12325 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
20-12325
4944 input = InpSQ;-
4945 } else if (c == QLatin1Char('"')) {
executed 20 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('"')Description
TRUEevaluated 1593 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10732 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
20-10732
4946 input = InpDQ;-
4947 } else if (c == QLatin1Char('S')) {
executed 1593 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('S')Description
TRUEevaluated 545 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10187 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
545-10187
4948 input = InpS;-
4949 } else if (c == QLatin1Char('P')) {
executed 545 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('P')Description
TRUEevaluated 142 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10045 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
142-10045
4950 input = InpP;-
4951 } else {
executed 142 times by 2 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
142
4952 input = InpUnknown;-
4953 }
executed 10045 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10045
4954 state = table[state][input];-
4955-
4956 switch (state) {-
4957 case Sys:
executed 544 times by 2 tests: case Sys:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
544
4958 parseString_s = QLatin1String("SYSTEM");-
4959 if (!parseString()) {
!parseString()Description
TRUEevaluated 392 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 152 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
152-392
4960 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state);-
4961 return false;
executed 392 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
392
4962 }-
4963 break;
executed 152 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
152
4964 case SysWS:
executed 544 times by 2 tests: case SysWS:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
544
4965 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 133 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 411 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
133-411
4966 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state);-
4967 return false;
executed 133 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
133
4968 }-
4969 break;
executed 411 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
411
4970 case SysSQ:
never executed: case SysSQ:
0
4971 case SysDQ:
executed 664 times by 3 tests: case SysDQ:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
664
4972 stringClear();-
4973 next();-
4974 break;
executed 664 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
664
4975 case SysSQ2:
never executed: case SysSQ2:
0
4976 case SysDQ2:
executed 7824 times by 3 tests: case SysDQ2:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7824
4977 stringAddC();-
4978 next();-
4979 break;
executed 7824 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7824
4980 case Pub:
executed 142 times by 2 tests: case Pub:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
142
4981 parseString_s = QLatin1String("PUBLIC");-
4982 if (!parseString()) {
!parseString()Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 92 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
50-92
4983 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state);-
4984 return false;
executed 50 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
50
4985 }-
4986 break;
executed 92 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
92
4987 case PubWS:
executed 142 times by 2 tests: case PubWS:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
142
4988 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 120 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
22-120
4989 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state);-
4990 return false;
executed 22 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
22
4991 }-
4992 break;
executed 120 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
120
4993 case PubSQ:
executed 10 times by 1 test: case PubSQ:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
4994 case PubDQ:
executed 132 times by 2 tests: case PubDQ:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
132
4995 stringClear();-
4996 next();-
4997 break;
executed 142 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
142
4998 case PubSQ2:
executed 80 times by 1 test: case PubSQ2:
Executed by:
  • tst_qxmlsimplereader - unknown status
80
4999 case PubDQ2:
executed 2296 times by 2 tests: case PubDQ2:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
2296
5000 stringAddC();-
5001 next();-
5002 break;
executed 2376 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
2376
5003 case PubE:
executed 142 times by 2 tests: case PubE:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
142
5004 next();-
5005 break;
executed 142 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
142
5006 case PubWS2:
executed 120 times by 2 tests: case PubWS2:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
120
5007 publicId = string();-
5008 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 102 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
18-102
5009 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state);-
5010 return false;
executed 18 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
18
5011 }-
5012 break;
executed 102 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
102
5013 case Done:
executed 664 times by 3 tests: case Done:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
664
5014 systemId = string();-
5015 next();-
5016 break;
executed 664 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
664
5017 }-
5018 }
executed 12711 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12711
5019 return false;
never executed: return false;
0
5020}-
5021-
5022/*-
5023 Parse a markupdecl [29].-
5024*/-
5025bool QXmlSimpleReaderPrivate::parseMarkupdecl()-
5026{-
5027 const signed char Init = 0;-
5028 const signed char Lt = 1; // < was read-
5029 const signed char Em = 2; // ! was read-
5030 const signed char CE = 3; // E was read-
5031 const signed char Qm = 4; // ? was read-
5032 const signed char Dash = 5; // - was read-
5033 const signed char CA = 6; // A was read-
5034 const signed char CEL = 7; // EL was read-
5035 const signed char CEN = 8; // EN was read-
5036 const signed char CN = 9; // N was read-
5037 const signed char Done = 10;-
5038-
5039 const signed char InpLt = 0; // <-
5040 const signed char InpQm = 1; // ?-
5041 const signed char InpEm = 2; // !-
5042 const signed char InpDash = 3; // --
5043 const signed char InpA = 4; // A-
5044 const signed char InpE = 5; // E-
5045 const signed char InpL = 6; // L-
5046 const signed char InpN = 7; // N-
5047 const signed char InpUnknown = 8;-
5048-
5049 static const signed char table[4][9] = {-
5050 /* InpLt InpQm InpEm InpDash InpA InpE InpL InpN InpUnknown */-
5051 { Lt, -1, -1, -1, -1, -1, -1, -1, -1 }, // Init-
5052 { -1, Qm, Em, -1, -1, -1, -1, -1, -1 }, // Lt-
5053 { -1, -1, -1, Dash, CA, CE, -1, CN, -1 }, // Em-
5054 { -1, -1, -1, -1, -1, -1, CEL, CEN, -1 } // CE-
5055 };-
5056 signed char state;-
5057 signed char input;-
5058-
5059 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 456 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 21658 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 2417 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19241 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
456-21658
5060 state = Init;-
5061 } else {
executed 2873 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2873
5062 state = parseStack->pop().state;-
5063#if defined(QT_QXML_DEBUG)-
5064 qDebug("QXmlSimpleReader: parseMarkupdecl (cont) in state %d", state);-
5065#endif-
5066 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 16888 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2353 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2353-16888
5067 ParseFunction function = parseStack->top().function;-
5068 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEevaluated 16888 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-16888
5069 parseStack->pop();-
5070#if defined(QT_QXML_DEBUG)-
5071 qDebug("QXmlSimpleReader: eat_ws (cont)");-
5072#endif-
5073 }
never executed: end of block
0
5074 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 14480 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2408 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2408-14480
5075 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5076 return false;
executed 14480 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
14480
5077 }-
5078 }
executed 2408 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2408
5079 }
executed 4761 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4761
5080-
5081 for (;;) {-
5082 switch (state) {-
5083 case Qm:
never executed: case Qm:
0
5084 if (contentHnd) {
contentHndDescription
TRUEnever evaluated
FALSEnever evaluated
0
5085 if (!contentHnd->processingInstruction(name(),string())) {
!contentHnd->p...me(),string())Description
TRUEnever evaluated
FALSEnever evaluated
0
5086 reportParseError(contentHnd->errorString());-
5087 return false;
never executed: return false;
0
5088 }-
5089 }
never executed: end of block
0
5090 return true;
never executed: return true;
0
5091 case Dash:
executed 17 times by 2 tests: case Dash:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
17
5092 if (lexicalHnd) {
lexicalHndDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
6-11
5093 if (!lexicalHnd->comment(string())) {
!lexicalHnd->comment(string())Description
TRUEnever evaluated
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-11
5094 reportParseError(lexicalHnd->errorString());-
5095 return false;
never executed: return false;
0
5096 }-
5097 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
11
5098 return true;
executed 17 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
17
5099 case CA:
executed 536 times by 1 test: case CA:
Executed by:
  • tst_qxmlsimplereader - unknown status
536
5100 return true;
executed 536 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
536
5101 case CEL:
executed 1561 times by 1 test: case CEL:
Executed by:
  • tst_qxmlsimplereader - unknown status
1561
5102 return true;
executed 1561 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
1561
5103 case CEN:
executed 652 times by 2 tests: case CEN:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
652
5104 return true;
executed 652 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
652
5105 case CN:
executed 54 times by 1 test: case CN:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
5106 return true;
executed 54 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
54
5107 case Done:
never executed: case Done:
0
5108 return true;
never executed: return true;
0
5109 case -1:
executed 3 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
5110 // Error-
5111 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
5112 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
5113 }-
5114-
5115 if (atEnd()) {
atEnd()Description
TRUEevaluated 2353 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10866 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2353-10866
5116 unexpectedEof(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5117 return false;
executed 2353 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2353
5118 }-
5119 if (c == QLatin1Char('<')) {
c == QLatin1Char('<')Description
TRUEevaluated 2873 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 7993 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2873-7993
5120 input = InpLt;-
5121 } else if (c == QLatin1Char('?')) {
executed 2873 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('?')Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 7992 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1-7992
5122 input = InpQm;-
5123 } else if (c == QLatin1Char('!')) {
executed 1 time by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('!')Description
TRUEevaluated 2871 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 5121 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1-5121
5124 input = InpEm;-
5125 } else if (c == QLatin1Char('-')) {
executed 2871 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('-')Description
TRUEevaluated 17 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 5104 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
17-5104
5126 input = InpDash;-
5127 } else if (c == QLatin1Char('A')) {
executed 17 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('A')Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4555 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
17-4555
5128 input = InpA;-
5129 } else if (c == QLatin1Char('E')) {
executed 549 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('E')Description
TRUEevaluated 2249 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2306 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
549-2306
5130 input = InpE;-
5131 } else if (c == QLatin1Char('L')) {
executed 2249 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('L')Description
TRUEevaluated 1582 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 724 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
724-2249
5132 input = InpL;-
5133 } else if (c == QLatin1Char('N')) {
executed 1582 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('N')Description
TRUEevaluated 721 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-1582
5134 input = InpN;-
5135 } else {
executed 721 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
721
5136 input = InpUnknown;-
5137 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
3
5138 state = table[state][input];-
5139-
5140 switch (state) {-
5141 case Lt:
executed 2873 times by 2 tests: case Lt:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2873
5142 next();-
5143 break;
executed 2873 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2873
5144 case Em:
executed 2871 times by 2 tests: case Em:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2871
5145 next();-
5146 break;
executed 2871 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2871
5147 case CE:
executed 2249 times by 2 tests: case CE:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2249
5148 next();-
5149 break;
executed 2249 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2249
5150 case Qm:
executed 1 time by 1 test: case Qm:
Executed by:
  • tst_qxmlsimplereader - unknown status
1
5151 parsePI_xmldecl = false;-
5152 if (!parsePI()) {
!parsePI()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1
5153 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5154 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
5155 }-
5156 break;
never executed: break;
0
5157 case Dash:
executed 17 times by 2 tests: case Dash:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
17
5158 if (!parseComment()) {
!parseComment()Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8-9
5159 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5160 return false;
executed 9 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
9
5161 }-
5162 break;
executed 8 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8
5163 case CA:
executed 549 times by 1 test: case CA:
Executed by:
  • tst_qxmlsimplereader - unknown status
549
5164 if (!parseAttlistDecl()) {
!parseAttlistDecl()Description
TRUEevaluated 490 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 59 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
59-490
5165 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5166 return false;
executed 490 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
490
5167 }-
5168 break;
executed 59 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
59
5169 case CEL:
executed 1582 times by 1 test: case CEL:
Executed by:
  • tst_qxmlsimplereader - unknown status
1582
5170 if (!parseElementDecl()) {
!parseElementDecl()Description
TRUEevaluated 1376 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 206 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
206-1376
5171 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5172 return false;
executed 1376 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1376
5173 }-
5174 break;
executed 206 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
206
5175 case CEN:
executed 667 times by 2 tests: case CEN:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
667
5176 if (!parseEntityDecl()) {
!parseEntityDecl()Description
TRUEevaluated 537 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 130 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
130-537
5177 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5178 return false;
executed 537 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
537
5179 }-
5180 break;
executed 130 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
130
5181 case CN:
executed 54 times by 1 test: case CN:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
5182 if (!parseNotationDecl()) {
!parseNotationDecl()Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
9-45
5183 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state);-
5184 return false;
executed 45 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
45
5185 }-
5186 break;
executed 9 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
9
5187 }-
5188 }
executed 8408 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8408
5189 return false;
never executed: return false;
0
5190}-
5191-
5192/*-
5193 Parse a PEReference [69]-
5194*/-
5195bool QXmlSimpleReaderPrivate::parsePEReference()-
5196{-
5197 const signed char Init = 0;-
5198 const signed char Next = 1;-
5199 const signed char Name = 2;-
5200 const signed char NameR = 3; // same as Name, but already reported-
5201 const signed char Done = 4;-
5202-
5203 const signed char InpSemi = 0; // ;-
5204 const signed char InpPer = 1; // %-
5205 const signed char InpUnknown = 2;-
5206-
5207 static const signed char table[4][3] = {-
5208 /* InpSemi InpPer InpUnknown */-
5209 { -1, Next, -1 }, // Init-
5210 { -1, -1, Name }, // Next-
5211 { Done, -1, -1 }, // Name-
5212 { Done, -1, -1 } // NameR-
5213 };-
5214 signed char state;-
5215 signed char input;-
5216-
5217 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 70 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-70
5218 state = Init;-
5219 } else {
executed 65 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5220 state = parseStack->pop().state;-
5221#if defined(QT_QXML_DEBUG)-
5222 qDebug("QXmlSimpleReader: parsePEReference (cont) in state %d", state);-
5223#endif-
5224 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
7-18
5225 ParseFunction function = parseStack->top().function;-
5226 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-7
5227 parseStack->pop();-
5228#if defined(QT_QXML_DEBUG)-
5229 qDebug("QXmlSimpleReader: eat_ws (cont)");-
5230#endif-
5231 }
never executed: end of block
0
5232 if (!(this->*function)()) {
!(this->*function)()Description
TRUEnever evaluated
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-7
5233 parseFailed(&QXmlSimpleReaderPrivate::parsePEReference, state);-
5234 return false;
never executed: return false;
0
5235 }-
5236 }
executed 7 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
7
5237 }
executed 25 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
25
5238-
5239 for (;;) {-
5240 switch (state) {-
5241 case Name:
executed 65 times by 1 test: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5242 {-
5243 bool skipIt = true;-
5244 QString xmlRefString;-
5245-
5246 QMap<QString,QString>::Iterator it;-
5247 it = parameterEntities.find(ref());-
5248 if (it != parameterEntities.end()) {
it != parameterEntities.end()Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
25-40
5249 skipIt = false;-
5250 xmlRefString = *it;-
5251 } else if (entityRes) {
executed 25 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
entityResDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-40
5252 QMap<QString,QXmlSimpleReaderPrivate::ExternParameterEntity>::Iterator it2;-
5253 it2 = externParameterEntities.find(ref());-
5254 QXmlInputSource *ret = 0;-
5255 if (it2 != externParameterEntities.end()) {
it2 != externP...Entities.end()Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-40
5256 if (!entityRes->resolveEntity((*it2).publicId, (*it2).systemId, ret)) {
!entityRes->re...systemId, ret)Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-40
5257 delete ret;-
5258 reportParseError(entityRes->errorString());-
5259 return false;
never executed: return false;
0
5260 }-
5261 if (ret) {
retDescription
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-40
5262 QString buffer = ret->data();-
5263 while (!buffer.isEmpty()) {
!buffer.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
5264 xmlRefString += buffer;-
5265 ret->fetchData();-
5266 buffer = ret->data();-
5267 }
never executed: end of block
0
5268 delete ret;-
5269 if (!stripTextDecl(xmlRefString)) {
!stripTextDecl(xmlRefString)Description
TRUEnever evaluated
FALSEnever evaluated
0
5270 reportParseError(QLatin1String(XMLERR_ERRORINTEXTDECL));-
5271 return false;
never executed: return false;
0
5272 }-
5273 skipIt = false;-
5274 }
never executed: end of block
0
5275 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
40
5276 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
40
5277-
5278 if (skipIt) {
skipItDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
25-40
5279 if (contentHnd) {
contentHndDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-40
5280 if (!contentHnd->skippedEntity(QLatin1Char('%') + ref())) {
!contentHnd->s...('%') + ref())Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-40
5281 reportParseError(contentHnd->errorString());-
5282 return false;
never executed: return false;
0
5283 }-
5284 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
40
5285 } else {
executed 40 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
40
5286 if (parsePEReference_context == InEntityValue) {
parsePEReferen... InEntityValueDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-15
5287 // Included in literal-
5288 if (!insertXmlRef(xmlRefString, ref(), true))
!insertXmlRef(..., ref(), true)Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-15
5289 return false;
never executed: return false;
0
5290 } else if (parsePEReference_context == InDTD) {
executed 15 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
parsePEReferen...ntext == InDTDDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-15
5291 // Included as PE-
5292 if (!insertXmlRef(QLatin1Char(' ') + xmlRefString + QLatin1Char(' '), ref(), false))
!insertXmlRef(... ref(), false)Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-10
5293 return false;
never executed: return false;
0
5294 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5295 }
executed 25 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
25
5296 }-
5297 state = NameR;-
5298 break;
executed 65 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5299 case Done:
executed 65 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5300 return true;
executed 65 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5301 case -1:
never executed: case -1:
0
5302 // Error-
5303 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
5304 return false;
never executed: return false;
0
5305 }-
5306-
5307 if (atEnd()) {
atEnd()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 195 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
18-195
5308 unexpectedEof(&QXmlSimpleReaderPrivate::parsePEReference, state);-
5309 return false;
executed 18 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
18
5310 }-
5311 if (c == QLatin1Char(';')) {
c == QLatin1Char(';')Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 130 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
65-130
5312 input = InpSemi;-
5313 } else if (c == QLatin1Char('%')) {
executed 65 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('%')Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 65 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
65
5314 input = InpPer;-
5315 } else {
executed 65 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5316 input = InpUnknown;-
5317 }
executed 65 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5318 state = table[state][input];-
5319-
5320 switch (state) {-
5321 case Next:
executed 65 times by 1 test: case Next:
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5322 next();-
5323 break;
executed 65 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5324 case Name:
executed 65 times by 1 test: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5325 case NameR:
never executed: case NameR:
0
5326 parseName_useRef = true;-
5327 if (!parseName()) {
!parseName()Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 58 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
7-58
5328 parseFailed(&QXmlSimpleReaderPrivate::parsePEReference, state);-
5329 return false;
executed 7 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
7
5330 }-
5331 break;
executed 58 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
58
5332 case Done:
executed 65 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5333 next();-
5334 break;
executed 65 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
65
5335 }-
5336 }
executed 188 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
188
5337 return false;
never executed: return false;
0
5338}-
5339-
5340/*-
5341 Parse a AttlistDecl [52].-
5342-
5343 Precondition: the beginning '<!' is already read and the head-
5344 stands on the 'A' of '<!ATTLIST'-
5345*/-
5346bool QXmlSimpleReaderPrivate::parseAttlistDecl()-
5347{-
5348 const signed char Init = 0;-
5349 const signed char Attlist = 1; // parse the string "ATTLIST"-
5350 const signed char Ws = 2; // whitespace read-
5351 const signed char Name = 3; // parse name-
5352 const signed char Ws1 = 4; // whitespace read-
5353 const signed char Attdef = 5; // parse the AttDef-
5354 const signed char Ws2 = 6; // whitespace read-
5355 const signed char Atttype = 7; // parse the AttType-
5356 const signed char Ws3 = 8; // whitespace read-
5357 const signed char DDecH = 9; // DefaultDecl with #-
5358 const signed char DefReq = 10; // parse the string "REQUIRED"-
5359 const signed char DefImp = 11; // parse the string "IMPLIED"-
5360 const signed char DefFix = 12; // parse the string "FIXED"-
5361 const signed char Attval = 13; // parse the AttValue-
5362 const signed char Ws4 = 14; // whitespace read-
5363 const signed char Done = 15;-
5364-
5365 const signed char InpWs = 0; // white space-
5366 const signed char InpGt = 1; // >-
5367 const signed char InpHash = 2; // #-
5368 const signed char InpA = 3; // A-
5369 const signed char InpI = 4; // I-
5370 const signed char InpF = 5; // F-
5371 const signed char InpR = 6; // R-
5372 const signed char InpUnknown = 7;-
5373-
5374 static const signed char table[15][8] = {-
5375 /* InpWs InpGt InpHash InpA InpI InpF InpR InpUnknown */-
5376 { -1, -1, -1, Attlist, -1, -1, -1, -1 }, // Init-
5377 { Ws, -1, -1, -1, -1, -1, -1, -1 }, // Attlist-
5378 { -1, -1, -1, Name, Name, Name, Name, Name }, // Ws-
5379 { Ws1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, // Name-
5380 { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, // Ws1-
5381 { Ws2, -1, -1, -1, -1, -1, -1, -1 }, // Attdef-
5382 { -1, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype }, // Ws2-
5383 { Ws3, -1, -1, -1, -1, -1, -1, -1 }, // Attype-
5384 { -1, Attval, DDecH, Attval, Attval, Attval, Attval, Attval }, // Ws3-
5385 { -1, -1, -1, -1, DefImp, DefFix, DefReq, -1 }, // DDecH-
5386 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, // DefReq-
5387 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, // DefImp-
5388 { Ws3, -1, -1, -1, -1, -1, -1, -1 }, // DefFix-
5389 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, // Attval-
5390 { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef } // Ws4-
5391 };-
5392 signed char state;-
5393 signed char input;-
5394-
5395 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5236 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 477 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4759 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
72-5236
5396 state = Init;-
5397 } else {
executed 549 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
549
5398 state = parseStack->pop().state;-
5399#if defined(QT_QXML_DEBUG)-
5400 qDebug("QXmlSimpleReader: parseAttlistDecl (cont) in state %d", state);-
5401#endif-
5402 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 4331 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 428 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
428-4331
5403 ParseFunction function = parseStack->top().function;-
5404 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 589 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3742 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
589-3742
5405 parseStack->pop();-
5406#if defined(QT_QXML_DEBUG)-
5407 qDebug("QXmlSimpleReader: eat_ws (cont)");-
5408#endif-
5409 }
executed 589 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
589
5410 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 1729 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2602 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1729-2602
5411 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5412 return false;
executed 1729 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1729
5413 }-
5414 }
executed 2602 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2602
5415 }
executed 3030 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
3030
5416-
5417 for (;;) {-
5418 switch (state) {-
5419 case Name:
executed 548 times by 1 test: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
548
5420 attDeclEName = name();-
5421 break;
executed 548 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
548
5422 case Attdef:
executed 619 times by 1 test: case Attdef:
Executed by:
  • tst_qxmlsimplereader - unknown status
619
5423 attDeclAName = name();-
5424 break;
executed 619 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
619
5425 case Done:
executed 536 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
536
5426 return true;
executed 536 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
536
5427 case -1:
executed 5 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
5
5428 // Error-
5429 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
5430 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
5431 }-
5432-
5433 if (atEnd()) {
atEnd()Description
TRUEevaluated 428 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6889 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
428-6889
5434 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5435 return false;
executed 428 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
428
5436 }-
5437 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 2429 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4460 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2429-4460
5438 input = InpWs;-
5439 } else if (c == QLatin1Char('>')) {
executed 2429 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 1062 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3398 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1062-3398
5440 input = InpGt;-
5441 } else if (c == QLatin1Char('#')) {
executed 1062 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('#')Description
TRUEevaluated 428 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2970 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
428-2970
5442 input = InpHash;-
5443 } else if (c == QLatin1Char('A')) {
executed 428 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('A')Description
TRUEevaluated 559 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2411 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
428-2411
5444 input = InpA;-
5445 } else if (c == QLatin1Char('I')) {
executed 559 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('I')Description
TRUEevaluated 425 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1986 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
425-1986
5446 input = InpI;-
5447 } else if (c == QLatin1Char('F')) {
executed 425 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('F')Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1965 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
21-1965
5448 input = InpF;-
5449 } else if (c == QLatin1Char('R')) {
executed 21 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('R')Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1955 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-1955
5450 input = InpR;-
5451 } else {
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5452 input = InpUnknown;-
5453 }
executed 1955 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1955
5454 state = table[state][input];-
5455-
5456 switch (state) {-
5457 case Attlist:
executed 549 times by 1 test: case Attlist:
Executed by:
  • tst_qxmlsimplereader - unknown status
549
5458 parseString_s = QLatin1String("ATTLIST");-
5459 if (!parseString()) {
!parseString()Description
TRUEevaluated 428 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 121 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
121-428
5460 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5461 return false;
executed 428 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
428
5462 }-
5463 break;
executed 121 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
121
5464 case Ws:
executed 549 times by 1 test: case Ws:
Executed by:
  • tst_qxmlsimplereader - unknown status
549
5465 case Ws1:
executed 548 times by 1 test: case Ws1:
Executed by:
  • tst_qxmlsimplereader - unknown status
548
5466 case Ws2:
executed 618 times by 1 test: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
618
5467 case Ws3:
executed 633 times by 1 test: case Ws3:
Executed by:
  • tst_qxmlsimplereader - unknown status
633
5468 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 545 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1803 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
545-1803
5469 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5470 return false;
executed 545 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
545
5471 }-
5472 break;
executed 1803 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1803
5473 case Name:
executed 548 times by 1 test: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
548
5474 parseName_useRef = false;-
5475 if (!parseName()) {
!parseName()Description
TRUEevaluated 401 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 147 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
147-401
5476 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5477 return false;
executed 401 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
401
5478 }-
5479 break;
executed 147 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
147
5480 case Attdef:
executed 619 times by 1 test: case Attdef:
Executed by:
  • tst_qxmlsimplereader - unknown status
619
5481 parseName_useRef = false;-
5482 if (!parseName()) {
!parseName()Description
TRUEevaluated 230 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 389 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
230-389
5483 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5484 return false;
executed 230 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
230
5485 }-
5486 break;
executed 389 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
389
5487 case Atttype:
executed 618 times by 1 test: case Atttype:
Executed by:
  • tst_qxmlsimplereader - unknown status
618
5488 if (!parseAttType()) {
!parseAttType()Description
TRUEevaluated 489 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 129 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
129-489
5489 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5490 return false;
executed 489 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
489
5491 }-
5492 break;
executed 129 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
129
5493 case DDecH:
executed 426 times by 1 test: case DDecH:
Executed by:
  • tst_qxmlsimplereader - unknown status
426
5494 next();-
5495 break;
executed 426 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
426
5496 case DefReq:
executed 10 times by 1 test: case DefReq:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5497 parseString_s = QLatin1String("REQUIRED");-
5498 if (!parseString()) {
!parseString()Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-9
5499 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5500 return false;
executed 9 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
9
5501 }-
5502 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
5503 case DefImp:
executed 395 times by 1 test: case DefImp:
Executed by:
  • tst_qxmlsimplereader - unknown status
395
5504 parseString_s = QLatin1String("IMPLIED");-
5505 if (!parseString()) {
!parseString()Description
TRUEevaluated 334 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 61 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
61-334
5506 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5507 return false;
executed 334 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
334
5508 }-
5509 break;
executed 61 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
61
5510 case DefFix:
executed 21 times by 1 test: case DefFix:
Executed by:
  • tst_qxmlsimplereader - unknown status
21
5511 parseString_s = QLatin1String("FIXED");-
5512 if (!parseString()) {
!parseString()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
9-12
5513 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5514 return false;
executed 12 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
12
5515 }-
5516 break;
executed 9 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
9
5517 case Attval:
executed 207 times by 1 test: case Attval:
Executed by:
  • tst_qxmlsimplereader - unknown status
207
5518 if (!parseAttValue()) {
!parseAttValue()Description
TRUEevaluated 127 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 80 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
80-127
5519 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5520 return false;
executed 127 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
127
5521 }-
5522 break;
executed 80 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
80
5523 case Ws4:
executed 607 times by 1 test: case Ws4:
Executed by:
  • tst_qxmlsimplereader - unknown status
607
5524 if (declHnd) {
declHndDescription
TRUEevaluated 607 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-607
5525 // ### not all values are computed yet...-
5526 if (!declHnd->attributeDecl(attDeclEName, attDeclAName, QLatin1String(""), QLatin1String(""), QLatin1String(""))) {
!declHnd->attr...in1String(""))Description
TRUEnever evaluated
FALSEevaluated 607 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-607
5527 reportParseError(declHnd->errorString());-
5528 return false;
never executed: return false;
0
5529 }-
5530 }
executed 607 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
607
5531 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 35 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 572 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
35-572
5532 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state);-
5533 return false;
executed 35 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
35
5534 }-
5535 break;
executed 572 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
572
5536 case Done:
executed 536 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
536
5537 next();-
5538 break;
executed 536 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
536
5539 }-
5540 }
executed 4279 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4279
5541 return false;
never executed: return false;
0
5542}-
5543-
5544/*-
5545 Parse a AttType [54]-
5546*/-
5547bool QXmlSimpleReaderPrivate::parseAttType()-
5548{-
5549 const signed char Init = 0;-
5550 const signed char ST = 1; // StringType-
5551 const signed char TTI = 2; // TokenizedType starting with 'I'-
5552 const signed char TTI2 = 3; // TokenizedType helpstate-
5553 const signed char TTI3 = 4; // TokenizedType helpstate-
5554 const signed char TTE = 5; // TokenizedType starting with 'E'-
5555 const signed char TTEY = 6; // TokenizedType starting with 'ENTITY'-
5556 const signed char TTEI = 7; // TokenizedType starting with 'ENTITI'-
5557 const signed char N = 8; // N read (TokenizedType or Notation)-
5558 const signed char TTNM = 9; // TokenizedType starting with 'NM'-
5559 const signed char TTNM2 = 10; // TokenizedType helpstate-
5560 const signed char NO = 11; // Notation-
5561 const signed char NO2 = 12; // Notation helpstate-
5562 const signed char NO3 = 13; // Notation helpstate-
5563 const signed char NOName = 14; // Notation, read name-
5564 const signed char NO4 = 15; // Notation helpstate-
5565 const signed char EN = 16; // Enumeration-
5566 const signed char ENNmt = 17; // Enumeration, read Nmtoken-
5567 const signed char EN2 = 18; // Enumeration helpstate-
5568 const signed char ADone = 19; // almost done (make next and accept)-
5569 const signed char Done = 20;-
5570-
5571 const signed char InpWs = 0; // whitespace-
5572 const signed char InpOp = 1; // (-
5573 const signed char InpCp = 2; //)-
5574 const signed char InpPipe = 3; // |-
5575 const signed char InpC = 4; // C-
5576 const signed char InpE = 5; // E-
5577 const signed char InpI = 6; // I-
5578 const signed char InpM = 7; // M-
5579 const signed char InpN = 8; // N-
5580 const signed char InpO = 9; // O-
5581 const signed char InpR = 10; // R-
5582 const signed char InpS = 11; // S-
5583 const signed char InpY = 12; // Y-
5584 const signed char InpUnknown = 13;-
5585-
5586 static const signed char table[19][14] = {-
5587 /* InpWs InpOp InpCp InpPipe InpC InpE InpI InpM InpN InpO InpR InpS InpY InpUnknown */-
5588 { -1, EN, -1, -1, ST, TTE, TTI, -1, N, -1, -1, -1, -1, -1 }, // Init-
5589 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // ST-
5590 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI2, Done, Done, Done }, // TTI-
5591 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI3, Done, Done }, // TTI2-
5592 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTI3-
5593 { -1, -1, -1, -1, -1, -1, TTEI, -1, -1, -1, -1, -1, TTEY, -1 }, // TTE-
5594 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTEY-
5595 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTEI-
5596 { -1, -1, -1, -1, -1, -1, -1, TTNM, -1, NO, -1, -1, -1, -1 }, // N-
5597 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTNM2, Done, Done }, // TTNM-
5598 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTNM2-
5599 { NO2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NO-
5600 { -1, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NO2-
5601 { NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName }, // NO3-
5602 { NO4, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NOName-
5603 { -1, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NO4-
5604 { -1, -1, ENNmt, -1, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt }, // EN-
5605 { EN2, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // ENNmt-
5606 { -1, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } // EN2-
5607 };-
5608 signed char state;-
5609 signed char input;-
5610-
5611 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 78 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1519 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 540 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 979 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
78-1519
5612 state = Init;-
5613 } else {
executed 618 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
618
5614 state = parseStack->pop().state;-
5615#if defined(QT_QXML_DEBUG)-
5616 qDebug("QXmlSimpleReader: parseAttType (cont) in state %d", state);-
5617#endif-
5618 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 747 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 232 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
232-747
5619 ParseFunction function = parseStack->top().function;-
5620 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 721 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
26-721
5621 parseStack->pop();-
5622#if defined(QT_QXML_DEBUG)-
5623 qDebug("QXmlSimpleReader: eat_ws (cont)");-
5624#endif-
5625 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
26
5626 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 267 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 480 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
267-480
5627 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5628 return false;
executed 267 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
267
5629 }-
5630 }
executed 480 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
480
5631 }
executed 712 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
712
5632-
5633 for (;;) {-
5634 switch (state) {-
5635 case ADone:
executed 32 times by 1 test: case ADone:
Executed by:
  • tst_qxmlsimplereader - unknown status
32
5636 return true;
executed 32 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
32
5637 case Done:
executed 583 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
583
5638 return true;
executed 583 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
583
5639 case -1:
executed 3 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
5640 // Error-
5641 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
5642 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
5643 }-
5644-
5645 if (atEnd()) {
atEnd()Description
TRUEevaluated 232 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1533 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
232-1533
5646 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttType, state);-
5647 return false;
executed 232 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
232
5648 }-
5649 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 602 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 931 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
602-931
5650 input = InpWs;-
5651 } else if (c == QLatin1Char('(')) {
executed 602 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('(')Description
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 897 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
34-897
5652 input = InpOp;-
5653 } else if (c == QLatin1Char(')')) {
executed 34 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char(')')Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 865 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
32-865
5654 input = InpCp;-
5655 } else if (c == QLatin1Char('|')) {
executed 32 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('|')Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 844 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
21-844
5656 input = InpPipe;-
5657 } else if (c == QLatin1Char('C')) {
executed 21 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('C')Description
TRUEevaluated 472 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 372 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
21-472
5658 input = InpC;-
5659 } else if (c == QLatin1Char('E')) {
executed 472 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('E')Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 342 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
30-472
5660 input = InpE;-
5661 } else if (c == QLatin1Char('I')) {
executed 30 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('I')Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 302 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
30-302
5662 input = InpI;-
5663 } else if (c == QLatin1Char('M')) {
executed 40 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('M')Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 251 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
40-251
5664 input = InpM;-
5665 } else if (c == QLatin1Char('N')) {
executed 51 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('N')Description
TRUEevaluated 73 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 178 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
51-178
5666 input = InpN;-
5667 } else if (c == QLatin1Char('O')) {
executed 73 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('O')Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 157 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
21-157
5668 input = InpO;-
5669 } else if (c == QLatin1Char('R')) {
executed 21 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('R')Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 137 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-137
5670 input = InpR;-
5671 } else if (c == QLatin1Char('S')) {
executed 20 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('S')Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 77 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-77
5672 input = InpS;-
5673 } else if (c == QLatin1Char('Y')) {
executed 60 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('Y')Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 57 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-60
5674 input = InpY;-
5675 } else {
executed 20 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
20
5676 input = InpUnknown;-
5677 }
executed 57 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
57
5678 state = table[state][input];-
5679-
5680 switch (state) {-
5681 case ST:
executed 472 times by 1 test: case ST:
Executed by:
  • tst_qxmlsimplereader - unknown status
472
5682 parseString_s = QLatin1String("CDATA");-
5683 if (!parseString()) {
!parseString()Description
TRUEevaluated 324 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 148 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
148-324
5684 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5685 return false;
executed 324 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
324
5686 }-
5687 break;
executed 148 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
148
5688 case TTI:
executed 30 times by 1 test: case TTI:
Executed by:
  • tst_qxmlsimplereader - unknown status
30
5689 parseString_s = QLatin1String("ID");-
5690 if (!parseString()) {
!parseString()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
12-18
5691 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5692 return false;
executed 18 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
18
5693 }-
5694 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
12
5695 case TTI2:
executed 20 times by 1 test: case TTI2:
Executed by:
  • tst_qxmlsimplereader - unknown status
20
5696 parseString_s = QLatin1String("REF");-
5697 if (!parseString()) {
!parseString()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10
5698 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5699 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5700 }-
5701 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5702 case TTI3:
executed 10 times by 1 test: case TTI3:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5703 next(); // S-
5704 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5705 case TTE:
executed 30 times by 1 test: case TTE:
Executed by:
  • tst_qxmlsimplereader - unknown status
30
5706 parseString_s = QLatin1String("ENTIT");-
5707 if (!parseString()) {
!parseString()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
6-24
5708 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5709 return false;
executed 24 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
24
5710 }-
5711 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
5712 case TTEY:
executed 20 times by 1 test: case TTEY:
Executed by:
  • tst_qxmlsimplereader - unknown status
20
5713 next(); // Y-
5714 break;
executed 20 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
20
5715 case TTEI:
executed 10 times by 1 test: case TTEI:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5716 parseString_s = QLatin1String("IES");-
5717 if (!parseString()) {
!parseString()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
5
5718 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5719 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
5720 }-
5721 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
5722 case N:
executed 73 times by 1 test: case N:
Executed by:
  • tst_qxmlsimplereader - unknown status
73
5723 next(); // N-
5724 break;
executed 73 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
73
5725 case TTNM:
executed 51 times by 1 test: case TTNM:
Executed by:
  • tst_qxmlsimplereader - unknown status
51
5726 parseString_s = QLatin1String("MTOKEN");-
5727 if (!parseString()) {
!parseString()Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-40
5728 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5729 return false;
executed 40 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
40
5730 }-
5731 break;
executed 11 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
11
5732 case TTNM2:
executed 50 times by 1 test: case TTNM2:
Executed by:
  • tst_qxmlsimplereader - unknown status
50
5733 next(); // S-
5734 break;
executed 50 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
50
5735 case NO:
executed 21 times by 1 test: case NO:
Executed by:
  • tst_qxmlsimplereader - unknown status
21
5736 parseString_s = QLatin1String("OTATION");-
5737 if (!parseString()) {
!parseString()Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-17
5738 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5739 return false;
executed 17 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
17
5740 }-
5741 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
5742 case NO2:
executed 20 times by 1 test: case NO2:
Executed by:
  • tst_qxmlsimplereader - unknown status
20
5743 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
8-12
5744 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5745 return false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
5746 }-
5747 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
12
5748 case NO3:
executed 30 times by 1 test: case NO3:
Executed by:
  • tst_qxmlsimplereader - unknown status
30
5749 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-20
5750 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5751 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
5752 }-
5753 break;
executed 20 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
20
5754 case NOName:
executed 30 times by 1 test: case NOName:
Executed by:
  • tst_qxmlsimplereader - unknown status
30
5755 parseName_useRef = false;-
5756 if (!parseName()) {
!parseName()Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-19
5757 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5758 return false;
executed 11 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
11
5759 }-
5760 break;
executed 19 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
19
5761 case NO4:
never executed: case NO4:
0
5762 if (!eat_ws()) {
!eat_ws()Description
TRUEnever evaluated
FALSEnever evaluated
0
5763 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5764 return false;
never executed: return false;
0
5765 }-
5766 break;
never executed: break;
0
5767 case EN:
executed 24 times by 1 test: case EN:
Executed by:
  • tst_qxmlsimplereader - unknown status
24
5768 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
8-16
5769 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5770 return false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
5771 }-
5772 break;
executed 16 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
16
5773 case ENNmt:
executed 24 times by 1 test: case ENNmt:
Executed by:
  • tst_qxmlsimplereader - unknown status
24
5774 if (!parseNmtoken()) {
!parseNmtoken()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
5-19
5775 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5776 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
5777 }-
5778 break;
executed 19 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
19
5779 case EN2:
never executed: case EN2:
0
5780 if (!eat_ws()) {
!eat_ws()Description
TRUEnever evaluated
FALSEnever evaluated
0
5781 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state);-
5782 return false;
never executed: return false;
0
5783 }-
5784 break;
never executed: break;
0
5785 case ADone:
executed 32 times by 1 test: case ADone:
Executed by:
  • tst_qxmlsimplereader - unknown status
32
5786 next();-
5787 break;
executed 32 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
32
5788 }-
5789 }
executed 1053 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1053
5790 return false;
never executed: return false;
0
5791}-
5792-
5793/*-
5794 Parse a AttValue [10]-
5795-
5796 Precondition: the head stands on the beginning " or '-
5797-
5798 If this function was successful, the head stands on the first-
5799 character after the closing " or ' and the value of the attribute-
5800 is in string().-
5801*/-
5802bool QXmlSimpleReaderPrivate::parseAttValue()-
5803{-
5804 const signed char Init = 0;-
5805 const signed char Dq = 1; // double quotes were read-
5806 const signed char DqRef = 2; // read references in double quotes-
5807 const signed char DqC = 3; // signed character read in double quotes-
5808 const signed char Sq = 4; // single quotes were read-
5809 const signed char SqRef = 5; // read references in single quotes-
5810 const signed char SqC = 6; // signed character read in single quotes-
5811 const signed char Done = 7;-
5812-
5813 const signed char InpDq = 0; // "-
5814 const signed char InpSq = 1; // '-
5815 const signed char InpAmp = 2; // &-
5816 const signed char InpLt = 3; // <-
5817 const signed char InpUnknown = 4;-
5818-
5819 static const signed char table[7][5] = {-
5820 /* InpDq InpSq InpAmp InpLt InpUnknown */-
5821 { Dq, Sq, -1, -1, -1 }, // Init-
5822 { Done, DqC, DqRef, -1, DqC }, // Dq-
5823 { Done, DqC, DqRef, -1, DqC }, // DqRef-
5824 { Done, DqC, DqRef, -1, DqC }, // DqC-
5825 { SqC, Done, SqRef, -1, SqC }, // Sq-
5826 { SqC, Done, SqRef, -1, SqC }, // SqRef-
5827 { SqC, Done, SqRef, -1, SqC } // SqRef-
5828 };-
5829 signed char state;-
5830 signed char input;-
5831-
5832 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 12621 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1870 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 729 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1141 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
729-12621
5833 state = Init;-
5834 } else {
executed 13350 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13350
5835 state = parseStack->pop().state;-
5836#if defined(QT_QXML_DEBUG)-
5837 qDebug("QXmlSimpleReader: parseAttValue (cont) in state %d", state);-
5838#endif-
5839 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 948 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
193-948
5840 ParseFunction function = parseStack->top().function;-
5841 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-193
5842 parseStack->pop();-
5843#if defined(QT_QXML_DEBUG)-
5844 qDebug("QXmlSimpleReader: eat_ws (cont)");-
5845#endif-
5846 }
never executed: end of block
0
5847 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 69 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 124 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
69-124
5848 parseFailed(&QXmlSimpleReaderPrivate::parseAttValue, state);-
5849 return false;
executed 69 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
69
5850 }-
5851 }
executed 124 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
124
5852 }
executed 1072 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1072
5853-
5854 for (;;) {-
5855 switch (state) {-
5856 case Done:
executed 13332 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13332
5857 return true;
executed 13332 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13332
5858 case -1:
executed 6 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
6
5859 // Error-
5860 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
5861 return false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
5862 }-
5863-
5864 if (atEnd()) {
atEnd()Description
TRUEevaluated 949 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 187156 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
949-187156
5865 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttValue, state);-
5866 return false;
executed 949 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
949
5867 }-
5868 if (c == QLatin1Char('"')) {
c == QLatin1Char('"')Description
TRUEevaluated 26529 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 160627 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
26529-160627
5869 input = InpDq;-
5870 } else if (c == QLatin1Char('\'')) {
executed 26529 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('\'')Description
TRUEevaluated 296 times by 4 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 160331 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
296-160331
5871 input = InpSq;-
5872 } else if (c == QLatin1Char('&')) {
executed 296 times by 4 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('&')Description
TRUEevaluated 258 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 160073 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
258-160073
5873 input = InpAmp;-
5874 } else if (c == QLatin1Char('<')) {
executed 258 times by 2 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('<')Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 160068 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
5-160068
5875 input = InpLt;-
5876 } else {
executed 5 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
5
5877 input = InpUnknown;-
5878 }
executed 160068 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
160068
5879 state = table[state][input];-
5880-
5881 switch (state) {-
5882 case Dq:
executed 13272 times by 5 tests: case Dq:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13272
5883 case Sq:
executed 77 times by 3 tests: case Sq:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
77
5884 stringClear();-
5885 next();-
5886 break;
executed 13349 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13349
5887 case DqRef:
executed 257 times by 2 tests: case DqRef:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
257
5888 case SqRef:
executed 1 time by 1 test: case SqRef:
Executed by:
  • tst_qxmlsimplereader - unknown status
1
5889 parseReference_context = InAttributeValue;-
5890 if (!parseReference()) {
!parseReference()Description
TRUEevaluated 135 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 123 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
123-135
5891 parseFailed(&QXmlSimpleReaderPrivate::parseAttValue, state);-
5892 return false;
executed 135 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
135
5893 }-
5894 break;
executed 123 times by 2 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
123
5895 case DqC:
executed 159958 times by 5 tests: case DqC:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
159958
5896 case SqC:
executed 253 times by 3 tests: case SqC:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
253
5897 stringAddC();-
5898 next();-
5899 break;
executed 160211 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
160211
5900 case Done:
executed 13332 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13332
5901 next();-
5902 break;
executed 13332 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13332
5903 }-
5904 }
executed 187021 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
187021
5905 return false;
never executed: return false;
0
5906}-
5907-
5908/*-
5909 Parse a elementdecl [45].-
5910-
5911 Precondition: the beginning '<!E' is already read and the head-
5912 stands on the 'L' of '<!ELEMENT'-
5913*/-
5914bool QXmlSimpleReaderPrivate::parseElementDecl()-
5915{-
5916 const signed char Init = 0;-
5917 const signed char Elem = 1; // parse the beginning string-
5918 const signed char Ws1 = 2; // whitespace required-
5919 const signed char Nam = 3; // parse Name-
5920 const signed char Ws2 = 4; // whitespace required-
5921 const signed char Empty = 5; // read EMPTY-
5922 const signed char Any = 6; // read ANY-
5923 const signed char Cont = 7; // read contentspec (except ANY or EMPTY)-
5924 const signed char Mix = 8; // read Mixed-
5925 const signed char Mix2 = 9; //-
5926 const signed char Mix3 = 10; //-
5927 const signed char MixN1 = 11; //-
5928 const signed char MixN2 = 12; //-
5929 const signed char MixN3 = 13; //-
5930 const signed char MixN4 = 14; //-
5931 const signed char Cp = 15; // parse cp-
5932 const signed char Cp2 = 16; //-
5933 const signed char WsD = 17; // eat whitespace before Done-
5934 const signed char Done = 18;-
5935-
5936 const signed char InpWs = 0;-
5937 const signed char InpGt = 1; // >-
5938 const signed char InpPipe = 2; // |-
5939 const signed char InpOp = 3; // (-
5940 const signed char InpCp = 4; //)-
5941 const signed char InpHash = 5; // #-
5942 const signed char InpQm = 6; // ?-
5943 const signed char InpAst = 7; // *-
5944 const signed char InpPlus = 8; // +-
5945 const signed char InpA = 9; // A-
5946 const signed char InpE = 10; // E-
5947 const signed char InpL = 11; // L-
5948 const signed char InpUnknown = 12;-
5949-
5950 static const signed char table[18][13] = {-
5951 /* InpWs InpGt InpPipe InpOp InpCp InpHash InpQm InpAst InpPlus InpA InpE InpL InpUnknown */-
5952 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, Elem, -1 }, // Init-
5953 { Ws1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Elem-
5954 { -1, -1, -1, -1, -1, -1, -1, -1, -1, Nam, Nam, Nam, Nam }, // Ws1-
5955 { Ws2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Nam-
5956 { -1, -1, -1, Cont, -1, -1, -1, -1, -1, Any, Empty, -1, -1 }, // Ws2-
5957 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Empty-
5958 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Any-
5959 { -1, -1, -1, Cp, Cp, Mix, -1, -1, -1, Cp, Cp, Cp, Cp }, // Cont-
5960 { Mix2, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, // Mix-
5961 { -1, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, // Mix2-
5962 { WsD, Done, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, // Mix3-
5963 { -1, -1, -1, -1, -1, -1, -1, -1, -1, MixN2, MixN2, MixN2, MixN2 }, // MixN1-
5964 { MixN3, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, // MixN2-
5965 { -1, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, // MixN3-
5966 { -1, -1, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, // MixN4-
5967 { WsD, Done, -1, -1, -1, -1, Cp2, Cp2, Cp2, -1, -1, -1, -1 }, // Cp-
5968 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Cp2-
5969 { -1, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } // WsD-
5970 };-
5971 signed char state;-
5972 signed char input;-
5973-
5974 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 218 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9563 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1364 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8199 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
218-9563
5975 state = Init;-
5976 } else {
executed 1582 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1582
5977 state = parseStack->pop().state;-
5978#if defined(QT_QXML_DEBUG)-
5979 qDebug("QXmlSimpleReader: parseElementDecl (cont) in state %d", state);-
5980#endif-
5981 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 6984 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1215 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1215-6984
5982 ParseFunction function = parseStack->top().function;-
5983 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 1242 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5742 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1242-5742
5984 parseStack->pop();-
5985#if defined(QT_QXML_DEBUG)-
5986 qDebug("QXmlSimpleReader: eat_ws (cont)");-
5987#endif-
5988 }
executed 1242 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1242
5989 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 2455 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4529 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2455-4529
5990 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
5991 return false;
executed 2455 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2455
5992 }-
5993 }
executed 4529 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
4529
5994 }
executed 5744 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
5744
5995-
5996 for (;;) {-
5997 switch (state) {-
5998 case Done:
executed 1561 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
1561
5999 return true;
executed 1561 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
1561
6000 case -1:
executed 12 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6001 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
6002 return false;
executed 12 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6003 }-
6004-
6005 if (atEnd()) {
atEnd()Description
TRUEevaluated 1215 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12237 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1215-12237
6006 unexpectedEof(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6007 return false;
executed 1215 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1215
6008 }-
6009 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 3168 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9069 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3168-9069
6010 input = InpWs;-
6011 } else if (c == QLatin1Char('>')) {
executed 3168 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 1561 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 7508 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1561-7508
6012 input = InpGt;-
6013 } else if (c == QLatin1Char('|')) {
executed 1561 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('|')Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 7496 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
12-7496
6014 input = InpPipe;-
6015 } else if (c == QLatin1Char('(')) {
executed 12 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('(')Description
TRUEevaluated 1448 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6048 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
12-6048
6016 input = InpOp;-
6017 } else if (c == QLatin1Char(')')) {
executed 1448 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char(')')Description
TRUEevaluated 1247 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4801 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1247-4801
6018 input = InpCp;-
6019 } else if (c == QLatin1Char('#')) {
executed 1247 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('#')Description
TRUEevaluated 1247 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3554 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1247-3554
6020 input = InpHash;-
6021 } else if (c == QLatin1Char('?')) {
executed 1247 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('?')Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3551 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-3551
6022 input = InpQm;-
6023 } else if (c == QLatin1Char('*')) {
executed 3 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('*')Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3519 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-3519
6024 input = InpAst;-
6025 } else if (c == QLatin1Char('+')) {
executed 32 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('+')Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3507 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
12-3507
6026 input = InpPlus;-
6027 } else if (c == QLatin1Char('A')) {
executed 12 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('A')Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3477 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
12-3477
6028 input = InpA;-
6029 } else if (c == QLatin1Char('E')) {
executed 30 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('E')Description
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3373 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
30-3373
6030 input = InpE;-
6031 } else if (c == QLatin1Char('L')) {
executed 104 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('L')Description
TRUEevaluated 1582 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1791 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
104-1791
6032 input = InpL;-
6033 } else {
executed 1582 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1582
6034 input = InpUnknown;-
6035 }
executed 1791 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1791
6036 state = table[state][input];-
6037-
6038 switch (state) {-
6039 case Elem:
executed 1582 times by 1 test: case Elem:
Executed by:
  • tst_qxmlsimplereader - unknown status
1582
6040 parseString_s = QLatin1String("LEMENT");-
6041 if (!parseString()) {
!parseString()Description
TRUEevaluated 1199 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 383 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
383-1199
6042 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6043 return false;
executed 1199 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1199
6044 }-
6045 break;
executed 383 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
383
6046 case Ws1:
executed 1582 times by 1 test: case Ws1:
Executed by:
  • tst_qxmlsimplereader - unknown status
1582
6047 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 465 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1117 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
465-1117
6048 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6049 return false;
executed 465 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
465
6050 }-
6051 break;
executed 1117 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1117
6052 case Nam:
executed 1582 times by 1 test: case Nam:
Executed by:
  • tst_qxmlsimplereader - unknown status
1582
6053 parseName_useRef = false;-
6054 if (!parseName()) {
!parseName()Description
TRUEevaluated 961 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 621 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
621-961
6055 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6056 return false;
executed 961 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
961
6057 }-
6058 break;
executed 621 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
621
6059 case Ws2:
executed 1581 times by 1 test: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
1581
6060 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 254 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1327 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
254-1327
6061 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6062 return false;
executed 254 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
254
6063 }-
6064 break;
executed 1327 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1327
6065 case Empty:
executed 104 times by 1 test: case Empty:
Executed by:
  • tst_qxmlsimplereader - unknown status
104
6066 parseString_s = QLatin1String("EMPTY");-
6067 if (!parseString()) {
!parseString()Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 39 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
39-65
6068 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6069 return false;
executed 65 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
65
6070 }-
6071 break;
executed 39 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
39
6072 case Any:
executed 30 times by 1 test: case Any:
Executed by:
  • tst_qxmlsimplereader - unknown status
30
6073 parseString_s = QLatin1String("ANY");-
6074 if (!parseString()) {
!parseString()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
14-16
6075 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6076 return false;
executed 16 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
16
6077 }-
6078 break;
executed 14 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
14
6079 case Cont:
executed 1444 times by 1 test: case Cont:
Executed by:
  • tst_qxmlsimplereader - unknown status
1444
6080 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 513 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 931 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
513-931
6081 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6082 return false;
executed 513 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
513
6083 }-
6084 break;
executed 931 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
931
6085 case Mix:
executed 1247 times by 1 test: case Mix:
Executed by:
  • tst_qxmlsimplereader - unknown status
1247
6086 parseString_s = QLatin1String("#PCDATA");-
6087 if (!parseString()) {
!parseString()Description
TRUEevaluated 964 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 283 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
283-964
6088 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6089 return false;
executed 964 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
964
6090 }-
6091 break;
executed 283 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
283
6092 case Mix2:
executed 2 times by 1 test: case Mix2:
Executed by:
  • tst_qxmlsimplereader - unknown status
2
6093 if (!eat_ws()) {
!eat_ws()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-2
6094 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6095 return false;
never executed: return false;
0
6096 }-
6097 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
6098 case Mix3:
executed 1235 times by 1 test: case Mix3:
Executed by:
  • tst_qxmlsimplereader - unknown status
1235
6099 next();-
6100 break;
executed 1235 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1235
6101 case MixN1:
executed 12 times by 1 test: case MixN1:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6102 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
5-7
6103 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6104 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
6105 }-
6106 break;
executed 7 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
7
6107 case MixN2:
executed 11 times by 1 test: case MixN2:
Executed by:
  • tst_qxmlsimplereader - unknown status
11
6108 parseName_useRef = false;-
6109 if (!parseName()) {
!parseName()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-10
6110 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6111 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6112 }-
6113 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
6114 case MixN3:
never executed: case MixN3:
0
6115 if (!eat_ws()) {
!eat_ws()Description
TRUEnever evaluated
FALSEnever evaluated
0
6116 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6117 return false;
never executed: return false;
0
6118 }-
6119 break;
never executed: break;
0
6120 case MixN4:
executed 10 times by 1 test: case MixN4:
Executed by:
  • tst_qxmlsimplereader - unknown status
10
6121 next();-
6122 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
6123 case Cp:
executed 197 times by 1 test: case Cp:
Executed by:
  • tst_qxmlsimplereader - unknown status
197
6124 if (!parseChoiceSeq()) {
!parseChoiceSeq()Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 103 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
94-103
6125 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6126 return false;
executed 94 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
94
6127 }-
6128 break;
executed 103 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
103
6129 case Cp2:
executed 32 times by 1 test: case Cp2:
Executed by:
  • tst_qxmlsimplereader - unknown status
32
6130 next();-
6131 break;
executed 32 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
32
6132 case WsD:
executed 13 times by 1 test: case WsD:
Executed by:
  • tst_qxmlsimplereader - unknown status
13
6133 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-12
6134 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state);-
6135 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6136 }-
6137 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6138 case Done:
executed 1561 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
1561
6139 next();-
6140 break;
executed 1561 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1561
6141 }-
6142 }
executed 7699 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
7699
6143 return false;
never executed: return false;
0
6144}-
6145-
6146/*-
6147 Parse a NotationDecl [82].-
6148-
6149 Precondition: the beginning '<!' is already read and the head-
6150 stands on the 'N' of '<!NOTATION'-
6151*/-
6152bool QXmlSimpleReaderPrivate::parseNotationDecl()-
6153{-
6154 const signed char Init = 0;-
6155 const signed char Not = 1; // read NOTATION-
6156 const signed char Ws1 = 2; // eat whitespaces-
6157 const signed char Nam = 3; // read Name-
6158 const signed char Ws2 = 4; // eat whitespaces-
6159 const signed char ExtID = 5; // parse ExternalID-
6160 const signed char ExtIDR = 6; // same as ExtID, but already reported-
6161 const signed char Ws3 = 7; // eat whitespaces-
6162 const signed char Done = 8;-
6163-
6164 const signed char InpWs = 0;-
6165 const signed char InpGt = 1; // >-
6166 const signed char InpN = 2; // N-
6167 const signed char InpUnknown = 3;-
6168-
6169 static const signed char table[8][4] = {-
6170 /* InpWs InpGt InpN InpUnknown */-
6171 { -1, -1, Not, -1 }, // Init-
6172 { Ws1, -1, -1, -1 }, // Not-
6173 { -1, -1, Nam, Nam }, // Ws1-
6174 { Ws2, Done, -1, -1 }, // Nam-
6175 { -1, Done, ExtID, ExtID }, // Ws2-
6176 { Ws3, Done, -1, -1 }, // ExtID-
6177 { Ws3, Done, -1, -1 }, // ExtIDR-
6178 { -1, Done, -1, -1 } // Ws3-
6179 };-
6180 signed char state;-
6181 signed char input;-
6182-
6183 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 536 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 491 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
9-536
6184 state = Init;-
6185 } else {
executed 54 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6186 state = parseStack->pop().state;-
6187#if defined(QT_QXML_DEBUG)-
6188 qDebug("QXmlSimpleReader: parseNotationDecl (cont) in state %d", state);-
6189#endif-
6190 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 472 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
19-472
6191 ParseFunction function = parseStack->top().function;-
6192 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 442 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
30-442
6193 parseStack->pop();-
6194#if defined(QT_QXML_DEBUG)-
6195 qDebug("QXmlSimpleReader: eat_ws (cont)");-
6196#endif-
6197 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
30
6198 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 333 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 139 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
139-333
6199 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6200 return false;
executed 333 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
333
6201 }-
6202 }
executed 139 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
139
6203 }
executed 158 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
158
6204-
6205 for (;;) {-
6206 switch (state) {-
6207 case ExtID:
executed 54 times by 1 test: case ExtID:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6208 // call the handler-
6209 if (dtdHnd) {
dtdHndDescription
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-54
6210 if (!dtdHnd->notationDecl(name(), publicId, systemId)) {
!dtdHnd->notat...cId, systemId)Description
TRUEnever evaluated
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-54
6211 reportParseError(dtdHnd->errorString());-
6212 return false;
never executed: return false;
0
6213 }-
6214 }
executed 54 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6215 state = ExtIDR;-
6216 break;
executed 54 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6217 case Done:
executed 54 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6218 return true;
executed 54 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6219 case -1:
never executed: case -1:
0
6220 // Error-
6221 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
6222 return false;
never executed: return false;
0
6223 }-
6224-
6225 if (atEnd()) {
atEnd()Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 324 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
19-324
6226 unexpectedEof(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6227 return false;
executed 19 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
19
6228 }-
6229 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 108 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 216 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
108-216
6230 input = InpWs;-
6231 } else if (c == QLatin1Char('>')) {
executed 108 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 162 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
54-162
6232 input = InpGt;-
6233 } else if (c == QLatin1Char('N')) {
executed 54 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('N')Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
54-108
6234 input = InpN;-
6235 } else {
executed 54 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6236 input = InpUnknown;-
6237 }
executed 108 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
108
6238 state = table[state][input];-
6239-
6240 switch (state) {-
6241 case Not:
executed 54 times by 1 test: case Not:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6242 parseString_s = QLatin1String("NOTATION");-
6243 if (!parseString()) {
!parseString()Description
TRUEevaluated 43 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
11-43
6244 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6245 return false;
executed 43 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
43
6246 }-
6247 break;
executed 11 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
11
6248 case Ws1:
executed 54 times by 1 test: case Ws1:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6249 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
16-38
6250 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6251 return false;
executed 16 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
16
6252 }-
6253 break;
executed 38 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
38
6254 case Nam:
executed 54 times by 1 test: case Nam:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6255 parseName_useRef = false;-
6256 if (!parseName()) {
!parseName()Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
21-33
6257 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6258 return false;
executed 21 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
21
6259 }-
6260 break;
executed 33 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
33
6261 case Ws2:
executed 54 times by 1 test: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6262 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
14-40
6263 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6264 return false;
executed 14 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
14
6265 }-
6266 break;
executed 40 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
40
6267 case ExtID:
executed 54 times by 1 test: case ExtID:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6268 case ExtIDR:
never executed: case ExtIDR:
0
6269 parseExternalID_allowPublicID = true;-
6270 if (!parseExternalID()) {
!parseExternalID()Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
9-45
6271 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6272 return false;
executed 45 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
45
6273 }-
6274 break;
executed 9 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
9
6275 case Ws3:
never executed: case Ws3:
0
6276 if (!eat_ws()) {
!eat_ws()Description
TRUEnever evaluated
FALSEnever evaluated
0
6277 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state);-
6278 return false;
never executed: return false;
0
6279 }-
6280 break;
never executed: break;
0
6281 case Done:
executed 54 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6282 next();-
6283 break;
executed 54 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6284 }-
6285 }
executed 185 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
185
6286 return false;
never executed: return false;
0
6287}-
6288-
6289/*-
6290 Parse choice [49] or seq [50].-
6291-
6292 Precondition: the beginning '('S? is already read and the head-
6293 stands on the first non-whitespace character after it.-
6294*/-
6295bool QXmlSimpleReaderPrivate::parseChoiceSeq()-
6296{-
6297 const signed char Init = 0;-
6298 const signed char Ws1 = 1; // eat whitespace-
6299 const signed char CoS = 2; // choice or set-
6300 const signed char Ws2 = 3; // eat whitespace-
6301 const signed char More = 4; // more cp to read-
6302 const signed char Name = 5; // read name-
6303 const signed char Done = 6; //-
6304-
6305 const signed char InpWs = 0; // S-
6306 const signed char InpOp = 1; // (-
6307 const signed char InpCp = 2; //)-
6308 const signed char InpQm = 3; // ?-
6309 const signed char InpAst = 4; // *-
6310 const signed char InpPlus = 5; // +-
6311 const signed char InpPipe = 6; // |-
6312 const signed char InpComm = 7; // ,-
6313 const signed char InpUnknown = 8;-
6314-
6315 static const signed char table[6][9] = {-
6316 /* InpWs InpOp InpCp InpQm InpAst InpPlus InpPipe InpComm InpUnknown */-
6317 { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, // Init-
6318 { -1, CoS, -1, -1, -1, -1, -1, -1, CoS }, // Ws1-
6319 { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 }, // CS-
6320 { -1, -1, Done, -1, -1, -1, More, More, -1 }, // Ws2-
6321 { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, // More (same as Init)-
6322 { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 } // Name (same as CS)-
6323 };-
6324 signed char state;-
6325 signed char input;-
6326-
6327 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 294 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 162 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
41-294
6328 state = Init;-
6329 } else {
executed 203 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
203
6330 state = parseStack->pop().state;-
6331#if defined(QT_QXML_DEBUG)-
6332 qDebug("QXmlSimpleReader: parseChoiceSeq (cont) in state %d", state);-
6333#endif-
6334 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 132 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-132
6335 ParseFunction function = parseStack->top().function;-
6336 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 59 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 73 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
59-73
6337 parseStack->pop();-
6338#if defined(QT_QXML_DEBUG)-
6339 qDebug("QXmlSimpleReader: eat_ws (cont)");-
6340#endif-
6341 }
executed 59 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
59
6342 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 118 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
14-118
6343 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6344 return false;
executed 14 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
14
6345 }-
6346 }
executed 118 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
118
6347 }
executed 118 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
118
6348-
6349 for (;;) {-
6350 switch (state) {-
6351 case Done:
executed 193 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
193
6352 return true;
executed 193 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
193
6353 case -1:
executed 4 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
4
6354 // Error-
6355 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
6356 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
6357 }-
6358-
6359 if (atEnd()) {
atEnd()Description
TRUEnever evaluated
FALSEevaluated 623 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-623
6360 unexpectedEof(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6361 return false;
never executed: return false;
0
6362 }-
6363 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 599 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
24-599
6364 input = InpWs;-
6365 } else if (c == QLatin1Char('(')) {
executed 24 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('(')Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 593 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
6-593
6366 input = InpOp;-
6367 } else if (c == QLatin1Char(')')) {
executed 6 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char(')')Description
TRUEevaluated 194 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 399 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
6-399
6368 input = InpCp;-
6369 } else if (c == QLatin1Char('?')) {
executed 194 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('?')Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 385 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
14-385
6370 input = InpQm;-
6371 } else if (c == QLatin1Char('*')) {
executed 14 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('*')Description
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 303 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
14-303
6372 input = InpAst;-
6373 } else if (c == QLatin1Char('+')) {
executed 82 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('+')Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 301 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-301
6374 input = InpPlus;-
6375 } else if (c == QLatin1Char('|')) {
executed 2 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('|')Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 278 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-278
6376 input = InpPipe;-
6377 } else if (c == QLatin1Char(',')) {
executed 23 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char(',')Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 252 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
23-252
6378 input = InpComm;-
6379 } else {
executed 26 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
26
6380 input = InpUnknown;-
6381 }
executed 252 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
252
6382 state = table[state][input];-
6383-
6384 switch (state) {-
6385 case Ws1:
executed 6 times by 1 test: case Ws1:
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6386 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-6
6387 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6388 return false;
never executed: return false;
0
6389 }-
6390 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6391 case CoS:
executed 6 times by 1 test: case CoS:
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6392 if (!parseChoiceSeq()) {
!parseChoiceSeq()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-5
6393 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6394 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6395 }-
6396 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
6397 case Ws2:
executed 120 times by 1 test: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
120
6398 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 82 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
38-82
6399 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6400 return false;
executed 38 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
38
6401 }-
6402 break;
executed 82 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
82
6403 case More:
executed 49 times by 1 test: case More:
Executed by:
  • tst_qxmlsimplereader - unknown status
49
6404 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
17-32
6405 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6406 return false;
executed 17 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
17
6407 }-
6408 break;
executed 32 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
32
6409 case Name:
executed 245 times by 1 test: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
245
6410 parseName_useRef = false;-
6411 if (!parseName()) {
!parseName()Description
TRUEevaluated 68 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 177 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
68-177
6412 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state);-
6413 return false;
executed 68 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
68
6414 }-
6415 break;
executed 177 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
177
6416 case Done:
executed 193 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
193
6417 next();-
6418 break;
executed 193 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
193
6419 }-
6420 }
executed 499 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
499
6421 return false;
never executed: return false;
0
6422}-
6423-
6424bool QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(QString *errorMessage)-
6425{-
6426 QString entityNameBuffer;-
6427-
6428 // For every entity, check how many times all entity names were referenced in its value.-
6429 for (QMap<QString,QString>::const_iterator toSearchIt = entities.constBegin();-
6430 toSearchIt != entities.constEnd();
toSearchIt != ...ies.constEnd()Description
TRUEevaluated 145 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 321 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
145-321
6431 ++toSearchIt) {-
6432 const QString &toSearch = toSearchIt.key();-
6433-
6434 // Don't check the same entities twice.-
6435 if (!literalEntitySizes.contains(toSearch)) {
!literalEntity...ains(toSearch)Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 55 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
55-90
6436 // The amount of characters that weren't entity names, but literals, like 'X'.-
6437 QString leftOvers = entities.value(toSearch);-
6438 // How many times was entityName referenced by toSearch?-
6439 for (QMap<QString,QString>::const_iterator referencedIt = entities.constBegin();-
6440 referencedIt != entities.constEnd();
referencedIt !...ies.constEnd()Description
TRUEevaluated 145 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 90 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
90-145
6441 ++referencedIt) {-
6442 const QString &entityName = referencedIt.key();-
6443-
6444 for (int i = 0; i < leftOvers.size() && i != -1; ) {
i < leftOvers.size()Description
TRUEevaluated 350 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
i != -1Description
TRUEevaluated 207 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 143 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-350
6445 entityNameBuffer = QLatin1Char('&') + entityName + QLatin1Char(';');-
6446-
6447 i = leftOvers.indexOf(entityNameBuffer, i);-
6448 if (i != -1) {
i != -1Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 143 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
64-143
6449 leftOvers.remove(i, entityName.size() + 2);-
6450 // The entityName we're currently trying to find was matched in this string; increase our count.-
6451 ++referencesToOtherEntities[toSearch][entityName];-
6452 }
executed 64 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
64
6453 }
executed 207 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
207
6454 }
executed 145 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
145
6455 literalEntitySizes[toSearch] = leftOvers.size();-
6456 }
executed 90 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
90
6457 }
executed 145 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
145
6458-
6459 for (QHash<QString, QHash<QString, int> >::const_iterator entityIt = referencesToOtherEntities.constBegin();-
6460 entityIt != referencesToOtherEntities.constEnd();
entityIt != re...ies.constEnd()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 320 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-320
6461 ++entityIt) {-
6462 const QString &entity = entityIt.key();-
6463-
6464 QHash<QString, int>::iterator expandedIt = expandedSizes.find(entity);-
6465 if (expandedIt == expandedSizes.end()) {
expandedIt == ...dedSizes.end()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1
6466 expandedIt = expandedSizes.insert(entity, literalEntitySizes.value(entity));-
6467 for (QHash<QString, int>::const_iterator referenceIt = entityIt->constBegin();-
6468 referenceIt != entityIt->constEnd();
referenceIt !=...It->constEnd()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1
6469 ++referenceIt) {-
6470 const QString &referenceTo = referenceIt.key();-
6471 const int references = referencesToOtherEntities.value(entity).value(referenceTo);-
6472 // The total size of an entity's value is the expanded size of all of its referenced entities, plus its literal size.-
6473 *expandedIt += expandedSizes.value(referenceTo) * references + literalEntitySizes.value(referenceTo) * references;-
6474 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6475-
6476 if (*expandedIt > entityCharacterLimit) {
*expandedIt > ...CharacterLimitDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1
6477 if (errorMessage) {
errorMessageDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1
6478 *errorMessage = QString::fromLatin1("The XML entity \"%1\" expands to a string that is too large to process (%2 characters > %3).")-
6479 .arg(entity, QString::number(*expandedIt), QString::number(entityCharacterLimit));-
6480 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6481 return true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6482 }-
6483 }
never executed: end of block
0
6484 }
never executed: end of block
0
6485 return false;
executed 320 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
320
6486}-
6487-
6488/*-
6489 Parse a EntityDecl [70].-
6490-
6491 Precondition: the beginning '<!E' is already read and the head-
6492 stand on the 'N' of '<!ENTITY'-
6493*/-
6494bool QXmlSimpleReaderPrivate::parseEntityDecl()-
6495{-
6496 const signed char Init = 0;-
6497 const signed char Ent = 1; // parse "ENTITY"-
6498 const signed char Ws1 = 2; // white space read-
6499 const signed char Name = 3; // parse name-
6500 const signed char Ws2 = 4; // white space read-
6501 const signed char EValue = 5; // parse entity value-
6502 const signed char EValueR = 6; // same as EValue, but already reported-
6503 const signed char ExtID = 7; // parse ExternalID-
6504 const signed char Ws3 = 8; // white space read-
6505 const signed char Ndata = 9; // parse "NDATA"-
6506 const signed char Ws4 = 10; // white space read-
6507 const signed char NNam = 11; // parse name-
6508 const signed char NNamR = 12; // same as NNam, but already reported-
6509 const signed char PEDec = 13; // parse PEDecl-
6510 const signed char Ws6 = 14; // white space read-
6511 const signed char PENam = 15; // parse name-
6512 const signed char Ws7 = 16; // white space read-
6513 const signed char PEVal = 17; // parse entity value-
6514 const signed char PEValR = 18; // same as PEVal, but already reported-
6515 const signed char PEEID = 19; // parse ExternalID-
6516 const signed char PEEIDR = 20; // same as PEEID, but already reported-
6517 const signed char WsE = 21; // white space read-
6518 const signed char Done = 22;-
6519 const signed char EDDone = 23; // done, but also report an external, unparsed entity decl-
6520-
6521 const signed char InpWs = 0; // white space-
6522 const signed char InpPer = 1; // %-
6523 const signed char InpQuot = 2; // " or '-
6524 const signed char InpGt = 3; // >-
6525 const signed char InpN = 4; // N-
6526 const signed char InpUnknown = 5;-
6527-
6528 static const signed char table[22][6] = {-
6529 /* InpWs InpPer InpQuot InpGt InpN InpUnknown */-
6530 { -1, -1, -1, -1, Ent, -1 }, // Init-
6531 { Ws1, -1, -1, -1, -1, -1 }, // Ent-
6532 { -1, PEDec, -1, -1, Name, Name }, // Ws1-
6533 { Ws2, -1, -1, -1, -1, -1 }, // Name-
6534 { -1, -1, EValue, -1, -1, ExtID }, // Ws2-
6535 { WsE, -1, -1, Done, -1, -1 }, // EValue-
6536 { WsE, -1, -1, Done, -1, -1 }, // EValueR-
6537 { Ws3, -1, -1, EDDone,-1, -1 }, // ExtID-
6538 { -1, -1, -1, EDDone,Ndata, -1 }, // Ws3-
6539 { Ws4, -1, -1, -1, -1, -1 }, // Ndata-
6540 { -1, -1, -1, -1, NNam, NNam }, // Ws4-
6541 { WsE, -1, -1, Done, -1, -1 }, // NNam-
6542 { WsE, -1, -1, Done, -1, -1 }, // NNamR-
6543 { Ws6, -1, -1, -1, -1, -1 }, // PEDec-
6544 { -1, -1, -1, -1, PENam, PENam }, // Ws6-
6545 { Ws7, -1, -1, -1, -1, -1 }, // PENam-
6546 { -1, -1, PEVal, -1, -1, PEEID }, // Ws7-
6547 { WsE, -1, -1, Done, -1, -1 }, // PEVal-
6548 { WsE, -1, -1, Done, -1, -1 }, // PEValR-
6549 { WsE, -1, -1, Done, -1, -1 }, // PEEID-
6550 { WsE, -1, -1, Done, -1, -1 }, // PEEIDR-
6551 { -1, -1, -1, Done, -1, -1 } // WsE-
6552 };-
6553 signed char state;-
6554 signed char input;-
6555-
6556 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 145 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3893 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 522 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3371 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
145-3893
6557 state = Init;-
6558 } else {
executed 667 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
667
6559 state = parseStack->pop().state;-
6560#if defined(QT_QXML_DEBUG)-
6561 qDebug("QXmlSimpleReader: parseEntityDecl (cont) in state %d", state);-
6562#endif-
6563 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 3026 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 345 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
345-3026
6564 ParseFunction function = parseStack->top().function;-
6565 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 431 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2595 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
431-2595
6566 parseStack->pop();-
6567#if defined(QT_QXML_DEBUG)-
6568 qDebug("QXmlSimpleReader: eat_ws (cont)");-
6569#endif-
6570 }
executed 431 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
431
6571 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 1549 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1477 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1477-1549
6572 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6573 return false;
executed 1549 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1549
6574 }-
6575 }
executed 1477 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1477
6576 }
executed 1822 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1822
6577-
6578 for (;;) {-
6579 switch (state) {-
6580 case EValue:
executed 341 times by 1 test: case EValue:
Executed by:
  • tst_qxmlsimplereader - unknown status
341
6581 if ( !entityExist(name())) {
!entityExist(name())Description
TRUEevaluated 321 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-321
6582 QString errorMessage;-
6583 if (isExpandedEntityValueTooLarge(&errorMessage)) {
isExpandedEnti...&errorMessage)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 320 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-320
6584 reportParseError(errorMessage);-
6585 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6586 }-
6587-
6588 entities.insert(name(), string());-
6589 if (declHnd) {
declHndDescription
TRUEevaluated 320 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-320
6590 if (!declHnd->internalEntityDecl(name(), string())) {
!declHnd->inte...e(), string())Description
TRUEnever evaluated
FALSEevaluated 320 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-320
6591 reportParseError(declHnd->errorString());-
6592 return false;
never executed: return false;
0
6593 }-
6594 }
executed 320 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
320
6595 }
executed 320 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
320
6596 state = EValueR;-
6597 break;
executed 340 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
340
6598 case NNam:
executed 12 times by 1 test: case NNam:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6599 if ( !entityExist(name())) {
!entityExist(name())Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-12
6600 externEntities.insert(name(), QXmlSimpleReaderPrivate::ExternEntity(publicId, systemId, ref()));-
6601 if (dtdHnd) {
dtdHndDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-12
6602 if (!dtdHnd->unparsedEntityDecl(name(), publicId, systemId, ref())) {
!dtdHnd->unpar...stemId, ref())Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-12
6603 reportParseError(declHnd->errorString());-
6604 return false;
never executed: return false;
0
6605 }-
6606 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6607 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6608 state = NNamR;-
6609 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6610 case PEVal:
executed 69 times by 1 test: case PEVal:
Executed by:
  • tst_qxmlsimplereader - unknown status
69
6611 if ( !entityExist(name())) {
!entityExist(name())Description
TRUEevaluated 69 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-69
6612 parameterEntities.insert(name(), string());-
6613 if (declHnd) {
declHndDescription
TRUEevaluated 69 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-69
6614 if (!declHnd->internalEntityDecl(QLatin1Char('%') + name(), string())) {
!declHnd->inte...e(), string())Description
TRUEnever evaluated
FALSEevaluated 69 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-69
6615 reportParseError(declHnd->errorString());-
6616 return false;
never executed: return false;
0
6617 }-
6618 }
executed 69 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
69
6619 }
executed 69 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
69
6620 state = PEValR;-
6621 break;
executed 69 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
69
6622 case PEEID:
executed 62 times by 1 test: case PEEID:
Executed by:
  • tst_qxmlsimplereader - unknown status
62
6623 if ( !entityExist(name())) {
!entityExist(name())Description
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-62
6624 externParameterEntities.insert(name(), QXmlSimpleReaderPrivate::ExternParameterEntity(publicId, systemId));-
6625 if (declHnd) {
declHndDescription
TRUEevaluated 62 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-62
6626 if (!declHnd->externalEntityDecl(QLatin1Char('%') + name(), publicId, systemId)) {
!declHnd->exte...cId, systemId)Description
TRUEnever evaluated
FALSEevaluated 62 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-62
6627 reportParseError(declHnd->errorString());-
6628 return false;
never executed: return false;
0
6629 }-
6630 }
executed 62 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
62
6631 }
executed 62 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
62
6632 state = PEEIDR;-
6633 break;
executed 62 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
62
6634 case EDDone:
executed 172 times by 2 tests: case EDDone:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
172
6635 if ( !entityExist(name())) {
!entityExist(name())Description
TRUEevaluated 172 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-172
6636 externEntities.insert(name(), QXmlSimpleReaderPrivate::ExternEntity(publicId, systemId, QString()));-
6637 if (declHnd) {
declHndDescription
TRUEevaluated 153 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
19-153
6638 if (!declHnd->externalEntityDecl(name(), publicId, systemId)) {
!declHnd->exte...cId, systemId)Description
TRUEnever evaluated
FALSEevaluated 153 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-153
6639 reportParseError(declHnd->errorString());-
6640 return false;
never executed: return false;
0
6641 }-
6642 }
executed 153 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
153
6643 }
executed 172 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
172
6644 return true;
executed 172 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
172
6645 case Done:
executed 480 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
480
6646 return true;
executed 480 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
480
6647 case -1:
executed 6 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6648 // Error-
6649 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
6650 return false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6651 }-
6652-
6653 if (atEnd()) {
atEnd()Description
TRUEevaluated 345 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4302 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
345-4302
6654 unexpectedEof(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6655 return false;
executed 345 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
345
6656 }-
6657 if (is_S(c)) {
is_S(c)Description
TRUEevaluated 1490 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2812 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1490-2812
6658 input = InpWs;-
6659 } else if (c == QLatin1Char('%')) {
executed 1490 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('%')Description
TRUEevaluated 134 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2678 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
134-2678
6660 input = InpPer;-
6661 } else if (c == QLatin1Char('"') || c == QLatin1Char('\'')) {
executed 134 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('"')Description
TRUEevaluated 415 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2263 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('\'')Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2262 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1-2263
6662 input = InpQuot;-
6663 } else if (c == QLatin1Char('>')) {
executed 416 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 652 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1610 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
416-1610
6664 input = InpGt;-
6665 } else if (c == QLatin1Char('N')) {
executed 652 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('N')Description
TRUEevaluated 682 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 928 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
652-928
6666 input = InpN;-
6667 } else {
executed 682 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
682
6668 input = InpUnknown;-
6669 }
executed 928 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
928
6670 state = table[state][input];-
6671-
6672 switch (state) {-
6673 case Ent:
executed 667 times by 2 tests: case Ent:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
667
6674 parseString_s = QLatin1String("NTITY");-
6675 if (!parseString()) {
!parseString()Description
TRUEevaluated 427 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 240 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
240-427
6676 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6677 return false;
executed 427 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
427
6678 }-
6679 break;
executed 240 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
240
6680 case Ws1:
executed 666 times by 2 tests: case Ws1:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
666
6681 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 162 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 504 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
162-504
6682 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6683 return false;
executed 162 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
162
6684 }-
6685 break;
executed 504 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
504
6686 case Name:
executed 533 times by 2 tests: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
533
6687 parseName_useRef = false;-
6688 if (!parseName()) {
!parseName()Description
TRUEevaluated 145 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 388 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
145-388
6689 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6690 return false;
executed 145 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
145
6691 }-
6692 break;
executed 388 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
388
6693 case Ws2:
executed 531 times by 2 tests: case Ws2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
531
6694 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 164 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 367 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
164-367
6695 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6696 return false;
executed 164 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
164
6697 }-
6698 break;
executed 367 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
367
6699 case EValue:
executed 344 times by 1 test: case EValue:
Executed by:
  • tst_qxmlsimplereader - unknown status
344
6700 case EValueR:
never executed: case EValueR:
0
6701 if (!parseEntityValue()) {
!parseEntityValue()Description
TRUEevaluated 207 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 137 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
137-207
6702 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6703 return false;
executed 207 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
207
6704 }-
6705 break;
executed 137 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
137
6706 case ExtID:
executed 187 times by 2 tests: case ExtID:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
187
6707 parseExternalID_allowPublicID = false;-
6708 if (!parseExternalID()) {
!parseExternalID()Description
TRUEevaluated 146 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 41 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
41-146
6709 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6710 return false;
executed 146 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
146
6711 }-
6712 break;
executed 41 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
41
6713 case Ws3:
executed 12 times by 1 test: case Ws3:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6714 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-9
6715 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6716 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
6717 }-
6718 break;
executed 9 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
9
6719 case Ndata:
executed 12 times by 1 test: case Ndata:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6720 parseString_s = QLatin1String("NDATA");-
6721 if (!parseString()) {
!parseString()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
6
6722 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6723 return false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6724 }-
6725 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
6726 case Ws4:
executed 12 times by 1 test: case Ws4:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6727 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-8
6728 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6729 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
6730 }-
6731 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
6732 case NNam:
executed 12 times by 1 test: case NNam:
Executed by:
  • tst_qxmlsimplereader - unknown status
12
6733 case NNamR:
never executed: case NNamR:
0
6734 parseName_useRef = true;-
6735 if (!parseName()) {
!parseName()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-10
6736 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6737 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
6738 }-
6739 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
10
6740 case PEDec:
executed 133 times by 1 test: case PEDec:
Executed by:
  • tst_qxmlsimplereader - unknown status
133
6741 next();-
6742 break;
executed 133 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
133
6743 case Ws6:
executed 133 times by 1 test: case Ws6:
Executed by:
  • tst_qxmlsimplereader - unknown status
133
6744 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 52 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 81 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
52-81
6745 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6746 return false;
executed 52 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
52
6747 }-
6748 break;
executed 81 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
81
6749 case PENam:
executed 133 times by 1 test: case PENam:
Executed by:
  • tst_qxmlsimplereader - unknown status
133
6750 parseName_useRef = false;-
6751 if (!parseName()) {
!parseName()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 115 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
18-115
6752 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6753 return false;
executed 18 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
18
6754 }-
6755 break;
executed 115 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
115
6756 case Ws7:
executed 133 times by 1 test: case Ws7:
Executed by:
  • tst_qxmlsimplereader - unknown status
133
6757 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 87 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
46-87
6758 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6759 return false;
executed 46 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
46
6760 }-
6761 break;
executed 87 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
87
6762 case PEVal:
executed 71 times by 1 test: case PEVal:
Executed by:
  • tst_qxmlsimplereader - unknown status
71
6763 case PEValR:
never executed: case PEValR:
0
6764 if (!parseEntityValue()) {
!parseEntityValue()Description
TRUEevaluated 49 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
22-49
6765 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6766 return false;
executed 49 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
49
6767 }-
6768 break;
executed 22 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
22
6769 case PEEID:
executed 62 times by 1 test: case PEEID:
Executed by:
  • tst_qxmlsimplereader - unknown status
62
6770 case PEEIDR:
never executed: case PEEIDR:
0
6771 parseExternalID_allowPublicID = false;-
6772 if (!parseExternalID()) {
!parseExternalID()Description
TRUEevaluated 54 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
8-54
6773 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6774 return false;
executed 54 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
54
6775 }-
6776 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
6777 case WsE:
executed 3 times by 1 test: case WsE:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
6778 if (!eat_ws()) {
!eat_ws()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-3
6779 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state);-
6780 return false;
never executed: return false;
0
6781 }-
6782 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
6783 case EDDone:
executed 172 times by 2 tests: case EDDone:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
172
6784 next();-
6785 break;
executed 172 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
172
6786 case Done:
executed 480 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
480
6787 next();-
6788 break;
executed 480 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
480
6789 }-
6790 }
executed 2817 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2817
6791 return false;
never executed: return false;
0
6792}-
6793-
6794/*-
6795 Parse a EntityValue [9]-
6796*/-
6797bool QXmlSimpleReaderPrivate::parseEntityValue()-
6798{-
6799 const signed char Init = 0;-
6800 const signed char Dq = 1; // EntityValue is double quoted-
6801 const signed char DqC = 2; // signed character-
6802 const signed char DqPER = 3; // PERefence-
6803 const signed char DqRef = 4; // Reference-
6804 const signed char Sq = 5; // EntityValue is double quoted-
6805 const signed char SqC = 6; // signed character-
6806 const signed char SqPER = 7; // PERefence-
6807 const signed char SqRef = 8; // Reference-
6808 const signed char Done = 9;-
6809-
6810 const signed char InpDq = 0; // "-
6811 const signed char InpSq = 1; // '-
6812 const signed char InpAmp = 2; // &-
6813 const signed char InpPer = 3; // %-
6814 const signed char InpUnknown = 4;-
6815-
6816 static const signed char table[9][5] = {-
6817 /* InpDq InpSq InpAmp InpPer InpUnknown */-
6818 { Dq, Sq, -1, -1, -1 }, // Init-
6819 { Done, DqC, DqRef, DqPER, DqC }, // Dq-
6820 { Done, DqC, DqRef, DqPER, DqC }, // DqC-
6821 { Done, DqC, DqRef, DqPER, DqC }, // DqPER-
6822 { Done, DqC, DqRef, DqPER, DqC }, // DqRef-
6823 { SqC, Done, SqRef, SqPER, SqC }, // Sq-
6824 { SqC, Done, SqRef, SqPER, SqC }, // SqC-
6825 { SqC, Done, SqRef, SqPER, SqC }, // SqPER-
6826 { SqC, Done, SqRef, SqPER, SqC } // SqRef-
6827 };-
6828 signed char state;-
6829 signed char input;-
6830-
6831 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 91 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 957 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 324 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 633 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
91-957
6832 state = Init;-
6833 } else {
executed 415 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
415
6834 state = parseStack->pop().state;-
6835#if defined(QT_QXML_DEBUG)-
6836 qDebug("QXmlSimpleReader: parseEntityValue (cont) in state %d", state);-
6837#endif-
6838 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 172 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 461 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
172-461
6839 ParseFunction function = parseStack->top().function;-
6840 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-172
6841 parseStack->pop();-
6842#if defined(QT_QXML_DEBUG)-
6843 qDebug("QXmlSimpleReader: eat_ws (cont)");-
6844#endif-
6845 }
never executed: end of block
0
6846 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 60 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
60-112
6847 parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state);-
6848 return false;
executed 60 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
60
6849 }-
6850 }
executed 112 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
112
6851 }
executed 573 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
573
6852-
6853 for (;;) {-
6854 switch (state) {-
6855 case Done:
executed 410 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
410
6856 return true;
executed 410 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
410
6857 case -1:
never executed: case -1:
0
6858 // Error-
6859 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
6860 return false;
never executed: return false;
0
6861 }-
6862-
6863 if (atEnd()) {
atEnd()Description
TRUEevaluated 463 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2711 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
463-2711
6864 unexpectedEof(&QXmlSimpleReaderPrivate::parseEntityValue, state);-
6865 return false;
executed 463 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
463
6866 }-
6867 if (c == QLatin1Char('"')) {
c == QLatin1Char('"')Description
TRUEevaluated 824 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1887 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
824-1887
6868 input = InpDq;-
6869 } else if (c == QLatin1Char('\'')) {
executed 824 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('\'')Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1877 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-1877
6870 input = InpSq;-
6871 } else if (c == QLatin1Char('&')) {
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('&')Description
TRUEevaluated 342 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1535 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-1535
6872 input = InpAmp;-
6873 } else if (c == QLatin1Char('%')) {
executed 342 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c == QLatin1Char('%')Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1520 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
15-1520
6874 input = InpPer;-
6875 } else {
executed 15 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
15
6876 input = InpUnknown;-
6877 }
executed 1520 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1520
6878 state = table[state][input];-
6879-
6880 switch (state) {-
6881 case Dq:
executed 414 times by 1 test: case Dq:
Executed by:
  • tst_qxmlsimplereader - unknown status
414
6882 case Sq:
executed 1 time by 1 test: case Sq:
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6883 stringClear();-
6884 next();-
6885 break;
executed 415 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
415
6886 case DqC:
executed 1528 times by 1 test: case DqC:
Executed by:
  • tst_qxmlsimplereader - unknown status
1528
6887 case SqC:
executed 1 time by 1 test: case SqC:
Executed by:
  • tst_qxmlsimplereader - unknown status
1
6888 stringAddC();-
6889 next();-
6890 break;
executed 1529 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
1529
6891 case DqPER:
executed 15 times by 1 test: case DqPER:
Executed by:
  • tst_qxmlsimplereader - unknown status
15
6892 case SqPER:
never executed: case SqPER:
0
6893 parsePEReference_context = InEntityValue;-
6894 if (!parsePEReference()) {
!parsePEReference()Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-15
6895 parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state);-
6896 return false;
never executed: return false;
0
6897 }-
6898 break;
executed 15 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
15
6899 case DqRef:
executed 342 times by 1 test: case DqRef:
Executed by:
  • tst_qxmlsimplereader - unknown status
342
6900 case SqRef:
never executed: case SqRef:
0
6901 parseReference_context = InEntityValue;-
6902 if (!parseReference()) {
!parseReference()Description
TRUEevaluated 115 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 227 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
115-227
6903 parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state);-
6904 return false;
executed 115 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
115
6905 }-
6906 break;
executed 227 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
227
6907 case Done:
executed 410 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
410
6908 next();-
6909 break;
executed 410 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
410
6910 }-
6911 }
executed 2596 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2596
6912 return false;
never executed: return false;
0
6913}-
6914-
6915/*-
6916 Parse a comment [15].-
6917-
6918 Precondition: the beginning '<!' of the comment is already read and the head-
6919 stands on the first '-' of '<!--'.-
6920-
6921 If this funktion was successful, the head-position is on the first-
6922 character after the comment.-
6923*/-
6924bool QXmlSimpleReaderPrivate::parseComment()-
6925{-
6926 const signed char Init = 0;-
6927 const signed char Dash1 = 1; // the first dash was read-
6928 const signed char Dash2 = 2; // the second dash was read-
6929 const signed char Com = 3; // read comment-
6930 const signed char Com2 = 4; // read comment (help state)-
6931 const signed char ComE = 5; // finished reading comment-
6932 const signed char Done = 6;-
6933-
6934 const signed char InpDash = 0; // --
6935 const signed char InpGt = 1; // >-
6936 const signed char InpUnknown = 2;-
6937-
6938 static const signed char table[6][3] = {-
6939 /* InpDash InpGt InpUnknown */-
6940 { Dash1, -1, -1 }, // Init-
6941 { Dash2, -1, -1 }, // Dash1-
6942 { Com2, Com, Com }, // Dash2-
6943 { Com2, Com, Com }, // Com-
6944 { ComE, Com, Com }, // Com2-
6945 { -1, Done, -1 } // ComE-
6946 };-
6947 signed char state;-
6948 signed char input;-
6949-
6950 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 88 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 527 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 63 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 464 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
63-527
6951 state = Init;-
6952 } else {
executed 151 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
151
6953 state = parseStack->pop().state;-
6954#if defined(QT_QXML_DEBUG)-
6955 qDebug("QXmlSimpleReader: parseComment (cont) in state %d", state);-
6956#endif-
6957 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEnever evaluated
FALSEevaluated 464 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-464
6958 ParseFunction function = parseStack->top().function;-
6959 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEnever evaluated
0
6960 parseStack->pop();-
6961#if defined(QT_QXML_DEBUG)-
6962 qDebug("QXmlSimpleReader: eat_ws (cont)");-
6963#endif-
6964 }
never executed: end of block
0
6965 if (!(this->*function)()) {
!(this->*function)()Description
TRUEnever evaluated
FALSEnever evaluated
0
6966 parseFailed(&QXmlSimpleReaderPrivate::parseComment, state);-
6967 return false;
never executed: return false;
0
6968 }-
6969 }
never executed: end of block
0
6970 }
executed 464 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
464
6971-
6972 for (;;) {-
6973 switch (state) {-
6974 case Dash2:
executed 176 times by 2 tests: case Dash2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
176
6975 stringClear();-
6976 break;
executed 176 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
176
6977 case Com2:
executed 234 times by 2 tests: case Com2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
234
6978 // if next character is not a dash than don't skip it-
6979 if (!atEnd() && c != QLatin1Char('-'))
!atEnd()Description
TRUEevaluated 204 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
c != QLatin1Char('-')Description
TRUEevaluated 56 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 148 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
30-204
6980 stringAddC(QLatin1Char('-'));
executed 56 times by 2 tests: stringAddC(QLatin1Char('-'));
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
56
6981 break;
executed 234 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
234
6982 case Done:
executed 146 times by 2 tests: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
146
6983 return true;
executed 146 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
146
6984 case -1:
executed 3 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
6985 // Error-
6986 reportParseError(QLatin1String(XMLERR_ERRORPARSINGCOMMENT));-
6987 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
6988 }-
6989-
6990 if (atEnd()) {
atEnd()Description
TRUEevaluated 466 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10856 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
466-10856
6991 unexpectedEof(&QXmlSimpleReaderPrivate::parseComment, state);-
6992 return false;
executed 466 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
466
6993 }-
6994 if (c == QLatin1Char('-')) {
c == QLatin1Char('-')Description
TRUEevaluated 653 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10203 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
653-10203
6995 input = InpDash;-
6996 } else if (c == QLatin1Char('>')) {
executed 653 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('>')Description
TRUEevaluated 159 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10044 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
159-10044
6997 input = InpGt;-
6998 } else {
executed 159 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
159
6999 input = InpUnknown;-
7000 }
executed 10044 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10044
7001 state = table[state][input];-
7002-
7003 switch (state) {-
7004 case Dash1:
executed 150 times by 2 tests: case Dash1:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
150
7005 next();-
7006 break;
executed 150 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
150
7007 case Dash2:
executed 150 times by 2 tests: case Dash2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
150
7008 next();-
7009 break;
executed 150 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
150
7010 case Com:
executed 10055 times by 2 tests: case Com:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10055
7011 stringAddC();-
7012 next();-
7013 break;
executed 10055 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10055
7014 case Com2:
executed 204 times by 2 tests: case Com2:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
204
7015 next();-
7016 break;
executed 204 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
204
7017 case ComE:
executed 148 times by 2 tests: case ComE:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
148
7018 next();-
7019 break;
executed 148 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
148
7020 case Done:
executed 146 times by 2 tests: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
146
7021 next();-
7022 break;
executed 146 times by 2 tests: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
146
7023 }-
7024 }
executed 10856 times by 2 tests: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10856
7025 return false;
never executed: return false;
0
7026}-
7027-
7028/*-
7029 Parse an Attribute [41].-
7030-
7031 Precondition: the head stands on the first character of the name-
7032 of the attribute (i.e. all whitespaces are already parsed).-
7033-
7034 The head stand on the next character after the end quotes. The-
7035 variable name contains the name of the attribute and the variable-
7036 string contains the value of the attribute.-
7037*/-
7038bool QXmlSimpleReaderPrivate::parseAttribute()-
7039{-
7040 const int Init = 0;-
7041 const int PName = 1; // parse name-
7042 const int Ws = 2; // eat ws-
7043 const int Eq = 3; // the '=' was read-
7044 const int Quotes = 4; // " or ' were read-
7045-
7046 const int InpNameBe = 0;-
7047 const int InpEq = 1; // =-
7048 const int InpDq = 2; // "-
7049 const int InpSq = 3; // '-
7050 const int InpUnknown = 4;-
7051-
7052 static const int table[4][5] = {-
7053 /* InpNameBe InpEq InpDq InpSq InpUnknown */-
7054 { PName, -1, -1, -1, -1 }, // Init-
7055 { -1, Eq, -1, -1, Ws }, // PName-
7056 { -1, Eq, -1, -1, -1 }, // Ws-
7057 { -1, -1, Quotes, Quotes, -1 } // Eq-
7058 };-
7059 int state;-
7060 int input;-
7061-
7062 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 12597 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2446 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 549 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1897 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
549-12597
7063 state = Init;-
7064 } else {
executed 13146 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13146
7065 state = parseStack->pop().state;-
7066#if defined(QT_QXML_DEBUG)-
7067 qDebug("QXmlSimpleReader: parseAttribute (cont) in state %d", state);-
7068#endif-
7069 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 1897 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-1897
7070 ParseFunction function = parseStack->top().function;-
7071 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEevaluated 158 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1739 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
158-1739
7072 parseStack->pop();-
7073#if defined(QT_QXML_DEBUG)-
7074 qDebug("QXmlSimpleReader: eat_ws (cont)");-
7075#endif-
7076 }
executed 158 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
158
7077 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 933 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 964 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
933-964
7078 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state);-
7079 return false;
executed 933 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
933
7080 }-
7081 }
executed 964 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
964
7082 }
executed 964 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
964
7083-
7084 for (;;) {-
7085 switch (state) {-
7086 case Quotes:
executed 13130 times by 6 tests: case Quotes:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13130
7087 // Done-
7088 return true;
executed 13130 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13130
7089 case -1:
executed 3 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
3
7090 // Error-
7091 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
7092 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
7093 }-
7094-
7095 if (atEnd()) {
atEnd()Description
TRUEnever evaluated
FALSEevaluated 39458 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-39458
7096 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttribute, state);-
7097 return false;
never executed: return false;
0
7098 }-
7099 if (determineNameChar(c) == NameBeginning) {
determineNameC... NameBeginningDescription
TRUEevaluated 13147 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 26311 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13147-26311
7100 input = InpNameBe;-
7101 } else if (c == QLatin1Char('=')) {
executed 13147 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('=')Description
TRUEevaluated 13145 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 13166 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13145-13166
7102 input = InpEq;-
7103 } else if (c == QLatin1Char('"')) {
executed 13145 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('"')Description
TRUEevaluated 13066 times by 5 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 100 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
100-13145
7104 input = InpDq;-
7105 } else if (c == QLatin1Char('\'')) {
executed 13066 times by 5 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c == QLatin1Char('\'')Description
TRUEevaluated 77 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
23-13066
7106 input = InpSq;-
7107 } else {
executed 77 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
77
7108 input = InpUnknown;-
7109 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
23
7110 state = table[state][input];-
7111-
7112 switch (state) {-
7113 case PName:
executed 13146 times by 6 tests: case PName:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13146
7114 parseName_useRef = false;-
7115 if (!parseName()) {
!parseName()Description
TRUEevaluated 362 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12784 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
362-12784
7116 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state);-
7117 return false;
executed 362 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
362
7118 }-
7119 break;
executed 12784 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12784
7120 case Ws:
executed 21 times by 1 test: case Ws:
Executed by:
  • tst_qxmlsimplereader - unknown status
21
7121 if (!eat_ws()) {
!eat_ws()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 17 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-17
7122 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state);-
7123 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
7124 }-
7125 break;
executed 17 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
17
7126 case Eq:
executed 13145 times by 6 tests: case Eq:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13145
7127 if (!next_eat_ws()) {
!next_eat_ws()Description
TRUEevaluated 152 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12993 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
152-12993
7128 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state);-
7129 return false;
executed 152 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
152
7130 }-
7131 break;
executed 12993 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12993
7132 case Quotes:
executed 13143 times by 6 tests: case Quotes:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
13143
7133 if (!parseAttValue()) {
!parseAttValue()Description
TRUEevaluated 459 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12684 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
459-12684
7134 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state);-
7135 return false;
executed 459 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
459
7136 }-
7137 break;
executed 12684 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12684
7138 }-
7139 }
executed 38481 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
38481
7140 return false;
never executed: return false;
0
7141}-
7142-
7143/*-
7144 Parse a Name [5] and store the name in name or ref (if useRef is true).-
7145*/-
7146bool QXmlSimpleReaderPrivate::parseName()-
7147{-
7148 const int Init = 0;-
7149 const int Name1 = 1; // parse first character of the name-
7150 const int Name = 2; // parse name-
7151 const int Done = 3;-
7152-
7153 static const int table[3][3] = {-
7154 /* InpNameBe InpNameCh InpUnknown */-
7155 { Name1, -1, -1 }, // Init-
7156 { Name, Name, Done }, // Name1-
7157 { Name, Name, Done } // Name-
7158 };-
7159 int state;-
7160-
7161 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 21597 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 18173 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 9758 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8415 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
8415-21597
7162 state = Init;-
7163 } else {
executed 31355 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
31355
7164 state = parseStack->pop().state;-
7165#if defined(QT_QXML_DEBUG)-
7166 qDebug("QXmlSimpleReader: parseName (cont) in state %d", state);-
7167#endif-
7168 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEnever evaluated
FALSEevaluated 8415 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-8415
7169 ParseFunction function = parseStack->top().function;-
7170 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEnever evaluated
0
7171 parseStack->pop();-
7172#if defined(QT_QXML_DEBUG)-
7173 qDebug("QXmlSimpleReader: eat_ws (cont)");-
7174#endif-
7175 }
never executed: end of block
0
7176 if (!(this->*function)()) {
!(this->*function)()Description
TRUEnever evaluated
FALSEnever evaluated
0
7177 parseFailed(&QXmlSimpleReaderPrivate::parseName, state);-
7178 return false;
never executed: return false;
0
7179 }-
7180 }
never executed: end of block
0
7181 }
executed 8415 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
8415
7182-
7183 for (;;) {-
7184 switch (state) {-
7185 case Done:
executed 31340 times by 6 tests: case Done:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
31340
7186 return true;
executed 31340 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
31340
7187 case -1:
executed 15 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
15
7188 // Error-
7189 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
7190 return false;
executed 15 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
15
7191 }-
7192-
7193 if (atEnd()) {
atEnd()Description
TRUEevaluated 8415 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 160573 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8415-160573
7194 unexpectedEof(&QXmlSimpleReaderPrivate::parseName, state);-
7195 return false;
executed 8415 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
8415
7196 }-
7197-
7198 // we can safely do the (int) cast thanks to the Q_ASSERTs earlier in this function-
7199 state = table[state][(int)fastDetermineNameChar(c)];-
7200-
7201 switch (state) {-
7202 case Name1:
executed 31340 times by 6 tests: case Name1:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
31340
7203 if (parseName_useRef) {
parseName_useRefDescription
TRUEevaluated 1343 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 29997 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1343-29997
7204 refClear();-
7205 refAddC();-
7206 } else {
executed 1343 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1343
7207 nameClear();-
7208 nameAddC();-
7209 }
executed 29997 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
29997
7210 next();-
7211 break;
executed 31340 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
31340
7212 case Name:
executed 97878 times by 6 tests: case Name:
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
97878
7213 if (parseName_useRef) {
parseName_useRefDescription
TRUEevaluated 1538 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 96340 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1538-96340
7214 refAddC();-
7215 } else {
executed 1538 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1538
7216 nameAddC();-
7217 }
executed 96340 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
96340
7218 next();-
7219 break;
executed 97878 times by 6 tests: break;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
97878
7220 }-
7221 }
executed 160573 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
160573
7222 return false;
never executed: return false;
0
7223}-
7224-
7225/*-
7226 Parse a Nmtoken [7] and store the name in name.-
7227*/-
7228bool QXmlSimpleReaderPrivate::parseNmtoken()-
7229{-
7230 const signed char Init = 0;-
7231 const signed char NameF = 1;-
7232 const signed char Name = 2;-
7233 const signed char Done = 3;-
7234-
7235 const signed char InpNameCh = 0; // NameChar without InpNameBe-
7236 const signed char InpUnknown = 1;-
7237-
7238 static const signed char table[3][2] = {-
7239 /* InpNameCh InpUnknown */-
7240 { NameF, -1 }, // Init-
7241 { Name, Done }, // NameF-
7242 { Name, Done } // Name-
7243 };-
7244 signed char state;-
7245 signed char input;-
7246-
7247 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
5-23
7248 state = Init;-
7249 } else {
executed 24 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
24
7250 state = parseStack->pop().state;-
7251#if defined(QT_QXML_DEBUG)-
7252 qDebug("QXmlSimpleReader: parseNmtoken (cont) in state %d", state);-
7253#endif-
7254 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-5
7255 ParseFunction function = parseStack->top().function;-
7256 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEnever evaluated
0
7257 parseStack->pop();-
7258#if defined(QT_QXML_DEBUG)-
7259 qDebug("QXmlSimpleReader: eat_ws (cont)");-
7260#endif-
7261 }
never executed: end of block
0
7262 if (!(this->*function)()) {
!(this->*function)()Description
TRUEnever evaluated
FALSEnever evaluated
0
7263 parseFailed(&QXmlSimpleReaderPrivate::parseNmtoken, state);-
7264 return false;
never executed: return false;
0
7265 }-
7266 }
never executed: end of block
0
7267 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
5
7268-
7269 for (;;) {-
7270 switch (state) {-
7271 case Done:
executed 24 times by 1 test: case Done:
Executed by:
  • tst_qxmlsimplereader - unknown status
24
7272 return true;
executed 24 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
24
7273 case -1:
never executed: case -1:
0
7274 // Error-
7275 reportParseError(QLatin1String(XMLERR_LETTEREXPECTED));-
7276 return false;
never executed: return false;
0
7277 }-
7278-
7279 if (atEnd()) {
atEnd()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
5-56
7280 unexpectedEof(&QXmlSimpleReaderPrivate::parseNmtoken, state);-
7281 return false;
executed 5 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
5
7282 }-
7283 if (determineNameChar(c) == NotName) {
determineNameC...(c) == NotNameDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
24-32
7284 input = InpUnknown;-
7285 } else {
executed 24 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
24
7286 input = InpNameCh;-
7287 }
executed 32 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
32
7288 state = table[state][input];-
7289-
7290 switch (state) {-
7291 case NameF:
executed 24 times by 1 test: case NameF:
Executed by:
  • tst_qxmlsimplereader - unknown status
24
7292 nameClear();-
7293 nameAddC();-
7294 next();-
7295 break;
executed 24 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
24
7296 case Name:
executed 8 times by 1 test: case Name:
Executed by:
  • tst_qxmlsimplereader - unknown status
8
7297 nameAddC();-
7298 next();-
7299 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
7300 }-
7301 }
executed 56 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
56
7302 return false;
never executed: return false;
0
7303}-
7304-
7305/*-
7306 Parse a Reference [67].-
7307-
7308 parseReference_charDataRead is set to true if the reference must not be-
7309 parsed. The character(s) which the reference mapped to are appended to-
7310 string. The head stands on the first character after the reference.-
7311-
7312 parseReference_charDataRead is set to false if the reference must be parsed.-
7313 The charachter(s) which the reference mapped to are inserted at the reference-
7314 position. The head stands on the first character of the replacement).-
7315*/-
7316bool QXmlSimpleReaderPrivate::parseReference()-
7317{-
7318 // temporary variables (only used in very local context, so they don't-
7319 // interfere with incremental parsing)-
7320 uint tmp;-
7321 bool ok;-
7322-
7323 const signed char Init = 0;-
7324 const signed char SRef = 1; // start of a reference-
7325 const signed char ChRef = 2; // parse CharRef-
7326 const signed char ChDec = 3; // parse CharRef decimal-
7327 const signed char ChHexS = 4; // start CharRef hexadecimal-
7328 const signed char ChHex = 5; // parse CharRef hexadecimal-
7329 const signed char Name = 6; // parse name-
7330 const signed char DoneD = 7; // done CharRef decimal-
7331 const signed char DoneH = 8; // done CharRef hexadecimal-
7332 const signed char DoneN = 9; // done EntityRef-
7333-
7334 const signed char InpAmp = 0; // &-
7335 const signed char InpSemi = 1; // ;-
7336 const signed char InpHash = 2; // #-
7337 const signed char InpX = 3; // x-
7338 const signed char InpNum = 4; // 0-9-
7339 const signed char InpHex = 5; // a-f A-F-
7340 const signed char InpUnknown = 6;-
7341-
7342 static const signed char table[8][7] = {-
7343 /* InpAmp InpSemi InpHash InpX InpNum InpHex InpUnknown */-
7344 { SRef, -1, -1, -1, -1, -1, -1 }, // Init-
7345 { -1, -1, ChRef, Name, Name, Name, Name }, // SRef-
7346 { -1, -1, -1, ChHexS, ChDec, -1, -1 }, // ChRef-
7347 { -1, DoneD, -1, -1, ChDec, -1, -1 }, // ChDec-
7348 { -1, -1, -1, -1, ChHex, ChHex, -1 }, // ChHexS-
7349 { -1, DoneH, -1, -1, ChHex, ChHex, -1 }, // ChHex-
7350 { -1, DoneN, -1, -1, -1, -1, -1 } // Name-
7351 };-
7352 signed char state;-
7353 signed char input;-
7354-
7355 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 453 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 2474 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 1161 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1313 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
453-2474
7356 parseReference_charDataRead = false;-
7357 state = Init;-
7358 } else {
executed 1614 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1614
7359 state = parseStack->pop().state;-
7360#if defined(QT_QXML_DEBUG)-
7361 qDebug("QXmlSimpleReader: parseReference (cont) in state %d", state);-
7362#endif-
7363 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEevaluated 504 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 809 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
504-809
7364 ParseFunction function = parseStack->top().function;-
7365 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEevaluated 504 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-504
7366 parseStack->pop();-
7367#if defined(QT_QXML_DEBUG)-
7368 qDebug("QXmlSimpleReader: eat_ws (cont)");-
7369#endif-
7370 }
never executed: end of block
0
7371 if (!(this->*function)()) {
!(this->*function)()Description
TRUEevaluated 130 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 374 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
130-374
7372 parseFailed(&QXmlSimpleReaderPrivate::parseReference, state);-
7373 return false;
executed 130 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
130
7374 }-
7375 }
executed 374 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
374
7376 }
executed 1183 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
1183
7377-
7378 for (;;) {-
7379 switch (state) {-
7380 case DoneD:
executed 255 times by 1 test: case DoneD:
Executed by:
  • tst_qxmlsimplereader - unknown status
255
7381 return true;
executed 255 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
255
7382 case DoneH:
executed 80 times by 1 test: case DoneH:
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7383 return true;
executed 80 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7384 case DoneN:
executed 1256 times by 3 tests: case DoneN:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1256
7385 return true;
executed 1256 times by 3 tests: return true;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1256
7386 case -1:
executed 6 times by 1 test: case -1:
Executed by:
  • tst_qxmlsimplereader - unknown status
6
7387 // Error-
7388 reportParseError(QLatin1String(XMLERR_ERRORPARSINGREFERENCE));-
7389 return false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
6
7390 }-
7391-
7392 if (atEnd()) {
atEnd()Description
TRUEevaluated 809 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 6427 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
809-6427
7393 unexpectedEof(&QXmlSimpleReaderPrivate::parseReference, state);-
7394 return false;
executed 809 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
809
7395 }-
7396 if (c.row()) {
c.row()Description
TRUEnever evaluated
FALSEevaluated 6427 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-6427
7397 input = InpUnknown;-
7398 } else if (c.cell() == '&') {
never executed: end of block
c.cell() == '&'Description
TRUEevaluated 1615 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 4812 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-4812
7399 input = InpAmp;-
7400 } else if (c.cell() == ';') {
executed 1615 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c.cell() == ';'Description
TRUEevaluated 1599 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3213 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1599-3213
7401 input = InpSemi;-
7402 } else if (c.cell() == '#') {
executed 1599 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
c.cell() == '#'Description
TRUEevaluated 338 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2875 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
338-2875
7403 input = InpHash;-
7404 } else if (c.cell() == 'x') {
executed 338 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
c.cell() == 'x'Description
TRUEevaluated 90 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2785 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
90-2785
7405 input = InpX;-
7406 } else if ('0' <= c.cell() && c.cell() <= '9') {
executed 90 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
'0' <= c.cell()Description
TRUEevaluated 2774 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
c.cell() <= '9'Description
TRUEevaluated 1426 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1348 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
11-2774
7407 input = InpNum;-
7408 } else if ('a' <= c.cell() && c.cell() <= 'f') {
executed 1426 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
'a' <= c.cell()Description
TRUEevaluated 1292 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 67 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
c.cell() <= 'f'Description
TRUEevaluated 1034 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 258 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
67-1426
7409 input = InpHex;-
7410 } else if ('A' <= c.cell() && c.cell() <= 'F') {
executed 1034 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
'A' <= c.cell()Description
TRUEevaluated 313 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
c.cell() <= 'F'Description
TRUEevaluated 53 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 260 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
12-1034
7411 input = InpHex;-
7412 } else {
executed 53 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
53
7413 input = InpUnknown;-
7414 }
executed 272 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
272
7415 state = table[state][input];-
7416-
7417 switch (state) {-
7418 case SRef:
executed 1614 times by 3 tests: case SRef:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1614
7419 refClear();-
7420 next();-
7421 break;
executed 1614 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1614
7422 case ChRef:
executed 338 times by 1 test: case ChRef:
Executed by:
  • tst_qxmlsimplereader - unknown status
338
7423 next();-
7424 break;
executed 338 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
338
7425 case ChDec:
executed 850 times by 1 test: case ChDec:
Executed by:
  • tst_qxmlsimplereader - unknown status
850
7426 refAddC();-
7427 next();-
7428 break;
executed 850 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
850
7429 case ChHexS:
executed 80 times by 1 test: case ChHexS:
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7430 next();-
7431 break;
executed 80 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7432 case ChHex:
executed 665 times by 1 test: case ChHex:
Executed by:
  • tst_qxmlsimplereader - unknown status
665
7433 refAddC();-
7434 next();-
7435 break;
executed 665 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
665
7436 case Name:
executed 1275 times by 3 tests: case Name:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1275
7437 // read the name into the ref-
7438 parseName_useRef = true;-
7439 if (!parseName()) {
!parseName()Description
TRUEevaluated 383 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 892 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
383-892
7440 parseFailed(&QXmlSimpleReaderPrivate::parseReference, state);-
7441 return false;
executed 383 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
383
7442 }-
7443 break;
executed 892 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
892
7444 case DoneD:
executed 255 times by 1 test: case DoneD:
Executed by:
  • tst_qxmlsimplereader - unknown status
255
7445 tmp = ref().toUInt(&ok, 10);-
7446 if (ok) {
okDescription
TRUEevaluated 255 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-255
7447 stringAddC(QChar(tmp));-
7448 } else {
executed 255 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
255
7449 reportParseError(QLatin1String(XMLERR_ERRORPARSINGREFERENCE));-
7450 return false;
never executed: return false;
0
7451 }-
7452 parseReference_charDataRead = true;-
7453 next();-
7454 break;
executed 255 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
255
7455 case DoneH:
executed 80 times by 1 test: case DoneH:
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7456 tmp = ref().toUInt(&ok, 16);-
7457 if (ok) {
okDescription
TRUEevaluated 80 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-80
7458 stringAddC(QChar(tmp));-
7459 } else {
executed 80 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7460 reportParseError(QLatin1String(XMLERR_ERRORPARSINGREFERENCE));-
7461 return false;
never executed: return false;
0
7462 }-
7463 parseReference_charDataRead = true;-
7464 next();-
7465 break;
executed 80 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
80
7466 case DoneN:
executed 1264 times by 3 tests: case DoneN:
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1264
7467 if (!processReference())
!processReference()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1256 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8-1256
7468 return false;
executed 8 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
8
7469 next();-
7470 break;
executed 1256 times by 3 tests: break;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1256
7471 }-
7472 }
executed 6036 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
6036
7473 return false;
never executed: return false;
0
7474}-
7475-
7476/*-
7477 Helper function for parseReference()-
7478*/-
7479bool QXmlSimpleReaderPrivate::processReference()-
7480{-
7481 QString reference = ref();-
7482 if (reference == QLatin1String("amp")) {
reference == Q...1String("amp")Description
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1228 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
36-1228
7483 if (parseReference_context == InEntityValue) {
parseReference... InEntityValueDescription
TRUEnever evaluated
FALSEevaluated 36 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-36
7484 // Bypassed-
7485 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('a')); stringAddC(QLatin1Char('m')); stringAddC(QLatin1Char('p')); stringAddC(QLatin1Char(';'));-
7486 } else {
never executed: end of block
0
7487 // Included or Included in literal-
7488 stringAddC(QLatin1Char('&'));-
7489 }
executed 36 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
36
7490 parseReference_charDataRead = true;-
7491 } else if (reference == QLatin1String("lt")) {
executed 36 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
reference == Q...n1String("lt")Description
TRUEevaluated 69 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1159 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
36-1159
7492 if (parseReference_context == InEntityValue) {
parseReference... InEntityValueDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 59 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10-59
7493 // Bypassed-
7494 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('l')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';'));-
7495 } else {
executed 10 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10
7496 // Included or Included in literal-
7497 stringAddC(QLatin1Char('<'));-
7498 }
executed 59 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
59
7499 parseReference_charDataRead = true;-
7500 } else if (reference == QLatin1String("gt")) {
executed 69 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
reference == Q...n1String("gt")Description
TRUEevaluated 54 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 1105 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
54-1105
7501 if (parseReference_context == InEntityValue) {
parseReference... InEntityValueDescription
TRUEnever evaluated
FALSEevaluated 54 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-54
7502 // Bypassed-
7503 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('g')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';'));-
7504 } else {
never executed: end of block
0
7505 // Included or Included in literal-
7506 stringAddC(QLatin1Char('>'));-
7507 }
executed 54 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
54
7508 parseReference_charDataRead = true;-
7509 } else if (reference == QLatin1String("apos")) {
executed 54 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
reference == Q...String("apos")Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1085 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
20-1085
7510 if (parseReference_context == InEntityValue) {
parseReference... InEntityValueDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-20
7511 // Bypassed-
7512 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('a')); stringAddC(QLatin1Char('p')); stringAddC(QLatin1Char('o')); stringAddC(QLatin1Char('s')); stringAddC(QLatin1Char(';'));-
7513 } else {
never executed: end of block
0
7514 // Included or Included in literal-
7515 stringAddC(QLatin1Char('\''));-
7516 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
20
7517 parseReference_charDataRead = true;-
7518 } else if (reference == QLatin1String("quot")) {
executed 20 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
reference == Q...String("quot")Description
TRUEevaluated 35 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1050 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
20-1050
7519 if (parseReference_context == InEntityValue) {
parseReference... InEntityValueDescription
TRUEnever evaluated
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
0-35
7520 // Bypassed-
7521 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('q')); stringAddC(QLatin1Char('u')); stringAddC(QLatin1Char('o')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';'));-
7522 } else {
never executed: end of block
0
7523 // Included or Included in literal-
7524 stringAddC(QLatin1Char('"'));-
7525 }
executed 35 times by 2 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
35
7526 parseReference_charDataRead = true;-
7527 } else {
executed 35 times by 2 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
35
7528 QMap<QString,QString>::Iterator it;-
7529 it = entities.find(reference);-
7530 if (it != entities.end()) {
it != entities.end()Description
TRUEevaluated 610 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 440 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
440-610
7531 // "Internal General"-
7532 switch (parseReference_context) {-
7533 case InContent:
executed 400 times by 1 test: case InContent:
Executed by:
  • tst_qxmlsimplereader - unknown status
400
7534 // Included-
7535 if (!insertXmlRef(*it, reference, false))
!insertXmlRef(...erence, false)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 399 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1-399
7536 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
1
7537 parseReference_charDataRead = false;-
7538 break;
executed 399 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
399
7539 case InAttributeValue:
executed 78 times by 1 test: case InAttributeValue:
Executed by:
  • tst_qxmlsimplereader - unknown status
78
7540 // Included in literal-
7541 if (!insertXmlRef(*it, reference, true))
!insertXmlRef(...ference, true)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 75 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-75
7542 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
7543 parseReference_charDataRead = false;-
7544 break;
executed 75 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
75
7545 case InEntityValue:
executed 132 times by 1 test: case InEntityValue:
Executed by:
  • tst_qxmlsimplereader - unknown status
132
7546 {-
7547 // Bypassed-
7548 stringAddC(QLatin1Char('&'));-
7549 for (int i=0; i<(int)reference.length(); i++) {
i<(int)reference.length()Description
TRUEevaluated 264 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 132 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
132-264
7550 stringAddC(reference[i]);-
7551 }
executed 264 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
264
7552 stringAddC(QLatin1Char(';'));-
7553 parseReference_charDataRead = true;-
7554 }-
7555 break;
executed 132 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
132
7556 case InDTD:
never executed: case InDTD:
0
7557 // Forbidden-
7558 parseReference_charDataRead = false;-
7559 reportParseError(QLatin1String(XMLERR_INTERNALGENERALENTITYINDTD));-
7560 return false;
never executed: return false;
0
7561 }-
7562 } else {
executed 606 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
606
7563 QMap<QString,QXmlSimpleReaderPrivate::ExternEntity>::Iterator itExtern;-
7564 itExtern = externEntities.find(reference);-
7565 if (itExtern == externEntities.end()) {
itExtern == ex...Entities.end()Description
TRUEevaluated 296 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 144 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
144-296
7566 // entity not declared-
7567 // ### check this case for conformance-
7568 if (parseReference_context == InEntityValue) {
parseReference... InEntityValueDescription
TRUEevaluated 99 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 197 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
99-197
7569 // Bypassed-
7570 stringAddC(QLatin1Char('&'));-
7571 for (int i=0; i<(int)reference.length(); i++) {
i<(int)reference.length()Description
TRUEevaluated 209 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 99 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
99-209
7572 stringAddC(reference[i]);-
7573 }
executed 209 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
209
7574 stringAddC(QLatin1Char(';'));-
7575 parseReference_charDataRead = true;-
7576 } else {
executed 99 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
99
7577 // if we have some char data read, report it now-
7578 if (parseReference_context == InContent) {
parseReference...t == InContentDescription
TRUEevaluated 183 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
14-183
7579 if (contentCharDataRead) {
contentCharDataReadDescription
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
83-100
7580 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
reportWhitespaceCharDataDescription
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
!string().simp...ed().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0-100
7581 if (contentHnd != 0 && !contentHnd->characters(string())) {
contentHnd != 0Description
TRUEevaluated 100 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
!contentHnd->c...ters(string())Description
TRUEnever evaluated
FALSEevaluated 100 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-100
7582 reportParseError(contentHnd->errorString());-
7583 return false;
never executed: return false;
0
7584 }-
7585 }
executed 100 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
100
7586 stringClear();-
7587 contentCharDataRead = false;-
7588 }
executed 100 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
100
7589 }
executed 183 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
183
7590-
7591 if (contentHnd) {
contentHndDescription
TRUEevaluated 197 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-197
7592 skipped_entity_in_content = parseReference_context == InContent;-
7593 if (!contentHnd->skippedEntity(reference)) {
!contentHnd->s...ity(reference)Description
TRUEnever evaluated
FALSEevaluated 197 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-197
7594 skipped_entity_in_content = false;-
7595 reportParseError(contentHnd->errorString());-
7596 return false; // error
never executed: return false;
0
7597 }-
7598 skipped_entity_in_content = false;-
7599 }
executed 197 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
197
7600 }
executed 197 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
197
7601 } else if ((*itExtern).notation.isNull()) {
(*itExtern).notation.isNull()Description
TRUEevaluated 142 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
2-142
7602 // "External Parsed General"-
7603 switch (parseReference_context) {-
7604 case InContent:
executed 140 times by 1 test: case InContent:
Executed by:
  • tst_qxmlsimplereader - unknown status
140
7605 {-
7606 // Included if validating-
7607 bool skipIt = true;-
7608 if (entityRes) {
entityResDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-140
7609 QXmlInputSource *ret = 0;-
7610 if (!entityRes->resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)) {
!entityRes->re...systemId, ret)Description
TRUEnever evaluated
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-140
7611 delete ret;-
7612 reportParseError(entityRes->errorString());-
7613 return false;
never executed: return false;
0
7614 }-
7615 if (ret) {
retDescription
TRUEnever evaluated
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-140
7616 QString xmlRefString;-
7617 QString buffer = ret->data();-
7618 while (!buffer.isEmpty()) {
!buffer.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
7619 xmlRefString += buffer;-
7620 ret->fetchData();-
7621 buffer = ret->data();-
7622 }
never executed: end of block
0
7623-
7624 delete ret;-
7625 if (!stripTextDecl(xmlRefString)) {
!stripTextDecl(xmlRefString)Description
TRUEnever evaluated
FALSEnever evaluated
0
7626 reportParseError(QLatin1String(XMLERR_ERRORINTEXTDECL));-
7627 return false;
never executed: return false;
0
7628 }-
7629 if (!insertXmlRef(xmlRefString, reference, false))
!insertXmlRef(...erence, false)Description
TRUEnever evaluated
FALSEnever evaluated
0
7630 return false;
never executed: return false;
0
7631 skipIt = false;-
7632 }
never executed: end of block
0
7633 }
executed 140 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
140
7634 if (skipIt && contentHnd) {
skipItDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
contentHndDescription
TRUEevaluated 140 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-140
7635 skipped_entity_in_content = true;-
7636 if (!contentHnd->skippedEntity(reference)) {
!contentHnd->s...ity(reference)Description
TRUEnever evaluated
FALSEevaluated 140 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-140
7637 skipped_entity_in_content = false;-
7638 reportParseError(contentHnd->errorString());-
7639 return false; // error
never executed: return false;
0
7640 }-
7641 skipped_entity_in_content = false;-
7642 }
executed 140 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
140
7643 parseReference_charDataRead = false;-
7644 } break;
executed 140 times by 1 test: break;
Executed by:
  • tst_qxmlsimplereader - unknown status
140
7645 case InAttributeValue:
executed 2 times by 1 test: case InAttributeValue:
Executed by:
  • tst_qxmlsimplereader - unknown status
2
7646 // Forbidden-
7647 parseReference_charDataRead = false;-
7648 reportParseError(QLatin1String(XMLERR_EXTERNALGENERALENTITYINAV));-
7649 return false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
7650 case InEntityValue:
never executed: case InEntityValue:
0
7651 {-
7652 // Bypassed-
7653 stringAddC(QLatin1Char('&'));-
7654 for (int i=0; i<(int)reference.length(); i++) {
i<(int)reference.length()Description
TRUEnever evaluated
FALSEnever evaluated
0
7655 stringAddC(reference[i]);-
7656 }
never executed: end of block
0
7657 stringAddC(QLatin1Char(';'));-
7658 parseReference_charDataRead = true;-
7659 }-
7660 break;
never executed: break;
0
7661 case InDTD:
never executed: case InDTD:
0
7662 // Forbidden-
7663 parseReference_charDataRead = false;-
7664 reportParseError(QLatin1String(XMLERR_EXTERNALGENERALENTITYINDTD));-
7665 return false;
never executed: return false;
0
7666 }-
7667 } else {
executed 140 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
140
7668 // "Unparsed"-
7669 // ### notify for "Occurs as Attribute Value" missing (but this is no refence, anyway)-
7670 // Forbidden-
7671 parseReference_charDataRead = false;-
7672 reportParseError(QLatin1String(XMLERR_UNPARSEDENTITYREFERENCE));-
7673 return false; // error
executed 2 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
2
7674 }-
7675 }-
7676 }-
7677 return true; // no error
executed 1256 times by 3 tests: return true;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1256
7678}-
7679-
7680-
7681/*-
7682 Parses over a simple string.-
7683-
7684 After the string was successfully parsed, the head is on the first-
7685 character after the string.-
7686*/-
7687bool QXmlSimpleReaderPrivate::parseString()-
7688{-
7689 const signed char InpCharExpected = 0; // the character that was expected-
7690 const signed char InpUnknown = 1;-
7691-
7692 signed char state; // state in this function is the position in the string s-
7693 signed char input;-
7694-
7695 if (parseStack==0 || parseStack->isEmpty()) {
parseStack==0Description
TRUEevaluated 1360 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 17594 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
parseStack->isEmpty()Description
TRUEevaluated 6612 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10982 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
1360-17594
7696 Done = parseString_s.length();-
7697 state = 0;-
7698 } else {
executed 7972 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7972
7699 state = parseStack->pop().state;-
7700#if defined(QT_QXML_DEBUG)-
7701 qDebug("QXmlSimpleReader: parseString (cont) in state %d", state);-
7702#endif-
7703 if (!parseStack->isEmpty()) {
!parseStack->isEmpty()Description
TRUEnever evaluated
FALSEevaluated 10982 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-10982
7704 ParseFunction function = parseStack->top().function;-
7705 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
function == &Q...rivate::eat_wsDescription
TRUEnever evaluated
FALSEnever evaluated
0
7706 parseStack->pop();-
7707#if defined(QT_QXML_DEBUG)-
7708 qDebug("QXmlSimpleReader: eat_ws (cont)");-
7709#endif-
7710 }
never executed: end of block
0
7711 if (!(this->*function)()) {
!(this->*function)()Description
TRUEnever evaluated
FALSEnever evaluated
0
7712 parseFailed(&QXmlSimpleReaderPrivate::parseString, state);-
7713 return false;
never executed: return false;
0
7714 }-
7715 }
never executed: end of block
0
7716 }
executed 10982 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
10982
7717-
7718 for (;;) {-
7719 if (state == Done) {
state == DoneDescription
TRUEevaluated 7969 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 61524 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7969-61524
7720 return true;
executed 7969 times by 4 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
7969
7721 }-
7722-
7723 if (atEnd()) {
atEnd()Description
TRUEevaluated 10982 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 50542 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10982-50542
7724 unexpectedEof(&QXmlSimpleReaderPrivate::parseString, state);-
7725 return false;
executed 10982 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10982
7726 }-
7727 if (c == parseString_s[(int)state]) {
c == parseString_s[(int)state]Description
TRUEevaluated 50539 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-50539
7728 input = InpCharExpected;-
7729 } else {
executed 50539 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
50539
7730 input = InpUnknown;-
7731 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
3
7732 if (input == InpCharExpected) {
input == InpCharExpectedDescription
TRUEevaluated 50539 times by 4 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
3-50539
7733 state++;-
7734 } else {
executed 50539 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
50539
7735 // Error-
7736 reportParseError(QLatin1String(XMLERR_UNEXPECTEDCHARACTER));-
7737 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
3
7738 }-
7739-
7740 next();-
7741 }
executed 50539 times by 4 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
50539
7742 return false;
never executed: return false;
0
7743}-
7744-
7745/*-
7746 This private function inserts and reports an entity substitution. The-
7747 substituted string is \a data and the name of the entity reference is \a-
7748 name. If \a inLiteral is true, the entity is IncludedInLiteral (i.e., " and '-
7749 must be quoted. Otherwise they are not quoted.-
7750-
7751 This function returns \c false on error.-
7752*/-
7753bool QXmlSimpleReaderPrivate::insertXmlRef(const QString &data, const QString &name, bool inLiteral)-
7754{-
7755 if (inLiteral) {
inLiteralDescription
TRUEevaluated 93 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 410 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
93-410
7756 QString tmp = data;-
7757 xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1Char('\"'),-
7758 QLatin1String("&quot;")).replace(QLatin1Char('\''), QLatin1String("&apos;"))));-
7759 } else {
executed 93 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
93
7760 xmlRefStack.push(XmlRef(name, data));-
7761 }
executed 410 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
410
7762 int n = qMax(parameterEntities.count(), entities.count());-
7763 if (xmlRefStack.count() > n+1) {
xmlRefStack.count() > n+1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 499 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
4-499
7764 // recursive entities-
7765 reportParseError(QLatin1String(XMLERR_RECURSIVEENTITIES));-
7766 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
4
7767 }-
7768 if (reportEntities && lexicalHnd) {
reportEntitiesDescription
TRUEnever evaluated
FALSEevaluated 499 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
lexicalHndDescription
TRUEnever evaluated
FALSEnever evaluated
0-499
7769 if (!lexicalHnd->startEntity(name)) {
!lexicalHnd->startEntity(name)Description
TRUEnever evaluated
FALSEnever evaluated
0
7770 reportParseError(lexicalHnd->errorString());-
7771 return false;
never executed: return false;
0
7772 }-
7773 }
never executed: end of block
0
7774 return true;
executed 499 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
499
7775}-
7776-
7777/*-
7778 This private function moves the cursor to the next character.-
7779*/-
7780void QXmlSimpleReaderPrivate::next()-
7781{-
7782 int count = xmlRefStack.size();-
7783 while (count != 0) {
count != 0Description
TRUEevaluated 2697 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 791592 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2697-791592
7784 if (xmlRefStack.top().isEmpty()) {
xmlRefStack.top().isEmpty()Description
TRUEevaluated 477 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2220 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
477-2220
7785 xmlRefStack.pop_back();-
7786 count--;-
7787 } else {
executed 477 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
477
7788 c = xmlRefStack.top().next();-
7789 return;
executed 2220 times by 1 test: return;
Executed by:
  • tst_qxmlsimplereader - unknown status
2220
7790 }-
7791 }-
7792-
7793 // the following could be written nicer, but since it is a time-critical-
7794 // function, rather optimize for speed-
7795 ushort uc = c.unicode();-
7796 c = inputSource->next();-
7797 // If we are not incremental parsing, we just skip over EndOfData chars to give the-
7798 // parser an uninterrupted stream of document chars.-
7799 if (c == QXmlInputSource::EndOfData && parseStack == 0)
c == QXmlInput...rce::EndOfDataDescription
TRUEevaluated 45897 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 745695 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
parseStack == 0Description
TRUEevaluated 989 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 44908 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
989-745695
7800 c = inputSource->next();
executed 989 times by 6 tests: c = inputSource->next();
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
989
7801 if (uc == '\n') {
uc == '\n'Description
TRUEevaluated 18010 times by 5 tests
Evaluated by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 773582 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
18010-773582
7802 lineNr++;-
7803 columnNr = -1;-
7804 } else if (uc == '\r') {
executed 18010 times by 5 tests: end of block
Executed by:
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
uc == '\r'Description
TRUEevaluated 8363 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 765219 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
8363-765219
7805 if (c != QLatin1Char('\n')) {
c != QLatin1Char('\n')Description
TRUEevaluated 2546 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5817 times by 2 tests
Evaluated by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
2546-5817
7806 lineNr++;-
7807 columnNr = -1;-
7808 }
executed 2546 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
2546
7809 }
executed 8363 times by 2 tests: end of block
Executed by:
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
8363
7810 ++columnNr;-
7811}
executed 791592 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
791592
7812-
7813/*-
7814 This private function moves the cursor to the next non-whitespace character.-
7815 This function does not move the cursor if the actual cursor position is a-
7816 non-whitespace charcter.-
7817-
7818 Returns \c false when you use incremental parsing and this function reaches EOF-
7819 with reading only whitespace characters. In this case it also poplulates the-
7820 parseStack with useful information. In all other cases, this function returns-
7821 true.-
7822*/-
7823bool QXmlSimpleReaderPrivate::eat_ws()-
7824{-
7825 while (!atEnd()) {
!atEnd()Description
TRUEevaluated 90379 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10298 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
10298-90379
7826 if (!is_S(c)) {
!is_S(c)Description
TRUEevaluated 48622 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 41757 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
41757-48622
7827 return true;
executed 48622 times by 6 tests: return true;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
48622
7828 }-
7829 next();-
7830 }
executed 41757 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
41757
7831 if (parseStack != 0) {
parseStack != 0Description
TRUEevaluated 10088 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 210 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
210-10088
7832 unexpectedEof(&QXmlSimpleReaderPrivate::eat_ws, 0);-
7833 return false;
executed 10088 times by 1 test: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
10088
7834 }-
7835 return true;
executed 210 times by 2 tests: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
210
7836}-
7837-
7838bool QXmlSimpleReaderPrivate::next_eat_ws()-
7839{-
7840 next();-
7841 return eat_ws();
executed 17906 times by 6 tests: return eat_ws();
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
17906
7842}-
7843-
7844-
7845/*-
7846 This private function initializes the reader. \a i is the input source to-
7847 read the data from.-
7848*/-
7849void QXmlSimpleReaderPrivate::init(const QXmlInputSource *i)-
7850{-
7851 lineNr = 0;-
7852 columnNr = -1;-
7853 inputSource = const_cast<QXmlInputSource *>(i);-
7854 initData();-
7855-
7856 externParameterEntities.clear();-
7857 parameterEntities.clear();-
7858 externEntities.clear();-
7859 entities.clear();-
7860-
7861 clear(tags);-
7862-
7863 doctype.clear();-
7864 xmlVersion.clear();-
7865 encoding.clear();-
7866 standalone = QXmlSimpleReaderPrivate::Unknown;-
7867 error.clear();-
7868}
executed 2106 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
2106
7869-
7870/*-
7871 This private function initializes the XML data related variables. Especially,-
7872 it reads the data from the input source.-
7873*/-
7874void QXmlSimpleReaderPrivate::initData()-
7875{-
7876 c = QXmlInputSource::EndOfData;-
7877 xmlRefStack.clear();-
7878 next();-
7879}
executed 47014 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
47014
7880-
7881/*-
7882 Returns \c true if a entity with the name \a e exists,-
7883 otherwise returns \c false.-
7884*/-
7885bool QXmlSimpleReaderPrivate::entityExist(const QString& e) const-
7886{-
7887 if ( parameterEntities.find(e) == parameterEntities.end() &&
parameterEntit...Entities.end()Description
TRUEevaluated 646 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-646
7888 externParameterEntities.find(e) == externParameterEntities.end() &&
externParamete...Entities.end()Description
TRUEevaluated 646 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-646
7889 externEntities.find(e) == externEntities.end() &&
externEntities...Entities.end()Description
TRUEevaluated 646 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEnever evaluated
0-646
7890 entities.find(e) == entities.end()) {
entities.find(...entities.end()Description
TRUEevaluated 636 times by 2 tests
Evaluated by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
10-636
7891 return false;
executed 636 times by 2 tests: return false;
Executed by:
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
636
7892 } else {-
7893 return true;
executed 20 times by 1 test: return true;
Executed by:
  • tst_qxmlsimplereader - unknown status
20
7894 }-
7895}-
7896-
7897void QXmlSimpleReaderPrivate::reportParseError(const QString& error)-
7898{-
7899 this->error = error;-
7900 if (errorHnd) {
errorHndDescription
TRUEevaluated 155 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-155
7901 if (this->error.isNull()) {
this->error.isNull()Description
TRUEnever evaluated
FALSEevaluated 155 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-155
7902 const QXmlParseException ex(QLatin1String(XMLERR_OK), columnNr+1, lineNr+1,-
7903 thisPublicId, thisSystemId);-
7904 errorHnd->fatalError(ex);-
7905 } else {
never executed: end of block
0
7906 const QXmlParseException ex(this->error, columnNr+1, lineNr+1,-
7907 thisPublicId, thisSystemId);-
7908 errorHnd->fatalError(ex);-
7909 }
executed 155 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
155
7910 }-
7911}
executed 155 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
155
7912-
7913/*-
7914 This private function is called when a parsing function encounters an-
7915 unexpected EOF. It decides what to do (depending on incremental parsing or-
7916 not). \a where is a pointer to the function where the error occurred and \a-
7917 state is the parsing state in this function.-
7918*/-
7919void QXmlSimpleReaderPrivate::unexpectedEof(ParseFunction where, int state)-
7920{-
7921 if (parseStack == 0) {
parseStack == 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 44467 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
19-44467
7922 reportParseError(QLatin1String(XMLERR_UNEXPECTEDEOF));-
7923 } else {
executed 19 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
19
7924 if (c == QXmlInputSource::EndOfDocument) {
c == QXmlInput...:EndOfDocumentDescription
TRUEnever evaluated
FALSEevaluated 44467 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
0-44467
7925 reportParseError(QLatin1String(XMLERR_UNEXPECTEDEOF));-
7926 } else {
never executed: end of block
0
7927 pushParseState(where, state);-
7928 }
executed 44467 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
44467
7929 }-
7930}-
7931-
7932/*-
7933 This private function is called when a parse...() function returned false. It-
7934 determines if there was an error or if incremental parsing simply went out of-
7935 data and does the right thing for the case. \a where is a pointer to the-
7936 function where the error occurred and \a state is the parsing state in this-
7937 function.-
7938*/-
7939void QXmlSimpleReaderPrivate::parseFailed(ParseFunction where, int state)-
7940{-
7941 if (parseStack!=0 && error.isNull()) {
parseStack!=0Description
TRUEevaluated 111660 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 342 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
error.isNull()Description
TRUEevaluated 111660 times by 1 test
Evaluated by:
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-111660
7942 pushParseState(where, state);-
7943 }
executed 111660 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
111660
7944}
executed 112002 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
112002
7945-
7946/*-
7947 This private function pushes the function pointer \a function and state \a-
7948 state to the parse stack. This is used when you are doing an incremental-
7949 parsing and reach the end of file too early.-
7950-
7951 Only call this function when d->parseStack!=0.-
7952*/-
7953void QXmlSimpleReaderPrivate::pushParseState(ParseFunction function, int state)-
7954{-
7955 QXmlSimpleReaderPrivate::ParseState ps;-
7956 ps.function = function;-
7957 ps.state = state;-
7958 parseStack->push(ps);-
7959}
executed 201035 times by 1 test: end of block
Executed by:
  • tst_qxmlsimplereader - unknown status
201035
7960-
7961inline static void updateValue(QString &value, const QChar *array, int &arrayPos, int &valueLen)-
7962{-
7963 value.resize(valueLen + arrayPos);-
7964 memcpy(value.data() + valueLen, array, arrayPos * sizeof(QChar));-
7965 valueLen += arrayPos;-
7966 arrayPos = 0;-
7967}
executed 53191 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
53191
7968-
7969// use buffers instead of QString::operator+= when single characters are read-
7970const QString& QXmlSimpleReaderPrivate::string()-
7971{-
7972 updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);-
7973 return stringValue;
executed 21656 times by 6 tests: return stringValue;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
21656
7974}-
7975const QString& QXmlSimpleReaderPrivate::name()-
7976{-
7977 updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);-
7978 return nameValue;
executed 29710 times by 6 tests: return nameValue;
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
29710
7979}-
7980const QString& QXmlSimpleReaderPrivate::ref()-
7981{-
7982 updateValue(refValue, refArray, refArrayPos, refValueLen);-
7983 return refValue;
executed 1793 times by 3 tests: return refValue;
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
1793
7984}-
7985-
7986void QXmlSimpleReaderPrivate::stringAddC(QChar ch)-
7987{-
7988 if (stringArrayPos == 256)
stringArrayPos == 256Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qxmlstream - unknown status
FALSEevaluated 426009 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
32-426009
7989 updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);
executed 32 times by 1 test: updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);
Executed by:
  • tst_qxmlstream - unknown status
32
7990 stringArray[stringArrayPos++] = ch;-
7991}
executed 426041 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
426041
7992void QXmlSimpleReaderPrivate::nameAddC(QChar ch)-
7993{-
7994 if (nameArrayPos == 256)
nameArrayPos == 256Description
TRUEnever evaluated
FALSEevaluated 126369 times by 6 tests
Evaluated by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-126369
7995 updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);
never executed: updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);
0
7996 nameArray[nameArrayPos++] = ch;-
7997}
executed 126369 times by 6 tests: end of block
Executed by:
  • tst_qcssparser - unknown status
  • tst_qdbusxmlparser - unknown status
  • tst_qtextdocument - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
126369
7998void QXmlSimpleReaderPrivate::refAddC(QChar ch)-
7999{-
8000 if (refArrayPos == 256)
refArrayPos == 256Description
TRUEnever evaluated
FALSEevaluated 4396 times by 3 tests
Evaluated by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
0-4396
8001 updateValue(refValue, refArray, refArrayPos, refValueLen);
never executed: updateValue(refValue, refArray, refArrayPos, refValueLen);
0
8002 refArray[refArrayPos++] = ch;-
8003}
executed 4396 times by 3 tests: end of block
Executed by:
  • tst_qtextdocument - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_qxmlstream - unknown status
4396
8004QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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