| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/xml/sax/qxml.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | static const signed char cltWS = 0; | - | ||||||||||||||||||||||||
| 5 | static const signed char cltPer = 1; | - | ||||||||||||||||||||||||
| 6 | static const signed char cltAmp = 2; | - | ||||||||||||||||||||||||
| 7 | static const signed char cltGt = 3; | - | ||||||||||||||||||||||||
| 8 | static const signed char cltLt = 4; | - | ||||||||||||||||||||||||
| 9 | static const signed char cltSlash = 5; | - | ||||||||||||||||||||||||
| 10 | static const signed char cltQm = 6; | - | ||||||||||||||||||||||||
| 11 | static const signed char cltEm = 7; | - | ||||||||||||||||||||||||
| 12 | static const signed char cltDash = 8; | - | ||||||||||||||||||||||||
| 13 | static const signed char cltCB = 9; | - | ||||||||||||||||||||||||
| 14 | static const signed char cltOB = 10; | - | ||||||||||||||||||||||||
| 15 | static const signed char cltEq = 11; | - | ||||||||||||||||||||||||
| 16 | static const signed char cltDq = 12; | - | ||||||||||||||||||||||||
| 17 | static const signed char cltSq = 13; | - | ||||||||||||||||||||||||
| 18 | static const signed char cltUnknown = 14; | - | ||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||
| 21 | static const signed char charLookupTable[256]={ | - | ||||||||||||||||||||||||
| 22 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 23 | cltUnknown, | - | ||||||||||||||||||||||||
| 24 | cltWS, | - | ||||||||||||||||||||||||
| 25 | cltWS, | - | ||||||||||||||||||||||||
| 26 | cltUnknown, | - | ||||||||||||||||||||||||
| 27 | cltUnknown, | - | ||||||||||||||||||||||||
| 28 | cltWS, | - | ||||||||||||||||||||||||
| 29 | cltUnknown, | - | ||||||||||||||||||||||||
| 30 | cltUnknown, | - | ||||||||||||||||||||||||
| 31 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 32 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 33 | cltWS, | - | ||||||||||||||||||||||||
| 34 | cltEm, | - | ||||||||||||||||||||||||
| 35 | cltDq, | - | ||||||||||||||||||||||||
| 36 | cltUnknown, | - | ||||||||||||||||||||||||
| 37 | cltUnknown, | - | ||||||||||||||||||||||||
| 38 | cltPer, | - | ||||||||||||||||||||||||
| 39 | cltAmp, | - | ||||||||||||||||||||||||
| 40 | cltSq, | - | ||||||||||||||||||||||||
| 41 | cltUnknown, | - | ||||||||||||||||||||||||
| 42 | cltUnknown, | - | ||||||||||||||||||||||||
| 43 | cltUnknown, | - | ||||||||||||||||||||||||
| 44 | cltUnknown, | - | ||||||||||||||||||||||||
| 45 | cltUnknown, | - | ||||||||||||||||||||||||
| 46 | cltDash, | - | ||||||||||||||||||||||||
| 47 | cltUnknown, | - | ||||||||||||||||||||||||
| 48 | cltSlash, | - | ||||||||||||||||||||||||
| 49 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 50 | cltUnknown, | - | ||||||||||||||||||||||||
| 51 | cltUnknown, | - | ||||||||||||||||||||||||
| 52 | cltUnknown, | - | ||||||||||||||||||||||||
| 53 | cltUnknown, | - | ||||||||||||||||||||||||
| 54 | cltLt, | - | ||||||||||||||||||||||||
| 55 | cltEq, | - | ||||||||||||||||||||||||
| 56 | cltGt, | - | ||||||||||||||||||||||||
| 57 | cltQm, | - | ||||||||||||||||||||||||
| 58 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 59 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 60 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 61 | cltUnknown, | - | ||||||||||||||||||||||||
| 62 | cltUnknown, | - | ||||||||||||||||||||||||
| 63 | cltUnknown, | - | ||||||||||||||||||||||||
| 64 | cltOB, | - | ||||||||||||||||||||||||
| 65 | cltUnknown, | - | ||||||||||||||||||||||||
| 66 | cltCB, | - | ||||||||||||||||||||||||
| 67 | cltUnknown, | - | ||||||||||||||||||||||||
| 68 | cltUnknown, | - | ||||||||||||||||||||||||
| 69 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 70 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 71 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 72 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 73 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 74 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 75 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 76 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 77 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 78 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 79 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 80 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 81 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 82 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 83 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 84 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 85 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 86 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 87 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, | - | ||||||||||||||||||||||||
| 88 | cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown | - | ||||||||||||||||||||||||
| 89 | }; | - | ||||||||||||||||||||||||
| 90 | static bool stripTextDecl(QString& str) | - | ||||||||||||||||||||||||
| 91 | { | - | ||||||||||||||||||||||||
| 92 | QString textDeclStart(QLatin1String("<?xml")); | - | ||||||||||||||||||||||||
| 93 | if (str.startsWith(textDeclStart)
| 0 | ||||||||||||||||||||||||
| 94 | QRegExp textDecl(QString::fromLatin1( | - | ||||||||||||||||||||||||
| 95 | "^<\\?xml\\s+" | - | ||||||||||||||||||||||||
| 96 | "(version\\s*=\\s*((['\"])[-a-zA-Z0-9_.:]+\\3))?" | - | ||||||||||||||||||||||||
| 97 | "\\s*" | - | ||||||||||||||||||||||||
| 98 | "(encoding\\s*=\\s*((['\"])[A-Za-z][-a-zA-Z0-9_.]*\\6))?" | - | ||||||||||||||||||||||||
| 99 | "\\s*\\?>" | - | ||||||||||||||||||||||||
| 100 | )); | - | ||||||||||||||||||||||||
| 101 | QString strTmp = str.replace(textDecl, QLatin1String("")); | - | ||||||||||||||||||||||||
| 102 | if (strTmp.length() != str.length()
| 0 | ||||||||||||||||||||||||
| 103 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 104 | str = strTmp; | - | ||||||||||||||||||||||||
| 105 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 106 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 107 | } | - | ||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||
| 109 | - | |||||||||||||||||||||||||
| 110 | class QXmlAttributesPrivate | - | ||||||||||||||||||||||||
| 111 | { | - | ||||||||||||||||||||||||
| 112 | }; | - | ||||||||||||||||||||||||
| 113 | class QXmlInputSourcePrivate | - | ||||||||||||||||||||||||
| 114 | { | - | ||||||||||||||||||||||||
| 115 | public: | - | ||||||||||||||||||||||||
| 116 | QIODevice *inputDevice; | - | ||||||||||||||||||||||||
| 117 | QTextStream *inputStream; | - | ||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||
| 119 | QString str; | - | ||||||||||||||||||||||||
| 120 | const QChar *unicode; | - | ||||||||||||||||||||||||
| 121 | int pos; | - | ||||||||||||||||||||||||
| 122 | int length; | - | ||||||||||||||||||||||||
| 123 | bool nextReturnedEndOfData; | - | ||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||
| 125 | QTextDecoder *encMapper; | - | ||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | QByteArray encodingDeclBytes; | - | ||||||||||||||||||||||||
| 129 | QString encodingDeclChars; | - | ||||||||||||||||||||||||
| 130 | bool lookingForEncodingDecl; | - | ||||||||||||||||||||||||
| 131 | }; | - | ||||||||||||||||||||||||
| 132 | class QXmlParseExceptionPrivate | - | ||||||||||||||||||||||||
| 133 | { | - | ||||||||||||||||||||||||
| 134 | public: | - | ||||||||||||||||||||||||
| 135 | QXmlParseExceptionPrivate() | - | ||||||||||||||||||||||||
| 136 | : column(-1), line(-1) | - | ||||||||||||||||||||||||
| 137 | { | - | ||||||||||||||||||||||||
| 138 | } executed 155 times by 1 test: end of blockExecuted by:
| 155 | ||||||||||||||||||||||||
| 139 | QXmlParseExceptionPrivate(const QXmlParseExceptionPrivate &other) | - | ||||||||||||||||||||||||
| 140 | : msg(other.msg), column(other.column), line(other.line), | - | ||||||||||||||||||||||||
| 141 | pub(other.pub), sys(other.sys) | - | ||||||||||||||||||||||||
| 142 | { | - | ||||||||||||||||||||||||
| 143 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||
| 145 | QString msg; | - | ||||||||||||||||||||||||
| 146 | int column; | - | ||||||||||||||||||||||||
| 147 | int line; | - | ||||||||||||||||||||||||
| 148 | QString pub; | - | ||||||||||||||||||||||||
| 149 | QString sys; | - | ||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||
| 151 | }; | - | ||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | class QXmlLocatorPrivate | - | ||||||||||||||||||||||||
| 154 | { | - | ||||||||||||||||||||||||
| 155 | }; | - | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | class QXmlDefaultHandlerPrivate | - | ||||||||||||||||||||||||
| 158 | { | - | ||||||||||||||||||||||||
| 159 | }; | - | ||||||||||||||||||||||||
| 160 | QXmlParseException::QXmlParseException(const QString& name, int c, int l, | - | ||||||||||||||||||||||||
| 161 | const QString& p, const QString& s) | - | ||||||||||||||||||||||||
| 162 | : d(new QXmlParseExceptionPrivate) | - | ||||||||||||||||||||||||
| 163 | { | - | ||||||||||||||||||||||||
| 164 | d->msg = name; | - | ||||||||||||||||||||||||
| 165 | d->column = c; | - | ||||||||||||||||||||||||
| 166 | d->line = l; | - | ||||||||||||||||||||||||
| 167 | d->pub = p; | - | ||||||||||||||||||||||||
| 168 | d->sys = s; | - | ||||||||||||||||||||||||
| 169 | } executed 155 times by 1 test: end of blockExecuted by:
| 155 | ||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||
| 174 | QXmlParseException::QXmlParseException(const QXmlParseException& other) : | - | ||||||||||||||||||||||||
| 175 | d(new QXmlParseExceptionPrivate(*other.d)) | - | ||||||||||||||||||||||||
| 176 | { | - | ||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||
| 178 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||
| 183 | QXmlParseException::~QXmlParseException() | - | ||||||||||||||||||||||||
| 184 | { | - | ||||||||||||||||||||||||
| 185 | } | - | ||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||
| 187 | - | |||||||||||||||||||||||||
| 188 | - | |||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | QString QXmlParseException::message() const | - | ||||||||||||||||||||||||
| 191 | { | - | ||||||||||||||||||||||||
| 192 | return executed 300 times by 1 test: d->msg;return d->msg;Executed by:
executed 300 times by 1 test: return d->msg;Executed by:
| 300 | ||||||||||||||||||||||||
| 193 | } | - | ||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||
| 196 | - | |||||||||||||||||||||||||
| 197 | int QXmlParseException::columnNumber() const | - | ||||||||||||||||||||||||
| 198 | { | - | ||||||||||||||||||||||||
| 199 | return executed 300 times by 1 test: d->column;return d->column;Executed by:
executed 300 times by 1 test: return d->column;Executed by:
| 300 | ||||||||||||||||||||||||
| 200 | } | - | ||||||||||||||||||||||||
| 201 | - | |||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 | - | |||||||||||||||||||||||||
| 204 | int QXmlParseException::lineNumber() const | - | ||||||||||||||||||||||||
| 205 | { | - | ||||||||||||||||||||||||
| 206 | return executed 300 times by 1 test: d->line;return d->line;Executed by:
executed 300 times by 1 test: return d->line;Executed by:
| 300 | ||||||||||||||||||||||||
| 207 | } | - | ||||||||||||||||||||||||
| 208 | - | |||||||||||||||||||||||||
| 209 | - | |||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||
| 211 | QString QXmlParseException::publicId() const | - | ||||||||||||||||||||||||
| 212 | { | - | ||||||||||||||||||||||||
| 213 | return executed 152 times by 1 test: d->pub;return d->pub;Executed by:
executed 152 times by 1 test: return d->pub;Executed by:
| 152 | ||||||||||||||||||||||||
| 214 | } | - | ||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||
| 218 | QString QXmlParseException::systemId() const | - | ||||||||||||||||||||||||
| 219 | { | - | ||||||||||||||||||||||||
| 220 | return executed 152 times by 1 test: d->sys;return d->sys;Executed by:
executed 152 times by 1 test: return d->sys;Executed by:
| 152 | ||||||||||||||||||||||||
| 221 | } | - | ||||||||||||||||||||||||
| 222 | QXmlLocator::QXmlLocator() | - | ||||||||||||||||||||||||
| 223 | { | - | ||||||||||||||||||||||||
| 224 | } | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | - | |||||||||||||||||||||||||
| 227 | - | |||||||||||||||||||||||||
| 228 | - | |||||||||||||||||||||||||
| 229 | QXmlLocator::~QXmlLocator() | - | ||||||||||||||||||||||||
| 230 | { | - | ||||||||||||||||||||||||
| 231 | } | - | ||||||||||||||||||||||||
| 232 | class QXmlSimpleReaderLocator : public QXmlLocator | - | ||||||||||||||||||||||||
| 233 | { | - | ||||||||||||||||||||||||
| 234 | public: | - | ||||||||||||||||||||||||
| 235 | QXmlSimpleReaderLocator(QXmlSimpleReader* parent) | - | ||||||||||||||||||||||||
| 236 | { | - | ||||||||||||||||||||||||
| 237 | reader = parent; | - | ||||||||||||||||||||||||
| 238 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 239 | ~QXmlSimpleReaderLocator() | - | ||||||||||||||||||||||||
| 240 | { | - | ||||||||||||||||||||||||
| 241 | } | - | ||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | int columnNumber() const override | - | ||||||||||||||||||||||||
| 244 | { | - | ||||||||||||||||||||||||
| 245 | return executed 2993 times by 5 tests: (reader->d_ptr->columnNr == -1return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);Executed by:
executed 2993 times by 5 tests: return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);Executed by:
| 0-2993 | ||||||||||||||||||||||||
| 246 | } | - | ||||||||||||||||||||||||
| 247 | int lineNumber() const override | - | ||||||||||||||||||||||||
| 248 | { | - | ||||||||||||||||||||||||
| 249 | return executed 2993 times by 5 tests: (reader->d_ptr->lineNr == -1return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);Executed by:
executed 2993 times by 5 tests: return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);Executed by:
| 0-2993 | ||||||||||||||||||||||||
| 250 | } | - | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||
| 254 | private: | - | ||||||||||||||||||||||||
| 255 | QXmlSimpleReader *reader; | - | ||||||||||||||||||||||||
| 256 | }; | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | typedef QMap<QString, QString> NamespaceMap; | - | ||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | class QXmlNamespaceSupportPrivate | - | ||||||||||||||||||||||||
| 267 | { | - | ||||||||||||||||||||||||
| 268 | public: | - | ||||||||||||||||||||||||
| 269 | QXmlNamespaceSupportPrivate() | - | ||||||||||||||||||||||||
| 270 | { | - | ||||||||||||||||||||||||
| 271 | ns.insert(QLatin1String("xml"), QLatin1String("http://www.w3.org/XML/1998/namespace")); | - | ||||||||||||||||||||||||
| 272 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||
| 274 | ~QXmlNamespaceSupportPrivate() | - | ||||||||||||||||||||||||
| 275 | { | - | ||||||||||||||||||||||||
| 276 | } | - | ||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||
| 278 | QStack<NamespaceMap> nsStack; | - | ||||||||||||||||||||||||
| 279 | NamespaceMap ns; | - | ||||||||||||||||||||||||
| 280 | }; | - | ||||||||||||||||||||||||
| 281 | QXmlNamespaceSupport::QXmlNamespaceSupport() | - | ||||||||||||||||||||||||
| 282 | { | - | ||||||||||||||||||||||||
| 283 | d = new QXmlNamespaceSupportPrivate; | - | ||||||||||||||||||||||||
| 284 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||
| 289 | QXmlNamespaceSupport::~QXmlNamespaceSupport() | - | ||||||||||||||||||||||||
| 290 | { | - | ||||||||||||||||||||||||
| 291 | delete d; | - | ||||||||||||||||||||||||
| 292 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 293 | void QXmlNamespaceSupport::setPrefix(const QString& pre, const QString& uri) | - | ||||||||||||||||||||||||
| 294 | { | - | ||||||||||||||||||||||||
| 295 | if(pre.isNull()
| 3-4 | ||||||||||||||||||||||||
| 296 | d->ns.insert(QLatin1String(""), uri); | - | ||||||||||||||||||||||||
| 297 | } executed 3 times by 1 test: else {end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 298 | d->ns.insert(pre, uri); | - | ||||||||||||||||||||||||
| 299 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 300 | } | - | ||||||||||||||||||||||||
| 301 | QString QXmlNamespaceSupport::prefix(const QString& uri) const | - | ||||||||||||||||||||||||
| 302 | { | - | ||||||||||||||||||||||||
| 303 | NamespaceMap::const_iterator itc, it = d->ns.constBegin(); | - | ||||||||||||||||||||||||
| 304 | while ((
| 0 | ||||||||||||||||||||||||
| 305 | ++it; | - | ||||||||||||||||||||||||
| 306 | if (*
| 0 | ||||||||||||||||||||||||
| 307 | return never executed: itc.key();return itc.key();never executed: return itc.key(); | 0 | ||||||||||||||||||||||||
| 308 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 309 | return never executed: QLatin1String("");return QLatin1String("");never executed: return QLatin1String(""); | 0 | ||||||||||||||||||||||||
| 310 | } | - | ||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||
| 317 | QString QXmlNamespaceSupport::uri(const QString& prefix) const | - | ||||||||||||||||||||||||
| 318 | { | - | ||||||||||||||||||||||||
| 319 | return executed 27 times by 2 tests: d->ns[prefix];return d->ns[prefix];Executed by:
executed 27 times by 2 tests: return d->ns[prefix];Executed by:
| 27 | ||||||||||||||||||||||||
| 320 | } | - | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | - | |||||||||||||||||||||||||
| 328 | void QXmlNamespaceSupport::splitName(const QString& qname, QString& prefix, | - | ||||||||||||||||||||||||
| 329 | QString& localname) const | - | ||||||||||||||||||||||||
| 330 | { | - | ||||||||||||||||||||||||
| 331 | int pos = qname.indexOf(QLatin1Char(':')); | - | ||||||||||||||||||||||||
| 332 | if (pos == -1
| 30-11998 | ||||||||||||||||||||||||
| 333 | pos = qname.size(); executed 11998 times by 3 tests: pos = qname.size();Executed by:
| 11998 | ||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||
| 335 | prefix = qname.left(pos); | - | ||||||||||||||||||||||||
| 336 | localname = qname.mid(pos+1); | - | ||||||||||||||||||||||||
| 337 | } executed 12028 times by 3 tests: end of blockExecuted by:
| 12028 | ||||||||||||||||||||||||
| 338 | void QXmlNamespaceSupport::processName(const QString& qname, | - | ||||||||||||||||||||||||
| 339 | bool isAttribute, | - | ||||||||||||||||||||||||
| 340 | QString& nsuri, QString& localname) const | - | ||||||||||||||||||||||||
| 341 | { | - | ||||||||||||||||||||||||
| 342 | int len = qname.size(); | - | ||||||||||||||||||||||||
| 343 | const QChar *data = qname.constData(); | - | ||||||||||||||||||||||||
| 344 | for (int pos = 0; pos < len
| 21219-96470 | ||||||||||||||||||||||||
| 345 | if (data[pos] == QLatin1Char(':')
| 27-96443 | ||||||||||||||||||||||||
| 346 | nsuri = uri(qname.left(pos)); | - | ||||||||||||||||||||||||
| 347 | localname = qname.mid(pos + 1); | - | ||||||||||||||||||||||||
| 348 | return; executed 27 times by 2 tests: return;Executed by:
| 27 | ||||||||||||||||||||||||
| 349 | } | - | ||||||||||||||||||||||||
| 350 | } executed 96443 times by 3 tests: end of blockExecuted by:
| 96443 | ||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||
| 353 | nsuri.clear(); | - | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 | if (!isAttribute
| 0-11995 | ||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||
| 359 | - | |||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||
| 361 | NamespaceMap::const_iterator first = d->ns.constBegin(); | - | ||||||||||||||||||||||||
| 362 | if (first.key().isEmpty()
| 21-9203 | ||||||||||||||||||||||||
| 363 | nsuri = first.value(); executed 21 times by 1 test: nsuri = first.value();Executed by:
| 21 | ||||||||||||||||||||||||
| 364 | } executed 9224 times by 3 tests: end of blockExecuted by:
| 9224 | ||||||||||||||||||||||||
| 365 | localname = qname; | - | ||||||||||||||||||||||||
| 366 | } executed 21219 times by 3 tests: end of blockExecuted by:
| 21219 | ||||||||||||||||||||||||
| 367 | QStringList QXmlNamespaceSupport::prefixes() const | - | ||||||||||||||||||||||||
| 368 | { | - | ||||||||||||||||||||||||
| 369 | QStringList list; | - | ||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 | NamespaceMap::const_iterator itc, it = d->ns.constBegin(); | - | ||||||||||||||||||||||||
| 372 | while ((
| 434-439 | ||||||||||||||||||||||||
| 373 | ++it; | - | ||||||||||||||||||||||||
| 374 | if (!itc.key().isEmpty()
| 1-438 | ||||||||||||||||||||||||
| 375 | list.append(itc.key()); executed 438 times by 2 tests: list.append(itc.key());Executed by:
| 438 | ||||||||||||||||||||||||
| 376 | } executed 439 times by 2 tests: end of blockExecuted by:
| 439 | ||||||||||||||||||||||||
| 377 | return executed 434 times by 2 tests: list;return list;Executed by:
executed 434 times by 2 tests: return list;Executed by:
| 434 | ||||||||||||||||||||||||
| 378 | } | - | ||||||||||||||||||||||||
| 379 | QStringList QXmlNamespaceSupport::prefixes(const QString& uri) const | - | ||||||||||||||||||||||||
| 380 | { | - | ||||||||||||||||||||||||
| 381 | QStringList list; | - | ||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||
| 383 | NamespaceMap::const_iterator itc, it = d->ns.constBegin(); | - | ||||||||||||||||||||||||
| 384 | while ((
| 0 | ||||||||||||||||||||||||
| 385 | ++it; | - | ||||||||||||||||||||||||
| 386 | if (*
| 0 | ||||||||||||||||||||||||
| 387 | list.append(itc.key()); never executed: list.append(itc.key()); | 0 | ||||||||||||||||||||||||
| 388 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 389 | return never executed: list;return list;never executed: return list; | 0 | ||||||||||||||||||||||||
| 390 | } | - | ||||||||||||||||||||||||
| 391 | void QXmlNamespaceSupport::pushContext() | - | ||||||||||||||||||||||||
| 392 | { | - | ||||||||||||||||||||||||
| 393 | d->nsStack.push(d->ns); | - | ||||||||||||||||||||||||
| 394 | } executed 4781 times by 3 tests: end of blockExecuted by:
| 4781 | ||||||||||||||||||||||||
| 395 | void QXmlNamespaceSupport::popContext() | - | ||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||
| 397 | d->ns.clear(); | - | ||||||||||||||||||||||||
| 398 | if(!d->nsStack.isEmpty()
| 0-4705 | ||||||||||||||||||||||||
| 399 | d->ns = d->nsStack.pop(); executed 4705 times by 3 tests: d->ns = d->nsStack.pop();Executed by:
| 4705 | ||||||||||||||||||||||||
| 400 | } executed 4705 times by 3 tests: end of blockExecuted by:
| 4705 | ||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||
| 405 | void QXmlNamespaceSupport::reset() | - | ||||||||||||||||||||||||
| 406 | { | - | ||||||||||||||||||||||||
| 407 | QXmlNamespaceSupportPrivate *newD = new QXmlNamespaceSupportPrivate; | - | ||||||||||||||||||||||||
| 408 | delete d; | - | ||||||||||||||||||||||||
| 409 | d = newD; | - | ||||||||||||||||||||||||
| 410 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 411 | QXmlAttributes::QXmlAttributes() | - | ||||||||||||||||||||||||
| 412 | { | - | ||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | - | |||||||||||||||||||||||||
| 415 | (void)d;; | - | ||||||||||||||||||||||||
| 416 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||
| 418 | - | |||||||||||||||||||||||||
| 419 | - | |||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||
| 423 | QXmlAttributes::~QXmlAttributes() | - | ||||||||||||||||||||||||
| 424 | { | - | ||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||
| 426 | int QXmlAttributes::index(const QString& qName) const | - | ||||||||||||||||||||||||
| 427 | { | - | ||||||||||||||||||||||||
| 428 | for (int i = 0; i < attList.size()
| 0 | ||||||||||||||||||||||||
| 429 | if (attList.at(i).qname == qName
| 0 | ||||||||||||||||||||||||
| 430 | return never executed: i;return i;never executed: return i; | 0 | ||||||||||||||||||||||||
| 431 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 432 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 433 | } | - | ||||||||||||||||||||||||
| 434 | - | |||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||
| 436 | - | |||||||||||||||||||||||||
| 437 | int QXmlAttributes::index(QLatin1String qName) const | - | ||||||||||||||||||||||||
| 438 | { | - | ||||||||||||||||||||||||
| 439 | for (int i = 0; i < attList.size()
| 2589-11810 | ||||||||||||||||||||||||
| 440 | if (attList.at(i).qname == qName
| 24-11786 | ||||||||||||||||||||||||
| 441 | return executed 24 times by 1 test: i;return i;Executed by:
executed 24 times by 1 test: return i;Executed by:
| 24 | ||||||||||||||||||||||||
| 442 | } executed 11786 times by 1 test: end of blockExecuted by:
| 11786 | ||||||||||||||||||||||||
| 443 | return executed 2589 times by 1 test: -1;return -1;Executed by:
executed 2589 times by 1 test: return -1;Executed by:
| 2589 | ||||||||||||||||||||||||
| 444 | } | - | ||||||||||||||||||||||||
| 445 | int QXmlAttributes::index(const QString& uri, const QString& localPart) const | - | ||||||||||||||||||||||||
| 446 | { | - | ||||||||||||||||||||||||
| 447 | for (int i = 0; i < attList.size()
| 5843-51512 | ||||||||||||||||||||||||
| 448 | const Attribute &att = attList.at(i); | - | ||||||||||||||||||||||||
| 449 | if (att.uri == uri
| 0-51512 | ||||||||||||||||||||||||
| 450 | return executed 8130 times by 1 test: i;return i;Executed by:
executed 8130 times by 1 test: return i;Executed by:
| 8130 | ||||||||||||||||||||||||
| 451 | } executed 43382 times by 1 test: end of blockExecuted by:
| 43382 | ||||||||||||||||||||||||
| 452 | return executed 5843 times by 1 test: -1;return -1;Executed by:
executed 5843 times by 1 test: return -1;Executed by:
| 5843 | ||||||||||||||||||||||||
| 453 | } | - | ||||||||||||||||||||||||
| 454 | - | |||||||||||||||||||||||||
| 455 | - | |||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||
| 460 | int QXmlAttributes::length() const | - | ||||||||||||||||||||||||
| 461 | { | - | ||||||||||||||||||||||||
| 462 | return executed 4017 times by 5 tests: attList.count();return attList.count();Executed by:
executed 4017 times by 5 tests: return attList.count();Executed by:
| 4017 | ||||||||||||||||||||||||
| 463 | } | - | ||||||||||||||||||||||||
| 464 | QString QXmlAttributes::localName(int index) const | - | ||||||||||||||||||||||||
| 465 | { | - | ||||||||||||||||||||||||
| 466 | return executed 407 times by 1 test: attList.at(index).localname;return attList.at(index).localname;Executed by:
executed 407 times by 1 test: return attList.at(index).localname;Executed by:
| 407 | ||||||||||||||||||||||||
| 467 | } | - | ||||||||||||||||||||||||
| 468 | - | |||||||||||||||||||||||||
| 469 | - | |||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||
| 472 | - | |||||||||||||||||||||||||
| 473 | - | |||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||
| 475 | QString QXmlAttributes::qName(int index) const | - | ||||||||||||||||||||||||
| 476 | { | - | ||||||||||||||||||||||||
| 477 | return executed 1275 times by 4 tests: attList.at(index).qname;return attList.at(index).qname;Executed by:
executed 1275 times by 4 tests: return attList.at(index).qname;Executed by:
| 1275 | ||||||||||||||||||||||||
| 478 | } | - | ||||||||||||||||||||||||
| 479 | QString QXmlAttributes::uri(int index) const | - | ||||||||||||||||||||||||
| 480 | { | - | ||||||||||||||||||||||||
| 481 | return executed 409 times by 1 test: attList.at(index).uri;return attList.at(index).uri;Executed by:
executed 409 times by 1 test: return attList.at(index).uri;Executed by:
| 409 | ||||||||||||||||||||||||
| 482 | } | - | ||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||
| 485 | - | |||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||
| 490 | QString QXmlAttributes::type(int) const | - | ||||||||||||||||||||||||
| 491 | { | - | ||||||||||||||||||||||||
| 492 | return executed 407 times by 1 test: QLatin1String("CDATA");return QLatin1String("CDATA");Executed by:
executed 407 times by 1 test: return QLatin1String("CDATA");Executed by:
| 407 | ||||||||||||||||||||||||
| 493 | } | - | ||||||||||||||||||||||||
| 494 | QString QXmlAttributes::type(const QString&) const | - | ||||||||||||||||||||||||
| 495 | { | - | ||||||||||||||||||||||||
| 496 | return never executed: QLatin1String("CDATA");return QLatin1String("CDATA");never executed: return QLatin1String("CDATA"); | 0 | ||||||||||||||||||||||||
| 497 | } | - | ||||||||||||||||||||||||
| 498 | QString QXmlAttributes::type(const QString&, const QString&) const | - | ||||||||||||||||||||||||
| 499 | { | - | ||||||||||||||||||||||||
| 500 | return never executed: QLatin1String("CDATA");return QLatin1String("CDATA");never executed: return QLatin1String("CDATA"); | 0 | ||||||||||||||||||||||||
| 501 | } | - | ||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||
| 506 | - | |||||||||||||||||||||||||
| 507 | - | |||||||||||||||||||||||||
| 508 | QString QXmlAttributes::value(int index) const | - | ||||||||||||||||||||||||
| 509 | { | - | ||||||||||||||||||||||||
| 510 | return executed 1287 times by 5 tests: attList.at(index).value;return attList.at(index).value;Executed by:
executed 1287 times by 5 tests: return attList.at(index).value;Executed by:
| 1287 | ||||||||||||||||||||||||
| 511 | } | - | ||||||||||||||||||||||||
| 512 | QString QXmlAttributes::value(const QString& qName) const | - | ||||||||||||||||||||||||
| 513 | { | - | ||||||||||||||||||||||||
| 514 | int i = index(qName); | - | ||||||||||||||||||||||||
| 515 | if (i == -1
| 0 | ||||||||||||||||||||||||
| 516 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 517 | return never executed: attList.at(i).value;return attList.at(i).value;never executed: return attList.at(i).value; | 0 | ||||||||||||||||||||||||
| 518 | } | - | ||||||||||||||||||||||||
| 519 | QString QXmlAttributes::value(QLatin1String qName) const | - | ||||||||||||||||||||||||
| 520 | { | - | ||||||||||||||||||||||||
| 521 | int i = index(qName); | - | ||||||||||||||||||||||||
| 522 | if (i == -1
| 0 | ||||||||||||||||||||||||
| 523 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 524 | return never executed: attList.at(i).value;return attList.at(i).value;never executed: return attList.at(i).value; | 0 | ||||||||||||||||||||||||
| 525 | } | - | ||||||||||||||||||||||||
| 526 | QString QXmlAttributes::value(const QString& uri, const QString& localName) const | - | ||||||||||||||||||||||||
| 527 | { | - | ||||||||||||||||||||||||
| 528 | int i = index(uri, localName); | - | ||||||||||||||||||||||||
| 529 | if (i == -1
| 4320-7751 | ||||||||||||||||||||||||
| 530 | return executed 4320 times by 1 test: QString();return QString();Executed by:
executed 4320 times by 1 test: return QString();Executed by:
| 4320 | ||||||||||||||||||||||||
| 531 | return executed 7751 times by 1 test: attList.at(i).value;return attList.at(i).value;Executed by:
executed 7751 times by 1 test: return attList.at(i).value;Executed by:
| 7751 | ||||||||||||||||||||||||
| 532 | } | - | ||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||
| 535 | - | |||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||
| 539 | void QXmlAttributes::clear() | - | ||||||||||||||||||||||||
| 540 | { | - | ||||||||||||||||||||||||
| 541 | attList.clear(); | - | ||||||||||||||||||||||||
| 542 | } executed 5802 times by 6 tests: end of blockExecuted by:
| 5802 | ||||||||||||||||||||||||
| 543 | void QXmlAttributes::append(const QString &qName, const QString &uri, const QString &localPart, const QString &value) | - | ||||||||||||||||||||||||
| 544 | { | - | ||||||||||||||||||||||||
| 545 | Attribute att; | - | ||||||||||||||||||||||||
| 546 | att.qname = qName; | - | ||||||||||||||||||||||||
| 547 | att.uri = uri; | - | ||||||||||||||||||||||||
| 548 | att.localname = localPart; | - | ||||||||||||||||||||||||
| 549 | att.value = value; | - | ||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||
| 551 | attList.append(att); | - | ||||||||||||||||||||||||
| 552 | } executed 12887 times by 6 tests: end of blockExecuted by:
| 12887 | ||||||||||||||||||||||||
| 553 | const ushort QXmlInputSource::EndOfData = 0xfffe; | - | ||||||||||||||||||||||||
| 554 | const ushort QXmlInputSource::EndOfDocument = 0xffff; | - | ||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||
| 556 | - | |||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||
| 559 | void QXmlInputSource::init() | - | ||||||||||||||||||||||||
| 560 | { | - | ||||||||||||||||||||||||
| 561 | d = new QXmlInputSourcePrivate; | - | ||||||||||||||||||||||||
| 562 | - | |||||||||||||||||||||||||
| 563 | if (true) { | - | ||||||||||||||||||||||||
| 564 | d->inputDevice = 0; | - | ||||||||||||||||||||||||
| 565 | d->inputStream = 0; | - | ||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||
| 567 | setData(QString()); | - | ||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||
| 569 | d->encMapper = 0; | - | ||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||
| 571 | d->nextReturnedEndOfData = true; | - | ||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||
| 573 | d->encodingDeclBytes.clear(); | - | ||||||||||||||||||||||||
| 574 | d->encodingDeclChars.clear(); | - | ||||||||||||||||||||||||
| 575 | d->lookingForEncodingDecl = true; | - | ||||||||||||||||||||||||
| 576 | } executed 2106 times by 6 tests: else {end of blockExecuted by:
dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
| 577 | delete(d); dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
| 578 | qt_noop(); dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
| 579 | } dead code: { delete(d); qt_noop(); } | - | ||||||||||||||||||||||||
| 580 | } | - | ||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||
| 583 | - | |||||||||||||||||||||||||
| 584 | - | |||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 | - | |||||||||||||||||||||||||
| 587 | QXmlInputSource::QXmlInputSource() | - | ||||||||||||||||||||||||
| 588 | { | - | ||||||||||||||||||||||||
| 589 | init(); | - | ||||||||||||||||||||||||
| 590 | } executed 1734 times by 5 tests: end of blockExecuted by:
| 1734 | ||||||||||||||||||||||||
| 591 | QXmlInputSource::QXmlInputSource(QIODevice *dev) | - | ||||||||||||||||||||||||
| 592 | { | - | ||||||||||||||||||||||||
| 593 | init(); | - | ||||||||||||||||||||||||
| 594 | d->inputDevice = dev; | - | ||||||||||||||||||||||||
| 595 | if (dev->isOpen()
| 9-363 | ||||||||||||||||||||||||
| 596 | d->inputDevice->setTextModeEnabled(false); executed 363 times by 2 tests: d->inputDevice->setTextModeEnabled(false);Executed by:
| 363 | ||||||||||||||||||||||||
| 597 | } executed 372 times by 3 tests: end of blockExecuted by:
| 372 | ||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||
| 599 | - | |||||||||||||||||||||||||
| 600 | - | |||||||||||||||||||||||||
| 601 | - | |||||||||||||||||||||||||
| 602 | QXmlInputSource::~QXmlInputSource() | - | ||||||||||||||||||||||||
| 603 | { | - | ||||||||||||||||||||||||
| 604 | - | |||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||
| 606 | delete d->encMapper; | - | ||||||||||||||||||||||||
| 607 | - | |||||||||||||||||||||||||
| 608 | delete d; | - | ||||||||||||||||||||||||
| 609 | } executed 2106 times by 6 tests: end of blockExecuted by:
| 2106 | ||||||||||||||||||||||||
| 610 | QChar QXmlInputSource::next() | - | ||||||||||||||||||||||||
| 611 | { | - | ||||||||||||||||||||||||
| 612 | if (d->pos >= d->length
| 48748-744723 | ||||||||||||||||||||||||
| 613 | if (d->nextReturnedEndOfData
| 2851-45897 | ||||||||||||||||||||||||
| 614 | d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
| 615 | fetchData(); | - | ||||||||||||||||||||||||
| 616 | if (d->pos >= d->length
| 890-1961 | ||||||||||||||||||||||||
| 617 | return executed 1961 times by 6 tests: EndOfDocument;return EndOfDocument;Executed by:
executed 1961 times by 6 tests: return EndOfDocument;Executed by:
| 1961 | ||||||||||||||||||||||||
| 618 | } | - | ||||||||||||||||||||||||
| 619 | return executed 890 times by 3 tests: next();return next();Executed by:
executed 890 times by 3 tests: return next();Executed by:
| 890 | ||||||||||||||||||||||||
| 620 | } | - | ||||||||||||||||||||||||
| 621 | d->nextReturnedEndOfData = true; | - | ||||||||||||||||||||||||
| 622 | return executed 45897 times by 6 tests: EndOfData;return EndOfData;Executed by:
executed 45897 times by 6 tests: return EndOfData;Executed by:
| 45897 | ||||||||||||||||||||||||
| 623 | } | - | ||||||||||||||||||||||||
| 624 | - | |||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||
| 626 | - | |||||||||||||||||||||||||
| 627 | - | |||||||||||||||||||||||||
| 628 | QChar c = d->unicode[d->pos++]; | - | ||||||||||||||||||||||||
| 629 | if (c.unicode() == EndOfData
| 1-744722 | ||||||||||||||||||||||||
| 630 | c = EndOfDocument; executed 1 time by 1 test: c = EndOfDocument;Executed by:
| 1 | ||||||||||||||||||||||||
| 631 | return executed 744723 times by 6 tests: c;return c;Executed by:
executed 744723 times by 6 tests: return c;Executed by:
| 744723 | ||||||||||||||||||||||||
| 632 | } | - | ||||||||||||||||||||||||
| 633 | void QXmlInputSource::reset() | - | ||||||||||||||||||||||||
| 634 | { | - | ||||||||||||||||||||||||
| 635 | d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
| 636 | d->pos = 0; | - | ||||||||||||||||||||||||
| 637 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 | - | |||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||
| 645 | QString QXmlInputSource::data() const | - | ||||||||||||||||||||||||
| 646 | { | - | ||||||||||||||||||||||||
| 647 | if (d->nextReturnedEndOfData
| 0-4 | ||||||||||||||||||||||||
| 648 | QXmlInputSource *that = const_cast<QXmlInputSource*>(this); | - | ||||||||||||||||||||||||
| 649 | that->d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
| 650 | that->fetchData(); | - | ||||||||||||||||||||||||
| 651 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 652 | return executed 4 times by 1 test: d->str;return d->str;Executed by:
executed 4 times by 1 test: return d->str;Executed by:
| 4 | ||||||||||||||||||||||||
| 653 | } | - | ||||||||||||||||||||||||
| 654 | void QXmlInputSource::setData(const QString& dat) | - | ||||||||||||||||||||||||
| 655 | { | - | ||||||||||||||||||||||||
| 656 | d->str = dat; | - | ||||||||||||||||||||||||
| 657 | d->unicode = dat.unicode(); | - | ||||||||||||||||||||||||
| 658 | d->pos = 0; | - | ||||||||||||||||||||||||
| 659 | d->length = d->str.length(); | - | ||||||||||||||||||||||||
| 660 | d->nextReturnedEndOfData = false; | - | ||||||||||||||||||||||||
| 661 | } executed 48375 times by 6 tests: end of blockExecuted by:
| 48375 | ||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||
| 665 | - | |||||||||||||||||||||||||
| 666 | - | |||||||||||||||||||||||||
| 667 | - | |||||||||||||||||||||||||
| 668 | - | |||||||||||||||||||||||||
| 669 | void QXmlInputSource::setData(const QByteArray& dat) | - | ||||||||||||||||||||||||
| 670 | { | - | ||||||||||||||||||||||||
| 671 | setData(fromRawData(dat)); | - | ||||||||||||||||||||||||
| 672 | } executed 44908 times by 1 test: end of blockExecuted by:
| 44908 | ||||||||||||||||||||||||
| 673 | void QXmlInputSource::fetchData() | - | ||||||||||||||||||||||||
| 674 | { | - | ||||||||||||||||||||||||
| 675 | enum | - | ||||||||||||||||||||||||
| 676 | { | - | ||||||||||||||||||||||||
| 677 | BufferSize = 1024 | - | ||||||||||||||||||||||||
| 678 | }; | - | ||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||
| 680 | QByteArray rawData; | - | ||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||
| 682 | if (d->inputDevice
| 0-1734 | ||||||||||||||||||||||||
| 683 | QIODevice *device = d->inputDevice
| 0-1117 | ||||||||||||||||||||||||
| 684 | - | |||||||||||||||||||||||||
| 685 | if (!device
| 0-1117 | ||||||||||||||||||||||||
| 686 | if (d->inputStream
| 0 | ||||||||||||||||||||||||
| 687 | QString *s = d->inputStream->string(); | - | ||||||||||||||||||||||||
| 688 | rawData = QByteArray((const char *) s->constData(), s->size() * sizeof(QChar)); | - | ||||||||||||||||||||||||
| 689 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 690 | } never executed: else if (device->isOpen()end of block
| 0-1108 | ||||||||||||||||||||||||
| 691 | rawData.resize(BufferSize); | - | ||||||||||||||||||||||||
| 692 | qint64 size = device->read(rawData.data(), BufferSize); | - | ||||||||||||||||||||||||
| 693 | - | |||||||||||||||||||||||||
| 694 | if (size != -1
| 0-1117 | ||||||||||||||||||||||||
| 695 | - | |||||||||||||||||||||||||
| 696 | while (size < 4
| 235-890 | ||||||||||||||||||||||||
| 697 | if (!device->waitForReadyRead(-1)
| 8-227 | ||||||||||||||||||||||||
| 698 | break; executed 227 times by 3 tests: break;Executed by:
| 227 | ||||||||||||||||||||||||
| 699 | int ret = device->read(rawData.data() + size, BufferSize - size); | - | ||||||||||||||||||||||||
| 700 | if (ret <= 0
| 0-8 | ||||||||||||||||||||||||
| 701 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 702 | size += ret; | - | ||||||||||||||||||||||||
| 703 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 704 | } executed 1117 times by 3 tests: end of blockExecuted by:
| 1117 | ||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||
| 706 | rawData.resize(qMax(qint64(0), size)); | - | ||||||||||||||||||||||||
| 707 | } executed 1117 times by 3 tests: end of blockExecuted by:
| 1117 | ||||||||||||||||||||||||
| 708 | - | |||||||||||||||||||||||||
| 709 | - | |||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||
| 711 | - | |||||||||||||||||||||||||
| 712 | - | |||||||||||||||||||||||||
| 713 | setData(fromRawData(rawData)); | - | ||||||||||||||||||||||||
| 714 | } executed 1117 times by 3 tests: end of blockExecuted by:
| 1117 | ||||||||||||||||||||||||
| 715 | } executed 2851 times by 6 tests: end of blockExecuted by:
| 2851 | ||||||||||||||||||||||||
| 716 | - | |||||||||||||||||||||||||
| 717 | - | |||||||||||||||||||||||||
| 718 | static QString extractEncodingDecl(const QString &text, bool *needMoreText) | - | ||||||||||||||||||||||||
| 719 | { | - | ||||||||||||||||||||||||
| 720 | *needMoreText = false; | - | ||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||
| 722 | int l = text.length(); | - | ||||||||||||||||||||||||
| 723 | QString snip = QString::fromLatin1("<?xml").left(l); | - | ||||||||||||||||||||||||
| 724 | if (l > 0
| 6-3097 | ||||||||||||||||||||||||
| 725 | return executed 1742 times by 2 tests: QString();return QString();Executed by:
executed 1742 times by 2 tests: return QString();Executed by:
| 1742 | ||||||||||||||||||||||||
| 726 | - | |||||||||||||||||||||||||
| 727 | int endPos = text.indexOf(QLatin1Char('>')); | - | ||||||||||||||||||||||||
| 728 | if (endPos == -1
| 119-1242 | ||||||||||||||||||||||||
| 729 | *needMoreText = l < 255; | - | ||||||||||||||||||||||||
| 730 | return executed 1242 times by 1 test: QString();return QString();Executed by:
executed 1242 times by 1 test: return QString();Executed by:
| 1242 | ||||||||||||||||||||||||
| 731 | } | - | ||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||
| 733 | int pos = text.indexOf(QLatin1String("encoding")); | - | ||||||||||||||||||||||||
| 734 | if (pos == -1
| 0-67 | ||||||||||||||||||||||||
| 735 | return executed 52 times by 1 test: QString();return QString();Executed by:
executed 52 times by 1 test: return QString();Executed by:
| 52 | ||||||||||||||||||||||||
| 736 | - | |||||||||||||||||||||||||
| 737 | while (pos < endPos
| 0-670 | ||||||||||||||||||||||||
| 738 | ushort uc = text.at(pos).unicode(); | - | ||||||||||||||||||||||||
| 739 | if (uc == '\''
| 0-670 | ||||||||||||||||||||||||
| 740 | break; executed 67 times by 2 tests: break;Executed by:
| 67 | ||||||||||||||||||||||||
| 741 | ++pos; | - | ||||||||||||||||||||||||
| 742 | } executed 603 times by 2 tests: end of blockExecuted by:
| 603 | ||||||||||||||||||||||||
| 743 | - | |||||||||||||||||||||||||
| 744 | if (pos == endPos
| 0-67 | ||||||||||||||||||||||||
| 745 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 746 | - | |||||||||||||||||||||||||
| 747 | QString encoding; | - | ||||||||||||||||||||||||
| 748 | ++pos; | - | ||||||||||||||||||||||||
| 749 | while (pos < endPos
| 0-404 | ||||||||||||||||||||||||
| 750 | ushort uc = text.at(pos).unicode(); | - | ||||||||||||||||||||||||
| 751 | if (uc == '\''
| 0-404 | ||||||||||||||||||||||||
| 752 | break; executed 67 times by 2 tests: break;Executed by:
| 67 | ||||||||||||||||||||||||
| 753 | encoding.append(uc); | - | ||||||||||||||||||||||||
| 754 | ++pos; | - | ||||||||||||||||||||||||
| 755 | } executed 337 times by 2 tests: end of blockExecuted by:
| 337 | ||||||||||||||||||||||||
| 756 | - | |||||||||||||||||||||||||
| 757 | return executed 67 times by 2 tests: encoding;return encoding;Executed by:
executed 67 times by 2 tests: return encoding;Executed by:
| 67 | ||||||||||||||||||||||||
| 758 | } | - | ||||||||||||||||||||||||
| 759 | QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) | - | ||||||||||||||||||||||||
| 760 | { | - | ||||||||||||||||||||||||
| 761 | - | |||||||||||||||||||||||||
| 762 | - | |||||||||||||||||||||||||
| 763 | - | |||||||||||||||||||||||||
| 764 | - | |||||||||||||||||||||||||
| 765 | if (data.size() == 0
| 227-45798 | ||||||||||||||||||||||||
| 766 | return executed 227 times by 3 tests: QString();return QString();Executed by:
executed 227 times by 3 tests: return QString();Executed by:
| 227 | ||||||||||||||||||||||||
| 767 | if (beginning
| 0-45798 | ||||||||||||||||||||||||
| 768 | delete d->encMapper; | - | ||||||||||||||||||||||||
| 769 | d->encMapper = 0; | - | ||||||||||||||||||||||||
| 770 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||
| 772 | int mib = 106; | - | ||||||||||||||||||||||||
| 773 | - | |||||||||||||||||||||||||
| 774 | - | |||||||||||||||||||||||||
| 775 | if (d->encMapper == 0
| 1861-43937 | ||||||||||||||||||||||||
| 776 | d->encodingDeclBytes.clear(); | - | ||||||||||||||||||||||||
| 777 | d->encodingDeclChars.clear(); | - | ||||||||||||||||||||||||
| 778 | d->lookingForEncodingDecl = true; | - | ||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||
| 781 | if (data.size() >= 4
| 494-1367 | ||||||||||||||||||||||||
| 782 | uchar ch1 = data.at(0); | - | ||||||||||||||||||||||||
| 783 | uchar ch2 = data.at(1); | - | ||||||||||||||||||||||||
| 784 | uchar ch3 = data.at(2); | - | ||||||||||||||||||||||||
| 785 | uchar ch4 = data.at(3); | - | ||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||
| 787 | if ((ch1 == 0
| 0-1367 | ||||||||||||||||||||||||
| 788 | (ch1 == 0xff
| 0-1345 | ||||||||||||||||||||||||
| 789 | mib = 1017; never executed: mib = 1017; | 0 | ||||||||||||||||||||||||
| 790 | else if (ch1 == 0x3c
| 0-1343 | ||||||||||||||||||||||||
| 791 | mib = 1019; never executed: mib = 1019; | 0 | ||||||||||||||||||||||||
| 792 | else if (ch1 == 0x00
| 0-1367 | ||||||||||||||||||||||||
| 793 | mib = 1018; never executed: mib = 1018; | 0 | ||||||||||||||||||||||||
| 794 | } executed 1367 times by 3 tests: end of blockExecuted by:
| 1367 | ||||||||||||||||||||||||
| 795 | if (mib == 106
| 0-1861 | ||||||||||||||||||||||||
| 796 | uchar ch1 = data.at(0); | - | ||||||||||||||||||||||||
| 797 | uchar ch2 = data.at(1); | - | ||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||
| 799 | if ((ch1 == 0xfe
| 0-1698 | ||||||||||||||||||||||||
| 800 | mib = 1015; executed 29 times by 1 test: mib = 1015;Executed by:
| 29 | ||||||||||||||||||||||||
| 801 | else if (ch1 == 0x3c
| 1-1669 | ||||||||||||||||||||||||
| 802 | mib = 1014; executed 1 time by 1 test: mib = 1014;Executed by:
| 1 | ||||||||||||||||||||||||
| 803 | else if (ch1 == 0x00
| 0-1669 | ||||||||||||||||||||||||
| 804 | mib = 1013; never executed: mib = 1013; | 0 | ||||||||||||||||||||||||
| 805 | } executed 1699 times by 3 tests: end of blockExecuted by:
| 1699 | ||||||||||||||||||||||||
| 806 | - | |||||||||||||||||||||||||
| 807 | QTextCodec *codec = QTextCodec::codecForMib(mib); | - | ||||||||||||||||||||||||
| 808 | ((!(codec)) ? qt_assert("codec",__FILE__,1382) : qt_noop()); | - | ||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||
| 810 | d->encMapper = codec->makeDecoder(); | - | ||||||||||||||||||||||||
| 811 | } executed 1861 times by 3 tests: end of blockExecuted by:
| 1861 | ||||||||||||||||||||||||
| 812 | - | |||||||||||||||||||||||||
| 813 | QString input = d->encMapper->toUnicode(data.constData(), data.size()); | - | ||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||
| 815 | if (d->lookingForEncodingDecl
| 3103-42695 | ||||||||||||||||||||||||
| 816 | d->encodingDeclChars += input; | - | ||||||||||||||||||||||||
| 817 | - | |||||||||||||||||||||||||
| 818 | bool needMoreText; | - | ||||||||||||||||||||||||
| 819 | QString encoding = extractEncodingDecl(d->encodingDeclChars, &needMoreText); | - | ||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||
| 821 | if (!encoding.isEmpty()
| 67-3036 | ||||||||||||||||||||||||
| 822 | if (QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1())
| 0-67 | ||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||
| 824 | if(codec->mibEnum() != mib
| 1-66 | ||||||||||||||||||||||||
| 825 | delete d->encMapper; | - | ||||||||||||||||||||||||
| 826 | d->encMapper = codec->makeDecoder(); | - | ||||||||||||||||||||||||
| 827 | - | |||||||||||||||||||||||||
| 828 | - | |||||||||||||||||||||||||
| 829 | - | |||||||||||||||||||||||||
| 830 | - | |||||||||||||||||||||||||
| 831 | input.clear(); | - | ||||||||||||||||||||||||
| 832 | - | |||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||
| 834 | d->encMapper->toUnicode(d->encodingDeclBytes.constData(), d->encodingDeclBytes.size()); | - | ||||||||||||||||||||||||
| 835 | - | |||||||||||||||||||||||||
| 836 | input = d->encMapper->toUnicode(data.constData(), data.size()); | - | ||||||||||||||||||||||||
| 837 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 838 | } executed 67 times by 2 tests: end of blockExecuted by:
| 67 | ||||||||||||||||||||||||
| 839 | } executed 67 times by 2 tests: end of blockExecuted by:
| 67 | ||||||||||||||||||||||||
| 840 | - | |||||||||||||||||||||||||
| 841 | d->encodingDeclBytes += data; | - | ||||||||||||||||||||||||
| 842 | d->lookingForEncodingDecl = needMoreText; | - | ||||||||||||||||||||||||
| 843 | } executed 3103 times by 3 tests: end of blockExecuted by:
| 3103 | ||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||
| 845 | return executed 45798 times by 3 tests: input;return input;Executed by:
executed 45798 times by 3 tests: return input;Executed by:
| 45798 | ||||||||||||||||||||||||
| 846 | - | |||||||||||||||||||||||||
| 847 | } | - | ||||||||||||||||||||||||
| 848 | QXmlDefaultHandler::QXmlDefaultHandler() | - | ||||||||||||||||||||||||
| 849 | { | - | ||||||||||||||||||||||||
| 850 | - | |||||||||||||||||||||||||
| 851 | - | |||||||||||||||||||||||||
| 852 | (void)d;; | - | ||||||||||||||||||||||||
| 853 | } executed 2103 times by 6 tests: end of blockExecuted by:
| 2103 | ||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||
| 856 | - | |||||||||||||||||||||||||
| 857 | - | |||||||||||||||||||||||||
| 858 | - | |||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||
| 860 | QXmlDefaultHandler::~QXmlDefaultHandler() | - | ||||||||||||||||||||||||
| 861 | { | - | ||||||||||||||||||||||||
| 862 | } | - | ||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||
| 864 | - | |||||||||||||||||||||||||
| 865 | - | |||||||||||||||||||||||||
| 866 | - | |||||||||||||||||||||||||
| 867 | - | |||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||
| 869 | void QXmlDefaultHandler::setDocumentLocator(QXmlLocator*) | - | ||||||||||||||||||||||||
| 870 | { | - | ||||||||||||||||||||||||
| 871 | } | - | ||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||
| 877 | - | |||||||||||||||||||||||||
| 878 | bool QXmlDefaultHandler::startDocument() | - | ||||||||||||||||||||||||
| 879 | { | - | ||||||||||||||||||||||||
| 880 | return executed 255 times by 6 tests: true;return true;Executed by:
executed 255 times by 6 tests: return true;Executed by:
| 255 | ||||||||||||||||||||||||
| 881 | } | - | ||||||||||||||||||||||||
| 882 | - | |||||||||||||||||||||||||
| 883 | - | |||||||||||||||||||||||||
| 884 | - | |||||||||||||||||||||||||
| 885 | - | |||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||
| 887 | - | |||||||||||||||||||||||||
| 888 | bool QXmlDefaultHandler::endDocument() | - | ||||||||||||||||||||||||
| 889 | { | - | ||||||||||||||||||||||||
| 890 | return executed 11 times by 3 tests: true;return true;Executed by:
executed 11 times by 3 tests: return true;Executed by:
| 11 | ||||||||||||||||||||||||
| 891 | } | - | ||||||||||||||||||||||||
| 892 | - | |||||||||||||||||||||||||
| 893 | - | |||||||||||||||||||||||||
| 894 | - | |||||||||||||||||||||||||
| 895 | - | |||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||
| 897 | - | |||||||||||||||||||||||||
| 898 | bool QXmlDefaultHandler::startPrefixMapping(const QString&, const QString&) | - | ||||||||||||||||||||||||
| 899 | { | - | ||||||||||||||||||||||||
| 900 | return executed 5 times by 1 test: true;return true;Executed by:
executed 5 times by 1 test: return true;Executed by:
| 5 | ||||||||||||||||||||||||
| 901 | } | - | ||||||||||||||||||||||||
| 902 | - | |||||||||||||||||||||||||
| 903 | - | |||||||||||||||||||||||||
| 904 | - | |||||||||||||||||||||||||
| 905 | - | |||||||||||||||||||||||||
| 906 | - | |||||||||||||||||||||||||
| 907 | - | |||||||||||||||||||||||||
| 908 | bool QXmlDefaultHandler::endPrefixMapping(const QString&) | - | ||||||||||||||||||||||||
| 909 | { | - | ||||||||||||||||||||||||
| 910 | return executed 4 times by 1 test: true;return true;Executed by:
executed 4 times by 1 test: return true;Executed by:
| 4 | ||||||||||||||||||||||||
| 911 | } | - | ||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||
| 914 | - | |||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||
| 916 | - | |||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||
| 918 | bool QXmlDefaultHandler::startElement(const QString&, const QString&, | - | ||||||||||||||||||||||||
| 919 | const QString&, const QXmlAttributes&) | - | ||||||||||||||||||||||||
| 920 | { | - | ||||||||||||||||||||||||
| 921 | return executed 206 times by 2 tests: true;return true;Executed by:
executed 206 times by 2 tests: return true;Executed by:
| 206 | ||||||||||||||||||||||||
| 922 | } | - | ||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||
| 924 | - | |||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||
| 926 | - | |||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||
| 928 | - | |||||||||||||||||||||||||
| 929 | bool QXmlDefaultHandler::endElement(const QString&, const QString&, | - | ||||||||||||||||||||||||
| 930 | const QString&) | - | ||||||||||||||||||||||||
| 931 | { | - | ||||||||||||||||||||||||
| 932 | return executed 206 times by 2 tests: true;return true;Executed by:
executed 206 times by 2 tests: return true;Executed by:
| 206 | ||||||||||||||||||||||||
| 933 | } | - | ||||||||||||||||||||||||
| 934 | - | |||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||
| 936 | - | |||||||||||||||||||||||||
| 937 | - | |||||||||||||||||||||||||
| 938 | - | |||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||
| 940 | bool QXmlDefaultHandler::characters(const QString&) | - | ||||||||||||||||||||||||
| 941 | { | - | ||||||||||||||||||||||||
| 942 | return executed 394 times by 1 test: true;return true;Executed by:
executed 394 times by 1 test: return true;Executed by:
| 394 | ||||||||||||||||||||||||
| 943 | } | - | ||||||||||||||||||||||||
| 944 | - | |||||||||||||||||||||||||
| 945 | - | |||||||||||||||||||||||||
| 946 | - | |||||||||||||||||||||||||
| 947 | - | |||||||||||||||||||||||||
| 948 | - | |||||||||||||||||||||||||
| 949 | - | |||||||||||||||||||||||||
| 950 | bool QXmlDefaultHandler::ignorableWhitespace(const QString&) | - | ||||||||||||||||||||||||
| 951 | { | - | ||||||||||||||||||||||||
| 952 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 953 | } | - | ||||||||||||||||||||||||
| 954 | - | |||||||||||||||||||||||||
| 955 | - | |||||||||||||||||||||||||
| 956 | - | |||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||
| 958 | - | |||||||||||||||||||||||||
| 959 | - | |||||||||||||||||||||||||
| 960 | bool QXmlDefaultHandler::processingInstruction(const QString&, | - | ||||||||||||||||||||||||
| 961 | const QString&) | - | ||||||||||||||||||||||||
| 962 | { | - | ||||||||||||||||||||||||
| 963 | return executed 6 times by 2 tests: true;return true;Executed by:
executed 6 times by 2 tests: return true;Executed by:
| 6 | ||||||||||||||||||||||||
| 964 | } | - | ||||||||||||||||||||||||
| 965 | - | |||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||
| 967 | - | |||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||
| 969 | - | |||||||||||||||||||||||||
| 970 | - | |||||||||||||||||||||||||
| 971 | bool QXmlDefaultHandler::skippedEntity(const QString&) | - | ||||||||||||||||||||||||
| 972 | { | - | ||||||||||||||||||||||||
| 973 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 974 | } | - | ||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||
| 977 | - | |||||||||||||||||||||||||
| 978 | - | |||||||||||||||||||||||||
| 979 | - | |||||||||||||||||||||||||
| 980 | - | |||||||||||||||||||||||||
| 981 | bool QXmlDefaultHandler::warning(const QXmlParseException&) | - | ||||||||||||||||||||||||
| 982 | { | - | ||||||||||||||||||||||||
| 983 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 984 | } | - | ||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||
| 986 | - | |||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||
| 991 | bool QXmlDefaultHandler::error(const QXmlParseException&) | - | ||||||||||||||||||||||||
| 992 | { | - | ||||||||||||||||||||||||
| 993 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 994 | } | - | ||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||
| 996 | - | |||||||||||||||||||||||||
| 997 | - | |||||||||||||||||||||||||
| 998 | - | |||||||||||||||||||||||||
| 999 | - | |||||||||||||||||||||||||
| 1000 | - | |||||||||||||||||||||||||
| 1001 | bool QXmlDefaultHandler::fatalError(const QXmlParseException&) | - | ||||||||||||||||||||||||
| 1002 | { | - | ||||||||||||||||||||||||
| 1003 | return executed 3 times by 1 test: true;return true;Executed by:
executed 3 times by 1 test: return true;Executed by:
| 3 | ||||||||||||||||||||||||
| 1004 | } | - | ||||||||||||||||||||||||
| 1005 | - | |||||||||||||||||||||||||
| 1006 | - | |||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||
| 1008 | - | |||||||||||||||||||||||||
| 1009 | - | |||||||||||||||||||||||||
| 1010 | - | |||||||||||||||||||||||||
| 1011 | bool QXmlDefaultHandler::notationDecl(const QString&, const QString&, | - | ||||||||||||||||||||||||
| 1012 | const QString&) | - | ||||||||||||||||||||||||
| 1013 | { | - | ||||||||||||||||||||||||
| 1014 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1015 | } | - | ||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||
| 1018 | - | |||||||||||||||||||||||||
| 1019 | - | |||||||||||||||||||||||||
| 1020 | - | |||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||
| 1022 | bool QXmlDefaultHandler::unparsedEntityDecl(const QString&, const QString&, | - | ||||||||||||||||||||||||
| 1023 | const QString&, const QString&) | - | ||||||||||||||||||||||||
| 1024 | { | - | ||||||||||||||||||||||||
| 1025 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1026 | } | - | ||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||
| 1028 | - | |||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||
| 1034 | bool QXmlDefaultHandler::resolveEntity(const QString&, const QString&, | - | ||||||||||||||||||||||||
| 1035 | QXmlInputSource*& ret) | - | ||||||||||||||||||||||||
| 1036 | { | - | ||||||||||||||||||||||||
| 1037 | ret = 0; | - | ||||||||||||||||||||||||
| 1038 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1039 | } | - | ||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||
| 1041 | - | |||||||||||||||||||||||||
| 1042 | - | |||||||||||||||||||||||||
| 1043 | - | |||||||||||||||||||||||||
| 1044 | - | |||||||||||||||||||||||||
| 1045 | - | |||||||||||||||||||||||||
| 1046 | QString QXmlDefaultHandler::errorString() const | - | ||||||||||||||||||||||||
| 1047 | { | - | ||||||||||||||||||||||||
| 1048 | return never executed: QString::fromLatin1("error triggered by consumer");return QString::fromLatin1("error triggered by consumer");never executed: return QString::fromLatin1("error triggered by consumer"); | 0 | ||||||||||||||||||||||||
| 1049 | } | - | ||||||||||||||||||||||||
| 1050 | - | |||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||
| 1052 | - | |||||||||||||||||||||||||
| 1053 | - | |||||||||||||||||||||||||
| 1054 | - | |||||||||||||||||||||||||
| 1055 | - | |||||||||||||||||||||||||
| 1056 | bool QXmlDefaultHandler::startDTD(const QString&, const QString&, const QString&) | - | ||||||||||||||||||||||||
| 1057 | { | - | ||||||||||||||||||||||||
| 1058 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1059 | } | - | ||||||||||||||||||||||||
| 1060 | - | |||||||||||||||||||||||||
| 1061 | - | |||||||||||||||||||||||||
| 1062 | - | |||||||||||||||||||||||||
| 1063 | - | |||||||||||||||||||||||||
| 1064 | - | |||||||||||||||||||||||||
| 1065 | - | |||||||||||||||||||||||||
| 1066 | bool QXmlDefaultHandler::endDTD() | - | ||||||||||||||||||||||||
| 1067 | { | - | ||||||||||||||||||||||||
| 1068 | return executed 157 times by 2 tests: true;return true;Executed by:
executed 157 times by 2 tests: return true;Executed by:
| 157 | ||||||||||||||||||||||||
| 1069 | } | - | ||||||||||||||||||||||||
| 1070 | - | |||||||||||||||||||||||||
| 1071 | - | |||||||||||||||||||||||||
| 1072 | - | |||||||||||||||||||||||||
| 1073 | - | |||||||||||||||||||||||||
| 1074 | - | |||||||||||||||||||||||||
| 1075 | - | |||||||||||||||||||||||||
| 1076 | bool QXmlDefaultHandler::startEntity(const QString&) | - | ||||||||||||||||||||||||
| 1077 | { | - | ||||||||||||||||||||||||
| 1078 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1079 | } | - | ||||||||||||||||||||||||
| 1080 | - | |||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||
| 1082 | - | |||||||||||||||||||||||||
| 1083 | - | |||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||
| 1086 | bool QXmlDefaultHandler::endEntity(const QString&) | - | ||||||||||||||||||||||||
| 1087 | { | - | ||||||||||||||||||||||||
| 1088 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1089 | } | - | ||||||||||||||||||||||||
| 1090 | - | |||||||||||||||||||||||||
| 1091 | - | |||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||
| 1093 | - | |||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||
| 1095 | - | |||||||||||||||||||||||||
| 1096 | bool QXmlDefaultHandler::startCDATA() | - | ||||||||||||||||||||||||
| 1097 | { | - | ||||||||||||||||||||||||
| 1098 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1099 | } | - | ||||||||||||||||||||||||
| 1100 | - | |||||||||||||||||||||||||
| 1101 | - | |||||||||||||||||||||||||
| 1102 | - | |||||||||||||||||||||||||
| 1103 | - | |||||||||||||||||||||||||
| 1104 | - | |||||||||||||||||||||||||
| 1105 | - | |||||||||||||||||||||||||
| 1106 | bool QXmlDefaultHandler::endCDATA() | - | ||||||||||||||||||||||||
| 1107 | { | - | ||||||||||||||||||||||||
| 1108 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1109 | } | - | ||||||||||||||||||||||||
| 1110 | - | |||||||||||||||||||||||||
| 1111 | - | |||||||||||||||||||||||||
| 1112 | - | |||||||||||||||||||||||||
| 1113 | - | |||||||||||||||||||||||||
| 1114 | - | |||||||||||||||||||||||||
| 1115 | - | |||||||||||||||||||||||||
| 1116 | bool QXmlDefaultHandler::comment(const QString&) | - | ||||||||||||||||||||||||
| 1117 | { | - | ||||||||||||||||||||||||
| 1118 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1119 | } | - | ||||||||||||||||||||||||
| 1120 | - | |||||||||||||||||||||||||
| 1121 | - | |||||||||||||||||||||||||
| 1122 | - | |||||||||||||||||||||||||
| 1123 | - | |||||||||||||||||||||||||
| 1124 | - | |||||||||||||||||||||||||
| 1125 | - | |||||||||||||||||||||||||
| 1126 | bool QXmlDefaultHandler::attributeDecl(const QString&, const QString&, const QString&, const QString&, const QString&) | - | ||||||||||||||||||||||||
| 1127 | { | - | ||||||||||||||||||||||||
| 1128 | return executed 1 time by 1 test: true;return true;Executed by:
executed 1 time by 1 test: return true;Executed by:
| 1 | ||||||||||||||||||||||||
| 1129 | } | - | ||||||||||||||||||||||||
| 1130 | - | |||||||||||||||||||||||||
| 1131 | - | |||||||||||||||||||||||||
| 1132 | - | |||||||||||||||||||||||||
| 1133 | - | |||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||
| 1136 | bool QXmlDefaultHandler::internalEntityDecl(const QString&, const QString&) | - | ||||||||||||||||||||||||
| 1137 | { | - | ||||||||||||||||||||||||
| 1138 | return executed 5 times by 1 test: true;return true;Executed by:
executed 5 times by 1 test: return true;Executed by:
| 5 | ||||||||||||||||||||||||
| 1139 | } | - | ||||||||||||||||||||||||
| 1140 | - | |||||||||||||||||||||||||
| 1141 | - | |||||||||||||||||||||||||
| 1142 | - | |||||||||||||||||||||||||
| 1143 | - | |||||||||||||||||||||||||
| 1144 | - | |||||||||||||||||||||||||
| 1145 | - | |||||||||||||||||||||||||
| 1146 | bool QXmlDefaultHandler::externalEntityDecl(const QString&, const QString&, const QString&) | - | ||||||||||||||||||||||||
| 1147 | { | - | ||||||||||||||||||||||||
| 1148 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1149 | } | - | ||||||||||||||||||||||||
| 1150 | inline bool QXmlSimpleReaderPrivate::atEnd() | - | ||||||||||||||||||||||||
| 1151 | { | - | ||||||||||||||||||||||||
| 1152 | return executed 1050513 times by 6 tests: (c.unicode()|0x0001) == 0xffff;return (c.unicode()|0x0001) == 0xffff;Executed by:
executed 1050513 times by 6 tests: return (c.unicode()|0x0001) == 0xffff;Executed by:
| 1050513 | ||||||||||||||||||||||||
| 1153 | } | - | ||||||||||||||||||||||||
| 1154 | - | |||||||||||||||||||||||||
| 1155 | inline void QXmlSimpleReaderPrivate::stringClear() | - | ||||||||||||||||||||||||
| 1156 | { | - | ||||||||||||||||||||||||
| 1157 | stringValueLen = 0; stringArrayPos = 0; | - | ||||||||||||||||||||||||
| 1158 | } executed 21975 times by 6 tests: end of blockExecuted by:
| 21975 | ||||||||||||||||||||||||
| 1159 | inline void QXmlSimpleReaderPrivate::nameClear() | - | ||||||||||||||||||||||||
| 1160 | { | - | ||||||||||||||||||||||||
| 1161 | nameValueLen = 0; nameArrayPos = 0; | - | ||||||||||||||||||||||||
| 1162 | } executed 30021 times by 6 tests: end of blockExecuted by:
| 30021 | ||||||||||||||||||||||||
| 1163 | - | |||||||||||||||||||||||||
| 1164 | inline void QXmlSimpleReaderPrivate::refClear() | - | ||||||||||||||||||||||||
| 1165 | { | - | ||||||||||||||||||||||||
| 1166 | refValueLen = 0; refArrayPos = 0; | - | ||||||||||||||||||||||||
| 1167 | } executed 2957 times by 3 tests: end of blockExecuted by:
| 2957 | ||||||||||||||||||||||||
| 1168 | - | |||||||||||||||||||||||||
| 1169 | QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader) | - | ||||||||||||||||||||||||
| 1170 | { | - | ||||||||||||||||||||||||
| 1171 | q_ptr = reader; | - | ||||||||||||||||||||||||
| 1172 | parseStack = 0; | - | ||||||||||||||||||||||||
| 1173 | - | |||||||||||||||||||||||||
| 1174 | locator.reset(new QXmlSimpleReaderLocator(reader)); | - | ||||||||||||||||||||||||
| 1175 | entityRes = 0; | - | ||||||||||||||||||||||||
| 1176 | dtdHnd = 0; | - | ||||||||||||||||||||||||
| 1177 | contentHnd = 0; | - | ||||||||||||||||||||||||
| 1178 | errorHnd = 0; | - | ||||||||||||||||||||||||
| 1179 | lexicalHnd = 0; | - | ||||||||||||||||||||||||
| 1180 | declHnd = 0; | - | ||||||||||||||||||||||||
| 1181 | - | |||||||||||||||||||||||||
| 1182 | - | |||||||||||||||||||||||||
| 1183 | useNamespaces = true; | - | ||||||||||||||||||||||||
| 1184 | useNamespacePrefixes = false; | - | ||||||||||||||||||||||||
| 1185 | reportWhitespaceCharData = true; | - | ||||||||||||||||||||||||
| 1186 | reportEntities = false; | - | ||||||||||||||||||||||||
| 1187 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 1188 | - | |||||||||||||||||||||||||
| 1189 | QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() | - | ||||||||||||||||||||||||
| 1190 | { | - | ||||||||||||||||||||||||
| 1191 | delete parseStack; | - | ||||||||||||||||||||||||
| 1192 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 1193 | - | |||||||||||||||||||||||||
| 1194 | void QXmlSimpleReaderPrivate::initIncrementalParsing() | - | ||||||||||||||||||||||||
| 1195 | { | - | ||||||||||||||||||||||||
| 1196 | if(parseStack
| 0-1490 | ||||||||||||||||||||||||
| 1197 | parseStack->clear(); never executed: parseStack->clear(); | 0 | ||||||||||||||||||||||||
| 1198 | else | - | ||||||||||||||||||||||||
| 1199 | parseStack = new QStack<ParseState>; executed 1490 times by 1 test: parseStack = new QStack<ParseState>;Executed by:
| 1490 | ||||||||||||||||||||||||
| 1200 | } | - | ||||||||||||||||||||||||
| 1201 | static inline bool is_S(QChar ch) | - | ||||||||||||||||||||||||
| 1202 | { | - | ||||||||||||||||||||||||
| 1203 | ushort uc = ch.unicode(); | - | ||||||||||||||||||||||||
| 1204 | return executed 187992 times by 6 tests: (uc == ' 'return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');Executed by:
executed 187992 times by 6 tests: return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');Executed by:
| 0-187992 | ||||||||||||||||||||||||
| 1205 | } | - | ||||||||||||||||||||||||
| 1206 | - | |||||||||||||||||||||||||
| 1207 | enum NameChar { NameBeginning, NameNotBeginning, NotName }; | - | ||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||
| 1209 | static const char Begi = (char)NameBeginning; | - | ||||||||||||||||||||||||
| 1210 | static const char NtBg = (char)NameNotBeginning; | - | ||||||||||||||||||||||||
| 1211 | static const char NotN = (char)NotName; | - | ||||||||||||||||||||||||
| 1212 | - | |||||||||||||||||||||||||
| 1213 | static const char nameCharTable[128] = | - | ||||||||||||||||||||||||
| 1214 | { | - | ||||||||||||||||||||||||
| 1215 | - | |||||||||||||||||||||||||
| 1216 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
| 1217 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
| 1218 | - | |||||||||||||||||||||||||
| 1219 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
| 1220 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
| 1221 | - | |||||||||||||||||||||||||
| 1222 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
| 1223 | NotN, NotN, NotN, NotN, NotN, NtBg, NtBg, NotN, | - | ||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||
| 1225 | NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, | - | ||||||||||||||||||||||||
| 1226 | NtBg, NtBg, Begi, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||
| 1227 | - | |||||||||||||||||||||||||
| 1228 | NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
| 1229 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
| 1230 | - | |||||||||||||||||||||||||
| 1231 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
| 1232 | Begi, Begi, Begi, NotN, NotN, NotN, NotN, Begi, | - | ||||||||||||||||||||||||
| 1233 | - | |||||||||||||||||||||||||
| 1234 | NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
| 1235 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
| 1236 | - | |||||||||||||||||||||||||
| 1237 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||
| 1238 | Begi, Begi, Begi, NotN, NotN, NotN, NotN, NotN | - | ||||||||||||||||||||||||
| 1239 | }; | - | ||||||||||||||||||||||||
| 1240 | - | |||||||||||||||||||||||||
| 1241 | static inline NameChar fastDetermineNameChar(QChar ch) | - | ||||||||||||||||||||||||
| 1242 | { | - | ||||||||||||||||||||||||
| 1243 | ushort uc = ch.unicode(); | - | ||||||||||||||||||||||||
| 1244 | if (!(uc & ~0x7f)
| 2385-258018 | ||||||||||||||||||||||||
| 1245 | return executed 258018 times by 6 tests: (NameChar)nameCharTable[uc];return (NameChar)nameCharTable[uc];Executed by:
executed 258018 times by 6 tests: return (NameChar)nameCharTable[uc];Executed by:
| 258018 | ||||||||||||||||||||||||
| 1246 | - | |||||||||||||||||||||||||
| 1247 | QChar::Category cat = ch.category(); | - | ||||||||||||||||||||||||
| 1248 | - | |||||||||||||||||||||||||
| 1249 | if ((cat >= QChar::Letter_Uppercase
| 12-2297 | ||||||||||||||||||||||||
| 1250 | || cat == QChar::Number_Letter
| 0-100 | ||||||||||||||||||||||||
| 1251 | return executed 2285 times by 1 test: NameBeginning;return NameBeginning;Executed by:
executed 2285 times by 1 test: return NameBeginning;Executed by:
| 2285 | ||||||||||||||||||||||||
| 1252 | if ((cat >= QChar::Number_DecimalDigit
| 0-77 | ||||||||||||||||||||||||
| 1253 | || (cat >= QChar::Mark_NonSpacing
| 0-100 | ||||||||||||||||||||||||
| 1254 | return executed 77 times by 1 test: NameNotBeginning;return NameNotBeginning;Executed by:
executed 77 times by 1 test: return NameNotBeginning;Executed by:
| 77 | ||||||||||||||||||||||||
| 1255 | return executed 23 times by 1 test: NotName;return NotName;Executed by:
executed 23 times by 1 test: return NotName;Executed by:
| 23 | ||||||||||||||||||||||||
| 1256 | } | - | ||||||||||||||||||||||||
| 1257 | - | |||||||||||||||||||||||||
| 1258 | static NameChar determineNameChar(QChar ch) | - | ||||||||||||||||||||||||
| 1259 | { | - | ||||||||||||||||||||||||
| 1260 | return executed 40888 times by 6 tests: fastDetermineNameChar(ch);return fastDetermineNameChar(ch);Executed by:
executed 40888 times by 6 tests: return fastDetermineNameChar(ch);Executed by:
| 40888 | ||||||||||||||||||||||||
| 1261 | } | - | ||||||||||||||||||||||||
| 1262 | - | |||||||||||||||||||||||||
| 1263 | - | |||||||||||||||||||||||||
| 1264 | - | |||||||||||||||||||||||||
| 1265 | - | |||||||||||||||||||||||||
| 1266 | - | |||||||||||||||||||||||||
| 1267 | QXmlSimpleReader::QXmlSimpleReader() | - | ||||||||||||||||||||||||
| 1268 | : d_ptr(new QXmlSimpleReaderPrivate(this)) | - | ||||||||||||||||||||||||
| 1269 | { | - | ||||||||||||||||||||||||
| 1270 | } executed 2104 times by 6 tests: end of blockExecuted by:
| 2104 | ||||||||||||||||||||||||
| 1271 | - | |||||||||||||||||||||||||
| 1272 | - | |||||||||||||||||||||||||
| 1273 | - | |||||||||||||||||||||||||
| 1274 | - | |||||||||||||||||||||||||
| 1275 | QXmlSimpleReader::~QXmlSimpleReader() | - | ||||||||||||||||||||||||
| 1276 | { | - | ||||||||||||||||||||||||
| 1277 | } | - | ||||||||||||||||||||||||
| 1278 | - | |||||||||||||||||||||||||
| 1279 | - | |||||||||||||||||||||||||
| 1280 | - | |||||||||||||||||||||||||
| 1281 | - | |||||||||||||||||||||||||
| 1282 | bool QXmlSimpleReader::feature(const QString& name, bool *ok) const | - | ||||||||||||||||||||||||
| 1283 | { | - | ||||||||||||||||||||||||
| 1284 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1285 | - | |||||||||||||||||||||||||
| 1286 | if (ok != 0
| 0-246 | ||||||||||||||||||||||||
| 1287 | * never executed: ok = true;*ok = true;never executed: *ok = true; | 0 | ||||||||||||||||||||||||
| 1288 | if (name == QLatin1String("http://xml.org/sax/features/namespaces")
| 2-244 | ||||||||||||||||||||||||
| 1289 | return executed 244 times by 5 tests: d->useNamespaces;return d->useNamespaces;Executed by:
executed 244 times by 5 tests: return d->useNamespaces;Executed by:
| 244 | ||||||||||||||||||||||||
| 1290 | } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
| 0-2 | ||||||||||||||||||||||||
| 1291 | return executed 2 times by 1 test: d->useNamespacePrefixes;return d->useNamespacePrefixes;Executed by:
executed 2 times by 1 test: return d->useNamespacePrefixes;Executed by:
| 2 | ||||||||||||||||||||||||
| 1292 | } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
| 1293 | || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
| 1294 | return never executed: d->reportWhitespaceCharData;return d->reportWhitespaceCharData;never executed: return d->reportWhitespaceCharData; | 0 | ||||||||||||||||||||||||
| 1295 | } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
| 1296 | || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
| 1297 | return never executed: d->reportEntities;return d->reportEntities;never executed: return d->reportEntities; | 0 | ||||||||||||||||||||||||
| 1298 | } else { | - | ||||||||||||||||||||||||
| 1299 | QMessageLogger(__FILE__, 2930, __PRETTY_FUNCTION__).warning("Unknown feature %s", name.toLatin1().data()); | - | ||||||||||||||||||||||||
| 1300 | if (ok != 0
| 0 | ||||||||||||||||||||||||
| 1301 | * never executed: ok = false;*ok = false;never executed: *ok = false; | 0 | ||||||||||||||||||||||||
| 1302 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1303 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1304 | } | - | ||||||||||||||||||||||||
| 1305 | void QXmlSimpleReader::setFeature(const QString& name, bool enable) | - | ||||||||||||||||||||||||
| 1306 | { | - | ||||||||||||||||||||||||
| 1307 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1308 | if (name == QLatin1String("http://xml.org/sax/features/namespaces")
| 244-488 | ||||||||||||||||||||||||
| 1309 | d->useNamespaces = enable; | - | ||||||||||||||||||||||||
| 1310 | } executed 244 times by 5 tests: else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")end of blockExecuted by:
| 244 | ||||||||||||||||||||||||
| 1311 | d->useNamespacePrefixes = enable; | - | ||||||||||||||||||||||||
| 1312 | } executed 244 times by 5 tests: else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")end of blockExecuted by:
| 0-244 | ||||||||||||||||||||||||
| 1313 | || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
| 1314 | d->reportWhitespaceCharData = enable; | - | ||||||||||||||||||||||||
| 1315 | } executed 244 times by 5 tests: else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")end of blockExecuted by:
| 0-244 | ||||||||||||||||||||||||
| 1316 | || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
| 1317 | d->reportEntities = enable; | - | ||||||||||||||||||||||||
| 1318 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1319 | QMessageLogger(__FILE__, 2984, __PRETTY_FUNCTION__).warning("Unknown feature %s", name.toLatin1().data()); | - | ||||||||||||||||||||||||
| 1320 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1321 | } | - | ||||||||||||||||||||||||
| 1322 | - | |||||||||||||||||||||||||
| 1323 | - | |||||||||||||||||||||||||
| 1324 | - | |||||||||||||||||||||||||
| 1325 | bool QXmlSimpleReader::hasFeature(const QString& name) const | - | ||||||||||||||||||||||||
| 1326 | { | - | ||||||||||||||||||||||||
| 1327 | if (name == QLatin1String("http://xml.org/sax/features/namespaces")
| 0 | ||||||||||||||||||||||||
| 1328 | || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
| 0 | ||||||||||||||||||||||||
| 1329 | || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
| 1330 | || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
| 0 | ||||||||||||||||||||||||
| 1331 | || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
| 1332 | || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
| 0 | ||||||||||||||||||||||||
| 1333 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1334 | } else { | - | ||||||||||||||||||||||||
| 1335 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1336 | } | - | ||||||||||||||||||||||||
| 1337 | } | - | ||||||||||||||||||||||||
| 1338 | - | |||||||||||||||||||||||||
| 1339 | - | |||||||||||||||||||||||||
| 1340 | - | |||||||||||||||||||||||||
| 1341 | void* QXmlSimpleReader::property(const QString&, bool *ok) const | - | ||||||||||||||||||||||||
| 1342 | { | - | ||||||||||||||||||||||||
| 1343 | if (ok != 0
| 0 | ||||||||||||||||||||||||
| 1344 | * never executed: ok = false;*ok = false;never executed: *ok = false; | 0 | ||||||||||||||||||||||||
| 1345 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 1346 | } | - | ||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||
| 1348 | - | |||||||||||||||||||||||||
| 1349 | - | |||||||||||||||||||||||||
| 1350 | void QXmlSimpleReader::setProperty(const QString&, void*) | - | ||||||||||||||||||||||||
| 1351 | { | - | ||||||||||||||||||||||||
| 1352 | } | - | ||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||
| 1354 | - | |||||||||||||||||||||||||
| 1355 | - | |||||||||||||||||||||||||
| 1356 | - | |||||||||||||||||||||||||
| 1357 | bool QXmlSimpleReader::hasProperty(const QString&) const | - | ||||||||||||||||||||||||
| 1358 | { | - | ||||||||||||||||||||||||
| 1359 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1360 | } | - | ||||||||||||||||||||||||
| 1361 | - | |||||||||||||||||||||||||
| 1362 | - | |||||||||||||||||||||||||
| 1363 | - | |||||||||||||||||||||||||
| 1364 | - | |||||||||||||||||||||||||
| 1365 | void QXmlSimpleReader::setEntityResolver(QXmlEntityResolver* handler) | - | ||||||||||||||||||||||||
| 1366 | { | - | ||||||||||||||||||||||||
| 1367 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1368 | d->entityRes = handler; | - | ||||||||||||||||||||||||
| 1369 | } executed 1845 times by 1 test: end of blockExecuted by:
| 1845 | ||||||||||||||||||||||||
| 1370 | - | |||||||||||||||||||||||||
| 1371 | - | |||||||||||||||||||||||||
| 1372 | - | |||||||||||||||||||||||||
| 1373 | - | |||||||||||||||||||||||||
| 1374 | QXmlEntityResolver* QXmlSimpleReader::entityResolver() const | - | ||||||||||||||||||||||||
| 1375 | { | - | ||||||||||||||||||||||||
| 1376 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1377 | return never executed: d->entityRes;return d->entityRes;never executed: return d->entityRes; | 0 | ||||||||||||||||||||||||
| 1378 | } | - | ||||||||||||||||||||||||
| 1379 | - | |||||||||||||||||||||||||
| 1380 | - | |||||||||||||||||||||||||
| 1381 | - | |||||||||||||||||||||||||
| 1382 | - | |||||||||||||||||||||||||
| 1383 | void QXmlSimpleReader::setDTDHandler(QXmlDTDHandler* handler) | - | ||||||||||||||||||||||||
| 1384 | { | - | ||||||||||||||||||||||||
| 1385 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1386 | d->dtdHnd = handler; | - | ||||||||||||||||||||||||
| 1387 | } executed 2089 times by 5 tests: end of blockExecuted by:
| 2089 | ||||||||||||||||||||||||
| 1388 | - | |||||||||||||||||||||||||
| 1389 | - | |||||||||||||||||||||||||
| 1390 | - | |||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||
| 1392 | QXmlDTDHandler* QXmlSimpleReader::DTDHandler() const | - | ||||||||||||||||||||||||
| 1393 | { | - | ||||||||||||||||||||||||
| 1394 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1395 | return never executed: d->dtdHnd;return d->dtdHnd;never executed: return d->dtdHnd; | 0 | ||||||||||||||||||||||||
| 1396 | } | - | ||||||||||||||||||||||||
| 1397 | - | |||||||||||||||||||||||||
| 1398 | - | |||||||||||||||||||||||||
| 1399 | - | |||||||||||||||||||||||||
| 1400 | - | |||||||||||||||||||||||||
| 1401 | void QXmlSimpleReader::setContentHandler(QXmlContentHandler* handler) | - | ||||||||||||||||||||||||
| 1402 | { | - | ||||||||||||||||||||||||
| 1403 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1404 | d->contentHnd = handler; | - | ||||||||||||||||||||||||
| 1405 | } executed 2100 times by 6 tests: end of blockExecuted by:
| 2100 | ||||||||||||||||||||||||
| 1406 | - | |||||||||||||||||||||||||
| 1407 | - | |||||||||||||||||||||||||
| 1408 | - | |||||||||||||||||||||||||
| 1409 | - | |||||||||||||||||||||||||
| 1410 | QXmlContentHandler* QXmlSimpleReader::contentHandler() const | - | ||||||||||||||||||||||||
| 1411 | { | - | ||||||||||||||||||||||||
| 1412 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1413 | return never executed: d->contentHnd;return d->contentHnd;never executed: return d->contentHnd; | 0 | ||||||||||||||||||||||||
| 1414 | } | - | ||||||||||||||||||||||||
| 1415 | - | |||||||||||||||||||||||||
| 1416 | - | |||||||||||||||||||||||||
| 1417 | - | |||||||||||||||||||||||||
| 1418 | - | |||||||||||||||||||||||||
| 1419 | void QXmlSimpleReader::setErrorHandler(QXmlErrorHandler* handler) | - | ||||||||||||||||||||||||
| 1420 | { | - | ||||||||||||||||||||||||
| 1421 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1422 | d->errorHnd = handler; | - | ||||||||||||||||||||||||
| 1423 | } executed 2094 times by 5 tests: end of blockExecuted by:
| 2094 | ||||||||||||||||||||||||
| 1424 | - | |||||||||||||||||||||||||
| 1425 | - | |||||||||||||||||||||||||
| 1426 | - | |||||||||||||||||||||||||
| 1427 | - | |||||||||||||||||||||||||
| 1428 | QXmlErrorHandler* QXmlSimpleReader::errorHandler() const | - | ||||||||||||||||||||||||
| 1429 | { | - | ||||||||||||||||||||||||
| 1430 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1431 | return never executed: d->errorHnd;return d->errorHnd;never executed: return d->errorHnd; | 0 | ||||||||||||||||||||||||
| 1432 | } | - | ||||||||||||||||||||||||
| 1433 | - | |||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||
| 1435 | - | |||||||||||||||||||||||||
| 1436 | - | |||||||||||||||||||||||||
| 1437 | void QXmlSimpleReader::setLexicalHandler(QXmlLexicalHandler* handler) | - | ||||||||||||||||||||||||
| 1438 | { | - | ||||||||||||||||||||||||
| 1439 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1440 | d->lexicalHnd = handler; | - | ||||||||||||||||||||||||
| 1441 | } executed 2089 times by 5 tests: end of blockExecuted by:
| 2089 | ||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||
| 1445 | - | |||||||||||||||||||||||||
| 1446 | QXmlLexicalHandler* QXmlSimpleReader::lexicalHandler() const | - | ||||||||||||||||||||||||
| 1447 | { | - | ||||||||||||||||||||||||
| 1448 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1449 | return never executed: d->lexicalHnd;return d->lexicalHnd;never executed: return d->lexicalHnd; | 0 | ||||||||||||||||||||||||
| 1450 | } | - | ||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||
| 1452 | - | |||||||||||||||||||||||||
| 1453 | - | |||||||||||||||||||||||||
| 1454 | - | |||||||||||||||||||||||||
| 1455 | void QXmlSimpleReader::setDeclHandler(QXmlDeclHandler* handler) | - | ||||||||||||||||||||||||
| 1456 | { | - | ||||||||||||||||||||||||
| 1457 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1458 | d->declHnd = handler; | - | ||||||||||||||||||||||||
| 1459 | } executed 2092 times by 5 tests: end of blockExecuted by:
| 2092 | ||||||||||||||||||||||||
| 1460 | - | |||||||||||||||||||||||||
| 1461 | - | |||||||||||||||||||||||||
| 1462 | - | |||||||||||||||||||||||||
| 1463 | - | |||||||||||||||||||||||||
| 1464 | QXmlDeclHandler* QXmlSimpleReader::declHandler() const | - | ||||||||||||||||||||||||
| 1465 | { | - | ||||||||||||||||||||||||
| 1466 | const QXmlSimpleReaderPrivate *d = d_func(); | - | ||||||||||||||||||||||||
| 1467 | return never executed: d->declHnd;return d->declHnd;never executed: return d->declHnd; | 0 | ||||||||||||||||||||||||
| 1468 | } | - | ||||||||||||||||||||||||
| 1469 | - | |||||||||||||||||||||||||
| 1470 | - | |||||||||||||||||||||||||
| 1471 | - | |||||||||||||||||||||||||
| 1472 | - | |||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||
| 1474 | - | |||||||||||||||||||||||||
| 1475 | bool QXmlSimpleReader::parse(const QXmlInputSource& input) | - | ||||||||||||||||||||||||
| 1476 | { | - | ||||||||||||||||||||||||
| 1477 | return executed 359 times by 2 tests: parse(&input, false);return parse(&input, false);Executed by:
executed 359 times by 2 tests: return parse(&input, false);Executed by:
| 359 | ||||||||||||||||||||||||
| 1478 | } | - | ||||||||||||||||||||||||
| 1479 | - | |||||||||||||||||||||||||
| 1480 | - | |||||||||||||||||||||||||
| 1481 | - | |||||||||||||||||||||||||
| 1482 | - | |||||||||||||||||||||||||
| 1483 | - | |||||||||||||||||||||||||
| 1484 | bool QXmlSimpleReader::parse(const QXmlInputSource* input) | - | ||||||||||||||||||||||||
| 1485 | { | - | ||||||||||||||||||||||||
| 1486 | return executed 252 times by 5 tests: parse(input, false);return parse(input, false);Executed by:
executed 252 times by 5 tests: return parse(input, false);Executed by:
| 252 | ||||||||||||||||||||||||
| 1487 | } | - | ||||||||||||||||||||||||
| 1488 | bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental) | - | ||||||||||||||||||||||||
| 1489 | { | - | ||||||||||||||||||||||||
| 1490 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1491 | - | |||||||||||||||||||||||||
| 1492 | d->literalEntitySizes.clear(); | - | ||||||||||||||||||||||||
| 1493 | d->referencesToOtherEntities.clear(); | - | ||||||||||||||||||||||||
| 1494 | d->expandedSizes.clear(); | - | ||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||
| 1496 | if (incremental
| 616-1490 | ||||||||||||||||||||||||
| 1497 | d->initIncrementalParsing(); | - | ||||||||||||||||||||||||
| 1498 | } executed 1490 times by 1 test: else {end of blockExecuted by:
| 1490 | ||||||||||||||||||||||||
| 1499 | delete d->parseStack; | - | ||||||||||||||||||||||||
| 1500 | d->parseStack = 0; | - | ||||||||||||||||||||||||
| 1501 | } executed 616 times by 6 tests: end of blockExecuted by:
| 616 | ||||||||||||||||||||||||
| 1502 | d->init(input); | - | ||||||||||||||||||||||||
| 1503 | - | |||||||||||||||||||||||||
| 1504 | - | |||||||||||||||||||||||||
| 1505 | if (d->contentHnd
| 6-2100 | ||||||||||||||||||||||||
| 1506 | d->contentHnd->setDocumentLocator(d->locator.data()); | - | ||||||||||||||||||||||||
| 1507 | if (!d->contentHnd->startDocument()
| 0-2100 | ||||||||||||||||||||||||
| 1508 | d->reportParseError(d->contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1509 | d->tags.clear(); | - | ||||||||||||||||||||||||
| 1510 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1511 | } | - | ||||||||||||||||||||||||
| 1512 | } executed 2100 times by 6 tests: end of blockExecuted by:
| 2100 | ||||||||||||||||||||||||
| 1513 | d->skipped_entity_in_content = false; | - | ||||||||||||||||||||||||
| 1514 | return executed 2106 times by 6 tests: d->parseBeginOrContinue(0, incremental);return d->parseBeginOrContinue(0, incremental);Executed by:
executed 2106 times by 6 tests: return d->parseBeginOrContinue(0, incremental);Executed by:
| 2106 | ||||||||||||||||||||||||
| 1515 | } | - | ||||||||||||||||||||||||
| 1516 | bool QXmlSimpleReader::parseContinue() | - | ||||||||||||||||||||||||
| 1517 | { | - | ||||||||||||||||||||||||
| 1518 | QXmlSimpleReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1519 | if (d->parseStack == 0
| 0-44908 | ||||||||||||||||||||||||
| 1520 | return executed 1490 times by 1 test: false;return false;Executed by:
executed 1490 times by 1 test: return false;Executed by:
| 1490 | ||||||||||||||||||||||||
| 1521 | d->initData(); | - | ||||||||||||||||||||||||
| 1522 | int state = d->parseStack->pop().state; | - | ||||||||||||||||||||||||
| 1523 | return executed 44908 times by 1 test: d->parseBeginOrContinue(state, true);return d->parseBeginOrContinue(state, true);Executed by:
executed 44908 times by 1 test: return d->parseBeginOrContinue(state, true);Executed by:
| 44908 | ||||||||||||||||||||||||
| 1524 | } | - | ||||||||||||||||||||||||
| 1525 | - | |||||||||||||||||||||||||
| 1526 | - | |||||||||||||||||||||||||
| 1527 | - | |||||||||||||||||||||||||
| 1528 | - | |||||||||||||||||||||||||
| 1529 | bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental) | - | ||||||||||||||||||||||||
| 1530 | { | - | ||||||||||||||||||||||||
| 1531 | bool atEndOrig = atEnd(); | - | ||||||||||||||||||||||||
| 1532 | - | |||||||||||||||||||||||||
| 1533 | if (state==0
| 10967-36047 | ||||||||||||||||||||||||
| 1534 | if (!parseProlog()
| 2029-34018 | ||||||||||||||||||||||||
| 1535 | if (incremental
| 0-33941 | ||||||||||||||||||||||||
| 1536 | pushParseState(0, 0); | - | ||||||||||||||||||||||||
| 1537 | return executed 33941 times by 1 test: true;return true;Executed by:
executed 33941 times by 1 test: return true;Executed by:
| 33941 | ||||||||||||||||||||||||
| 1538 | } else { | - | ||||||||||||||||||||||||
| 1539 | tags.clear(); | - | ||||||||||||||||||||||||
| 1540 | return executed 77 times by 1 test: false;return false;Executed by:
executed 77 times by 1 test: return false;Executed by:
| 77 | ||||||||||||||||||||||||
| 1541 | } | - | ||||||||||||||||||||||||
| 1542 | } | - | ||||||||||||||||||||||||
| 1543 | state = 1; | - | ||||||||||||||||||||||||
| 1544 | } executed 2029 times by 6 tests: end of blockExecuted by:
| 2029 | ||||||||||||||||||||||||
| 1545 | if (state==1
| 2514-10482 | ||||||||||||||||||||||||
| 1546 | if (!parseElement()
| 1961-8521 | ||||||||||||||||||||||||
| 1547 | if (incremental
| 0-8453 | ||||||||||||||||||||||||
| 1548 | pushParseState(0, 1); | - | ||||||||||||||||||||||||
| 1549 | return executed 8453 times by 1 test: true;return true;Executed by:
executed 8453 times by 1 test: return true;Executed by:
| 8453 | ||||||||||||||||||||||||
| 1550 | } else { | - | ||||||||||||||||||||||||
| 1551 | tags.clear(); | - | ||||||||||||||||||||||||
| 1552 | return executed 68 times by 1 test: false;return false;Executed by:
executed 68 times by 1 test: return false;Executed by:
| 68 | ||||||||||||||||||||||||
| 1553 | } | - | ||||||||||||||||||||||||
| 1554 | } | - | ||||||||||||||||||||||||
| 1555 | state = 2; | - | ||||||||||||||||||||||||
| 1556 | } executed 1961 times by 6 tests: end of blockExecuted by:
| 1961 | ||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||
| 1558 | while (!atEnd()
| 2340-2392 | ||||||||||||||||||||||||
| 1559 | if (!parseMisc()
| 257-2083 | ||||||||||||||||||||||||
| 1560 | if (incremental
| 0-2073 | ||||||||||||||||||||||||
| 1561 | pushParseState(0, 2); | - | ||||||||||||||||||||||||
| 1562 | return executed 2073 times by 1 test: true;return true;Executed by:
executed 2073 times by 1 test: return true;Executed by:
| 2073 | ||||||||||||||||||||||||
| 1563 | } else { | - | ||||||||||||||||||||||||
| 1564 | tags.clear(); | - | ||||||||||||||||||||||||
| 1565 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 1566 | } | - | ||||||||||||||||||||||||
| 1567 | } | - | ||||||||||||||||||||||||
| 1568 | } executed 257 times by 2 tests: end of blockExecuted by:
| 257 | ||||||||||||||||||||||||
| 1569 | if (!atEndOrig
| 441-1490 | ||||||||||||||||||||||||
| 1570 | - | |||||||||||||||||||||||||
| 1571 | pushParseState(0, 2); | - | ||||||||||||||||||||||||
| 1572 | return executed 441 times by 1 test: true;return true;Executed by:
executed 441 times by 1 test: return true;Executed by:
| 441 | ||||||||||||||||||||||||
| 1573 | } | - | ||||||||||||||||||||||||
| 1574 | - | |||||||||||||||||||||||||
| 1575 | if (!tags.isEmpty()
| 0-1951 | ||||||||||||||||||||||||
| 1576 | reportParseError(QLatin1String("unexpected end of file")); | - | ||||||||||||||||||||||||
| 1577 | tags.clear(); | - | ||||||||||||||||||||||||
| 1578 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1579 | } | - | ||||||||||||||||||||||||
| 1580 | - | |||||||||||||||||||||||||
| 1581 | if (contentHnd
| 1-1950 | ||||||||||||||||||||||||
| 1582 | delete parseStack; | - | ||||||||||||||||||||||||
| 1583 | parseStack = 0; | - | ||||||||||||||||||||||||
| 1584 | if (!contentHnd->endDocument()
| 0-1950 | ||||||||||||||||||||||||
| 1585 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1586 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1587 | } | - | ||||||||||||||||||||||||
| 1588 | } executed 1950 times by 6 tests: end of blockExecuted by:
| 1950 | ||||||||||||||||||||||||
| 1589 | return executed 1951 times by 6 tests: true;return true;Executed by:
executed 1951 times by 6 tests: return true;Executed by:
| 1951 | ||||||||||||||||||||||||
| 1590 | } | - | ||||||||||||||||||||||||
| 1591 | bool QXmlSimpleReaderPrivate::parseProlog() | - | ||||||||||||||||||||||||
| 1592 | { | - | ||||||||||||||||||||||||
| 1593 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 1594 | const signed char EatWS = 1; | - | ||||||||||||||||||||||||
| 1595 | const signed char Lt = 2; | - | ||||||||||||||||||||||||
| 1596 | const signed char Em = 3; | - | ||||||||||||||||||||||||
| 1597 | const signed char DocType = 4; | - | ||||||||||||||||||||||||
| 1598 | const signed char Comment = 5; | - | ||||||||||||||||||||||||
| 1599 | const signed char CommentR = 6; | - | ||||||||||||||||||||||||
| 1600 | const signed char PInstr = 7; | - | ||||||||||||||||||||||||
| 1601 | const signed char PInstrR = 8; | - | ||||||||||||||||||||||||
| 1602 | const signed char Done = 9; | - | ||||||||||||||||||||||||
| 1603 | - | |||||||||||||||||||||||||
| 1604 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 1605 | const signed char InpLt = 1; | - | ||||||||||||||||||||||||
| 1606 | const signed char InpQm = 2; | - | ||||||||||||||||||||||||
| 1607 | const signed char InpEm = 3; | - | ||||||||||||||||||||||||
| 1608 | const signed char InpD = 4; | - | ||||||||||||||||||||||||
| 1609 | const signed char InpDash = 5; | - | ||||||||||||||||||||||||
| 1610 | const signed char InpUnknown = 6; | - | ||||||||||||||||||||||||
| 1611 | - | |||||||||||||||||||||||||
| 1612 | static const signed char table[9][7] = { | - | ||||||||||||||||||||||||
| 1613 | - | |||||||||||||||||||||||||
| 1614 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1615 | { -1, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1616 | { -1, -1, PInstr,Em, Done, -1, Done }, | - | ||||||||||||||||||||||||
| 1617 | { -1, -1, -1, -1, DocType, Comment, -1 }, | - | ||||||||||||||||||||||||
| 1618 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1619 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1620 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1621 | { EatWS, Lt, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1622 | { EatWS, Lt, -1, -1, -1, -1, -1 } | - | ||||||||||||||||||||||||
| 1623 | }; | - | ||||||||||||||||||||||||
| 1624 | signed char state; | - | ||||||||||||||||||||||||
| 1625 | signed char input; | - | ||||||||||||||||||||||||
| 1626 | - | |||||||||||||||||||||||||
| 1627 | if (parseStack == 0
| 616-35431 | ||||||||||||||||||||||||
| 1628 | xmldecl_possible = true; | - | ||||||||||||||||||||||||
| 1629 | doctype_read = false; | - | ||||||||||||||||||||||||
| 1630 | state = Init; | - | ||||||||||||||||||||||||
| 1631 | } executed 2106 times by 6 tests: else {end of blockExecuted by:
| 2106 | ||||||||||||||||||||||||
| 1632 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 1633 | - | |||||||||||||||||||||||||
| 1634 | - | |||||||||||||||||||||||||
| 1635 | - | |||||||||||||||||||||||||
| 1636 | if (!parseStack->isEmpty()
| 1663-32278 | ||||||||||||||||||||||||
| 1637 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 1638 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 923-31355 | ||||||||||||||||||||||||
| 1639 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 1640 | - | |||||||||||||||||||||||||
| 1641 | - | |||||||||||||||||||||||||
| 1642 | - | |||||||||||||||||||||||||
| 1643 | } executed 923 times by 1 test: end of blockExecuted by:
| 923 | ||||||||||||||||||||||||
| 1644 | if (!(this->*function)()
| 2353-29925 | ||||||||||||||||||||||||
| 1645 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
| 1646 | return executed 29925 times by 1 test: false;return false;Executed by:
executed 29925 times by 1 test: return false;Executed by:
| 29925 | ||||||||||||||||||||||||
| 1647 | } | - | ||||||||||||||||||||||||
| 1648 | } executed 2353 times by 1 test: end of blockExecuted by:
| 2353 | ||||||||||||||||||||||||
| 1649 | } executed 4016 times by 1 test: end of blockExecuted by:
| 4016 | ||||||||||||||||||||||||
| 1650 | - | |||||||||||||||||||||||||
| 1651 | for (;;) { | - | ||||||||||||||||||||||||
| 1652 | switch (state) { | - | ||||||||||||||||||||||||
| 1653 | case executed 2370 times by 4 tests: DocType:case DocType:Executed by:
executed 2370 times by 4 tests: case DocType:Executed by:
| 2370 | ||||||||||||||||||||||||
| 1654 | if (doctype_read
| 0-2370 | ||||||||||||||||||||||||
| 1655 | reportParseError(QLatin1String("more than one document type definition")); | - | ||||||||||||||||||||||||
| 1656 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1657 | } else { | - | ||||||||||||||||||||||||
| 1658 | doctype_read = false; | - | ||||||||||||||||||||||||
| 1659 | } executed 2370 times by 4 tests: end of blockExecuted by:
| 2370 | ||||||||||||||||||||||||
| 1660 | break; executed 2370 times by 4 tests: break;Executed by:
| 2370 | ||||||||||||||||||||||||
| 1661 | case executed 21 times by 2 tests: Comment:case Comment:Executed by:
executed 21 times by 2 tests: case Comment:Executed by:
| 21 | ||||||||||||||||||||||||
| 1662 | if (lexicalHnd
| 8-13 | ||||||||||||||||||||||||
| 1663 | if (!lexicalHnd->comment(string())
| 0-13 | ||||||||||||||||||||||||
| 1664 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 1665 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1666 | } | - | ||||||||||||||||||||||||
| 1667 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||
| 1668 | state = CommentR; | - | ||||||||||||||||||||||||
| 1669 | break; executed 21 times by 2 tests: break;Executed by:
| 21 | ||||||||||||||||||||||||
| 1670 | case executed 134 times by 2 tests: PInstr:case PInstr:Executed by:
executed 134 times by 2 tests: case PInstr:Executed by:
| 134 | ||||||||||||||||||||||||
| 1671 | - | |||||||||||||||||||||||||
| 1672 | if (contentHnd
| 3-131 | ||||||||||||||||||||||||
| 1673 | if (xmldecl_possible
| 11-120 | ||||||||||||||||||||||||
| 1674 | QString value(QLatin1String("version='")); | - | ||||||||||||||||||||||||
| 1675 | value += xmlVersion; | - | ||||||||||||||||||||||||
| 1676 | value += QLatin1Char('\''); | - | ||||||||||||||||||||||||
| 1677 | if (!encoding.isEmpty()
| 45-63 | ||||||||||||||||||||||||
| 1678 | value += QLatin1String(" encoding='"); | - | ||||||||||||||||||||||||
| 1679 | value += encoding; | - | ||||||||||||||||||||||||
| 1680 | value += QLatin1Char('\''); | - | ||||||||||||||||||||||||
| 1681 | } executed 63 times by 2 tests: end of blockExecuted by:
| 63 | ||||||||||||||||||||||||
| 1682 | if (standalone == QXmlSimpleReaderPrivate::Yes
| 21-87 | ||||||||||||||||||||||||
| 1683 | value += QLatin1String(" standalone='yes'"); | - | ||||||||||||||||||||||||
| 1684 | } executed 21 times by 1 test: else if (standalone == QXmlSimpleReaderPrivate::Noend of blockExecuted by:
| 21-57 | ||||||||||||||||||||||||
| 1685 | value += QLatin1String(" standalone='no'"); | - | ||||||||||||||||||||||||
| 1686 | } executed 30 times by 1 test: end of blockExecuted by:
| 30 | ||||||||||||||||||||||||
| 1687 | if (!contentHnd->processingInstruction(QLatin1String("xml"), value)
| 0-108 | ||||||||||||||||||||||||
| 1688 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1689 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1690 | } | - | ||||||||||||||||||||||||
| 1691 | } executed 108 times by 2 tests: else {end of blockExecuted by:
| 108 | ||||||||||||||||||||||||
| 1692 | if (!contentHnd->processingInstruction(name(), string())
| 0-23 | ||||||||||||||||||||||||
| 1693 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1694 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1695 | } | - | ||||||||||||||||||||||||
| 1696 | } executed 23 times by 2 tests: end of blockExecuted by:
| 23 | ||||||||||||||||||||||||
| 1697 | } | - | ||||||||||||||||||||||||
| 1698 | - | |||||||||||||||||||||||||
| 1699 | xmldecl_possible = false; | - | ||||||||||||||||||||||||
| 1700 | state = PInstrR; | - | ||||||||||||||||||||||||
| 1701 | break; executed 134 times by 2 tests: break;Executed by:
| 134 | ||||||||||||||||||||||||
| 1702 | case executed 2029 times by 6 tests: Done:case Done:Executed by:
executed 2029 times by 6 tests: case Done:Executed by:
| 2029 | ||||||||||||||||||||||||
| 1703 | return executed 2029 times by 6 tests: true;return true;Executed by:
executed 2029 times by 6 tests: return true;Executed by:
| 2029 | ||||||||||||||||||||||||
| 1704 | case executed 6 times by 1 test: -1:case -1:Executed by:
executed 6 times by 1 test: case -1:Executed by:
| 6 | ||||||||||||||||||||||||
| 1705 | reportParseError(QLatin1String("error occurred while parsing element")); | - | ||||||||||||||||||||||||
| 1706 | return executed 6 times by 1 test: false;return false;Executed by:
executed 6 times by 1 test: return false;Executed by:
| 6 | ||||||||||||||||||||||||
| 1707 | } | - | ||||||||||||||||||||||||
| 1708 | - | |||||||||||||||||||||||||
| 1709 | if (atEnd()
| 1664-12160 | ||||||||||||||||||||||||
| 1710 | unexpectedEof(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
| 1711 | return executed 1664 times by 1 test: false;return false;Executed by:
executed 1664 times by 1 test: return false;Executed by:
| 1664 | ||||||||||||||||||||||||
| 1712 | } | - | ||||||||||||||||||||||||
| 1713 | if (is_S(c)
| 1960-10200 | ||||||||||||||||||||||||
| 1714 | input = InpWs; | - | ||||||||||||||||||||||||
| 1715 | } executed 1960 times by 4 tests: else if (c == QLatin1Char('<')end of blockExecuted by:
| 1960-6076 | ||||||||||||||||||||||||
| 1716 | input = InpLt; | - | ||||||||||||||||||||||||
| 1717 | } executed 4124 times by 6 tests: else if (c == QLatin1Char('?')end of blockExecuted by:
| 147-5929 | ||||||||||||||||||||||||
| 1718 | input = InpQm; | - | ||||||||||||||||||||||||
| 1719 | } executed 147 times by 2 tests: else if (c == QLatin1Char('!')end of blockExecuted by:
| 147-3981 | ||||||||||||||||||||||||
| 1720 | input = InpEm; | - | ||||||||||||||||||||||||
| 1721 | } executed 1948 times by 4 tests: else if (c == QLatin1Char('D')end of blockExecuted by:
| 1923-2058 | ||||||||||||||||||||||||
| 1722 | input = InpD; | - | ||||||||||||||||||||||||
| 1723 | } executed 1923 times by 4 tests: else if (c == QLatin1Char('-')end of blockExecuted by:
| 23-2035 | ||||||||||||||||||||||||
| 1724 | input = InpDash; | - | ||||||||||||||||||||||||
| 1725 | } executed 23 times by 2 tests: else {end of blockExecuted by:
| 23 | ||||||||||||||||||||||||
| 1726 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 1727 | } executed 2035 times by 6 tests: end of blockExecuted by:
| 2035 | ||||||||||||||||||||||||
| 1728 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 1729 | - | |||||||||||||||||||||||||
| 1730 | switch (state) { | - | ||||||||||||||||||||||||
| 1731 | case executed 1960 times by 4 tests: EatWS:case EatWS:Executed by:
executed 1960 times by 4 tests: case EatWS:Executed by:
| 1960 | ||||||||||||||||||||||||
| 1732 | - | |||||||||||||||||||||||||
| 1733 | xmldecl_possible = false; | - | ||||||||||||||||||||||||
| 1734 | if (!eat_ws()
| 746-1214 | ||||||||||||||||||||||||
| 1735 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
| 1736 | return executed 746 times by 1 test: false;return false;Executed by:
executed 746 times by 1 test: return false;Executed by:
| 746 | ||||||||||||||||||||||||
| 1737 | } | - | ||||||||||||||||||||||||
| 1738 | break; executed 1214 times by 4 tests: break;Executed by:
| 1214 | ||||||||||||||||||||||||
| 1739 | case executed 4124 times by 6 tests: Lt:case Lt:Executed by:
executed 4124 times by 6 tests: case Lt:Executed by:
| 4124 | ||||||||||||||||||||||||
| 1740 | next(); | - | ||||||||||||||||||||||||
| 1741 | break; executed 4124 times by 6 tests: break;Executed by:
| 4124 | ||||||||||||||||||||||||
| 1742 | case executed 1948 times by 4 tests: Em:case Em:Executed by:
executed 1948 times by 4 tests: case Em:Executed by:
| 1948 | ||||||||||||||||||||||||
| 1743 | - | |||||||||||||||||||||||||
| 1744 | xmldecl_possible = false; | - | ||||||||||||||||||||||||
| 1745 | next(); | - | ||||||||||||||||||||||||
| 1746 | break; executed 1948 times by 4 tests: break;Executed by:
| 1948 | ||||||||||||||||||||||||
| 1747 | case executed 1923 times by 4 tests: DocType:case DocType:Executed by:
executed 1923 times by 4 tests: case DocType:Executed by:
| 1923 | ||||||||||||||||||||||||
| 1748 | if (!parseDoctype()
| 378-1545 | ||||||||||||||||||||||||
| 1749 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
| 1750 | return executed 1545 times by 1 test: false;return false;Executed by:
executed 1545 times by 1 test: return false;Executed by:
| 1545 | ||||||||||||||||||||||||
| 1751 | } | - | ||||||||||||||||||||||||
| 1752 | break; executed 378 times by 4 tests: break;Executed by:
| 378 | ||||||||||||||||||||||||
| 1753 | case executed 23 times by 2 tests: Comment:case Comment:Executed by:
executed 23 times by 2 tests: case Comment:Executed by:
| 23 | ||||||||||||||||||||||||
| 1754 | case never executed: CommentR:case CommentR:never executed: case CommentR: | 0 | ||||||||||||||||||||||||
| 1755 | if (!parseComment()
| 11-12 | ||||||||||||||||||||||||
| 1756 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
| 1757 | return executed 11 times by 1 test: false;return false;Executed by:
executed 11 times by 1 test: return false;Executed by:
| 11 | ||||||||||||||||||||||||
| 1758 | } | - | ||||||||||||||||||||||||
| 1759 | break; executed 12 times by 2 tests: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 1760 | case executed 147 times by 2 tests: PInstr:case PInstr:Executed by:
executed 147 times by 2 tests: case PInstr:Executed by:
| 147 | ||||||||||||||||||||||||
| 1761 | case never executed: PInstrR:case PInstrR:never executed: case PInstrR: | 0 | ||||||||||||||||||||||||
| 1762 | parsePI_xmldecl = xmldecl_possible; | - | ||||||||||||||||||||||||
| 1763 | if (!parsePI()
| 26-121 | ||||||||||||||||||||||||
| 1764 | parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); | - | ||||||||||||||||||||||||
| 1765 | return executed 121 times by 1 test: false;return false;Executed by:
executed 121 times by 1 test: return false;Executed by:
| 121 | ||||||||||||||||||||||||
| 1766 | } | - | ||||||||||||||||||||||||
| 1767 | break; executed 26 times by 2 tests: break;Executed by:
| 26 | ||||||||||||||||||||||||
| 1768 | } | - | ||||||||||||||||||||||||
| 1769 | } executed 9737 times by 6 tests: end of blockExecuted by:
| 9737 | ||||||||||||||||||||||||
| 1770 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1771 | } | - | ||||||||||||||||||||||||
| 1772 | - | |||||||||||||||||||||||||
| 1773 | - | |||||||||||||||||||||||||
| 1774 | - | |||||||||||||||||||||||||
| 1775 | - | |||||||||||||||||||||||||
| 1776 | - | |||||||||||||||||||||||||
| 1777 | - | |||||||||||||||||||||||||
| 1778 | bool QXmlSimpleReaderPrivate::parseElement() | - | ||||||||||||||||||||||||
| 1779 | { | - | ||||||||||||||||||||||||
| 1780 | const int Init = 0; | - | ||||||||||||||||||||||||
| 1781 | const int ReadName = 1; | - | ||||||||||||||||||||||||
| 1782 | const int Ws1 = 2; | - | ||||||||||||||||||||||||
| 1783 | const int STagEnd = 3; | - | ||||||||||||||||||||||||
| 1784 | const int STagEnd2 = 4; | - | ||||||||||||||||||||||||
| 1785 | const int ETagBegin = 5; | - | ||||||||||||||||||||||||
| 1786 | const int ETagBegin2 = 6; | - | ||||||||||||||||||||||||
| 1787 | const int Ws2 = 7; | - | ||||||||||||||||||||||||
| 1788 | const int EmptyTag = 8; | - | ||||||||||||||||||||||||
| 1789 | const int Attrib = 9; | - | ||||||||||||||||||||||||
| 1790 | const int AttribPro = 10; | - | ||||||||||||||||||||||||
| 1791 | const int Ws3 = 11; | - | ||||||||||||||||||||||||
| 1792 | const int Done = 12; | - | ||||||||||||||||||||||||
| 1793 | - | |||||||||||||||||||||||||
| 1794 | const int InpWs = 0; | - | ||||||||||||||||||||||||
| 1795 | const int InpNameBe = 1; | - | ||||||||||||||||||||||||
| 1796 | const int InpGt = 2; | - | ||||||||||||||||||||||||
| 1797 | const int InpSlash = 3; | - | ||||||||||||||||||||||||
| 1798 | const int InpUnknown = 4; | - | ||||||||||||||||||||||||
| 1799 | - | |||||||||||||||||||||||||
| 1800 | static const int table[12][5] = { | - | ||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||
| 1802 | { -1, ReadName, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1803 | { Ws1, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
| 1804 | { -1, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
| 1805 | { STagEnd2, STagEnd2, STagEnd2, STagEnd2, STagEnd2 }, | - | ||||||||||||||||||||||||
| 1806 | { -1, -1, -1, ETagBegin, -1 }, | - | ||||||||||||||||||||||||
| 1807 | { -1, ETagBegin2, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 1808 | { Ws2, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 1809 | { -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 1810 | { -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 1811 | { Ws3, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
| 1812 | { Ws3, Attrib, STagEnd, EmptyTag, -1 }, | - | ||||||||||||||||||||||||
| 1813 | { -1, Attrib, STagEnd, EmptyTag, -1 } | - | ||||||||||||||||||||||||
| 1814 | }; | - | ||||||||||||||||||||||||
| 1815 | int state; | - | ||||||||||||||||||||||||
| 1816 | int input; | - | ||||||||||||||||||||||||
| 1817 | - | |||||||||||||||||||||||||
| 1818 | if (parseStack == 0
| 1814-11462 | ||||||||||||||||||||||||
| 1819 | state = Init; | - | ||||||||||||||||||||||||
| 1820 | } executed 5806 times by 6 tests: else {end of blockExecuted by:
| 5806 | ||||||||||||||||||||||||
| 1821 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 1822 | - | |||||||||||||||||||||||||
| 1823 | - | |||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||
| 1825 | if (!parseStack->isEmpty()
| 1223-8425 | ||||||||||||||||||||||||
| 1826 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 1827 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 136-8289 | ||||||||||||||||||||||||
| 1828 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 1829 | - | |||||||||||||||||||||||||
| 1830 | - | |||||||||||||||||||||||||
| 1831 | - | |||||||||||||||||||||||||
| 1832 | } executed 136 times by 1 test: end of blockExecuted by:
| 136 | ||||||||||||||||||||||||
| 1833 | if (!(this->*function)()
| 3566-4859 | ||||||||||||||||||||||||
| 1834 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1835 | return executed 4859 times by 1 test: false;return false;Executed by:
executed 4859 times by 1 test: return false;Executed by:
| 4859 | ||||||||||||||||||||||||
| 1836 | } | - | ||||||||||||||||||||||||
| 1837 | } executed 3566 times by 1 test: end of blockExecuted by:
| 3566 | ||||||||||||||||||||||||
| 1838 | } executed 4789 times by 1 test: end of blockExecuted by:
| 4789 | ||||||||||||||||||||||||
| 1839 | - | |||||||||||||||||||||||||
| 1840 | for (;;) { | - | ||||||||||||||||||||||||
| 1841 | switch (state) { | - | ||||||||||||||||||||||||
| 1842 | case executed 5802 times by 6 tests: ReadName:case ReadName:Executed by:
executed 5802 times by 6 tests: case ReadName:Executed by:
| 5802 | ||||||||||||||||||||||||
| 1843 | - | |||||||||||||||||||||||||
| 1844 | tags.push(name()); | - | ||||||||||||||||||||||||
| 1845 | - | |||||||||||||||||||||||||
| 1846 | attList.clear(); | - | ||||||||||||||||||||||||
| 1847 | if (useNamespaces
| 1021-4781 | ||||||||||||||||||||||||
| 1848 | namespaceSupport.pushContext(); executed 4781 times by 3 tests: namespaceSupport.pushContext();Executed by:
| 4781 | ||||||||||||||||||||||||
| 1849 | break; executed 5802 times by 6 tests: break;Executed by:
| 5802 | ||||||||||||||||||||||||
| 1850 | case executed 5180 times by 6 tests: ETagBegin2:case ETagBegin2:Executed by:
executed 5180 times by 6 tests: case ETagBegin2:Executed by:
| 5180 | ||||||||||||||||||||||||
| 1851 | if (!processElementETagBegin2()
| 4-5176 | ||||||||||||||||||||||||
| 1852 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 1853 | break; executed 5176 times by 6 tests: break;Executed by:
| 5176 | ||||||||||||||||||||||||
| 1854 | case executed 12894 times by 6 tests: Attrib:case Attrib:Executed by:
executed 12894 times by 6 tests: case Attrib:Executed by:
| 12894 | ||||||||||||||||||||||||
| 1855 | if (!processElementAttribute()
| 0-12894 | ||||||||||||||||||||||||
| 1856 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1857 | state = AttribPro; | - | ||||||||||||||||||||||||
| 1858 | break; executed 12894 times by 6 tests: break;Executed by:
| 12894 | ||||||||||||||||||||||||
| 1859 | case executed 5723 times by 6 tests: Done:case Done:Executed by:
executed 5723 times by 6 tests: case Done:Executed by:
| 5723 | ||||||||||||||||||||||||
| 1860 | return executed 5723 times by 6 tests: true;return true;Executed by:
executed 5723 times by 6 tests: return true;Executed by:
| 5723 | ||||||||||||||||||||||||
| 1861 | case executed 14 times by 1 test: -1:case -1:Executed by:
executed 14 times by 1 test: case -1:Executed by:
| 14 | ||||||||||||||||||||||||
| 1862 | reportParseError(QLatin1String("error occurred while parsing element")); | - | ||||||||||||||||||||||||
| 1863 | return executed 14 times by 1 test: false;return false;Executed by:
executed 14 times by 1 test: return false;Executed by:
| 14 | ||||||||||||||||||||||||
| 1864 | } | - | ||||||||||||||||||||||||
| 1865 | - | |||||||||||||||||||||||||
| 1866 | if (atEnd()
| 1225-58942 | ||||||||||||||||||||||||
| 1867 | unexpectedEof(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1868 | return executed 1225 times by 1 test: false;return false;Executed by:
executed 1225 times by 1 test: return false;Executed by:
| 1225 | ||||||||||||||||||||||||
| 1869 | } | - | ||||||||||||||||||||||||
| 1870 | if (fastDetermineNameChar(c) == NameBeginning
| 24149-34793 | ||||||||||||||||||||||||
| 1871 | input = InpNameBe; | - | ||||||||||||||||||||||||
| 1872 | } executed 24149 times by 6 tests: else if (c == QLatin1Char('>')end of blockExecuted by:
| 10954-24149 | ||||||||||||||||||||||||
| 1873 | input = InpGt; | - | ||||||||||||||||||||||||
| 1874 | } executed 10954 times by 6 tests: else if (is_S(c)end of blockExecuted by:
| 7870-15969 | ||||||||||||||||||||||||
| 1875 | input = InpWs; | - | ||||||||||||||||||||||||
| 1876 | } executed 15969 times by 6 tests: else if (c == QLatin1Char('/')end of blockExecuted by:
| 2139-15969 | ||||||||||||||||||||||||
| 1877 | input = InpSlash; | - | ||||||||||||||||||||||||
| 1878 | } executed 5731 times by 6 tests: else {end of blockExecuted by:
| 5731 | ||||||||||||||||||||||||
| 1879 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 1880 | } executed 2139 times by 5 tests: end of blockExecuted by:
| 2139 | ||||||||||||||||||||||||
| 1881 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 1882 | - | |||||||||||||||||||||||||
| 1883 | switch (state) { | - | ||||||||||||||||||||||||
| 1884 | case executed 5802 times by 6 tests: ReadName:case ReadName:Executed by:
executed 5802 times by 6 tests: case ReadName:Executed by:
| 5802 | ||||||||||||||||||||||||
| 1885 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 1886 | if (!parseName()
| 1145-4657 | ||||||||||||||||||||||||
| 1887 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1888 | return executed 1145 times by 1 test: false;return false;Executed by:
executed 1145 times by 1 test: return false;Executed by:
| 1145 | ||||||||||||||||||||||||
| 1889 | } | - | ||||||||||||||||||||||||
| 1890 | break; executed 4657 times by 6 tests: break;Executed by:
| 4657 | ||||||||||||||||||||||||
| 1891 | case executed 3442 times by 6 tests: Ws1:case Ws1:Executed by:
executed 3442 times by 6 tests: case Ws1:Executed by:
| 3442 | ||||||||||||||||||||||||
| 1892 | case executed 20 times by 1 test: Ws2:case Ws2:Executed by:
executed 20 times by 1 test: case Ws2:Executed by:
| 20 | ||||||||||||||||||||||||
| 1893 | case executed 9662 times by 6 tests: Ws3:case Ws3:Executed by:
executed 9662 times by 6 tests: case Ws3:Executed by:
| 9662 | ||||||||||||||||||||||||
| 1894 | if (!eat_ws()
| 134-12990 | ||||||||||||||||||||||||
| 1895 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1896 | return executed 134 times by 1 test: false;return false;Executed by:
executed 134 times by 1 test: return false;Executed by:
| 134 | ||||||||||||||||||||||||
| 1897 | } | - | ||||||||||||||||||||||||
| 1898 | break; executed 12990 times by 6 tests: break;Executed by:
| 12990 | ||||||||||||||||||||||||
| 1899 | case executed 5230 times by 6 tests: STagEnd:case STagEnd:Executed by:
executed 5230 times by 6 tests: case STagEnd:Executed by:
| 5230 | ||||||||||||||||||||||||
| 1900 | - | |||||||||||||||||||||||||
| 1901 | if (contentHnd
| 4-5226 | ||||||||||||||||||||||||
| 1902 | const QString &tagsTop = tags.top(); | - | ||||||||||||||||||||||||
| 1903 | if (useNamespaces
| 697-4529 | ||||||||||||||||||||||||
| 1904 | QString uri, lname; | - | ||||||||||||||||||||||||
| 1905 | namespaceSupport.processName(tagsTop, false, uri, lname); | - | ||||||||||||||||||||||||
| 1906 | if (!contentHnd->startElement(uri, lname, tagsTop, attList)
| 0-4529 | ||||||||||||||||||||||||
| 1907 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1908 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1909 | } | - | ||||||||||||||||||||||||
| 1910 | } executed 4529 times by 2 tests: else {end of blockExecuted by:
| 4529 | ||||||||||||||||||||||||
| 1911 | if (!contentHnd->startElement(QString(), QString(), tagsTop, attList)
| 0-697 | ||||||||||||||||||||||||
| 1912 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1913 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1914 | } | - | ||||||||||||||||||||||||
| 1915 | } executed 697 times by 4 tests: end of blockExecuted by:
| 697 | ||||||||||||||||||||||||
| 1916 | } | - | ||||||||||||||||||||||||
| 1917 | next(); | - | ||||||||||||||||||||||||
| 1918 | break; executed 5230 times by 6 tests: break;Executed by:
| 5230 | ||||||||||||||||||||||||
| 1919 | case executed 5228 times by 6 tests: STagEnd2:case STagEnd2:Executed by:
executed 5228 times by 6 tests: case STagEnd2:Executed by:
| 5228 | ||||||||||||||||||||||||
| 1920 | if (!parseContent()
| 921-4307 | ||||||||||||||||||||||||
| 1921 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1922 | return executed 921 times by 1 test: false;return false;Executed by:
executed 921 times by 1 test: return false;Executed by:
| 921 | ||||||||||||||||||||||||
| 1923 | } | - | ||||||||||||||||||||||||
| 1924 | break; executed 4307 times by 6 tests: break;Executed by:
| 4307 | ||||||||||||||||||||||||
| 1925 | case executed 5181 times by 6 tests: ETagBegin:case ETagBegin:Executed by:
executed 5181 times by 6 tests: case ETagBegin:Executed by:
| 5181 | ||||||||||||||||||||||||
| 1926 | next(); | - | ||||||||||||||||||||||||
| 1927 | break; executed 5181 times by 6 tests: break;Executed by:
| 5181 | ||||||||||||||||||||||||
| 1928 | case executed 5180 times by 6 tests: ETagBegin2:case ETagBegin2:Executed by:
executed 5180 times by 6 tests: case ETagBegin2:Executed by:
| 5180 | ||||||||||||||||||||||||
| 1929 | - | |||||||||||||||||||||||||
| 1930 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 1931 | if (!parseName()
| 1072-4108 | ||||||||||||||||||||||||
| 1932 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1933 | return executed 1072 times by 1 test: false;return false;Executed by:
executed 1072 times by 1 test: return false;Executed by:
| 1072 | ||||||||||||||||||||||||
| 1934 | } | - | ||||||||||||||||||||||||
| 1935 | break; executed 4108 times by 6 tests: break;Executed by:
| 4108 | ||||||||||||||||||||||||
| 1936 | case executed 550 times by 5 tests: EmptyTag:case EmptyTag:Executed by:
executed 550 times by 5 tests: case EmptyTag:Executed by:
| 550 | ||||||||||||||||||||||||
| 1937 | if (tags.isEmpty()
| 0-550 | ||||||||||||||||||||||||
| 1938 | reportParseError(QLatin1String("tag mismatch")); | - | ||||||||||||||||||||||||
| 1939 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1940 | } | - | ||||||||||||||||||||||||
| 1941 | if (!processElementEmptyTag()
| 0-550 | ||||||||||||||||||||||||
| 1942 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1943 | next(); | - | ||||||||||||||||||||||||
| 1944 | break; executed 550 times by 5 tests: break;Executed by:
| 550 | ||||||||||||||||||||||||
| 1945 | case executed 12910 times by 6 tests: Attrib:case Attrib:Executed by:
executed 12910 times by 6 tests: case Attrib:Executed by:
| 12910 | ||||||||||||||||||||||||
| 1946 | case never executed: AttribPro:case AttribPro:never executed: case AttribPro: | 0 | ||||||||||||||||||||||||
| 1947 | - | |||||||||||||||||||||||||
| 1948 | if (!parseAttribute()
| 357-12553 | ||||||||||||||||||||||||
| 1949 | parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); | - | ||||||||||||||||||||||||
| 1950 | return executed 357 times by 1 test: false;return false;Executed by:
executed 357 times by 1 test: return false;Executed by:
| 357 | ||||||||||||||||||||||||
| 1951 | } | - | ||||||||||||||||||||||||
| 1952 | break; executed 12553 times by 6 tests: break;Executed by:
| 12553 | ||||||||||||||||||||||||
| 1953 | case executed 5723 times by 6 tests: Done:case Done:Executed by:
executed 5723 times by 6 tests: case Done:Executed by:
| 5723 | ||||||||||||||||||||||||
| 1954 | next(); | - | ||||||||||||||||||||||||
| 1955 | break; executed 5723 times by 6 tests: break;Executed by:
| 5723 | ||||||||||||||||||||||||
| 1956 | } | - | ||||||||||||||||||||||||
| 1957 | } executed 55313 times by 6 tests: end of blockExecuted by:
| 55313 | ||||||||||||||||||||||||
| 1958 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1959 | } | - | ||||||||||||||||||||||||
| 1960 | - | |||||||||||||||||||||||||
| 1961 | - | |||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||
| 1963 | - | |||||||||||||||||||||||||
| 1964 | - | |||||||||||||||||||||||||
| 1965 | bool QXmlSimpleReaderPrivate::processElementEmptyTag() | - | ||||||||||||||||||||||||
| 1966 | { | - | ||||||||||||||||||||||||
| 1967 | QString uri, lname; | - | ||||||||||||||||||||||||
| 1968 | - | |||||||||||||||||||||||||
| 1969 | if (contentHnd
| 9-541 | ||||||||||||||||||||||||
| 1970 | if (useNamespaces
| 217-324 | ||||||||||||||||||||||||
| 1971 | - | |||||||||||||||||||||||||
| 1972 | namespaceSupport.processName(tags.top(), false, uri, lname); | - | ||||||||||||||||||||||||
| 1973 | if (!contentHnd->startElement(uri, lname, tags.top(), attList)
| 0-217 | ||||||||||||||||||||||||
| 1974 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1975 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1976 | } | - | ||||||||||||||||||||||||
| 1977 | - | |||||||||||||||||||||||||
| 1978 | if (!contentHnd->endElement(uri, lname, tags.pop())
| 0-217 | ||||||||||||||||||||||||
| 1979 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1980 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1981 | } | - | ||||||||||||||||||||||||
| 1982 | - | |||||||||||||||||||||||||
| 1983 | QStringList prefixesBefore, prefixesAfter; | - | ||||||||||||||||||||||||
| 1984 | if (contentHnd
| 0-217 | ||||||||||||||||||||||||
| 1985 | prefixesBefore = namespaceSupport.prefixes(); | - | ||||||||||||||||||||||||
| 1986 | } executed 217 times by 2 tests: end of blockExecuted by:
| 217 | ||||||||||||||||||||||||
| 1987 | namespaceSupport.popContext(); | - | ||||||||||||||||||||||||
| 1988 | - | |||||||||||||||||||||||||
| 1989 | prefixesAfter = namespaceSupport.prefixes(); | - | ||||||||||||||||||||||||
| 1990 | for (QStringList::Iterator it = prefixesBefore.begin(); it != prefixesBefore.end()
| 217-221 | ||||||||||||||||||||||||
| 1991 | if (!prefixesAfter.contains(*it)
| 4-217 | ||||||||||||||||||||||||
| 1992 | if (!contentHnd->endPrefixMapping(*it)
| 0-4 | ||||||||||||||||||||||||
| 1993 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 1994 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1995 | } | - | ||||||||||||||||||||||||
| 1996 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 1997 | } executed 221 times by 2 tests: end of blockExecuted by:
| 221 | ||||||||||||||||||||||||
| 1998 | } executed 217 times by 2 tests: else {end of blockExecuted by:
| 217 | ||||||||||||||||||||||||
| 1999 | - | |||||||||||||||||||||||||
| 2000 | if (!contentHnd->startElement(QString(), QString(), tags.top(), attList)
| 0-324 | ||||||||||||||||||||||||
| 2001 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2002 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2003 | } | - | ||||||||||||||||||||||||
| 2004 | - | |||||||||||||||||||||||||
| 2005 | if (!contentHnd->endElement(QString(), QString(), tags.pop())
| 0-324 | ||||||||||||||||||||||||
| 2006 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2007 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2008 | } | - | ||||||||||||||||||||||||
| 2009 | } executed 324 times by 4 tests: end of blockExecuted by:
| 324 | ||||||||||||||||||||||||
| 2010 | } else { | - | ||||||||||||||||||||||||
| 2011 | tags.pop_back(); | - | ||||||||||||||||||||||||
| 2012 | namespaceSupport.popContext(); | - | ||||||||||||||||||||||||
| 2013 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||
| 2014 | return executed 550 times by 5 tests: true;return true;Executed by:
executed 550 times by 5 tests: return true;Executed by:
| 550 | ||||||||||||||||||||||||
| 2015 | } | - | ||||||||||||||||||||||||
| 2016 | - | |||||||||||||||||||||||||
| 2017 | - | |||||||||||||||||||||||||
| 2018 | - | |||||||||||||||||||||||||
| 2019 | - | |||||||||||||||||||||||||
| 2020 | bool QXmlSimpleReaderPrivate::processElementETagBegin2() | - | ||||||||||||||||||||||||
| 2021 | { | - | ||||||||||||||||||||||||
| 2022 | const QString &name = QXmlSimpleReaderPrivate::name(); | - | ||||||||||||||||||||||||
| 2023 | - | |||||||||||||||||||||||||
| 2024 | - | |||||||||||||||||||||||||
| 2025 | if (tags.pop() != name
| 4-5176 | ||||||||||||||||||||||||
| 2026 | reportParseError(QLatin1String("tag mismatch")); | - | ||||||||||||||||||||||||
| 2027 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 2028 | } | - | ||||||||||||||||||||||||
| 2029 | - | |||||||||||||||||||||||||
| 2030 | if (contentHnd
| 0-5176 | ||||||||||||||||||||||||
| 2031 | QString uri, lname; | - | ||||||||||||||||||||||||
| 2032 | - | |||||||||||||||||||||||||
| 2033 | if (useNamespaces
| 697-4479 | ||||||||||||||||||||||||
| 2034 | namespaceSupport.processName(name, false, uri, lname); executed 4479 times by 2 tests: namespaceSupport.processName(name, false, uri, lname);Executed by:
| 4479 | ||||||||||||||||||||||||
| 2035 | if (!contentHnd->endElement(uri, lname, name)
| 0-5176 | ||||||||||||||||||||||||
| 2036 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2037 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2038 | } | - | ||||||||||||||||||||||||
| 2039 | } executed 5176 times by 6 tests: end of blockExecuted by:
| 5176 | ||||||||||||||||||||||||
| 2040 | if (useNamespaces
| 697-4479 | ||||||||||||||||||||||||
| 2041 | NamespaceMap prefixesBefore, prefixesAfter; | - | ||||||||||||||||||||||||
| 2042 | if (contentHnd
| 0-4479 | ||||||||||||||||||||||||
| 2043 | prefixesBefore = namespaceSupport.d->ns; executed 4479 times by 2 tests: prefixesBefore = namespaceSupport.d->ns;Executed by:
| 4479 | ||||||||||||||||||||||||
| 2044 | - | |||||||||||||||||||||||||
| 2045 | namespaceSupport.popContext(); | - | ||||||||||||||||||||||||
| 2046 | - | |||||||||||||||||||||||||
| 2047 | if (contentHnd
| 0-4479 | ||||||||||||||||||||||||
| 2048 | prefixesAfter = namespaceSupport.d->ns; | - | ||||||||||||||||||||||||
| 2049 | if (prefixesBefore.size() != prefixesAfter.size()
| 10-4469 | ||||||||||||||||||||||||
| 2050 | for (NamespaceMap::const_iterator it = prefixesBefore.constBegin(); it != prefixesBefore.constEnd()
| 10-20 | ||||||||||||||||||||||||
| 2051 | if (!it.key().isEmpty()
| 0-10 | ||||||||||||||||||||||||
| 2052 | if (!contentHnd->endPrefixMapping(it.key())
| 0 | ||||||||||||||||||||||||
| 2053 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2054 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2055 | } | - | ||||||||||||||||||||||||
| 2056 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2057 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 2058 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 2059 | } executed 4479 times by 2 tests: end of blockExecuted by:
| 4479 | ||||||||||||||||||||||||
| 2060 | } executed 4479 times by 2 tests: end of blockExecuted by:
| 4479 | ||||||||||||||||||||||||
| 2061 | return executed 5176 times by 6 tests: true;return true;Executed by:
executed 5176 times by 6 tests: return true;Executed by:
| 5176 | ||||||||||||||||||||||||
| 2062 | } | - | ||||||||||||||||||||||||
| 2063 | - | |||||||||||||||||||||||||
| 2064 | - | |||||||||||||||||||||||||
| 2065 | - | |||||||||||||||||||||||||
| 2066 | - | |||||||||||||||||||||||||
| 2067 | bool QXmlSimpleReaderPrivate::processElementAttribute() | - | ||||||||||||||||||||||||
| 2068 | { | - | ||||||||||||||||||||||||
| 2069 | QString uri, lname, prefix; | - | ||||||||||||||||||||||||
| 2070 | const QString &name = QXmlSimpleReaderPrivate::name(); | - | ||||||||||||||||||||||||
| 2071 | const QString &string = QXmlSimpleReaderPrivate::string(); | - | ||||||||||||||||||||||||
| 2072 | - | |||||||||||||||||||||||||
| 2073 | - | |||||||||||||||||||||||||
| 2074 | if (useNamespaces
| 866-12028 | ||||||||||||||||||||||||
| 2075 | - | |||||||||||||||||||||||||
| 2076 | namespaceSupport.splitName(name, prefix, lname); | - | ||||||||||||||||||||||||
| 2077 | if (prefix == QLatin1String("xmlns")
| 7-12021 | ||||||||||||||||||||||||
| 2078 | - | |||||||||||||||||||||||||
| 2079 | namespaceSupport.setPrefix(lname, string); | - | ||||||||||||||||||||||||
| 2080 | if (useNamespacePrefixes
| 0-7 | ||||||||||||||||||||||||
| 2081 | - | |||||||||||||||||||||||||
| 2082 | - | |||||||||||||||||||||||||
| 2083 | - | |||||||||||||||||||||||||
| 2084 | attList.append(name, QLatin1String("http://www.w3.org/2000/xmlns/"), lname, string); | - | ||||||||||||||||||||||||
| 2085 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2086 | - | |||||||||||||||||||||||||
| 2087 | if (contentHnd
| 2-5 | ||||||||||||||||||||||||
| 2088 | if (!contentHnd->startPrefixMapping(lname, string)
| 0-5 | ||||||||||||||||||||||||
| 2089 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2090 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2091 | } | - | ||||||||||||||||||||||||
| 2092 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 2093 | } executed 7 times by 1 test: else {end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 2094 | - | |||||||||||||||||||||||||
| 2095 | namespaceSupport.processName(name, true, uri, lname); | - | ||||||||||||||||||||||||
| 2096 | attList.append(name, uri, lname, string); | - | ||||||||||||||||||||||||
| 2097 | } executed 12021 times by 3 tests: end of blockExecuted by:
| 12021 | ||||||||||||||||||||||||
| 2098 | } else { | - | ||||||||||||||||||||||||
| 2099 | - | |||||||||||||||||||||||||
| 2100 | attList.append(name, uri, lname, string); | - | ||||||||||||||||||||||||
| 2101 | } executed 866 times by 3 tests: end of blockExecuted by:
| 866 | ||||||||||||||||||||||||
| 2102 | return executed 12894 times by 6 tests: true;return true;Executed by:
executed 12894 times by 6 tests: return true;Executed by:
| 12894 | ||||||||||||||||||||||||
| 2103 | } | - | ||||||||||||||||||||||||
| 2104 | - | |||||||||||||||||||||||||
| 2105 | - | |||||||||||||||||||||||||
| 2106 | - | |||||||||||||||||||||||||
| 2107 | - | |||||||||||||||||||||||||
| 2108 | - | |||||||||||||||||||||||||
| 2109 | - | |||||||||||||||||||||||||
| 2110 | - | |||||||||||||||||||||||||
| 2111 | bool QXmlSimpleReaderPrivate::parseContent() | - | ||||||||||||||||||||||||
| 2112 | { | - | ||||||||||||||||||||||||
| 2113 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 2114 | const signed char ChD = 1; | - | ||||||||||||||||||||||||
| 2115 | const signed char ChD1 = 2; | - | ||||||||||||||||||||||||
| 2116 | const signed char ChD2 = 3; | - | ||||||||||||||||||||||||
| 2117 | const signed char Ref = 4; | - | ||||||||||||||||||||||||
| 2118 | const signed char Lt = 5; | - | ||||||||||||||||||||||||
| 2119 | const signed char PInstr = 6; | - | ||||||||||||||||||||||||
| 2120 | const signed char PInstrR = 7; | - | ||||||||||||||||||||||||
| 2121 | const signed char Elem = 8; | - | ||||||||||||||||||||||||
| 2122 | const signed char Em = 9; | - | ||||||||||||||||||||||||
| 2123 | const signed char Com = 10; | - | ||||||||||||||||||||||||
| 2124 | const signed char ComR = 11; | - | ||||||||||||||||||||||||
| 2125 | const signed char CDS = 12; | - | ||||||||||||||||||||||||
| 2126 | const signed char CDS1 = 13; | - | ||||||||||||||||||||||||
| 2127 | const signed char CDS2 = 14; | - | ||||||||||||||||||||||||
| 2128 | const signed char CDS3 = 15; | - | ||||||||||||||||||||||||
| 2129 | const signed char Done = 16; | - | ||||||||||||||||||||||||
| 2130 | - | |||||||||||||||||||||||||
| 2131 | const signed char InpLt = 0; | - | ||||||||||||||||||||||||
| 2132 | const signed char InpGt = 1; | - | ||||||||||||||||||||||||
| 2133 | const signed char InpSlash = 2; | - | ||||||||||||||||||||||||
| 2134 | const signed char InpQMark = 3; | - | ||||||||||||||||||||||||
| 2135 | const signed char InpEMark = 4; | - | ||||||||||||||||||||||||
| 2136 | const signed char InpAmp = 5; | - | ||||||||||||||||||||||||
| 2137 | const signed char InpDash = 6; | - | ||||||||||||||||||||||||
| 2138 | const signed char InpOpenB = 7; | - | ||||||||||||||||||||||||
| 2139 | const signed char InpCloseB = 8; | - | ||||||||||||||||||||||||
| 2140 | const signed char InpUnknown = 9; | - | ||||||||||||||||||||||||
| 2141 | - | |||||||||||||||||||||||||
| 2142 | static const signed char mapCLT2FSMChar[] = { | - | ||||||||||||||||||||||||
| 2143 | InpUnknown, | - | ||||||||||||||||||||||||
| 2144 | InpUnknown, | - | ||||||||||||||||||||||||
| 2145 | InpAmp, | - | ||||||||||||||||||||||||
| 2146 | InpGt, | - | ||||||||||||||||||||||||
| 2147 | InpLt, | - | ||||||||||||||||||||||||
| 2148 | InpSlash, | - | ||||||||||||||||||||||||
| 2149 | InpQMark, | - | ||||||||||||||||||||||||
| 2150 | InpEMark, | - | ||||||||||||||||||||||||
| 2151 | InpDash, | - | ||||||||||||||||||||||||
| 2152 | InpCloseB, | - | ||||||||||||||||||||||||
| 2153 | InpOpenB, | - | ||||||||||||||||||||||||
| 2154 | InpUnknown, | - | ||||||||||||||||||||||||
| 2155 | InpUnknown, | - | ||||||||||||||||||||||||
| 2156 | InpUnknown, | - | ||||||||||||||||||||||||
| 2157 | InpUnknown | - | ||||||||||||||||||||||||
| 2158 | }; | - | ||||||||||||||||||||||||
| 2159 | - | |||||||||||||||||||||||||
| 2160 | static const signed char table[16][10] = { | - | ||||||||||||||||||||||||
| 2161 | - | |||||||||||||||||||||||||
| 2162 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, | - | ||||||||||||||||||||||||
| 2163 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, | - | ||||||||||||||||||||||||
| 2164 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, | - | ||||||||||||||||||||||||
| 2165 | { Lt, -1, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, | - | ||||||||||||||||||||||||
| 2166 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, | - | ||||||||||||||||||||||||
| 2167 | { -1, -1, Done, PInstr, Em, -1, -1, -1, -1, Elem }, | - | ||||||||||||||||||||||||
| 2168 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, | - | ||||||||||||||||||||||||
| 2169 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, | - | ||||||||||||||||||||||||
| 2170 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, | - | ||||||||||||||||||||||||
| 2171 | { -1, -1, -1, -1, -1, -1, Com, CDS, -1, -1 }, | - | ||||||||||||||||||||||||
| 2172 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, | - | ||||||||||||||||||||||||
| 2173 | { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, | - | ||||||||||||||||||||||||
| 2174 | { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, | - | ||||||||||||||||||||||||
| 2175 | { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, | - | ||||||||||||||||||||||||
| 2176 | { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 }, | - | ||||||||||||||||||||||||
| 2177 | { CDS1, Init, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 } | - | ||||||||||||||||||||||||
| 2178 | }; | - | ||||||||||||||||||||||||
| 2179 | signed char state; | - | ||||||||||||||||||||||||
| 2180 | signed char input; | - | ||||||||||||||||||||||||
| 2181 | - | |||||||||||||||||||||||||
| 2182 | if (parseStack == 0
| 1634-5718 | ||||||||||||||||||||||||
| 2183 | contentCharDataRead = false; | - | ||||||||||||||||||||||||
| 2184 | state = Init; | - | ||||||||||||||||||||||||
| 2185 | } executed 5228 times by 6 tests: else {end of blockExecuted by:
| 5228 | ||||||||||||||||||||||||
| 2186 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 2187 | - | |||||||||||||||||||||||||
| 2188 | - | |||||||||||||||||||||||||
| 2189 | - | |||||||||||||||||||||||||
| 2190 | if (!parseStack->isEmpty()
| 1446-2638 | ||||||||||||||||||||||||
| 2191 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 2192 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0-2638 | ||||||||||||||||||||||||
| 2193 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 2194 | - | |||||||||||||||||||||||||
| 2195 | - | |||||||||||||||||||||||||
| 2196 | - | |||||||||||||||||||||||||
| 2197 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2198 | if (!(this->*function)()
| 825-1813 | ||||||||||||||||||||||||
| 2199 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2200 | return executed 1813 times by 1 test: false;return false;Executed by:
executed 1813 times by 1 test: return false;Executed by:
| 1813 | ||||||||||||||||||||||||
| 2201 | } | - | ||||||||||||||||||||||||
| 2202 | } executed 825 times by 1 test: end of blockExecuted by:
| 825 | ||||||||||||||||||||||||
| 2203 | } executed 2271 times by 1 test: end of blockExecuted by:
| 2271 | ||||||||||||||||||||||||
| 2204 | - | |||||||||||||||||||||||||
| 2205 | for (;;) { | - | ||||||||||||||||||||||||
| 2206 | switch (state) { | - | ||||||||||||||||||||||||
| 2207 | case executed 1137 times by 3 tests: Ref:case Ref:Executed by:
executed 1137 times by 3 tests: case Ref:Executed by:
| 1137 | ||||||||||||||||||||||||
| 2208 | if (!contentCharDataRead
| 372-765 | ||||||||||||||||||||||||
| 2209 | contentCharDataRead = parseReference_charDataRead; executed 765 times by 3 tests: contentCharDataRead = parseReference_charDataRead;Executed by:
| 765 | ||||||||||||||||||||||||
| 2210 | break; executed 1137 times by 3 tests: break;Executed by:
| 1137 | ||||||||||||||||||||||||
| 2211 | case executed 31 times by 1 test: PInstr:case PInstr:Executed by:
executed 31 times by 1 test: case PInstr:Executed by:
| 31 | ||||||||||||||||||||||||
| 2212 | if (contentHnd
| 0-31 | ||||||||||||||||||||||||
| 2213 | if (!contentHnd->processingInstruction(name(),string())
| 0-31 | ||||||||||||||||||||||||
| 2214 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2215 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2216 | } | - | ||||||||||||||||||||||||
| 2217 | } executed 31 times by 1 test: end of blockExecuted by:
| 31 | ||||||||||||||||||||||||
| 2218 | state = PInstrR; | - | ||||||||||||||||||||||||
| 2219 | break; executed 31 times by 1 test: break;Executed by:
| 31 | ||||||||||||||||||||||||
| 2220 | case executed 98 times by 2 tests: Com:case Com:Executed by:
executed 98 times by 2 tests: case Com:Executed by:
| 98 | ||||||||||||||||||||||||
| 2221 | if (lexicalHnd
| 42-56 | ||||||||||||||||||||||||
| 2222 | if (!lexicalHnd->comment(string())
| 0-42 | ||||||||||||||||||||||||
| 2223 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2224 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2225 | } | - | ||||||||||||||||||||||||
| 2226 | } executed 42 times by 1 test: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||
| 2227 | state = ComR; | - | ||||||||||||||||||||||||
| 2228 | break; executed 98 times by 2 tests: break;Executed by:
| 98 | ||||||||||||||||||||||||
| 2229 | case executed 59 times by 1 test: CDS:case CDS:Executed by:
executed 59 times by 1 test: case CDS:Executed by:
| 59 | ||||||||||||||||||||||||
| 2230 | stringClear(); | - | ||||||||||||||||||||||||
| 2231 | break; executed 59 times by 1 test: break;Executed by:
| 59 | ||||||||||||||||||||||||
| 2232 | case executed 80 times by 1 test: CDS2:case CDS2:Executed by:
executed 80 times by 1 test: case CDS2:Executed by:
| 80 | ||||||||||||||||||||||||
| 2233 | if (!atEnd()
| 10-63 | ||||||||||||||||||||||||
| 2234 | stringAddC(QLatin1Char(']')); executed 10 times by 1 test: stringAddC(QLatin1Char(']'));Executed by:
| 10 | ||||||||||||||||||||||||
| 2235 | break; executed 80 times by 1 test: break;Executed by:
| 80 | ||||||||||||||||||||||||
| 2236 | case executed 75 times by 1 test: CDS3:case CDS3:Executed by:
executed 75 times by 1 test: case CDS3:Executed by:
| 75 | ||||||||||||||||||||||||
| 2237 | - | |||||||||||||||||||||||||
| 2238 | if (!atEnd()
| 11-64 | ||||||||||||||||||||||||
| 2239 | if (c == QLatin1Char('>')
| 11-53 | ||||||||||||||||||||||||
| 2240 | - | |||||||||||||||||||||||||
| 2241 | if (lexicalHnd
| 0-53 | ||||||||||||||||||||||||
| 2242 | if (!lexicalHnd->startCDATA()
| 0-53 | ||||||||||||||||||||||||
| 2243 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2244 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2245 | } | - | ||||||||||||||||||||||||
| 2246 | } executed 53 times by 1 test: end of blockExecuted by:
| 53 | ||||||||||||||||||||||||
| 2247 | if (contentHnd
| 0-53 | ||||||||||||||||||||||||
| 2248 | if (!contentHnd->characters(string())
| 0-53 | ||||||||||||||||||||||||
| 2249 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2250 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2251 | } | - | ||||||||||||||||||||||||
| 2252 | } executed 53 times by 1 test: end of blockExecuted by:
| 53 | ||||||||||||||||||||||||
| 2253 | if (lexicalHnd
| 0-53 | ||||||||||||||||||||||||
| 2254 | if (!lexicalHnd->endCDATA()
| 0-53 | ||||||||||||||||||||||||
| 2255 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2256 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2257 | } | - | ||||||||||||||||||||||||
| 2258 | } executed 53 times by 1 test: end of blockExecuted by:
| 53 | ||||||||||||||||||||||||
| 2259 | } executed 53 times by 1 test: else if (c == QLatin1Char(']')end of blockExecuted by:
| 0-53 | ||||||||||||||||||||||||
| 2260 | - | |||||||||||||||||||||||||
| 2261 | stringAddC(QLatin1Char(']')); | - | ||||||||||||||||||||||||
| 2262 | } executed 11 times by 1 test: else {end of blockExecuted by:
| 11 | ||||||||||||||||||||||||
| 2263 | - | |||||||||||||||||||||||||
| 2264 | stringAddC(QLatin1Char(']')); | - | ||||||||||||||||||||||||
| 2265 | stringAddC(QLatin1Char(']')); | - | ||||||||||||||||||||||||
| 2266 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2267 | } | - | ||||||||||||||||||||||||
| 2268 | break; executed 75 times by 1 test: break;Executed by:
| 75 | ||||||||||||||||||||||||
| 2269 | case executed 5181 times by 6 tests: Done:case Done:Executed by:
executed 5181 times by 6 tests: case Done:Executed by:
| 5181 | ||||||||||||||||||||||||
| 2270 | - | |||||||||||||||||||||||||
| 2271 | if (contentHnd
| 0-5181 | ||||||||||||||||||||||||
| 2272 | if (contentCharDataRead
| 0-5181 | ||||||||||||||||||||||||
| 2273 | if (reportWhitespaceCharData
| 0 | ||||||||||||||||||||||||
| 2274 | if (!contentHnd->characters(string())
| 0 | ||||||||||||||||||||||||
| 2275 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2276 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2277 | } | - | ||||||||||||||||||||||||
| 2278 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2279 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2280 | } executed 5181 times by 6 tests: end of blockExecuted by:
| 5181 | ||||||||||||||||||||||||
| 2281 | - | |||||||||||||||||||||||||
| 2282 | return executed 5181 times by 6 tests: true;return true;Executed by:
executed 5181 times by 6 tests: return true;Executed by:
| 5181 | ||||||||||||||||||||||||
| 2283 | case executed 3 times by 1 test: -1:case -1:Executed by:
executed 3 times by 1 test: case -1:Executed by:
| 3 | ||||||||||||||||||||||||
| 2284 | - | |||||||||||||||||||||||||
| 2285 | reportParseError(QLatin1String("error occurred while parsing content")); | - | ||||||||||||||||||||||||
| 2286 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 2287 | } | - | ||||||||||||||||||||||||
| 2288 | - | |||||||||||||||||||||||||
| 2289 | - | |||||||||||||||||||||||||
| 2290 | - | |||||||||||||||||||||||||
| 2291 | if (atEnd()
| 1453-261643 | ||||||||||||||||||||||||
| 2292 | unexpectedEof(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2293 | return executed 1453 times by 1 test: false;return false;Executed by:
executed 1453 times by 1 test: return false;Executed by:
| 1453 | ||||||||||||||||||||||||
| 2294 | } | - | ||||||||||||||||||||||||
| 2295 | if (c.row()
| 877-260766 | ||||||||||||||||||||||||
| 2296 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 2297 | } executed 877 times by 1 test: else {end of blockExecuted by:
| 877 | ||||||||||||||||||||||||
| 2298 | input = mapCLT2FSMChar[charLookupTable[c.cell()]]; | - | ||||||||||||||||||||||||
| 2299 | } executed 260766 times by 6 tests: end of blockExecuted by:
| 260766 | ||||||||||||||||||||||||
| 2300 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 2301 | - | |||||||||||||||||||||||||
| 2302 | switch (state) { | - | ||||||||||||||||||||||||
| 2303 | case executed 53 times by 1 test: Init:case Init:Executed by:
executed 53 times by 1 test: case Init:Executed by:
| 53 | ||||||||||||||||||||||||
| 2304 | - | |||||||||||||||||||||||||
| 2305 | next(); | - | ||||||||||||||||||||||||
| 2306 | break; executed 53 times by 1 test: break;Executed by:
| 53 | ||||||||||||||||||||||||
| 2307 | case executed 241738 times by 6 tests: ChD:case ChD:Executed by:
executed 241738 times by 6 tests: case ChD:Executed by:
| 241738 | ||||||||||||||||||||||||
| 2308 | - | |||||||||||||||||||||||||
| 2309 | if (!contentCharDataRead
| 6401-235337 | ||||||||||||||||||||||||
| 2310 | contentCharDataRead = true; | - | ||||||||||||||||||||||||
| 2311 | stringClear(); | - | ||||||||||||||||||||||||
| 2312 | } executed 6401 times by 6 tests: end of blockExecuted by:
| 6401 | ||||||||||||||||||||||||
| 2313 | stringAddC(); | - | ||||||||||||||||||||||||
| 2314 | if (reportEntities
| 0-241738 | ||||||||||||||||||||||||
| 2315 | if (!reportEndEntities()
| 0 | ||||||||||||||||||||||||
| 2316 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2317 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2318 | next(); | - | ||||||||||||||||||||||||
| 2319 | break; executed 241738 times by 6 tests: break;Executed by:
| 241738 | ||||||||||||||||||||||||
| 2320 | case executed 43 times by 2 tests: ChD1:case ChD1:Executed by:
executed 43 times by 2 tests: case ChD1:Executed by:
| 43 | ||||||||||||||||||||||||
| 2321 | - | |||||||||||||||||||||||||
| 2322 | if (!contentCharDataRead
| 12-31 | ||||||||||||||||||||||||
| 2323 | contentCharDataRead = true; | - | ||||||||||||||||||||||||
| 2324 | stringClear(); | - | ||||||||||||||||||||||||
| 2325 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2326 | stringAddC(); | - | ||||||||||||||||||||||||
| 2327 | if (reportEntities
| 0-43 | ||||||||||||||||||||||||
| 2328 | if (!reportEndEntities()
| 0 | ||||||||||||||||||||||||
| 2329 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2330 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2331 | next(); | - | ||||||||||||||||||||||||
| 2332 | break; executed 43 times by 2 tests: break;Executed by:
| 43 | ||||||||||||||||||||||||
| 2333 | case executed 16 times by 2 tests: ChD2:case ChD2:Executed by:
executed 16 times by 2 tests: case ChD2:Executed by:
| 16 | ||||||||||||||||||||||||
| 2334 | stringAddC(); | - | ||||||||||||||||||||||||
| 2335 | if (reportEntities
| 0-16 | ||||||||||||||||||||||||
| 2336 | if (!reportEndEntities()
| 0 | ||||||||||||||||||||||||
| 2337 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2338 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2339 | next(); | - | ||||||||||||||||||||||||
| 2340 | break; executed 16 times by 2 tests: break;Executed by:
| 16 | ||||||||||||||||||||||||
| 2341 | case executed 1014 times by 3 tests: Ref:case Ref:Executed by:
executed 1014 times by 3 tests: case Ref:Executed by:
| 1014 | ||||||||||||||||||||||||
| 2342 | if (!contentCharDataRead
| 425-589 | ||||||||||||||||||||||||
| 2343 | - | |||||||||||||||||||||||||
| 2344 | stringClear(); | - | ||||||||||||||||||||||||
| 2345 | parseReference_context = InContent; | - | ||||||||||||||||||||||||
| 2346 | if (!parseReference()
| 292-297 | ||||||||||||||||||||||||
| 2347 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2348 | return executed 292 times by 1 test: false;return false;Executed by:
executed 292 times by 1 test: return false;Executed by:
| 292 | ||||||||||||||||||||||||
| 2349 | } | - | ||||||||||||||||||||||||
| 2350 | } executed 297 times by 3 tests: else {end of blockExecuted by:
| 297 | ||||||||||||||||||||||||
| 2351 | if (reportEntities
| 0-425 | ||||||||||||||||||||||||
| 2352 | - | |||||||||||||||||||||||||
| 2353 | if (contentHnd
| 0 | ||||||||||||||||||||||||
| 2354 | if (reportWhitespaceCharData
| 0 | ||||||||||||||||||||||||
| 2355 | if (!contentHnd->characters(string())
| 0 | ||||||||||||||||||||||||
| 2356 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2357 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2358 | } | - | ||||||||||||||||||||||||
| 2359 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2360 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2361 | stringClear(); | - | ||||||||||||||||||||||||
| 2362 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2363 | parseReference_context = InContent; | - | ||||||||||||||||||||||||
| 2364 | if (!parseReference()
| 180-245 | ||||||||||||||||||||||||
| 2365 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2366 | return executed 180 times by 1 test: false;return false;Executed by:
executed 180 times by 1 test: return false;Executed by:
| 180 | ||||||||||||||||||||||||
| 2367 | } | - | ||||||||||||||||||||||||
| 2368 | } executed 245 times by 3 tests: end of blockExecuted by:
| 245 | ||||||||||||||||||||||||
| 2369 | break; executed 542 times by 3 tests: break;Executed by:
| 542 | ||||||||||||||||||||||||
| 2370 | case executed 9155 times by 6 tests: Lt:case Lt:Executed by:
executed 9155 times by 6 tests: case Lt:Executed by:
| 9155 | ||||||||||||||||||||||||
| 2371 | - | |||||||||||||||||||||||||
| 2372 | if (contentHnd
| 10-9145 | ||||||||||||||||||||||||
| 2373 | if (contentCharDataRead
| 2718-6427 | ||||||||||||||||||||||||
| 2374 | if (reportWhitespaceCharData
| 125-5910 | ||||||||||||||||||||||||
| 2375 | if (!contentHnd->characters(string())
| 0-6035 | ||||||||||||||||||||||||
| 2376 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2377 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2378 | } | - | ||||||||||||||||||||||||
| 2379 | } executed 6035 times by 4 tests: end of blockExecuted by:
| 6035 | ||||||||||||||||||||||||
| 2380 | } executed 6427 times by 6 tests: end of blockExecuted by:
| 6427 | ||||||||||||||||||||||||
| 2381 | } executed 9145 times by 6 tests: end of blockExecuted by:
| 9145 | ||||||||||||||||||||||||
| 2382 | contentCharDataRead = false; | - | ||||||||||||||||||||||||
| 2383 | next(); | - | ||||||||||||||||||||||||
| 2384 | break; executed 9155 times by 6 tests: break;Executed by:
| 9155 | ||||||||||||||||||||||||
| 2385 | case executed 39 times by 1 test: PInstr:case PInstr:Executed by:
executed 39 times by 1 test: case PInstr:Executed by:
| 39 | ||||||||||||||||||||||||
| 2386 | case never executed: PInstrR:case PInstrR:never executed: case PInstrR: | 0 | ||||||||||||||||||||||||
| 2387 | parsePI_xmldecl = false; | - | ||||||||||||||||||||||||
| 2388 | if (!parsePI()
| 4-35 | ||||||||||||||||||||||||
| 2389 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2390 | return executed 35 times by 1 test: false;return false;Executed by:
executed 35 times by 1 test: return false;Executed by:
| 35 | ||||||||||||||||||||||||
| 2391 | } | - | ||||||||||||||||||||||||
| 2392 | break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||
| 2393 | case executed 3777 times by 6 tests: Elem:case Elem:Executed by:
executed 3777 times by 6 tests: case Elem:Executed by:
| 3777 | ||||||||||||||||||||||||
| 2394 | if (!parseElement()
| 282-3495 | ||||||||||||||||||||||||
| 2395 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2396 | return executed 282 times by 1 test: false;return false;Executed by:
executed 282 times by 1 test: return false;Executed by:
| 282 | ||||||||||||||||||||||||
| 2397 | } | - | ||||||||||||||||||||||||
| 2398 | break; executed 3495 times by 6 tests: break;Executed by:
| 3495 | ||||||||||||||||||||||||
| 2399 | case executed 158 times by 2 tests: Em:case Em:Executed by:
executed 158 times by 2 tests: case Em:Executed by:
| 158 | ||||||||||||||||||||||||
| 2400 | next(); | - | ||||||||||||||||||||||||
| 2401 | break; executed 158 times by 2 tests: break;Executed by:
| 158 | ||||||||||||||||||||||||
| 2402 | case executed 100 times by 2 tests: Com:case Com:Executed by:
executed 100 times by 2 tests: case Com:Executed by:
| 100 | ||||||||||||||||||||||||
| 2403 | case never executed: ComR:case ComR:never executed: case ComR: | 0 | ||||||||||||||||||||||||
| 2404 | if (!parseComment()
| 38-62 | ||||||||||||||||||||||||
| 2405 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2406 | return executed 38 times by 1 test: false;return false;Executed by:
executed 38 times by 1 test: return false;Executed by:
| 38 | ||||||||||||||||||||||||
| 2407 | } | - | ||||||||||||||||||||||||
| 2408 | break; executed 62 times by 2 tests: break;Executed by:
| 62 | ||||||||||||||||||||||||
| 2409 | case executed 58 times by 1 test: CDS:case CDS:Executed by:
executed 58 times by 1 test: case CDS:Executed by:
| 58 | ||||||||||||||||||||||||
| 2410 | parseString_s = QLatin1String("[CDATA["); | - | ||||||||||||||||||||||||
| 2411 | if (!parseString()
| 23-35 | ||||||||||||||||||||||||
| 2412 | parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); | - | ||||||||||||||||||||||||
| 2413 | return executed 35 times by 1 test: false;return false;Executed by:
executed 35 times by 1 test: return false;Executed by:
| 35 | ||||||||||||||||||||||||
| 2414 | } | - | ||||||||||||||||||||||||
| 2415 | break; executed 23 times by 1 test: break;Executed by:
| 23 | ||||||||||||||||||||||||
| 2416 | case executed 181 times by 1 test: CDS1:case CDS1:Executed by:
executed 181 times by 1 test: case CDS1:Executed by:
| 181 | ||||||||||||||||||||||||
| 2417 | stringAddC(); | - | ||||||||||||||||||||||||
| 2418 | next(); | - | ||||||||||||||||||||||||
| 2419 | break; executed 181 times by 1 test: break;Executed by:
| 181 | ||||||||||||||||||||||||
| 2420 | case executed 63 times by 1 test: CDS2:case CDS2:Executed by:
executed 63 times by 1 test: case CDS2:Executed by:
| 63 | ||||||||||||||||||||||||
| 2421 | - | |||||||||||||||||||||||||
| 2422 | next(); | - | ||||||||||||||||||||||||
| 2423 | break; executed 63 times by 1 test: break;Executed by:
| 63 | ||||||||||||||||||||||||
| 2424 | case executed 64 times by 1 test: CDS3:case CDS3:Executed by:
executed 64 times by 1 test: case CDS3:Executed by:
| 64 | ||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||
| 2426 | next(); | - | ||||||||||||||||||||||||
| 2427 | break; executed 64 times by 1 test: break;Executed by:
| 64 | ||||||||||||||||||||||||
| 2428 | } | - | ||||||||||||||||||||||||
| 2429 | } executed 260781 times by 6 tests: end of blockExecuted by:
| 260781 | ||||||||||||||||||||||||
| 2430 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2431 | } | - | ||||||||||||||||||||||||
| 2432 | - | |||||||||||||||||||||||||
| 2433 | bool QXmlSimpleReaderPrivate::reportEndEntities() | - | ||||||||||||||||||||||||
| 2434 | { | - | ||||||||||||||||||||||||
| 2435 | int count = (int)xmlRefStack.count(); | - | ||||||||||||||||||||||||
| 2436 | while (count != 0
| 0 | ||||||||||||||||||||||||
| 2437 | if (contentHnd
| 0 | ||||||||||||||||||||||||
| 2438 | if (reportWhitespaceCharData
| 0 | ||||||||||||||||||||||||
| 2439 | if (!contentHnd->characters(string())
| 0 | ||||||||||||||||||||||||
| 2440 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2441 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2442 | } | - | ||||||||||||||||||||||||
| 2443 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2444 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2445 | stringClear(); | - | ||||||||||||||||||||||||
| 2446 | if (lexicalHnd
| 0 | ||||||||||||||||||||||||
| 2447 | if (!lexicalHnd->endEntity(xmlRefStack.top().name)
| 0 | ||||||||||||||||||||||||
| 2448 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2449 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2450 | } | - | ||||||||||||||||||||||||
| 2451 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2452 | xmlRefStack.pop_back(); | - | ||||||||||||||||||||||||
| 2453 | count--; | - | ||||||||||||||||||||||||
| 2454 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2455 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 2456 | } | - | ||||||||||||||||||||||||
| 2457 | - | |||||||||||||||||||||||||
| 2458 | - | |||||||||||||||||||||||||
| 2459 | - | |||||||||||||||||||||||||
| 2460 | - | |||||||||||||||||||||||||
| 2461 | bool QXmlSimpleReaderPrivate::parseMisc() | - | ||||||||||||||||||||||||
| 2462 | { | - | ||||||||||||||||||||||||
| 2463 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 2464 | const signed char Lt = 1; | - | ||||||||||||||||||||||||
| 2465 | const signed char Comment = 2; | - | ||||||||||||||||||||||||
| 2466 | const signed char eatWS = 3; | - | ||||||||||||||||||||||||
| 2467 | const signed char PInstr = 4; | - | ||||||||||||||||||||||||
| 2468 | const signed char Comment2 = 5; | - | ||||||||||||||||||||||||
| 2469 | - | |||||||||||||||||||||||||
| 2470 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 2471 | const signed char InpLt = 1; | - | ||||||||||||||||||||||||
| 2472 | const signed char InpQm = 2; | - | ||||||||||||||||||||||||
| 2473 | const signed char InpEm = 3; | - | ||||||||||||||||||||||||
| 2474 | const signed char InpUnknown = 4; | - | ||||||||||||||||||||||||
| 2475 | - | |||||||||||||||||||||||||
| 2476 | static const signed char table[3][5] = { | - | ||||||||||||||||||||||||
| 2477 | - | |||||||||||||||||||||||||
| 2478 | { eatWS, Lt, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2479 | { -1, -1, PInstr,Comment, -1 }, | - | ||||||||||||||||||||||||
| 2480 | { -1, -1, -1, -1, Comment2 } | - | ||||||||||||||||||||||||
| 2481 | }; | - | ||||||||||||||||||||||||
| 2482 | signed char state; | - | ||||||||||||||||||||||||
| 2483 | signed char input; | - | ||||||||||||||||||||||||
| 2484 | - | |||||||||||||||||||||||||
| 2485 | if (parseStack==0
| 231-2109 | ||||||||||||||||||||||||
| 2486 | state = Init; | - | ||||||||||||||||||||||||
| 2487 | } executed 1757 times by 2 tests: else {end of blockExecuted by:
| 1757 | ||||||||||||||||||||||||
| 2488 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 2489 | - | |||||||||||||||||||||||||
| 2490 | - | |||||||||||||||||||||||||
| 2491 | - | |||||||||||||||||||||||||
| 2492 | if (!parseStack->isEmpty()
| 4-579 | ||||||||||||||||||||||||
| 2493 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 2494 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 64-515 | ||||||||||||||||||||||||
| 2495 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 2496 | - | |||||||||||||||||||||||||
| 2497 | - | |||||||||||||||||||||||||
| 2498 | - | |||||||||||||||||||||||||
| 2499 | } executed 515 times by 1 test: end of blockExecuted by:
| 515 | ||||||||||||||||||||||||
| 2500 | if (!(this->*function)()
| 30-549 | ||||||||||||||||||||||||
| 2501 | parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); | - | ||||||||||||||||||||||||
| 2502 | return executed 549 times by 1 test: false;return false;Executed by:
executed 549 times by 1 test: return false;Executed by:
| 549 | ||||||||||||||||||||||||
| 2503 | } | - | ||||||||||||||||||||||||
| 2504 | } executed 30 times by 1 test: end of blockExecuted by:
| 30 | ||||||||||||||||||||||||
| 2505 | } executed 34 times by 1 test: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||
| 2506 | - | |||||||||||||||||||||||||
| 2507 | for (;;) { | - | ||||||||||||||||||||||||
| 2508 | switch (state) { | - | ||||||||||||||||||||||||
| 2509 | case executed 237 times by 2 tests: eatWS:case eatWS:Executed by:
executed 237 times by 2 tests: case eatWS:Executed by:
| 237 | ||||||||||||||||||||||||
| 2510 | return executed 237 times by 2 tests: true;return true;Executed by:
executed 237 times by 2 tests: return true;Executed by:
| 237 | ||||||||||||||||||||||||
| 2511 | case executed 10 times by 1 test: PInstr:case PInstr:Executed by:
executed 10 times by 1 test: case PInstr:Executed by:
| 10 | ||||||||||||||||||||||||
| 2512 | if (contentHnd
| 0-10 | ||||||||||||||||||||||||
| 2513 | if (!contentHnd->processingInstruction(name(),string())
| 0-10 | ||||||||||||||||||||||||
| 2514 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 2515 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2516 | } | - | ||||||||||||||||||||||||
| 2517 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 2518 | return executed 10 times by 1 test: true;return true;Executed by:
executed 10 times by 1 test: return true;Executed by:
| 10 | ||||||||||||||||||||||||
| 2519 | case executed 10 times by 1 test: Comment2:case Comment2:Executed by:
executed 10 times by 1 test: case Comment2:Executed by:
| 10 | ||||||||||||||||||||||||
| 2520 | if (lexicalHnd
| 0-10 | ||||||||||||||||||||||||
| 2521 | if (!lexicalHnd->comment(string())
| 0-10 | ||||||||||||||||||||||||
| 2522 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2523 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2524 | } | - | ||||||||||||||||||||||||
| 2525 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 2526 | return executed 10 times by 1 test: true;return true;Executed by:
executed 10 times by 1 test: return true;Executed by:
| 10 | ||||||||||||||||||||||||
| 2527 | case executed 8 times by 1 test: -1:case -1:Executed by:
executed 8 times by 1 test: case -1:Executed by:
| 8 | ||||||||||||||||||||||||
| 2528 | - | |||||||||||||||||||||||||
| 2529 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 2530 | return executed 8 times by 1 test: false;return false;Executed by:
executed 8 times by 1 test: return false;Executed by:
| 8 | ||||||||||||||||||||||||
| 2531 | } | - | ||||||||||||||||||||||||
| 2532 | - | |||||||||||||||||||||||||
| 2533 | if (atEnd()
| 4-1794 | ||||||||||||||||||||||||
| 2534 | unexpectedEof(&QXmlSimpleReaderPrivate::parseMisc, state); | - | ||||||||||||||||||||||||
| 2535 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 2536 | } | - | ||||||||||||||||||||||||
| 2537 | if (is_S(c)
| 67-1727 | ||||||||||||||||||||||||
| 2538 | input = InpWs; | - | ||||||||||||||||||||||||
| 2539 | } executed 1727 times by 2 tests: else if (c == QLatin1Char('<')end of blockExecuted by:
| 26-1727 | ||||||||||||||||||||||||
| 2540 | input = InpLt; | - | ||||||||||||||||||||||||
| 2541 | } executed 26 times by 1 test: else if (c == QLatin1Char('?')end of blockExecuted by:
| 11-30 | ||||||||||||||||||||||||
| 2542 | input = InpQm; | - | ||||||||||||||||||||||||
| 2543 | } executed 11 times by 1 test: else if (c == QLatin1Char('!')end of blockExecuted by:
| 11-19 | ||||||||||||||||||||||||
| 2544 | input = InpEm; | - | ||||||||||||||||||||||||
| 2545 | } executed 11 times by 1 test: else {end of blockExecuted by:
| 11 | ||||||||||||||||||||||||
| 2546 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 2547 | } executed 19 times by 1 test: end of blockExecuted by:
| 19 | ||||||||||||||||||||||||
| 2548 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 2549 | - | |||||||||||||||||||||||||
| 2550 | switch (state) { | - | ||||||||||||||||||||||||
| 2551 | case executed 1727 times by 2 tests: eatWS:case eatWS:Executed by:
executed 1727 times by 2 tests: case eatWS:Executed by:
| 1727 | ||||||||||||||||||||||||
| 2552 | if (!eat_ws()
| 225-1502 | ||||||||||||||||||||||||
| 2553 | parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); | - | ||||||||||||||||||||||||
| 2554 | return executed 1502 times by 1 test: false;return false;Executed by:
executed 1502 times by 1 test: return false;Executed by:
| 1502 | ||||||||||||||||||||||||
| 2555 | } | - | ||||||||||||||||||||||||
| 2556 | break; executed 225 times by 2 tests: break;Executed by:
| 225 | ||||||||||||||||||||||||
| 2557 | case executed 26 times by 1 test: Lt:case Lt:Executed by:
executed 26 times by 1 test: case Lt:Executed by:
| 26 | ||||||||||||||||||||||||
| 2558 | next(); | - | ||||||||||||||||||||||||
| 2559 | break; executed 26 times by 1 test: break;Executed by:
| 26 | ||||||||||||||||||||||||
| 2560 | case executed 11 times by 1 test: PInstr:case PInstr:Executed by:
executed 11 times by 1 test: case PInstr:Executed by:
| 11 | ||||||||||||||||||||||||
| 2561 | parsePI_xmldecl = false; | - | ||||||||||||||||||||||||
| 2562 | if (!parsePI()
| 1-10 | ||||||||||||||||||||||||
| 2563 | parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); | - | ||||||||||||||||||||||||
| 2564 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 2565 | } | - | ||||||||||||||||||||||||
| 2566 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||
| 2567 | case executed 11 times by 1 test: Comment:case Comment:Executed by:
executed 11 times by 1 test: case Comment:Executed by:
| 11 | ||||||||||||||||||||||||
| 2568 | next(); | - | ||||||||||||||||||||||||
| 2569 | break; executed 11 times by 1 test: break;Executed by:
| 11 | ||||||||||||||||||||||||
| 2570 | case executed 11 times by 1 test: Comment2:case Comment2:Executed by:
executed 11 times by 1 test: case Comment2:Executed by:
| 11 | ||||||||||||||||||||||||
| 2571 | if (!parseComment()
| 1-10 | ||||||||||||||||||||||||
| 2572 | parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); | - | ||||||||||||||||||||||||
| 2573 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 2574 | } | - | ||||||||||||||||||||||||
| 2575 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||
| 2576 | } | - | ||||||||||||||||||||||||
| 2577 | } executed 272 times by 2 tests: end of blockExecuted by:
| 272 | ||||||||||||||||||||||||
| 2578 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2579 | } | - | ||||||||||||||||||||||||
| 2580 | bool QXmlSimpleReaderPrivate::parsePI() | - | ||||||||||||||||||||||||
| 2581 | { | - | ||||||||||||||||||||||||
| 2582 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 2583 | const signed char QmI = 1; | - | ||||||||||||||||||||||||
| 2584 | const signed char Name = 2; | - | ||||||||||||||||||||||||
| 2585 | const signed char XMLDecl = 3; | - | ||||||||||||||||||||||||
| 2586 | const signed char Ws1 = 4; | - | ||||||||||||||||||||||||
| 2587 | const signed char PInstr = 5; | - | ||||||||||||||||||||||||
| 2588 | const signed char Ws2 = 6; | - | ||||||||||||||||||||||||
| 2589 | const signed char Version = 7; | - | ||||||||||||||||||||||||
| 2590 | const signed char Ws3 = 8; | - | ||||||||||||||||||||||||
| 2591 | const signed char EorSD = 9; | - | ||||||||||||||||||||||||
| 2592 | const signed char Ws4 = 10; | - | ||||||||||||||||||||||||
| 2593 | const signed char SD = 11; | - | ||||||||||||||||||||||||
| 2594 | const signed char Ws5 = 12; | - | ||||||||||||||||||||||||
| 2595 | const signed char ADone = 13; | - | ||||||||||||||||||||||||
| 2596 | const signed char Char = 14; | - | ||||||||||||||||||||||||
| 2597 | const signed char Qm = 15; | - | ||||||||||||||||||||||||
| 2598 | const signed char Done = 16; | - | ||||||||||||||||||||||||
| 2599 | - | |||||||||||||||||||||||||
| 2600 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 2601 | const signed char InpNameBe = 1; | - | ||||||||||||||||||||||||
| 2602 | const signed char InpGt = 2; | - | ||||||||||||||||||||||||
| 2603 | const signed char InpQm = 3; | - | ||||||||||||||||||||||||
| 2604 | const signed char InpUnknown = 4; | - | ||||||||||||||||||||||||
| 2605 | - | |||||||||||||||||||||||||
| 2606 | static const signed char table[16][5] = { | - | ||||||||||||||||||||||||
| 2607 | - | |||||||||||||||||||||||||
| 2608 | { -1, -1, -1, QmI, -1 }, | - | ||||||||||||||||||||||||
| 2609 | { -1, Name, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2610 | { -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2611 | { Ws1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2612 | { -1, Version, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2613 | { Ws2, -1, -1, Qm, -1 }, | - | ||||||||||||||||||||||||
| 2614 | { Char, Char, Char, Qm, Char }, | - | ||||||||||||||||||||||||
| 2615 | { Ws3, -1, -1, ADone, -1 }, | - | ||||||||||||||||||||||||
| 2616 | { -1, EorSD, -1, ADone, -1 }, | - | ||||||||||||||||||||||||
| 2617 | { Ws4, -1, -1, ADone, -1 }, | - | ||||||||||||||||||||||||
| 2618 | { -1, SD, -1, ADone, -1 }, | - | ||||||||||||||||||||||||
| 2619 | { Ws5, -1, -1, ADone, -1 }, | - | ||||||||||||||||||||||||
| 2620 | { -1, -1, -1, ADone, -1 }, | - | ||||||||||||||||||||||||
| 2621 | { -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 2622 | { Char, Char, Char, Qm, Char }, | - | ||||||||||||||||||||||||
| 2623 | { Char, Char, Done, Qm, Char }, | - | ||||||||||||||||||||||||
| 2624 | }; | - | ||||||||||||||||||||||||
| 2625 | signed char state; | - | ||||||||||||||||||||||||
| 2626 | signed char input; | - | ||||||||||||||||||||||||
| 2627 | - | |||||||||||||||||||||||||
| 2628 | if (parseStack==0
| 54-1386 | ||||||||||||||||||||||||
| 2629 | state = Init; | - | ||||||||||||||||||||||||
| 2630 | } executed 198 times by 2 tests: else {end of blockExecuted by:
| 198 | ||||||||||||||||||||||||
| 2631 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 2632 | - | |||||||||||||||||||||||||
| 2633 | - | |||||||||||||||||||||||||
| 2634 | - | |||||||||||||||||||||||||
| 2635 | if (!parseStack->isEmpty()
| 245-997 | ||||||||||||||||||||||||
| 2636 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 2637 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 87-910 | ||||||||||||||||||||||||
| 2638 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 2639 | - | |||||||||||||||||||||||||
| 2640 | - | |||||||||||||||||||||||||
| 2641 | - | |||||||||||||||||||||||||
| 2642 | } executed 87 times by 1 test: end of blockExecuted by:
| 87 | ||||||||||||||||||||||||
| 2643 | if (!(this->*function)()
| 358-639 | ||||||||||||||||||||||||
| 2644 | parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2645 | return executed 639 times by 1 test: false;return false;Executed by:
executed 639 times by 1 test: return false;Executed by:
| 639 | ||||||||||||||||||||||||
| 2646 | } | - | ||||||||||||||||||||||||
| 2647 | } executed 358 times by 1 test: end of blockExecuted by:
| 358 | ||||||||||||||||||||||||
| 2648 | } executed 603 times by 1 test: end of blockExecuted by:
| 603 | ||||||||||||||||||||||||
| 2649 | - | |||||||||||||||||||||||||
| 2650 | for (;;) { | - | ||||||||||||||||||||||||
| 2651 | switch (state) { | - | ||||||||||||||||||||||||
| 2652 | case executed 197 times by 2 tests: Name:case Name:Executed by:
executed 197 times by 2 tests: case Name:Executed by:
| 197 | ||||||||||||||||||||||||
| 2653 | - | |||||||||||||||||||||||||
| 2654 | - | |||||||||||||||||||||||||
| 2655 | if (name().toLower() == QLatin1String("xml")
| 68-129 | ||||||||||||||||||||||||
| 2656 | if (parsePI_xmldecl
| 2-121 | ||||||||||||||||||||||||
| 2657 | state = XMLDecl; | - | ||||||||||||||||||||||||
| 2658 | } executed 119 times by 2 tests: else {end of blockExecuted by:
| 119 | ||||||||||||||||||||||||
| 2659 | reportParseError(QLatin1String("invalid name for processing instruction")); | - | ||||||||||||||||||||||||
| 2660 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 2661 | } | - | ||||||||||||||||||||||||
| 2662 | } else { | - | ||||||||||||||||||||||||
| 2663 | state = PInstr; | - | ||||||||||||||||||||||||
| 2664 | stringClear(); | - | ||||||||||||||||||||||||
| 2665 | } executed 68 times by 2 tests: end of blockExecuted by:
| 68 | ||||||||||||||||||||||||
| 2666 | break; executed 187 times by 2 tests: break;Executed by:
| 187 | ||||||||||||||||||||||||
| 2667 | case executed 131 times by 2 tests: Version:case Version:Executed by:
executed 131 times by 2 tests: case Version:Executed by:
| 131 | ||||||||||||||||||||||||
| 2668 | - | |||||||||||||||||||||||||
| 2669 | if (name() != QLatin1String("version")
| 3-128 | ||||||||||||||||||||||||
| 2670 | reportParseError(QLatin1String("version expected while reading the XML declaration")); | - | ||||||||||||||||||||||||
| 2671 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 2672 | } | - | ||||||||||||||||||||||||
| 2673 | xmlVersion = string(); | - | ||||||||||||||||||||||||
| 2674 | break; executed 128 times by 2 tests: break;Executed by:
| 128 | ||||||||||||||||||||||||
| 2675 | case executed 119 times by 2 tests: EorSD:case EorSD:Executed by:
executed 119 times by 2 tests: case EorSD:Executed by:
| 119 | ||||||||||||||||||||||||
| 2676 | - | |||||||||||||||||||||||||
| 2677 | if (name() == QLatin1String("standalone")
| 18-101 | ||||||||||||||||||||||||
| 2678 | if (string()== QLatin1String("yes")
| 1-17 | ||||||||||||||||||||||||
| 2679 | standalone = QXmlSimpleReaderPrivate::Yes; | - | ||||||||||||||||||||||||
| 2680 | } executed 17 times by 1 test: else if (string() == QLatin1String("no")end of blockExecuted by:
| 0-17 | ||||||||||||||||||||||||
| 2681 | standalone = QXmlSimpleReaderPrivate::No; | - | ||||||||||||||||||||||||
| 2682 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2683 | reportParseError(QLatin1String("wrong value for standalone declaration")); | - | ||||||||||||||||||||||||
| 2684 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 2685 | } | - | ||||||||||||||||||||||||
| 2686 | } else if (name() == QLatin1String("encoding")
| 2-99 | ||||||||||||||||||||||||
| 2687 | encoding = string(); | - | ||||||||||||||||||||||||
| 2688 | } executed 99 times by 2 tests: else {end of blockExecuted by:
| 99 | ||||||||||||||||||||||||
| 2689 | reportParseError(QLatin1String("encoding declaration or standalone declaration expected while reading the XML declaration")); | - | ||||||||||||||||||||||||
| 2690 | return executed 2 times by 1 test: false;return false;Executed by:
executed 2 times by 1 test: return false;Executed by:
| 2 | ||||||||||||||||||||||||
| 2691 | } | - | ||||||||||||||||||||||||
| 2692 | break; executed 116 times by 2 tests: break;Executed by:
| 116 | ||||||||||||||||||||||||
| 2693 | case executed 50 times by 1 test: SD:case SD:Executed by:
executed 50 times by 1 test: case SD:Executed by:
| 50 | ||||||||||||||||||||||||
| 2694 | if (name() != QLatin1String("standalone")
| 0-50 | ||||||||||||||||||||||||
| 2695 | reportParseError(QLatin1String("standalone declaration expected while reading the XML declaration")); | - | ||||||||||||||||||||||||
| 2696 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2697 | } | - | ||||||||||||||||||||||||
| 2698 | if (string() == QLatin1String("yes")
| 11-39 | ||||||||||||||||||||||||
| 2699 | standalone = QXmlSimpleReaderPrivate::Yes; | - | ||||||||||||||||||||||||
| 2700 | } executed 11 times by 1 test: else if (string() == QLatin1String("no")end of blockExecuted by:
| 0-39 | ||||||||||||||||||||||||
| 2701 | standalone = QXmlSimpleReaderPrivate::No; | - | ||||||||||||||||||||||||
| 2702 | } executed 39 times by 1 test: else {end of blockExecuted by:
| 39 | ||||||||||||||||||||||||
| 2703 | reportParseError(QLatin1String("wrong value for standalone declaration")); | - | ||||||||||||||||||||||||
| 2704 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2705 | } | - | ||||||||||||||||||||||||
| 2706 | break; executed 50 times by 1 test: break;Executed by:
| 50 | ||||||||||||||||||||||||
| 2707 | case executed 104 times by 2 tests: Qm:case Qm:Executed by:
executed 104 times by 2 tests: case Qm:Executed by:
| 104 | ||||||||||||||||||||||||
| 2708 | - | |||||||||||||||||||||||||
| 2709 | if (!atEnd()
| 19-85 | ||||||||||||||||||||||||
| 2710 | stringAddC(QLatin1Char('?')); executed 21 times by 1 test: stringAddC(QLatin1Char('?'));Executed by:
| 21 | ||||||||||||||||||||||||
| 2711 | break; executed 104 times by 2 tests: break;Executed by:
| 104 | ||||||||||||||||||||||||
| 2712 | case executed 175 times by 2 tests: Done:case Done:Executed by:
executed 175 times by 2 tests: case Done:Executed by:
| 175 | ||||||||||||||||||||||||
| 2713 | return executed 175 times by 2 tests: true;return true;Executed by:
executed 175 times by 2 tests: return true;Executed by:
| 175 | ||||||||||||||||||||||||
| 2714 | case executed 3 times by 1 test: -1:case -1:Executed by:
executed 3 times by 1 test: case -1:Executed by:
| 3 | ||||||||||||||||||||||||
| 2715 | - | |||||||||||||||||||||||||
| 2716 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 2717 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 2718 | } | - | ||||||||||||||||||||||||
| 2719 | - | |||||||||||||||||||||||||
| 2720 | if (atEnd()
| 249-1786 | ||||||||||||||||||||||||
| 2721 | unexpectedEof(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2722 | return executed 249 times by 1 test: false;return false;Executed by:
executed 249 times by 1 test: return false;Executed by:
| 249 | ||||||||||||||||||||||||
| 2723 | } | - | ||||||||||||||||||||||||
| 2724 | if (is_S(c)
| 412-1374 | ||||||||||||||||||||||||
| 2725 | input = InpWs; | - | ||||||||||||||||||||||||
| 2726 | } executed 412 times by 2 tests: else if (determineNameChar(c) == NameBeginningend of blockExecuted by:
| 412-764 | ||||||||||||||||||||||||
| 2727 | input = InpNameBe; | - | ||||||||||||||||||||||||
| 2728 | } executed 764 times by 2 tests: else if (c == QLatin1Char('>')end of blockExecuted by:
| 189-764 | ||||||||||||||||||||||||
| 2729 | input = InpGt; | - | ||||||||||||||||||||||||
| 2730 | } executed 189 times by 2 tests: else if (c == QLatin1Char('?')end of blockExecuted by:
| 27-394 | ||||||||||||||||||||||||
| 2731 | input = InpQm; | - | ||||||||||||||||||||||||
| 2732 | } executed 394 times by 2 tests: else {end of blockExecuted by:
| 394 | ||||||||||||||||||||||||
| 2733 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 2734 | } executed 27 times by 2 tests: end of blockExecuted by:
| 27 | ||||||||||||||||||||||||
| 2735 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 2736 | - | |||||||||||||||||||||||||
| 2737 | switch (state) { | - | ||||||||||||||||||||||||
| 2738 | case executed 198 times by 2 tests: QmI:case QmI:Executed by:
executed 198 times by 2 tests: case QmI:Executed by:
| 198 | ||||||||||||||||||||||||
| 2739 | next(); | - | ||||||||||||||||||||||||
| 2740 | break; executed 198 times by 2 tests: break;Executed by:
| 198 | ||||||||||||||||||||||||
| 2741 | case executed 197 times by 2 tests: Name:case Name:Executed by:
executed 197 times by 2 tests: case Name:Executed by:
| 197 | ||||||||||||||||||||||||
| 2742 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 2743 | if (!parseName()
| 83-114 | ||||||||||||||||||||||||
| 2744 | parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2745 | return executed 83 times by 1 test: false;return false;Executed by:
executed 83 times by 1 test: return false;Executed by:
| 83 | ||||||||||||||||||||||||
| 2746 | } | - | ||||||||||||||||||||||||
| 2747 | break; executed 114 times by 2 tests: break;Executed by:
| 114 | ||||||||||||||||||||||||
| 2748 | case executed 119 times by 2 tests: Ws1:case Ws1:Executed by:
executed 119 times by 2 tests: case Ws1:Executed by:
| 119 | ||||||||||||||||||||||||
| 2749 | case executed 58 times by 2 tests: Ws2:case Ws2:Executed by:
executed 58 times by 2 tests: case Ws2:Executed by:
| 58 | ||||||||||||||||||||||||
| 2750 | case executed 78 times by 2 tests: Ws3:case Ws3:Executed by:
executed 78 times by 2 tests: case Ws3:Executed by:
| 78 | ||||||||||||||||||||||||
| 2751 | case executed 40 times by 1 test: Ws4:case Ws4:Executed by:
executed 40 times by 1 test: case Ws4:Executed by:
| 40 | ||||||||||||||||||||||||
| 2752 | case executed 30 times by 1 test: Ws5:case Ws5:Executed by:
executed 30 times by 1 test: case Ws5:Executed by:
| 30 | ||||||||||||||||||||||||
| 2753 | if (!eat_ws()
| 86-239 | ||||||||||||||||||||||||
| 2754 | parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2755 | return executed 86 times by 1 test: false;return false;Executed by:
executed 86 times by 1 test: return false;Executed by:
| 86 | ||||||||||||||||||||||||
| 2756 | } | - | ||||||||||||||||||||||||
| 2757 | break; executed 239 times by 2 tests: break;Executed by:
| 239 | ||||||||||||||||||||||||
| 2758 | case executed 119 times by 2 tests: Version:case Version:Executed by:
executed 119 times by 2 tests: case Version:Executed by:
| 119 | ||||||||||||||||||||||||
| 2759 | if (!parseAttribute()
| 29-90 | ||||||||||||||||||||||||
| 2760 | parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2761 | return executed 90 times by 1 test: false;return false;Executed by:
executed 90 times by 1 test: return false;Executed by:
| 90 | ||||||||||||||||||||||||
| 2762 | } | - | ||||||||||||||||||||||||
| 2763 | break; executed 29 times by 2 tests: break;Executed by:
| 29 | ||||||||||||||||||||||||
| 2764 | case executed 77 times by 2 tests: EorSD:case EorSD:Executed by:
executed 77 times by 2 tests: case EorSD:Executed by:
| 77 | ||||||||||||||||||||||||
| 2765 | if (!parseAttribute()
| 14-63 | ||||||||||||||||||||||||
| 2766 | parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2767 | return executed 63 times by 1 test: false;return false;Executed by:
executed 63 times by 1 test: return false;Executed by:
| 63 | ||||||||||||||||||||||||
| 2768 | } | - | ||||||||||||||||||||||||
| 2769 | break; executed 14 times by 2 tests: break;Executed by:
| 14 | ||||||||||||||||||||||||
| 2770 | case executed 40 times by 1 test: SD:case SD:Executed by:
executed 40 times by 1 test: case SD:Executed by:
| 40 | ||||||||||||||||||||||||
| 2771 | - | |||||||||||||||||||||||||
| 2772 | if (standalone != QXmlSimpleReaderPrivate::Unknown
| 0-40 | ||||||||||||||||||||||||
| 2773 | - | |||||||||||||||||||||||||
| 2774 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 2775 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2776 | } | - | ||||||||||||||||||||||||
| 2777 | if (!parseAttribute()
| 4-36 | ||||||||||||||||||||||||
| 2778 | parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); | - | ||||||||||||||||||||||||
| 2779 | return executed 36 times by 1 test: false;return false;Executed by:
executed 36 times by 1 test: return false;Executed by:
| 36 | ||||||||||||||||||||||||
| 2780 | } | - | ||||||||||||||||||||||||
| 2781 | break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||
| 2782 | case executed 111 times by 2 tests: ADone:case ADone:Executed by:
executed 111 times by 2 tests: case ADone:Executed by:
| 111 | ||||||||||||||||||||||||
| 2783 | next(); | - | ||||||||||||||||||||||||
| 2784 | break; executed 111 times by 2 tests: break;Executed by:
| 111 | ||||||||||||||||||||||||
| 2785 | case executed 456 times by 2 tests: Char:case Char:Executed by:
executed 456 times by 2 tests: case Char:Executed by:
| 456 | ||||||||||||||||||||||||
| 2786 | stringAddC(); | - | ||||||||||||||||||||||||
| 2787 | next(); | - | ||||||||||||||||||||||||
| 2788 | break; executed 456 times by 2 tests: break;Executed by:
| 456 | ||||||||||||||||||||||||
| 2789 | case executed 85 times by 2 tests: Qm:case Qm:Executed by:
executed 85 times by 2 tests: case Qm:Executed by:
| 85 | ||||||||||||||||||||||||
| 2790 | - | |||||||||||||||||||||||||
| 2791 | next(); | - | ||||||||||||||||||||||||
| 2792 | break; executed 85 times by 2 tests: break;Executed by:
| 85 | ||||||||||||||||||||||||
| 2793 | case executed 175 times by 2 tests: Done:case Done:Executed by:
executed 175 times by 2 tests: case Done:Executed by:
| 175 | ||||||||||||||||||||||||
| 2794 | next(); | - | ||||||||||||||||||||||||
| 2795 | break; executed 175 times by 2 tests: break;Executed by:
| 175 | ||||||||||||||||||||||||
| 2796 | } | - | ||||||||||||||||||||||||
| 2797 | } executed 1428 times by 2 tests: end of blockExecuted by:
| 1428 | ||||||||||||||||||||||||
| 2798 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2799 | } | - | ||||||||||||||||||||||||
| 2800 | bool QXmlSimpleReaderPrivate::parseDoctype() | - | ||||||||||||||||||||||||
| 2801 | { | - | ||||||||||||||||||||||||
| 2802 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 2803 | const signed char Doctype = 1; | - | ||||||||||||||||||||||||
| 2804 | const signed char Ws1 = 2; | - | ||||||||||||||||||||||||
| 2805 | const signed char Doctype2 = 3; | - | ||||||||||||||||||||||||
| 2806 | const signed char Ws2 = 4; | - | ||||||||||||||||||||||||
| 2807 | const signed char Sys = 5; | - | ||||||||||||||||||||||||
| 2808 | const signed char Ws3 = 6; | - | ||||||||||||||||||||||||
| 2809 | const signed char MP = 7; | - | ||||||||||||||||||||||||
| 2810 | const signed char MPR = 8; | - | ||||||||||||||||||||||||
| 2811 | const signed char PER = 9; | - | ||||||||||||||||||||||||
| 2812 | const signed char Mup = 10; | - | ||||||||||||||||||||||||
| 2813 | const signed char Ws4 = 11; | - | ||||||||||||||||||||||||
| 2814 | const signed char MPE = 12; | - | ||||||||||||||||||||||||
| 2815 | const signed char Done = 13; | - | ||||||||||||||||||||||||
| 2816 | - | |||||||||||||||||||||||||
| 2817 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 2818 | const signed char InpD = 1; | - | ||||||||||||||||||||||||
| 2819 | const signed char InpS = 2; | - | ||||||||||||||||||||||||
| 2820 | const signed char InpOB = 3; | - | ||||||||||||||||||||||||
| 2821 | const signed char InpCB = 4; | - | ||||||||||||||||||||||||
| 2822 | const signed char InpPer = 5; | - | ||||||||||||||||||||||||
| 2823 | const signed char InpGt = 6; | - | ||||||||||||||||||||||||
| 2824 | const signed char InpUnknown = 7; | - | ||||||||||||||||||||||||
| 2825 | - | |||||||||||||||||||||||||
| 2826 | static const signed char table[13][8] = { | - | ||||||||||||||||||||||||
| 2827 | - | |||||||||||||||||||||||||
| 2828 | { -1, Doctype, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2829 | { Ws1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 2830 | { -1, Doctype2, Doctype2, -1, -1, -1, -1, Doctype2 }, | - | ||||||||||||||||||||||||
| 2831 | { Ws2, -1, Sys, MP, -1, -1, Done, -1 }, | - | ||||||||||||||||||||||||
| 2832 | { -1, -1, Sys, MP, -1, -1, Done, -1 }, | - | ||||||||||||||||||||||||
| 2833 | { Ws3, -1, -1, MP, -1, -1, Done, -1 }, | - | ||||||||||||||||||||||||
| 2834 | { -1, -1, -1, MP, -1, -1, Done, -1 }, | - | ||||||||||||||||||||||||
| 2835 | { -1, -1, -1, -1, MPE, PER, -1, Mup }, | - | ||||||||||||||||||||||||
| 2836 | { -1, -1, -1, -1, MPE, PER, -1, Mup }, | - | ||||||||||||||||||||||||
| 2837 | { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, | - | ||||||||||||||||||||||||
| 2838 | { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, | - | ||||||||||||||||||||||||
| 2839 | { -1, -1, -1, -1, MPE, PER, -1, Mup }, | - | ||||||||||||||||||||||||
| 2840 | { -1, -1, -1, -1, -1, -1, Done, -1 } | - | ||||||||||||||||||||||||
| 2841 | }; | - | ||||||||||||||||||||||||
| 2842 | signed char state; | - | ||||||||||||||||||||||||
| 2843 | signed char input; | - | ||||||||||||||||||||||||
| 2844 | - | |||||||||||||||||||||||||
| 2845 | if (parseStack==0
| 433-31694 | ||||||||||||||||||||||||
| 2846 | startDTDwasReported = false; | - | ||||||||||||||||||||||||
| 2847 | systemId.clear(); | - | ||||||||||||||||||||||||
| 2848 | publicId.clear(); | - | ||||||||||||||||||||||||
| 2849 | state = Init; | - | ||||||||||||||||||||||||
| 2850 | } executed 1923 times by 4 tests: else {end of blockExecuted by:
| 1923 | ||||||||||||||||||||||||
| 2851 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 2852 | - | |||||||||||||||||||||||||
| 2853 | - | |||||||||||||||||||||||||
| 2854 | - | |||||||||||||||||||||||||
| 2855 | if (!parseStack->isEmpty()
| 1260-28944 | ||||||||||||||||||||||||
| 2856 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 2857 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 4229-24715 | ||||||||||||||||||||||||
| 2858 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 2859 | - | |||||||||||||||||||||||||
| 2860 | - | |||||||||||||||||||||||||
| 2861 | - | |||||||||||||||||||||||||
| 2862 | } executed 4229 times by 1 test: end of blockExecuted by:
| 4229 | ||||||||||||||||||||||||
| 2863 | if (!(this->*function)()
| 8495-20449 | ||||||||||||||||||||||||
| 2864 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2865 | return executed 20449 times by 1 test: false;return false;Executed by:
executed 20449 times by 1 test: return false;Executed by:
| 20449 | ||||||||||||||||||||||||
| 2866 | } | - | ||||||||||||||||||||||||
| 2867 | } executed 8495 times by 1 test: end of blockExecuted by:
| 8495 | ||||||||||||||||||||||||
| 2868 | } executed 9755 times by 1 test: end of blockExecuted by:
| 9755 | ||||||||||||||||||||||||
| 2869 | - | |||||||||||||||||||||||||
| 2870 | for (;;) { | - | ||||||||||||||||||||||||
| 2871 | switch (state) { | - | ||||||||||||||||||||||||
| 2872 | case executed 1923 times by 4 tests: Doctype2:case Doctype2:Executed by:
executed 1923 times by 4 tests: case Doctype2:Executed by:
| 1923 | ||||||||||||||||||||||||
| 2873 | doctype = name(); | - | ||||||||||||||||||||||||
| 2874 | break; executed 1923 times by 4 tests: break;Executed by:
| 1923 | ||||||||||||||||||||||||
| 2875 | case executed 1558 times by 2 tests: MP:case MP:Executed by:
executed 1558 times by 2 tests: case MP:Executed by:
| 1558 | ||||||||||||||||||||||||
| 2876 | if (!startDTDwasReported
| 0-1558 | ||||||||||||||||||||||||
| 2877 | startDTDwasReported = true; | - | ||||||||||||||||||||||||
| 2878 | if (!lexicalHnd->startDTD(doctype, publicId, systemId)
| 0-1554 | ||||||||||||||||||||||||
| 2879 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2880 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2881 | } | - | ||||||||||||||||||||||||
| 2882 | } executed 1554 times by 1 test: end of blockExecuted by:
| 1554 | ||||||||||||||||||||||||
| 2883 | state = MPR; | - | ||||||||||||||||||||||||
| 2884 | break; executed 1558 times by 2 tests: break;Executed by:
| 1558 | ||||||||||||||||||||||||
| 2885 | case executed 1868 times by 4 tests: Done:case Done:Executed by:
executed 1868 times by 4 tests: case Done:Executed by:
| 1868 | ||||||||||||||||||||||||
| 2886 | return executed 1868 times by 4 tests: true;return true;Executed by:
executed 1868 times by 4 tests: return true;Executed by:
| 1868 | ||||||||||||||||||||||||
| 2887 | case executed 2 times by 1 test: -1:case -1:Executed by:
executed 2 times by 1 test: case -1:Executed by:
| 2 | ||||||||||||||||||||||||
| 2888 | - | |||||||||||||||||||||||||
| 2889 | reportParseError(QLatin1String("error occurred while parsing document type definition")); | - | ||||||||||||||||||||||||
| 2890 | return executed 2 times by 1 test: false;return false;Executed by:
executed 2 times by 1 test: return false;Executed by:
| 2 | ||||||||||||||||||||||||
| 2891 | } | - | ||||||||||||||||||||||||
| 2892 | - | |||||||||||||||||||||||||
| 2893 | if (atEnd()
| 1260-18800 | ||||||||||||||||||||||||
| 2894 | unexpectedEof(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2895 | return executed 1260 times by 1 test: false;return false;Executed by:
executed 1260 times by 1 test: return false;Executed by:
| 1260 | ||||||||||||||||||||||||
| 2896 | } | - | ||||||||||||||||||||||||
| 2897 | if (is_S(c)
| 6715-12085 | ||||||||||||||||||||||||
| 2898 | input = InpWs; | - | ||||||||||||||||||||||||
| 2899 | } executed 6715 times by 4 tests: else if (c == QLatin1Char('D')end of blockExecuted by:
| 1923-10162 | ||||||||||||||||||||||||
| 2900 | input = InpD; | - | ||||||||||||||||||||||||
| 2901 | } executed 1923 times by 4 tests: else if (c == QLatin1Char('S')end of blockExecuted by:
| 296-9866 | ||||||||||||||||||||||||
| 2902 | input = InpS; | - | ||||||||||||||||||||||||
| 2903 | } executed 296 times by 2 tests: else if (c == QLatin1Char('P')end of blockExecuted by:
| 87-9779 | ||||||||||||||||||||||||
| 2904 | input = InpS; | - | ||||||||||||||||||||||||
| 2905 | } executed 87 times by 2 tests: else if (c == QLatin1Char('[')end of blockExecuted by:
| 87-8221 | ||||||||||||||||||||||||
| 2906 | input = InpOB; | - | ||||||||||||||||||||||||
| 2907 | } executed 1558 times by 2 tests: else if (c == QLatin1Char(']')end of blockExecuted by:
| 1505-6716 | ||||||||||||||||||||||||
| 2908 | input = InpCB; | - | ||||||||||||||||||||||||
| 2909 | } executed 1505 times by 2 tests: else if (c == QLatin1Char('%')end of blockExecuted by:
| 51-6665 | ||||||||||||||||||||||||
| 2910 | input = InpPer; | - | ||||||||||||||||||||||||
| 2911 | } executed 51 times by 1 test: else if (c == QLatin1Char('>')end of blockExecuted by:
| 51-4797 | ||||||||||||||||||||||||
| 2912 | input = InpGt; | - | ||||||||||||||||||||||||
| 2913 | } executed 1868 times by 4 tests: else {end of blockExecuted by:
| 1868 | ||||||||||||||||||||||||
| 2914 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 2915 | } executed 4797 times by 4 tests: end of blockExecuted by:
| 4797 | ||||||||||||||||||||||||
| 2916 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 2917 | - | |||||||||||||||||||||||||
| 2918 | switch (state) { | - | ||||||||||||||||||||||||
| 2919 | case executed 1923 times by 4 tests: Doctype:case Doctype:Executed by:
executed 1923 times by 4 tests: case Doctype:Executed by:
| 1923 | ||||||||||||||||||||||||
| 2920 | parseString_s = QLatin1String("DOCTYPE"); | - | ||||||||||||||||||||||||
| 2921 | if (!parseString()
| 591-1332 | ||||||||||||||||||||||||
| 2922 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2923 | return executed 1332 times by 1 test: false;return false;Executed by:
executed 1332 times by 1 test: return false;Executed by:
| 1332 | ||||||||||||||||||||||||
| 2924 | } | - | ||||||||||||||||||||||||
| 2925 | break; executed 591 times by 4 tests: break;Executed by:
| 591 | ||||||||||||||||||||||||
| 2926 | case executed 1923 times by 4 tests: Ws1:case Ws1:Executed by:
executed 1923 times by 4 tests: case Ws1:Executed by:
| 1923 | ||||||||||||||||||||||||
| 2927 | case executed 1831 times by 3 tests: Ws2:case Ws2:Executed by:
executed 1831 times by 3 tests: case Ws2:Executed by:
| 1831 | ||||||||||||||||||||||||
| 2928 | case executed 111 times by 2 tests: Ws3:case Ws3:Executed by:
executed 111 times by 2 tests: case Ws3:Executed by:
| 111 | ||||||||||||||||||||||||
| 2929 | case executed 2850 times by 2 tests: Ws4:case Ws4:Executed by:
executed 2850 times by 2 tests: case Ws4:Executed by:
| 2850 | ||||||||||||||||||||||||
| 2930 | if (!eat_ws()
| 2308-4407 | ||||||||||||||||||||||||
| 2931 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2932 | return executed 2308 times by 1 test: false;return false;Executed by:
executed 2308 times by 1 test: return false;Executed by:
| 2308 | ||||||||||||||||||||||||
| 2933 | } | - | ||||||||||||||||||||||||
| 2934 | break; executed 4407 times by 4 tests: break;Executed by:
| 4407 | ||||||||||||||||||||||||
| 2935 | case executed 1923 times by 4 tests: Doctype2:case Doctype2:Executed by:
executed 1923 times by 4 tests: case Doctype2:Executed by:
| 1923 | ||||||||||||||||||||||||
| 2936 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 2937 | if (!parseName()
| 846-1077 | ||||||||||||||||||||||||
| 2938 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2939 | return executed 846 times by 1 test: false;return false;Executed by:
executed 846 times by 1 test: return false;Executed by:
| 846 | ||||||||||||||||||||||||
| 2940 | } | - | ||||||||||||||||||||||||
| 2941 | break; executed 1077 times by 4 tests: break;Executed by:
| 1077 | ||||||||||||||||||||||||
| 2942 | case executed 383 times by 3 tests: Sys:case Sys:Executed by:
executed 383 times by 3 tests: case Sys:Executed by:
| 383 | ||||||||||||||||||||||||
| 2943 | parseExternalID_allowPublicID = false; | - | ||||||||||||||||||||||||
| 2944 | if (!parseExternalID()
| 104-279 | ||||||||||||||||||||||||
| 2945 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2946 | return executed 279 times by 1 test: false;return false;Executed by:
executed 279 times by 1 test: return false;Executed by:
| 279 | ||||||||||||||||||||||||
| 2947 | } | - | ||||||||||||||||||||||||
| 2948 | thisPublicId = publicId; | - | ||||||||||||||||||||||||
| 2949 | thisSystemId = systemId; | - | ||||||||||||||||||||||||
| 2950 | break; executed 104 times by 3 tests: break;Executed by:
| 104 | ||||||||||||||||||||||||
| 2951 | case executed 1558 times by 2 tests: MP:case MP:Executed by:
executed 1558 times by 2 tests: case MP:Executed by:
| 1558 | ||||||||||||||||||||||||
| 2952 | case never executed: MPR:case MPR:never executed: case MPR: | 0 | ||||||||||||||||||||||||
| 2953 | if (!next_eat_ws()
| 673-885 | ||||||||||||||||||||||||
| 2954 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2955 | return executed 885 times by 1 test: false;return false;Executed by:
executed 885 times by 1 test: return false;Executed by:
| 885 | ||||||||||||||||||||||||
| 2956 | } | - | ||||||||||||||||||||||||
| 2957 | break; executed 673 times by 2 tests: break;Executed by:
| 673 | ||||||||||||||||||||||||
| 2958 | case executed 50 times by 1 test: PER:case PER:Executed by:
executed 50 times by 1 test: case PER:Executed by:
| 50 | ||||||||||||||||||||||||
| 2959 | parsePEReference_context = InDTD; | - | ||||||||||||||||||||||||
| 2960 | if (!parsePEReference()
| 20-30 | ||||||||||||||||||||||||
| 2961 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2962 | return executed 20 times by 1 test: false;return false;Executed by:
executed 20 times by 1 test: return false;Executed by:
| 20 | ||||||||||||||||||||||||
| 2963 | } | - | ||||||||||||||||||||||||
| 2964 | break; executed 30 times by 1 test: break;Executed by:
| 30 | ||||||||||||||||||||||||
| 2965 | case executed 2873 times by 2 tests: Mup:case Mup:Executed by:
executed 2873 times by 2 tests: case Mup:Executed by:
| 2873 | ||||||||||||||||||||||||
| 2966 | if (dtdRecursionLimit > 0
| 0-2873 | ||||||||||||||||||||||||
| 2967 | reportParseError(QString::fromLatin1( | - | ||||||||||||||||||||||||
| 2968 | "DTD parsing exceeded recursion limit of %1.").arg(dtdRecursionLimit)); | - | ||||||||||||||||||||||||
| 2969 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2970 | } | - | ||||||||||||||||||||||||
| 2971 | if (!parseMarkupdecl()
| 412-2461 | ||||||||||||||||||||||||
| 2972 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2973 | return executed 2461 times by 1 test: false;return false;Executed by:
executed 2461 times by 1 test: return false;Executed by:
| 2461 | ||||||||||||||||||||||||
| 2974 | } | - | ||||||||||||||||||||||||
| 2975 | break; executed 412 times by 2 tests: break;Executed by:
| 412 | ||||||||||||||||||||||||
| 2976 | case executed 1505 times by 2 tests: MPE:case MPE:Executed by:
executed 1505 times by 2 tests: case MPE:Executed by:
| 1505 | ||||||||||||||||||||||||
| 2977 | if (!next_eat_ws()
| 417-1088 | ||||||||||||||||||||||||
| 2978 | parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); | - | ||||||||||||||||||||||||
| 2979 | return executed 417 times by 1 test: false;return false;Executed by:
executed 417 times by 1 test: return false;Executed by:
| 417 | ||||||||||||||||||||||||
| 2980 | } | - | ||||||||||||||||||||||||
| 2981 | break; executed 1088 times by 2 tests: break;Executed by:
| 1088 | ||||||||||||||||||||||||
| 2982 | case executed 1868 times by 4 tests: Done:case Done:Executed by:
executed 1868 times by 4 tests: case Done:Executed by:
| 1868 | ||||||||||||||||||||||||
| 2983 | if (lexicalHnd
| 6-1862 | ||||||||||||||||||||||||
| 2984 | if (!startDTDwasReported
| 359-1503 | ||||||||||||||||||||||||
| 2985 | startDTDwasReported = true; | - | ||||||||||||||||||||||||
| 2986 | if (!lexicalHnd->startDTD(doctype, publicId, systemId)
| 0-359 | ||||||||||||||||||||||||
| 2987 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2988 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2989 | } | - | ||||||||||||||||||||||||
| 2990 | } executed 359 times by 3 tests: end of blockExecuted by:
| 359 | ||||||||||||||||||||||||
| 2991 | if (!lexicalHnd->endDTD()
| 0-1862 | ||||||||||||||||||||||||
| 2992 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 2993 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2994 | } | - | ||||||||||||||||||||||||
| 2995 | } executed 1862 times by 3 tests: end of blockExecuted by:
| 1862 | ||||||||||||||||||||||||
| 2996 | next(); | - | ||||||||||||||||||||||||
| 2997 | break; executed 1868 times by 4 tests: break;Executed by:
| 1868 | ||||||||||||||||||||||||
| 2998 | } | - | ||||||||||||||||||||||||
| 2999 | } executed 10252 times by 4 tests: end of blockExecuted by:
| 10252 | ||||||||||||||||||||||||
| 3000 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3001 | } | - | ||||||||||||||||||||||||
| 3002 | - | |||||||||||||||||||||||||
| 3003 | - | |||||||||||||||||||||||||
| 3004 | - | |||||||||||||||||||||||||
| 3005 | - | |||||||||||||||||||||||||
| 3006 | - | |||||||||||||||||||||||||
| 3007 | - | |||||||||||||||||||||||||
| 3008 | bool QXmlSimpleReaderPrivate::parseExternalID() | - | ||||||||||||||||||||||||
| 3009 | { | - | ||||||||||||||||||||||||
| 3010 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 3011 | const signed char Sys = 1; | - | ||||||||||||||||||||||||
| 3012 | const signed char SysWS = 2; | - | ||||||||||||||||||||||||
| 3013 | const signed char SysSQ = 3; | - | ||||||||||||||||||||||||
| 3014 | const signed char SysSQ2 = 4; | - | ||||||||||||||||||||||||
| 3015 | const signed char SysDQ = 5; | - | ||||||||||||||||||||||||
| 3016 | const signed char SysDQ2 = 6; | - | ||||||||||||||||||||||||
| 3017 | const signed char Pub = 7; | - | ||||||||||||||||||||||||
| 3018 | const signed char PubWS = 8; | - | ||||||||||||||||||||||||
| 3019 | const signed char PubSQ = 9; | - | ||||||||||||||||||||||||
| 3020 | const signed char PubSQ2 = 10; | - | ||||||||||||||||||||||||
| 3021 | const signed char PubDQ = 11; | - | ||||||||||||||||||||||||
| 3022 | const signed char PubDQ2 = 12; | - | ||||||||||||||||||||||||
| 3023 | const signed char PubE = 13; | - | ||||||||||||||||||||||||
| 3024 | const signed char PubWS2 = 14; | - | ||||||||||||||||||||||||
| 3025 | const signed char PDone = 15; | - | ||||||||||||||||||||||||
| 3026 | const signed char Done = 16; | - | ||||||||||||||||||||||||
| 3027 | - | |||||||||||||||||||||||||
| 3028 | const signed char InpSQ = 0; | - | ||||||||||||||||||||||||
| 3029 | const signed char InpDQ = 1; | - | ||||||||||||||||||||||||
| 3030 | const signed char InpS = 2; | - | ||||||||||||||||||||||||
| 3031 | const signed char InpP = 3; | - | ||||||||||||||||||||||||
| 3032 | const signed char InpWs = 4; | - | ||||||||||||||||||||||||
| 3033 | const signed char InpUnknown = 5; | - | ||||||||||||||||||||||||
| 3034 | - | |||||||||||||||||||||||||
| 3035 | static const signed char table[15][6] = { | - | ||||||||||||||||||||||||
| 3036 | - | |||||||||||||||||||||||||
| 3037 | { -1, -1, Sys, Pub, -1, -1 }, | - | ||||||||||||||||||||||||
| 3038 | { -1, -1, -1, -1, SysWS, -1 }, | - | ||||||||||||||||||||||||
| 3039 | { SysSQ, SysDQ, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3040 | { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, | - | ||||||||||||||||||||||||
| 3041 | { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, | - | ||||||||||||||||||||||||
| 3042 | { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, | - | ||||||||||||||||||||||||
| 3043 | { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, | - | ||||||||||||||||||||||||
| 3044 | { -1, -1, -1, -1, PubWS, -1 }, | - | ||||||||||||||||||||||||
| 3045 | { PubSQ, PubDQ, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3046 | { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, | - | ||||||||||||||||||||||||
| 3047 | { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, | - | ||||||||||||||||||||||||
| 3048 | { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, | - | ||||||||||||||||||||||||
| 3049 | { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, | - | ||||||||||||||||||||||||
| 3050 | { PDone, PDone, PDone, PDone, PubWS2, PDone }, | - | ||||||||||||||||||||||||
| 3051 | { SysSQ, SysDQ, PDone, PDone, PDone, PDone } | - | ||||||||||||||||||||||||
| 3052 | }; | - | ||||||||||||||||||||||||
| 3053 | signed char state; | - | ||||||||||||||||||||||||
| 3054 | signed char input; | - | ||||||||||||||||||||||||
| 3055 | - | |||||||||||||||||||||||||
| 3056 | if (parseStack==0
| 164-3322 | ||||||||||||||||||||||||
| 3057 | systemId.clear(); | - | ||||||||||||||||||||||||
| 3058 | publicId.clear(); | - | ||||||||||||||||||||||||
| 3059 | state = Init; | - | ||||||||||||||||||||||||
| 3060 | } executed 686 times by 3 tests: else {end of blockExecuted by:
| 686 | ||||||||||||||||||||||||
| 3061 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 3062 | - | |||||||||||||||||||||||||
| 3063 | - | |||||||||||||||||||||||||
| 3064 | - | |||||||||||||||||||||||||
| 3065 | if (!parseStack->isEmpty()
| 956-1844 | ||||||||||||||||||||||||
| 3066 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 3067 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 173-783 | ||||||||||||||||||||||||
| 3068 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 3069 | - | |||||||||||||||||||||||||
| 3070 | - | |||||||||||||||||||||||||
| 3071 | - | |||||||||||||||||||||||||
| 3072 | } executed 173 times by 1 test: end of blockExecuted by:
| 173 | ||||||||||||||||||||||||
| 3073 | if (!(this->*function)()
| 341-615 | ||||||||||||||||||||||||
| 3074 | parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3075 | return executed 341 times by 1 test: false;return false;Executed by:
executed 341 times by 1 test: return false;Executed by:
| 341 | ||||||||||||||||||||||||
| 3076 | } | - | ||||||||||||||||||||||||
| 3077 | } executed 615 times by 1 test: end of blockExecuted by:
| 615 | ||||||||||||||||||||||||
| 3078 | } executed 2459 times by 1 test: end of blockExecuted by:
| 2459 | ||||||||||||||||||||||||
| 3079 | - | |||||||||||||||||||||||||
| 3080 | for (;;) { | - | ||||||||||||||||||||||||
| 3081 | switch (state) { | - | ||||||||||||||||||||||||
| 3082 | case executed 22 times by 1 test: PDone:case PDone:Executed by:
executed 22 times by 1 test: case PDone:Executed by:
| 22 | ||||||||||||||||||||||||
| 3083 | if (parseExternalID_allowPublicID
| 2-20 | ||||||||||||||||||||||||
| 3084 | publicId = string(); | - | ||||||||||||||||||||||||
| 3085 | return executed 20 times by 1 test: true;return true;Executed by:
executed 20 times by 1 test: return true;Executed by:
| 20 | ||||||||||||||||||||||||
| 3086 | } else { | - | ||||||||||||||||||||||||
| 3087 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 3088 | return executed 2 times by 1 test: false;return false;Executed by:
executed 2 times by 1 test: return false;Executed by:
| 2 | ||||||||||||||||||||||||
| 3089 | } | - | ||||||||||||||||||||||||
| 3090 | case executed 664 times by 3 tests: Done:case Done:Executed by:
executed 664 times by 3 tests: case Done:Executed by:
| 664 | ||||||||||||||||||||||||
| 3091 | return executed 664 times by 3 tests: true;return true;Executed by:
executed 664 times by 3 tests: return true;Executed by:
| 664 | ||||||||||||||||||||||||
| 3092 | case never executed: -1:case -1:never executed: case -1: | 0 | ||||||||||||||||||||||||
| 3093 | - | |||||||||||||||||||||||||
| 3094 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 3095 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3096 | } | - | ||||||||||||||||||||||||
| 3097 | - | |||||||||||||||||||||||||
| 3098 | if (atEnd()
| 1844-13326 | ||||||||||||||||||||||||
| 3099 | unexpectedEof(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3100 | return executed 1844 times by 1 test: false;return false;Executed by:
executed 1844 times by 1 test: return false;Executed by:
| 1844 | ||||||||||||||||||||||||
| 3101 | } | - | ||||||||||||||||||||||||
| 3102 | if (is_S(c)
| 981-12345 | ||||||||||||||||||||||||
| 3103 | input = InpWs; | - | ||||||||||||||||||||||||
| 3104 | } executed 981 times by 3 tests: else if (c == QLatin1Char('\'')end of blockExecuted by:
| 20-12325 | ||||||||||||||||||||||||
| 3105 | input = InpSQ; | - | ||||||||||||||||||||||||
| 3106 | } executed 20 times by 1 test: else if (c == QLatin1Char('"')end of blockExecuted by:
| 20-10732 | ||||||||||||||||||||||||
| 3107 | input = InpDQ; | - | ||||||||||||||||||||||||
| 3108 | } executed 1593 times by 3 tests: else if (c == QLatin1Char('S')end of blockExecuted by:
| 545-10187 | ||||||||||||||||||||||||
| 3109 | input = InpS; | - | ||||||||||||||||||||||||
| 3110 | } executed 545 times by 2 tests: else if (c == QLatin1Char('P')end of blockExecuted by:
| 142-10045 | ||||||||||||||||||||||||
| 3111 | input = InpP; | - | ||||||||||||||||||||||||
| 3112 | } executed 142 times by 2 tests: else {end of blockExecuted by:
| 142 | ||||||||||||||||||||||||
| 3113 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 3114 | } executed 10045 times by 3 tests: end of blockExecuted by:
| 10045 | ||||||||||||||||||||||||
| 3115 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 3116 | - | |||||||||||||||||||||||||
| 3117 | switch (state) { | - | ||||||||||||||||||||||||
| 3118 | case executed 544 times by 2 tests: Sys:case Sys:Executed by:
executed 544 times by 2 tests: case Sys:Executed by:
| 544 | ||||||||||||||||||||||||
| 3119 | parseString_s = QLatin1String("SYSTEM"); | - | ||||||||||||||||||||||||
| 3120 | if (!parseString()
| 152-392 | ||||||||||||||||||||||||
| 3121 | parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3122 | return executed 392 times by 1 test: false;return false;Executed by:
executed 392 times by 1 test: return false;Executed by:
| 392 | ||||||||||||||||||||||||
| 3123 | } | - | ||||||||||||||||||||||||
| 3124 | break; executed 152 times by 2 tests: break;Executed by:
| 152 | ||||||||||||||||||||||||
| 3125 | case executed 544 times by 2 tests: SysWS:case SysWS:Executed by:
executed 544 times by 2 tests: case SysWS:Executed by:
| 544 | ||||||||||||||||||||||||
| 3126 | if (!eat_ws()
| 133-411 | ||||||||||||||||||||||||
| 3127 | parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3128 | return executed 133 times by 1 test: false;return false;Executed by:
executed 133 times by 1 test: return false;Executed by:
| 133 | ||||||||||||||||||||||||
| 3129 | } | - | ||||||||||||||||||||||||
| 3130 | break; executed 411 times by 2 tests: break;Executed by:
| 411 | ||||||||||||||||||||||||
| 3131 | case never executed: SysSQ:case SysSQ:never executed: case SysSQ: | 0 | ||||||||||||||||||||||||
| 3132 | case executed 664 times by 3 tests: SysDQ:case SysDQ:Executed by:
executed 664 times by 3 tests: case SysDQ:Executed by:
| 664 | ||||||||||||||||||||||||
| 3133 | stringClear(); | - | ||||||||||||||||||||||||
| 3134 | next(); | - | ||||||||||||||||||||||||
| 3135 | break; executed 664 times by 3 tests: break;Executed by:
| 664 | ||||||||||||||||||||||||
| 3136 | case never executed: SysSQ2:case SysSQ2:never executed: case SysSQ2: | 0 | ||||||||||||||||||||||||
| 3137 | case executed 7824 times by 3 tests: SysDQ2:case SysDQ2:Executed by:
executed 7824 times by 3 tests: case SysDQ2:Executed by:
| 7824 | ||||||||||||||||||||||||
| 3138 | stringAddC(); | - | ||||||||||||||||||||||||
| 3139 | next(); | - | ||||||||||||||||||||||||
| 3140 | break; executed 7824 times by 3 tests: break;Executed by:
| 7824 | ||||||||||||||||||||||||
| 3141 | case executed 142 times by 2 tests: Pub:case Pub:Executed by:
executed 142 times by 2 tests: case Pub:Executed by:
| 142 | ||||||||||||||||||||||||
| 3142 | parseString_s = QLatin1String("PUBLIC"); | - | ||||||||||||||||||||||||
| 3143 | if (!parseString()
| 50-92 | ||||||||||||||||||||||||
| 3144 | parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3145 | return executed 50 times by 1 test: false;return false;Executed by:
executed 50 times by 1 test: return false;Executed by:
| 50 | ||||||||||||||||||||||||
| 3146 | } | - | ||||||||||||||||||||||||
| 3147 | break; executed 92 times by 2 tests: break;Executed by:
| 92 | ||||||||||||||||||||||||
| 3148 | case executed 142 times by 2 tests: PubWS:case PubWS:Executed by:
executed 142 times by 2 tests: case PubWS:Executed by:
| 142 | ||||||||||||||||||||||||
| 3149 | if (!eat_ws()
| 22-120 | ||||||||||||||||||||||||
| 3150 | parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3151 | return executed 22 times by 1 test: false;return false;Executed by:
executed 22 times by 1 test: return false;Executed by:
| 22 | ||||||||||||||||||||||||
| 3152 | } | - | ||||||||||||||||||||||||
| 3153 | break; executed 120 times by 2 tests: break;Executed by:
| 120 | ||||||||||||||||||||||||
| 3154 | case executed 10 times by 1 test: PubSQ:case PubSQ:Executed by:
executed 10 times by 1 test: case PubSQ:Executed by:
| 10 | ||||||||||||||||||||||||
| 3155 | case executed 132 times by 2 tests: PubDQ:case PubDQ:Executed by:
executed 132 times by 2 tests: case PubDQ:Executed by:
| 132 | ||||||||||||||||||||||||
| 3156 | stringClear(); | - | ||||||||||||||||||||||||
| 3157 | next(); | - | ||||||||||||||||||||||||
| 3158 | break; executed 142 times by 2 tests: break;Executed by:
| 142 | ||||||||||||||||||||||||
| 3159 | case executed 80 times by 1 test: PubSQ2:case PubSQ2:Executed by:
executed 80 times by 1 test: case PubSQ2:Executed by:
| 80 | ||||||||||||||||||||||||
| 3160 | case executed 2296 times by 2 tests: PubDQ2:case PubDQ2:Executed by:
executed 2296 times by 2 tests: case PubDQ2:Executed by:
| 2296 | ||||||||||||||||||||||||
| 3161 | stringAddC(); | - | ||||||||||||||||||||||||
| 3162 | next(); | - | ||||||||||||||||||||||||
| 3163 | break; executed 2376 times by 2 tests: break;Executed by:
| 2376 | ||||||||||||||||||||||||
| 3164 | case executed 142 times by 2 tests: PubE:case PubE:Executed by:
executed 142 times by 2 tests: case PubE:Executed by:
| 142 | ||||||||||||||||||||||||
| 3165 | next(); | - | ||||||||||||||||||||||||
| 3166 | break; executed 142 times by 2 tests: break;Executed by:
| 142 | ||||||||||||||||||||||||
| 3167 | case executed 120 times by 2 tests: PubWS2:case PubWS2:Executed by:
executed 120 times by 2 tests: case PubWS2:Executed by:
| 120 | ||||||||||||||||||||||||
| 3168 | publicId = string(); | - | ||||||||||||||||||||||||
| 3169 | if (!eat_ws()
| 18-102 | ||||||||||||||||||||||||
| 3170 | parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); | - | ||||||||||||||||||||||||
| 3171 | return executed 18 times by 1 test: false;return false;Executed by:
executed 18 times by 1 test: return false;Executed by:
| 18 | ||||||||||||||||||||||||
| 3172 | } | - | ||||||||||||||||||||||||
| 3173 | break; executed 102 times by 2 tests: break;Executed by:
| 102 | ||||||||||||||||||||||||
| 3174 | case executed 664 times by 3 tests: Done:case Done:Executed by:
executed 664 times by 3 tests: case Done:Executed by:
| 664 | ||||||||||||||||||||||||
| 3175 | systemId = string(); | - | ||||||||||||||||||||||||
| 3176 | next(); | - | ||||||||||||||||||||||||
| 3177 | break; executed 664 times by 3 tests: break;Executed by:
| 664 | ||||||||||||||||||||||||
| 3178 | } | - | ||||||||||||||||||||||||
| 3179 | } executed 12711 times by 3 tests: end of blockExecuted by:
| 12711 | ||||||||||||||||||||||||
| 3180 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3181 | } | - | ||||||||||||||||||||||||
| 3182 | - | |||||||||||||||||||||||||
| 3183 | - | |||||||||||||||||||||||||
| 3184 | - | |||||||||||||||||||||||||
| 3185 | - | |||||||||||||||||||||||||
| 3186 | bool QXmlSimpleReaderPrivate::parseMarkupdecl() | - | ||||||||||||||||||||||||
| 3187 | { | - | ||||||||||||||||||||||||
| 3188 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 3189 | const signed char Lt = 1; | - | ||||||||||||||||||||||||
| 3190 | const signed char Em = 2; | - | ||||||||||||||||||||||||
| 3191 | const signed char CE = 3; | - | ||||||||||||||||||||||||
| 3192 | const signed char Qm = 4; | - | ||||||||||||||||||||||||
| 3193 | const signed char Dash = 5; | - | ||||||||||||||||||||||||
| 3194 | const signed char CA = 6; | - | ||||||||||||||||||||||||
| 3195 | const signed char CEL = 7; | - | ||||||||||||||||||||||||
| 3196 | const signed char CEN = 8; | - | ||||||||||||||||||||||||
| 3197 | const signed char CN = 9; | - | ||||||||||||||||||||||||
| 3198 | const signed char Done = 10; | - | ||||||||||||||||||||||||
| 3199 | - | |||||||||||||||||||||||||
| 3200 | const signed char InpLt = 0; | - | ||||||||||||||||||||||||
| 3201 | const signed char InpQm = 1; | - | ||||||||||||||||||||||||
| 3202 | const signed char InpEm = 2; | - | ||||||||||||||||||||||||
| 3203 | const signed char InpDash = 3; | - | ||||||||||||||||||||||||
| 3204 | const signed char InpA = 4; | - | ||||||||||||||||||||||||
| 3205 | const signed char InpE = 5; | - | ||||||||||||||||||||||||
| 3206 | const signed char InpL = 6; | - | ||||||||||||||||||||||||
| 3207 | const signed char InpN = 7; | - | ||||||||||||||||||||||||
| 3208 | const signed char InpUnknown = 8; | - | ||||||||||||||||||||||||
| 3209 | - | |||||||||||||||||||||||||
| 3210 | static const signed char table[4][9] = { | - | ||||||||||||||||||||||||
| 3211 | - | |||||||||||||||||||||||||
| 3212 | { Lt, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3213 | { -1, Qm, Em, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3214 | { -1, -1, -1, Dash, CA, CE, -1, CN, -1 }, | - | ||||||||||||||||||||||||
| 3215 | { -1, -1, -1, -1, -1, -1, CEL, CEN, -1 } | - | ||||||||||||||||||||||||
| 3216 | }; | - | ||||||||||||||||||||||||
| 3217 | signed char state; | - | ||||||||||||||||||||||||
| 3218 | signed char input; | - | ||||||||||||||||||||||||
| 3219 | - | |||||||||||||||||||||||||
| 3220 | if (parseStack==0
| 456-21658 | ||||||||||||||||||||||||
| 3221 | state = Init; | - | ||||||||||||||||||||||||
| 3222 | } executed 2873 times by 2 tests: else {end of blockExecuted by:
| 2873 | ||||||||||||||||||||||||
| 3223 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 3224 | - | |||||||||||||||||||||||||
| 3225 | - | |||||||||||||||||||||||||
| 3226 | - | |||||||||||||||||||||||||
| 3227 | if (!parseStack->isEmpty()
| 2353-16888 | ||||||||||||||||||||||||
| 3228 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 3229 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0-16888 | ||||||||||||||||||||||||
| 3230 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 3231 | - | |||||||||||||||||||||||||
| 3232 | - | |||||||||||||||||||||||||
| 3233 | - | |||||||||||||||||||||||||
| 3234 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3235 | if (!(this->*function)()
| 2408-14480 | ||||||||||||||||||||||||
| 3236 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3237 | return executed 14480 times by 1 test: false;return false;Executed by:
executed 14480 times by 1 test: return false;Executed by:
| 14480 | ||||||||||||||||||||||||
| 3238 | } | - | ||||||||||||||||||||||||
| 3239 | } executed 2408 times by 1 test: end of blockExecuted by:
| 2408 | ||||||||||||||||||||||||
| 3240 | } executed 4761 times by 1 test: end of blockExecuted by:
| 4761 | ||||||||||||||||||||||||
| 3241 | - | |||||||||||||||||||||||||
| 3242 | for (;;) { | - | ||||||||||||||||||||||||
| 3243 | switch (state) { | - | ||||||||||||||||||||||||
| 3244 | case never executed: Qm:case Qm:never executed: case Qm: | 0 | ||||||||||||||||||||||||
| 3245 | if (contentHnd
| 0 | ||||||||||||||||||||||||
| 3246 | if (!contentHnd->processingInstruction(name(),string())
| 0 | ||||||||||||||||||||||||
| 3247 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 3248 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3249 | } | - | ||||||||||||||||||||||||
| 3250 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3251 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 3252 | case executed 17 times by 2 tests: Dash:case Dash:Executed by:
executed 17 times by 2 tests: case Dash:Executed by:
| 17 | ||||||||||||||||||||||||
| 3253 | if (lexicalHnd
| 6-11 | ||||||||||||||||||||||||
| 3254 | if (!lexicalHnd->comment(string())
| 0-11 | ||||||||||||||||||||||||
| 3255 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 3256 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3257 | } | - | ||||||||||||||||||||||||
| 3258 | } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||||||||||||||
| 3259 | return executed 17 times by 2 tests: true;return true;Executed by:
executed 17 times by 2 tests: return true;Executed by:
| 17 | ||||||||||||||||||||||||
| 3260 | case executed 536 times by 1 test: CA:case CA:Executed by:
executed 536 times by 1 test: case CA:Executed by:
| 536 | ||||||||||||||||||||||||
| 3261 | return executed 536 times by 1 test: true;return true;Executed by:
executed 536 times by 1 test: return true;Executed by:
| 536 | ||||||||||||||||||||||||
| 3262 | case executed 1561 times by 1 test: CEL:case CEL:Executed by:
executed 1561 times by 1 test: case CEL:Executed by:
| 1561 | ||||||||||||||||||||||||
| 3263 | return executed 1561 times by 1 test: true;return true;Executed by:
executed 1561 times by 1 test: return true;Executed by:
| 1561 | ||||||||||||||||||||||||
| 3264 | case executed 652 times by 2 tests: CEN:case CEN:Executed by:
executed 652 times by 2 tests: case CEN:Executed by:
| 652 | ||||||||||||||||||||||||
| 3265 | return executed 652 times by 2 tests: true;return true;Executed by:
executed 652 times by 2 tests: return true;Executed by:
| 652 | ||||||||||||||||||||||||
| 3266 | case executed 54 times by 1 test: CN:case CN:Executed by:
executed 54 times by 1 test: case CN:Executed by:
| 54 | ||||||||||||||||||||||||
| 3267 | return executed 54 times by 1 test: true;return true;Executed by:
executed 54 times by 1 test: return true;Executed by:
| 54 | ||||||||||||||||||||||||
| 3268 | case never executed: Done:case Done:never executed: case Done: | 0 | ||||||||||||||||||||||||
| 3269 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 3270 | case executed 3 times by 1 test: -1:case -1:Executed by:
executed 3 times by 1 test: case -1:Executed by:
| 3 | ||||||||||||||||||||||||
| 3271 | - | |||||||||||||||||||||||||
| 3272 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 3273 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 3274 | } | - | ||||||||||||||||||||||||
| 3275 | - | |||||||||||||||||||||||||
| 3276 | if (atEnd()
| 2353-10866 | ||||||||||||||||||||||||
| 3277 | unexpectedEof(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3278 | return executed 2353 times by 1 test: false;return false;Executed by:
executed 2353 times by 1 test: return false;Executed by:
| 2353 | ||||||||||||||||||||||||
| 3279 | } | - | ||||||||||||||||||||||||
| 3280 | if (c == QLatin1Char('<')
| 2873-7993 | ||||||||||||||||||||||||
| 3281 | input = InpLt; | - | ||||||||||||||||||||||||
| 3282 | } executed 2873 times by 2 tests: else if (c == QLatin1Char('?')end of blockExecuted by:
| 1-7992 | ||||||||||||||||||||||||
| 3283 | input = InpQm; | - | ||||||||||||||||||||||||
| 3284 | } executed 1 time by 1 test: else if (c == QLatin1Char('!')end of blockExecuted by:
| 1-5121 | ||||||||||||||||||||||||
| 3285 | input = InpEm; | - | ||||||||||||||||||||||||
| 3286 | } executed 2871 times by 2 tests: else if (c == QLatin1Char('-')end of blockExecuted by:
| 17-5104 | ||||||||||||||||||||||||
| 3287 | input = InpDash; | - | ||||||||||||||||||||||||
| 3288 | } executed 17 times by 2 tests: else if (c == QLatin1Char('A')end of blockExecuted by:
| 17-4555 | ||||||||||||||||||||||||
| 3289 | input = InpA; | - | ||||||||||||||||||||||||
| 3290 | } executed 549 times by 1 test: else if (c == QLatin1Char('E')end of blockExecuted by:
| 549-2306 | ||||||||||||||||||||||||
| 3291 | input = InpE; | - | ||||||||||||||||||||||||
| 3292 | } executed 2249 times by 2 tests: else if (c == QLatin1Char('L')end of blockExecuted by:
| 724-2249 | ||||||||||||||||||||||||
| 3293 | input = InpL; | - | ||||||||||||||||||||||||
| 3294 | } executed 1582 times by 1 test: else if (c == QLatin1Char('N')end of blockExecuted by:
| 3-1582 | ||||||||||||||||||||||||
| 3295 | input = InpN; | - | ||||||||||||||||||||||||
| 3296 | } executed 721 times by 2 tests: else {end of blockExecuted by:
| 721 | ||||||||||||||||||||||||
| 3297 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 3298 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 3299 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 3300 | - | |||||||||||||||||||||||||
| 3301 | switch (state) { | - | ||||||||||||||||||||||||
| 3302 | case executed 2873 times by 2 tests: Lt:case Lt:Executed by:
executed 2873 times by 2 tests: case Lt:Executed by:
| 2873 | ||||||||||||||||||||||||
| 3303 | next(); | - | ||||||||||||||||||||||||
| 3304 | break; executed 2873 times by 2 tests: break;Executed by:
| 2873 | ||||||||||||||||||||||||
| 3305 | case executed 2871 times by 2 tests: Em:case Em:Executed by:
executed 2871 times by 2 tests: case Em:Executed by:
| 2871 | ||||||||||||||||||||||||
| 3306 | next(); | - | ||||||||||||||||||||||||
| 3307 | break; executed 2871 times by 2 tests: break;Executed by:
| 2871 | ||||||||||||||||||||||||
| 3308 | case executed 2249 times by 2 tests: CE:case CE:Executed by:
executed 2249 times by 2 tests: case CE:Executed by:
| 2249 | ||||||||||||||||||||||||
| 3309 | next(); | - | ||||||||||||||||||||||||
| 3310 | break; executed 2249 times by 2 tests: break;Executed by:
| 2249 | ||||||||||||||||||||||||
| 3311 | case executed 1 time by 1 test: Qm:case Qm:Executed by:
executed 1 time by 1 test: case Qm:Executed by:
| 1 | ||||||||||||||||||||||||
| 3312 | parsePI_xmldecl = false; | - | ||||||||||||||||||||||||
| 3313 | if (!parsePI()
| 0-1 | ||||||||||||||||||||||||
| 3314 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3315 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 3316 | } | - | ||||||||||||||||||||||||
| 3317 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3318 | case executed 17 times by 2 tests: Dash:case Dash:Executed by:
executed 17 times by 2 tests: case Dash:Executed by:
| 17 | ||||||||||||||||||||||||
| 3319 | if (!parseComment()
| 8-9 | ||||||||||||||||||||||||
| 3320 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3321 | return executed 9 times by 1 test: false;return false;Executed by:
executed 9 times by 1 test: return false;Executed by:
| 9 | ||||||||||||||||||||||||
| 3322 | } | - | ||||||||||||||||||||||||
| 3323 | break; executed 8 times by 2 tests: break;Executed by:
| 8 | ||||||||||||||||||||||||
| 3324 | case executed 549 times by 1 test: CA:case CA:Executed by:
executed 549 times by 1 test: case CA:Executed by:
| 549 | ||||||||||||||||||||||||
| 3325 | if (!parseAttlistDecl()
| 59-490 | ||||||||||||||||||||||||
| 3326 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3327 | return executed 490 times by 1 test: false;return false;Executed by:
executed 490 times by 1 test: return false;Executed by:
| 490 | ||||||||||||||||||||||||
| 3328 | } | - | ||||||||||||||||||||||||
| 3329 | break; executed 59 times by 1 test: break;Executed by:
| 59 | ||||||||||||||||||||||||
| 3330 | case executed 1582 times by 1 test: CEL:case CEL:Executed by:
executed 1582 times by 1 test: case CEL:Executed by:
| 1582 | ||||||||||||||||||||||||
| 3331 | if (!parseElementDecl()
| 206-1376 | ||||||||||||||||||||||||
| 3332 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3333 | return executed 1376 times by 1 test: false;return false;Executed by:
executed 1376 times by 1 test: return false;Executed by:
| 1376 | ||||||||||||||||||||||||
| 3334 | } | - | ||||||||||||||||||||||||
| 3335 | break; executed 206 times by 1 test: break;Executed by:
| 206 | ||||||||||||||||||||||||
| 3336 | case executed 667 times by 2 tests: CEN:case CEN:Executed by:
executed 667 times by 2 tests: case CEN:Executed by:
| 667 | ||||||||||||||||||||||||
| 3337 | if (!parseEntityDecl()
| 130-537 | ||||||||||||||||||||||||
| 3338 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3339 | return executed 537 times by 1 test: false;return false;Executed by:
executed 537 times by 1 test: return false;Executed by:
| 537 | ||||||||||||||||||||||||
| 3340 | } | - | ||||||||||||||||||||||||
| 3341 | break; executed 130 times by 2 tests: break;Executed by:
| 130 | ||||||||||||||||||||||||
| 3342 | case executed 54 times by 1 test: CN:case CN:Executed by:
executed 54 times by 1 test: case CN:Executed by:
| 54 | ||||||||||||||||||||||||
| 3343 | if (!parseNotationDecl()
| 9-45 | ||||||||||||||||||||||||
| 3344 | parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); | - | ||||||||||||||||||||||||
| 3345 | return executed 45 times by 1 test: false;return false;Executed by:
executed 45 times by 1 test: return false;Executed by:
| 45 | ||||||||||||||||||||||||
| 3346 | } | - | ||||||||||||||||||||||||
| 3347 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||
| 3348 | } | - | ||||||||||||||||||||||||
| 3349 | } executed 8408 times by 2 tests: end of blockExecuted by:
| 8408 | ||||||||||||||||||||||||
| 3350 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3351 | } | - | ||||||||||||||||||||||||
| 3352 | - | |||||||||||||||||||||||||
| 3353 | - | |||||||||||||||||||||||||
| 3354 | - | |||||||||||||||||||||||||
| 3355 | - | |||||||||||||||||||||||||
| 3356 | bool QXmlSimpleReaderPrivate::parsePEReference() | - | ||||||||||||||||||||||||
| 3357 | { | - | ||||||||||||||||||||||||
| 3358 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 3359 | const signed char Next = 1; | - | ||||||||||||||||||||||||
| 3360 | const signed char Name = 2; | - | ||||||||||||||||||||||||
| 3361 | const signed char NameR = 3; | - | ||||||||||||||||||||||||
| 3362 | const signed char Done = 4; | - | ||||||||||||||||||||||||
| 3363 | - | |||||||||||||||||||||||||
| 3364 | const signed char InpSemi = 0; | - | ||||||||||||||||||||||||
| 3365 | const signed char InpPer = 1; | - | ||||||||||||||||||||||||
| 3366 | const signed char InpUnknown = 2; | - | ||||||||||||||||||||||||
| 3367 | - | |||||||||||||||||||||||||
| 3368 | static const signed char table[4][3] = { | - | ||||||||||||||||||||||||
| 3369 | - | |||||||||||||||||||||||||
| 3370 | { -1, Next, -1 }, | - | ||||||||||||||||||||||||
| 3371 | { -1, -1, Name }, | - | ||||||||||||||||||||||||
| 3372 | { Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 3373 | { Done, -1, -1 } | - | ||||||||||||||||||||||||
| 3374 | }; | - | ||||||||||||||||||||||||
| 3375 | signed char state; | - | ||||||||||||||||||||||||
| 3376 | signed char input; | - | ||||||||||||||||||||||||
| 3377 | - | |||||||||||||||||||||||||
| 3378 | if (parseStack==0
| 20-70 | ||||||||||||||||||||||||
| 3379 | state = Init; | - | ||||||||||||||||||||||||
| 3380 | } executed 65 times by 1 test: else {end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 3381 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 3382 | - | |||||||||||||||||||||||||
| 3383 | - | |||||||||||||||||||||||||
| 3384 | - | |||||||||||||||||||||||||
| 3385 | if (!parseStack->isEmpty()
| 7-18 | ||||||||||||||||||||||||
| 3386 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 3387 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0-7 | ||||||||||||||||||||||||
| 3388 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 3389 | - | |||||||||||||||||||||||||
| 3390 | - | |||||||||||||||||||||||||
| 3391 | - | |||||||||||||||||||||||||
| 3392 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3393 | if (!(this->*function)()
| 0-7 | ||||||||||||||||||||||||
| 3394 | parseFailed(&QXmlSimpleReaderPrivate::parsePEReference, state); | - | ||||||||||||||||||||||||
| 3395 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3396 | } | - | ||||||||||||||||||||||||
| 3397 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 3398 | } executed 25 times by 1 test: end of blockExecuted by:
| 25 | ||||||||||||||||||||||||
| 3399 | - | |||||||||||||||||||||||||
| 3400 | for (;;) { | - | ||||||||||||||||||||||||
| 3401 | switch (state) { | - | ||||||||||||||||||||||||
| 3402 | case executed 65 times by 1 test: Name:case Name:Executed by:
executed 65 times by 1 test: case Name:Executed by:
| 65 | ||||||||||||||||||||||||
| 3403 | { | - | ||||||||||||||||||||||||
| 3404 | bool skipIt = true; | - | ||||||||||||||||||||||||
| 3405 | QString xmlRefString; | - | ||||||||||||||||||||||||
| 3406 | - | |||||||||||||||||||||||||
| 3407 | QMap<QString,QString>::Iterator it; | - | ||||||||||||||||||||||||
| 3408 | it = parameterEntities.find(ref()); | - | ||||||||||||||||||||||||
| 3409 | if (it != parameterEntities.end()
| 25-40 | ||||||||||||||||||||||||
| 3410 | skipIt = false; | - | ||||||||||||||||||||||||
| 3411 | xmlRefString = *it; | - | ||||||||||||||||||||||||
| 3412 | } executed 25 times by 1 test: else if (entityResend of blockExecuted by:
| 0-40 | ||||||||||||||||||||||||
| 3413 | QMap<QString,QXmlSimpleReaderPrivate::ExternParameterEntity>::Iterator it2; | - | ||||||||||||||||||||||||
| 3414 | it2 = externParameterEntities.find(ref()); | - | ||||||||||||||||||||||||
| 3415 | QXmlInputSource *ret = 0; | - | ||||||||||||||||||||||||
| 3416 | if (it2 != externParameterEntities.end()
| 0-40 | ||||||||||||||||||||||||
| 3417 | if (!entityRes->resolveEntity((*it2).publicId, (*it2).systemId, ret)
| 0-40 | ||||||||||||||||||||||||
| 3418 | delete ret; | - | ||||||||||||||||||||||||
| 3419 | reportParseError(entityRes->errorString()); | - | ||||||||||||||||||||||||
| 3420 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3421 | } | - | ||||||||||||||||||||||||
| 3422 | if (ret
| 0-40 | ||||||||||||||||||||||||
| 3423 | QString buffer = ret->data(); | - | ||||||||||||||||||||||||
| 3424 | while (!buffer.isEmpty()
| 0 | ||||||||||||||||||||||||
| 3425 | xmlRefString += buffer; | - | ||||||||||||||||||||||||
| 3426 | ret->fetchData(); | - | ||||||||||||||||||||||||
| 3427 | buffer = ret->data(); | - | ||||||||||||||||||||||||
| 3428 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3429 | delete ret; | - | ||||||||||||||||||||||||
| 3430 | if (!stripTextDecl(xmlRefString)
| 0 | ||||||||||||||||||||||||
| 3431 | reportParseError(QLatin1String("error in the text declaration of an external entity")); | - | ||||||||||||||||||||||||
| 3432 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3433 | } | - | ||||||||||||||||||||||||
| 3434 | skipIt = false; | - | ||||||||||||||||||||||||
| 3435 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3436 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 3437 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 3438 | - | |||||||||||||||||||||||||
| 3439 | if (skipIt
| 25-40 | ||||||||||||||||||||||||
| 3440 | if (contentHnd
| 0-40 | ||||||||||||||||||||||||
| 3441 | if (!contentHnd->skippedEntity(QLatin1Char('%') + ref())
| 0-40 | ||||||||||||||||||||||||
| 3442 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 3443 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3444 | } | - | ||||||||||||||||||||||||
| 3445 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 3446 | } executed 40 times by 1 test: else {end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 3447 | if (parsePEReference_context == InEntityValue
| 10-15 | ||||||||||||||||||||||||
| 3448 | - | |||||||||||||||||||||||||
| 3449 | if (!insertXmlRef(xmlRefString, ref(), true)
| 0-15 | ||||||||||||||||||||||||
| 3450 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3451 | } executed 15 times by 1 test: else if (parsePEReference_context == InDTDend of blockExecuted by:
| 0-15 | ||||||||||||||||||||||||
| 3452 | - | |||||||||||||||||||||||||
| 3453 | if (!insertXmlRef(QLatin1Char(' ') + xmlRefString + QLatin1Char(' '), ref(), false)
| 0-10 | ||||||||||||||||||||||||
| 3454 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3455 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 3456 | } executed 25 times by 1 test: end of blockExecuted by:
| 25 | ||||||||||||||||||||||||
| 3457 | } | - | ||||||||||||||||||||||||
| 3458 | state = NameR; | - | ||||||||||||||||||||||||
| 3459 | break; executed 65 times by 1 test: break;Executed by:
| 65 | ||||||||||||||||||||||||
| 3460 | case executed 65 times by 1 test: Done:case Done:Executed by:
executed 65 times by 1 test: case Done:Executed by:
| 65 | ||||||||||||||||||||||||
| 3461 | return executed 65 times by 1 test: true;return true;Executed by:
executed 65 times by 1 test: return true;Executed by:
| 65 | ||||||||||||||||||||||||
| 3462 | case never executed: -1:case -1:never executed: case -1: | 0 | ||||||||||||||||||||||||
| 3463 | - | |||||||||||||||||||||||||
| 3464 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 3465 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3466 | } | - | ||||||||||||||||||||||||
| 3467 | - | |||||||||||||||||||||||||
| 3468 | if (atEnd()
| 18-195 | ||||||||||||||||||||||||
| 3469 | unexpectedEof(&QXmlSimpleReaderPrivate::parsePEReference, state); | - | ||||||||||||||||||||||||
| 3470 | return executed 18 times by 1 test: false;return false;Executed by:
executed 18 times by 1 test: return false;Executed by:
| 18 | ||||||||||||||||||||||||
| 3471 | } | - | ||||||||||||||||||||||||
| 3472 | if (c == QLatin1Char(';')
| 65-130 | ||||||||||||||||||||||||
| 3473 | input = InpSemi; | - | ||||||||||||||||||||||||
| 3474 | } executed 65 times by 1 test: else if (c == QLatin1Char('%')end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 3475 | input = InpPer; | - | ||||||||||||||||||||||||
| 3476 | } executed 65 times by 1 test: else {end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 3477 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 3478 | } executed 65 times by 1 test: end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 3479 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 3480 | - | |||||||||||||||||||||||||
| 3481 | switch (state) { | - | ||||||||||||||||||||||||
| 3482 | case executed 65 times by 1 test: Next:case Next:Executed by:
executed 65 times by 1 test: case Next:Executed by:
| 65 | ||||||||||||||||||||||||
| 3483 | next(); | - | ||||||||||||||||||||||||
| 3484 | break; executed 65 times by 1 test: break;Executed by:
| 65 | ||||||||||||||||||||||||
| 3485 | case executed 65 times by 1 test: Name:case Name:Executed by:
executed 65 times by 1 test: case Name:Executed by:
| 65 | ||||||||||||||||||||||||
| 3486 | case never executed: NameR:case NameR:never executed: case NameR: | 0 | ||||||||||||||||||||||||
| 3487 | parseName_useRef = true; | - | ||||||||||||||||||||||||
| 3488 | if (!parseName()
| 7-58 | ||||||||||||||||||||||||
| 3489 | parseFailed(&QXmlSimpleReaderPrivate::parsePEReference, state); | - | ||||||||||||||||||||||||
| 3490 | return executed 7 times by 1 test: false;return false;Executed by:
executed 7 times by 1 test: return false;Executed by:
| 7 | ||||||||||||||||||||||||
| 3491 | } | - | ||||||||||||||||||||||||
| 3492 | break; executed 58 times by 1 test: break;Executed by:
| 58 | ||||||||||||||||||||||||
| 3493 | case executed 65 times by 1 test: Done:case Done:Executed by:
executed 65 times by 1 test: case Done:Executed by:
| 65 | ||||||||||||||||||||||||
| 3494 | next(); | - | ||||||||||||||||||||||||
| 3495 | break; executed 65 times by 1 test: break;Executed by:
| 65 | ||||||||||||||||||||||||
| 3496 | } | - | ||||||||||||||||||||||||
| 3497 | } executed 188 times by 1 test: end of blockExecuted by:
| 188 | ||||||||||||||||||||||||
| 3498 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3499 | } | - | ||||||||||||||||||||||||
| 3500 | - | |||||||||||||||||||||||||
| 3501 | - | |||||||||||||||||||||||||
| 3502 | - | |||||||||||||||||||||||||
| 3503 | - | |||||||||||||||||||||||||
| 3504 | - | |||||||||||||||||||||||||
| 3505 | - | |||||||||||||||||||||||||
| 3506 | - | |||||||||||||||||||||||||
| 3507 | bool QXmlSimpleReaderPrivate::parseAttlistDecl() | - | ||||||||||||||||||||||||
| 3508 | { | - | ||||||||||||||||||||||||
| 3509 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 3510 | const signed char Attlist = 1; | - | ||||||||||||||||||||||||
| 3511 | const signed char Ws = 2; | - | ||||||||||||||||||||||||
| 3512 | const signed char Name = 3; | - | ||||||||||||||||||||||||
| 3513 | const signed char Ws1 = 4; | - | ||||||||||||||||||||||||
| 3514 | const signed char Attdef = 5; | - | ||||||||||||||||||||||||
| 3515 | const signed char Ws2 = 6; | - | ||||||||||||||||||||||||
| 3516 | const signed char Atttype = 7; | - | ||||||||||||||||||||||||
| 3517 | const signed char Ws3 = 8; | - | ||||||||||||||||||||||||
| 3518 | const signed char DDecH = 9; | - | ||||||||||||||||||||||||
| 3519 | const signed char DefReq = 10; | - | ||||||||||||||||||||||||
| 3520 | const signed char DefImp = 11; | - | ||||||||||||||||||||||||
| 3521 | const signed char DefFix = 12; | - | ||||||||||||||||||||||||
| 3522 | const signed char Attval = 13; | - | ||||||||||||||||||||||||
| 3523 | const signed char Ws4 = 14; | - | ||||||||||||||||||||||||
| 3524 | const signed char Done = 15; | - | ||||||||||||||||||||||||
| 3525 | - | |||||||||||||||||||||||||
| 3526 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 3527 | const signed char InpGt = 1; | - | ||||||||||||||||||||||||
| 3528 | const signed char InpHash = 2; | - | ||||||||||||||||||||||||
| 3529 | const signed char InpA = 3; | - | ||||||||||||||||||||||||
| 3530 | const signed char InpI = 4; | - | ||||||||||||||||||||||||
| 3531 | const signed char InpF = 5; | - | ||||||||||||||||||||||||
| 3532 | const signed char InpR = 6; | - | ||||||||||||||||||||||||
| 3533 | const signed char InpUnknown = 7; | - | ||||||||||||||||||||||||
| 3534 | - | |||||||||||||||||||||||||
| 3535 | static const signed char table[15][8] = { | - | ||||||||||||||||||||||||
| 3536 | - | |||||||||||||||||||||||||
| 3537 | { -1, -1, -1, Attlist, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3538 | { Ws, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3539 | { -1, -1, -1, Name, Name, Name, Name, Name }, | - | ||||||||||||||||||||||||
| 3540 | { Ws1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, | - | ||||||||||||||||||||||||
| 3541 | { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, | - | ||||||||||||||||||||||||
| 3542 | { Ws2, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3543 | { -1, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype }, | - | ||||||||||||||||||||||||
| 3544 | { Ws3, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3545 | { -1, Attval, DDecH, Attval, Attval, Attval, Attval, Attval }, | - | ||||||||||||||||||||||||
| 3546 | { -1, -1, -1, -1, DefImp, DefFix, DefReq, -1 }, | - | ||||||||||||||||||||||||
| 3547 | { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3548 | { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3549 | { Ws3, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3550 | { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3551 | { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef } | - | ||||||||||||||||||||||||
| 3552 | }; | - | ||||||||||||||||||||||||
| 3553 | signed char state; | - | ||||||||||||||||||||||||
| 3554 | signed char input; | - | ||||||||||||||||||||||||
| 3555 | - | |||||||||||||||||||||||||
| 3556 | if (parseStack==0
| 72-5236 | ||||||||||||||||||||||||
| 3557 | state = Init; | - | ||||||||||||||||||||||||
| 3558 | } executed 549 times by 1 test: else {end of blockExecuted by:
| 549 | ||||||||||||||||||||||||
| 3559 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 3560 | - | |||||||||||||||||||||||||
| 3561 | - | |||||||||||||||||||||||||
| 3562 | - | |||||||||||||||||||||||||
| 3563 | if (!parseStack->isEmpty()
| 428-4331 | ||||||||||||||||||||||||
| 3564 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 3565 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 589-3742 | ||||||||||||||||||||||||
| 3566 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 3567 | - | |||||||||||||||||||||||||
| 3568 | - | |||||||||||||||||||||||||
| 3569 | - | |||||||||||||||||||||||||
| 3570 | } executed 589 times by 1 test: end of blockExecuted by:
| 589 | ||||||||||||||||||||||||
| 3571 | if (!(this->*function)()
| 1729-2602 | ||||||||||||||||||||||||
| 3572 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3573 | return executed 1729 times by 1 test: false;return false;Executed by:
executed 1729 times by 1 test: return false;Executed by:
| 1729 | ||||||||||||||||||||||||
| 3574 | } | - | ||||||||||||||||||||||||
| 3575 | } executed 2602 times by 1 test: end of blockExecuted by:
| 2602 | ||||||||||||||||||||||||
| 3576 | } executed 3030 times by 1 test: end of blockExecuted by:
| 3030 | ||||||||||||||||||||||||
| 3577 | - | |||||||||||||||||||||||||
| 3578 | for (;;) { | - | ||||||||||||||||||||||||
| 3579 | switch (state) { | - | ||||||||||||||||||||||||
| 3580 | case executed 548 times by 1 test: Name:case Name:Executed by:
executed 548 times by 1 test: case Name:Executed by:
| 548 | ||||||||||||||||||||||||
| 3581 | attDeclEName = name(); | - | ||||||||||||||||||||||||
| 3582 | break; executed 548 times by 1 test: break;Executed by:
| 548 | ||||||||||||||||||||||||
| 3583 | case executed 619 times by 1 test: Attdef:case Attdef:Executed by:
executed 619 times by 1 test: case Attdef:Executed by:
| 619 | ||||||||||||||||||||||||
| 3584 | attDeclAName = name(); | - | ||||||||||||||||||||||||
| 3585 | break; executed 619 times by 1 test: break;Executed by:
| 619 | ||||||||||||||||||||||||
| 3586 | case executed 536 times by 1 test: Done:case Done:Executed by:
executed 536 times by 1 test: case Done:Executed by:
| 536 | ||||||||||||||||||||||||
| 3587 | return executed 536 times by 1 test: true;return true;Executed by:
executed 536 times by 1 test: return true;Executed by:
| 536 | ||||||||||||||||||||||||
| 3588 | case executed 5 times by 1 test: -1:case -1:Executed by:
executed 5 times by 1 test: case -1:Executed by:
| 5 | ||||||||||||||||||||||||
| 3589 | - | |||||||||||||||||||||||||
| 3590 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 3591 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 3592 | } | - | ||||||||||||||||||||||||
| 3593 | - | |||||||||||||||||||||||||
| 3594 | if (atEnd()
| 428-6889 | ||||||||||||||||||||||||
| 3595 | unexpectedEof(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3596 | return executed 428 times by 1 test: false;return false;Executed by:
executed 428 times by 1 test: return false;Executed by:
| 428 | ||||||||||||||||||||||||
| 3597 | } | - | ||||||||||||||||||||||||
| 3598 | if (is_S(c)
| 2429-4460 | ||||||||||||||||||||||||
| 3599 | input = InpWs; | - | ||||||||||||||||||||||||
| 3600 | } executed 2429 times by 1 test: else if (c == QLatin1Char('>')end of blockExecuted by:
| 1062-3398 | ||||||||||||||||||||||||
| 3601 | input = InpGt; | - | ||||||||||||||||||||||||
| 3602 | } executed 1062 times by 1 test: else if (c == QLatin1Char('#')end of blockExecuted by:
| 428-2970 | ||||||||||||||||||||||||
| 3603 | input = InpHash; | - | ||||||||||||||||||||||||
| 3604 | } executed 428 times by 1 test: else if (c == QLatin1Char('A')end of blockExecuted by:
| 428-2411 | ||||||||||||||||||||||||
| 3605 | input = InpA; | - | ||||||||||||||||||||||||
| 3606 | } executed 559 times by 1 test: else if (c == QLatin1Char('I')end of blockExecuted by:
| 425-1986 | ||||||||||||||||||||||||
| 3607 | input = InpI; | - | ||||||||||||||||||||||||
| 3608 | } executed 425 times by 1 test: else if (c == QLatin1Char('F')end of blockExecuted by:
| 21-1965 | ||||||||||||||||||||||||
| 3609 | input = InpF; | - | ||||||||||||||||||||||||
| 3610 | } executed 21 times by 1 test: else if (c == QLatin1Char('R')end of blockExecuted by:
| 10-1955 | ||||||||||||||||||||||||
| 3611 | input = InpR; | - | ||||||||||||||||||||||||
| 3612 | } executed 10 times by 1 test: else {end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 3613 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 3614 | } executed 1955 times by 1 test: end of blockExecuted by:
| 1955 | ||||||||||||||||||||||||
| 3615 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 3616 | - | |||||||||||||||||||||||||
| 3617 | switch (state) { | - | ||||||||||||||||||||||||
| 3618 | case executed 549 times by 1 test: Attlist:case Attlist:Executed by:
executed 549 times by 1 test: case Attlist:Executed by:
| 549 | ||||||||||||||||||||||||
| 3619 | parseString_s = QLatin1String("ATTLIST"); | - | ||||||||||||||||||||||||
| 3620 | if (!parseString()
| 121-428 | ||||||||||||||||||||||||
| 3621 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3622 | return executed 428 times by 1 test: false;return false;Executed by:
executed 428 times by 1 test: return false;Executed by:
| 428 | ||||||||||||||||||||||||
| 3623 | } | - | ||||||||||||||||||||||||
| 3624 | break; executed 121 times by 1 test: break;Executed by:
| 121 | ||||||||||||||||||||||||
| 3625 | case executed 549 times by 1 test: Ws:case Ws:Executed by:
executed 549 times by 1 test: case Ws:Executed by:
| 549 | ||||||||||||||||||||||||
| 3626 | case executed 548 times by 1 test: Ws1:case Ws1:Executed by:
executed 548 times by 1 test: case Ws1:Executed by:
| 548 | ||||||||||||||||||||||||
| 3627 | case executed 618 times by 1 test: Ws2:case Ws2:Executed by:
executed 618 times by 1 test: case Ws2:Executed by:
| 618 | ||||||||||||||||||||||||
| 3628 | case executed 633 times by 1 test: Ws3:case Ws3:Executed by:
executed 633 times by 1 test: case Ws3:Executed by:
| 633 | ||||||||||||||||||||||||
| 3629 | if (!eat_ws()
| 545-1803 | ||||||||||||||||||||||||
| 3630 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3631 | return executed 545 times by 1 test: false;return false;Executed by:
executed 545 times by 1 test: return false;Executed by:
| 545 | ||||||||||||||||||||||||
| 3632 | } | - | ||||||||||||||||||||||||
| 3633 | break; executed 1803 times by 1 test: break;Executed by:
| 1803 | ||||||||||||||||||||||||
| 3634 | case executed 548 times by 1 test: Name:case Name:Executed by:
executed 548 times by 1 test: case Name:Executed by:
| 548 | ||||||||||||||||||||||||
| 3635 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 3636 | if (!parseName()
| 147-401 | ||||||||||||||||||||||||
| 3637 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3638 | return executed 401 times by 1 test: false;return false;Executed by:
executed 401 times by 1 test: return false;Executed by:
| 401 | ||||||||||||||||||||||||
| 3639 | } | - | ||||||||||||||||||||||||
| 3640 | break; executed 147 times by 1 test: break;Executed by:
| 147 | ||||||||||||||||||||||||
| 3641 | case executed 619 times by 1 test: Attdef:case Attdef:Executed by:
executed 619 times by 1 test: case Attdef:Executed by:
| 619 | ||||||||||||||||||||||||
| 3642 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 3643 | if (!parseName()
| 230-389 | ||||||||||||||||||||||||
| 3644 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3645 | return executed 230 times by 1 test: false;return false;Executed by:
executed 230 times by 1 test: return false;Executed by:
| 230 | ||||||||||||||||||||||||
| 3646 | } | - | ||||||||||||||||||||||||
| 3647 | break; executed 389 times by 1 test: break;Executed by:
| 389 | ||||||||||||||||||||||||
| 3648 | case executed 618 times by 1 test: Atttype:case Atttype:Executed by:
executed 618 times by 1 test: case Atttype:Executed by:
| 618 | ||||||||||||||||||||||||
| 3649 | if (!parseAttType()
| 129-489 | ||||||||||||||||||||||||
| 3650 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3651 | return executed 489 times by 1 test: false;return false;Executed by:
executed 489 times by 1 test: return false;Executed by:
| 489 | ||||||||||||||||||||||||
| 3652 | } | - | ||||||||||||||||||||||||
| 3653 | break; executed 129 times by 1 test: break;Executed by:
| 129 | ||||||||||||||||||||||||
| 3654 | case executed 426 times by 1 test: DDecH:case DDecH:Executed by:
executed 426 times by 1 test: case DDecH:Executed by:
| 426 | ||||||||||||||||||||||||
| 3655 | next(); | - | ||||||||||||||||||||||||
| 3656 | break; executed 426 times by 1 test: break;Executed by:
| 426 | ||||||||||||||||||||||||
| 3657 | case executed 10 times by 1 test: DefReq:case DefReq:Executed by:
executed 10 times by 1 test: case DefReq:Executed by:
| 10 | ||||||||||||||||||||||||
| 3658 | parseString_s = QLatin1String("REQUIRED"); | - | ||||||||||||||||||||||||
| 3659 | if (!parseString()
| 1-9 | ||||||||||||||||||||||||
| 3660 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3661 | return executed 9 times by 1 test: false;return false;Executed by:
executed 9 times by 1 test: return false;Executed by:
| 9 | ||||||||||||||||||||||||
| 3662 | } | - | ||||||||||||||||||||||||
| 3663 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||
| 3664 | case executed 395 times by 1 test: DefImp:case DefImp:Executed by:
executed 395 times by 1 test: case DefImp:Executed by:
| 395 | ||||||||||||||||||||||||
| 3665 | parseString_s = QLatin1String("IMPLIED"); | - | ||||||||||||||||||||||||
| 3666 | if (!parseString()
| 61-334 | ||||||||||||||||||||||||
| 3667 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3668 | return executed 334 times by 1 test: false;return false;Executed by:
executed 334 times by 1 test: return false;Executed by:
| 334 | ||||||||||||||||||||||||
| 3669 | } | - | ||||||||||||||||||||||||
| 3670 | break; executed 61 times by 1 test: break;Executed by:
| 61 | ||||||||||||||||||||||||
| 3671 | case executed 21 times by 1 test: DefFix:case DefFix:Executed by:
executed 21 times by 1 test: case DefFix:Executed by:
| 21 | ||||||||||||||||||||||||
| 3672 | parseString_s = QLatin1String("FIXED"); | - | ||||||||||||||||||||||||
| 3673 | if (!parseString()
| 9-12 | ||||||||||||||||||||||||
| 3674 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3675 | return executed 12 times by 1 test: false;return false;Executed by:
executed 12 times by 1 test: return false;Executed by:
| 12 | ||||||||||||||||||||||||
| 3676 | } | - | ||||||||||||||||||||||||
| 3677 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||
| 3678 | case executed 207 times by 1 test: Attval:case Attval:Executed by:
executed 207 times by 1 test: case Attval:Executed by:
| 207 | ||||||||||||||||||||||||
| 3679 | if (!parseAttValue()
| 80-127 | ||||||||||||||||||||||||
| 3680 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3681 | return executed 127 times by 1 test: false;return false;Executed by:
executed 127 times by 1 test: return false;Executed by:
| 127 | ||||||||||||||||||||||||
| 3682 | } | - | ||||||||||||||||||||||||
| 3683 | break; executed 80 times by 1 test: break;Executed by:
| 80 | ||||||||||||||||||||||||
| 3684 | case executed 607 times by 1 test: Ws4:case Ws4:Executed by:
executed 607 times by 1 test: case Ws4:Executed by:
| 607 | ||||||||||||||||||||||||
| 3685 | if (declHnd
| 0-607 | ||||||||||||||||||||||||
| 3686 | - | |||||||||||||||||||||||||
| 3687 | if (!declHnd->attributeDecl(attDeclEName, attDeclAName, QLatin1String(""), QLatin1String(""), QLatin1String(""))
| 0-607 | ||||||||||||||||||||||||
| 3688 | reportParseError(declHnd->errorString()); | - | ||||||||||||||||||||||||
| 3689 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3690 | } | - | ||||||||||||||||||||||||
| 3691 | } executed 607 times by 1 test: end of blockExecuted by:
| 607 | ||||||||||||||||||||||||
| 3692 | if (!eat_ws()
| 35-572 | ||||||||||||||||||||||||
| 3693 | parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); | - | ||||||||||||||||||||||||
| 3694 | return executed 35 times by 1 test: false;return false;Executed by:
executed 35 times by 1 test: return false;Executed by:
| 35 | ||||||||||||||||||||||||
| 3695 | } | - | ||||||||||||||||||||||||
| 3696 | break; executed 572 times by 1 test: break;Executed by:
| 572 | ||||||||||||||||||||||||
| 3697 | case executed 536 times by 1 test: Done:case Done:Executed by:
executed 536 times by 1 test: case Done:Executed by:
| 536 | ||||||||||||||||||||||||
| 3698 | next(); | - | ||||||||||||||||||||||||
| 3699 | break; executed 536 times by 1 test: break;Executed by:
| 536 | ||||||||||||||||||||||||
| 3700 | } | - | ||||||||||||||||||||||||
| 3701 | } executed 4279 times by 1 test: end of blockExecuted by:
| 4279 | ||||||||||||||||||||||||
| 3702 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3703 | } | - | ||||||||||||||||||||||||
| 3704 | - | |||||||||||||||||||||||||
| 3705 | - | |||||||||||||||||||||||||
| 3706 | - | |||||||||||||||||||||||||
| 3707 | - | |||||||||||||||||||||||||
| 3708 | bool QXmlSimpleReaderPrivate::parseAttType() | - | ||||||||||||||||||||||||
| 3709 | { | - | ||||||||||||||||||||||||
| 3710 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 3711 | const signed char ST = 1; | - | ||||||||||||||||||||||||
| 3712 | const signed char TTI = 2; | - | ||||||||||||||||||||||||
| 3713 | const signed char TTI2 = 3; | - | ||||||||||||||||||||||||
| 3714 | const signed char TTI3 = 4; | - | ||||||||||||||||||||||||
| 3715 | const signed char TTE = 5; | - | ||||||||||||||||||||||||
| 3716 | const signed char TTEY = 6; | - | ||||||||||||||||||||||||
| 3717 | const signed char TTEI = 7; | - | ||||||||||||||||||||||||
| 3718 | const signed char N = 8; | - | ||||||||||||||||||||||||
| 3719 | const signed char TTNM = 9; | - | ||||||||||||||||||||||||
| 3720 | const signed char TTNM2 = 10; | - | ||||||||||||||||||||||||
| 3721 | const signed char NO = 11; | - | ||||||||||||||||||||||||
| 3722 | const signed char NO2 = 12; | - | ||||||||||||||||||||||||
| 3723 | const signed char NO3 = 13; | - | ||||||||||||||||||||||||
| 3724 | const signed char NOName = 14; | - | ||||||||||||||||||||||||
| 3725 | const signed char NO4 = 15; | - | ||||||||||||||||||||||||
| 3726 | const signed char EN = 16; | - | ||||||||||||||||||||||||
| 3727 | const signed char ENNmt = 17; | - | ||||||||||||||||||||||||
| 3728 | const signed char EN2 = 18; | - | ||||||||||||||||||||||||
| 3729 | const signed char ADone = 19; | - | ||||||||||||||||||||||||
| 3730 | const signed char Done = 20; | - | ||||||||||||||||||||||||
| 3731 | - | |||||||||||||||||||||||||
| 3732 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 3733 | const signed char InpOp = 1; | - | ||||||||||||||||||||||||
| 3734 | const signed char InpCp = 2; | - | ||||||||||||||||||||||||
| 3735 | const signed char InpPipe = 3; | - | ||||||||||||||||||||||||
| 3736 | const signed char InpC = 4; | - | ||||||||||||||||||||||||
| 3737 | const signed char InpE = 5; | - | ||||||||||||||||||||||||
| 3738 | const signed char InpI = 6; | - | ||||||||||||||||||||||||
| 3739 | const signed char InpM = 7; | - | ||||||||||||||||||||||||
| 3740 | const signed char InpN = 8; | - | ||||||||||||||||||||||||
| 3741 | const signed char InpO = 9; | - | ||||||||||||||||||||||||
| 3742 | const signed char InpR = 10; | - | ||||||||||||||||||||||||
| 3743 | const signed char InpS = 11; | - | ||||||||||||||||||||||||
| 3744 | const signed char InpY = 12; | - | ||||||||||||||||||||||||
| 3745 | const signed char InpUnknown = 13; | - | ||||||||||||||||||||||||
| 3746 | - | |||||||||||||||||||||||||
| 3747 | static const signed char table[19][14] = { | - | ||||||||||||||||||||||||
| 3748 | - | |||||||||||||||||||||||||
| 3749 | { -1, EN, -1, -1, ST, TTE, TTI, -1, N, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3750 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, | - | ||||||||||||||||||||||||
| 3751 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI2, Done, Done, Done }, | - | ||||||||||||||||||||||||
| 3752 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI3, Done, Done }, | - | ||||||||||||||||||||||||
| 3753 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, | - | ||||||||||||||||||||||||
| 3754 | { -1, -1, -1, -1, -1, -1, TTEI, -1, -1, -1, -1, -1, TTEY, -1 }, | - | ||||||||||||||||||||||||
| 3755 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, | - | ||||||||||||||||||||||||
| 3756 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, | - | ||||||||||||||||||||||||
| 3757 | { -1, -1, -1, -1, -1, -1, -1, TTNM, -1, NO, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3758 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTNM2, Done, Done }, | - | ||||||||||||||||||||||||
| 3759 | { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, | - | ||||||||||||||||||||||||
| 3760 | { NO2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3761 | { -1, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3762 | { NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName }, | - | ||||||||||||||||||||||||
| 3763 | { NO4, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3764 | { -1, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3765 | { -1, -1, ENNmt, -1, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt }, | - | ||||||||||||||||||||||||
| 3766 | { EN2, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3767 | { -1, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } | - | ||||||||||||||||||||||||
| 3768 | }; | - | ||||||||||||||||||||||||
| 3769 | signed char state; | - | ||||||||||||||||||||||||
| 3770 | signed char input; | - | ||||||||||||||||||||||||
| 3771 | - | |||||||||||||||||||||||||
| 3772 | if (parseStack==0
| 78-1519 | ||||||||||||||||||||||||
| 3773 | state = Init; | - | ||||||||||||||||||||||||
| 3774 | } executed 618 times by 1 test: else {end of blockExecuted by:
| 618 | ||||||||||||||||||||||||
| 3775 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 3776 | - | |||||||||||||||||||||||||
| 3777 | - | |||||||||||||||||||||||||
| 3778 | - | |||||||||||||||||||||||||
| 3779 | if (!parseStack->isEmpty()
| 232-747 | ||||||||||||||||||||||||
| 3780 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 3781 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 26-721 | ||||||||||||||||||||||||
| 3782 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 3783 | - | |||||||||||||||||||||||||
| 3784 | - | |||||||||||||||||||||||||
| 3785 | - | |||||||||||||||||||||||||
| 3786 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||
| 3787 | if (!(this->*function)()
| 267-480 | ||||||||||||||||||||||||
| 3788 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3789 | return executed 267 times by 1 test: false;return false;Executed by:
executed 267 times by 1 test: return false;Executed by:
| 267 | ||||||||||||||||||||||||
| 3790 | } | - | ||||||||||||||||||||||||
| 3791 | } executed 480 times by 1 test: end of blockExecuted by:
| 480 | ||||||||||||||||||||||||
| 3792 | } executed 712 times by 1 test: end of blockExecuted by:
| 712 | ||||||||||||||||||||||||
| 3793 | - | |||||||||||||||||||||||||
| 3794 | for (;;) { | - | ||||||||||||||||||||||||
| 3795 | switch (state) { | - | ||||||||||||||||||||||||
| 3796 | case executed 32 times by 1 test: ADone:case ADone:Executed by:
executed 32 times by 1 test: case ADone:Executed by:
| 32 | ||||||||||||||||||||||||
| 3797 | return executed 32 times by 1 test: true;return true;Executed by:
executed 32 times by 1 test: return true;Executed by:
| 32 | ||||||||||||||||||||||||
| 3798 | case executed 583 times by 1 test: Done:case Done:Executed by:
executed 583 times by 1 test: case Done:Executed by:
| 583 | ||||||||||||||||||||||||
| 3799 | return executed 583 times by 1 test: true;return true;Executed by:
executed 583 times by 1 test: return true;Executed by:
| 583 | ||||||||||||||||||||||||
| 3800 | case executed 3 times by 1 test: -1:case -1:Executed by:
executed 3 times by 1 test: case -1:Executed by:
| 3 | ||||||||||||||||||||||||
| 3801 | - | |||||||||||||||||||||||||
| 3802 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 3803 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 3804 | } | - | ||||||||||||||||||||||||
| 3805 | - | |||||||||||||||||||||||||
| 3806 | if (atEnd()
| 232-1533 | ||||||||||||||||||||||||
| 3807 | unexpectedEof(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3808 | return executed 232 times by 1 test: false;return false;Executed by:
executed 232 times by 1 test: return false;Executed by:
| 232 | ||||||||||||||||||||||||
| 3809 | } | - | ||||||||||||||||||||||||
| 3810 | if (is_S(c)
| 602-931 | ||||||||||||||||||||||||
| 3811 | input = InpWs; | - | ||||||||||||||||||||||||
| 3812 | } executed 602 times by 1 test: else if (c == QLatin1Char('(')end of blockExecuted by:
| 34-897 | ||||||||||||||||||||||||
| 3813 | input = InpOp; | - | ||||||||||||||||||||||||
| 3814 | } executed 34 times by 1 test: else if (c == QLatin1Char(')')end of blockExecuted by:
| 32-865 | ||||||||||||||||||||||||
| 3815 | input = InpCp; | - | ||||||||||||||||||||||||
| 3816 | } executed 32 times by 1 test: else if (c == QLatin1Char('|')end of blockExecuted by:
| 21-844 | ||||||||||||||||||||||||
| 3817 | input = InpPipe; | - | ||||||||||||||||||||||||
| 3818 | } executed 21 times by 1 test: else if (c == QLatin1Char('C')end of blockExecuted by:
| 21-472 | ||||||||||||||||||||||||
| 3819 | input = InpC; | - | ||||||||||||||||||||||||
| 3820 | } executed 472 times by 1 test: else if (c == QLatin1Char('E')end of blockExecuted by:
| 30-472 | ||||||||||||||||||||||||
| 3821 | input = InpE; | - | ||||||||||||||||||||||||
| 3822 | } executed 30 times by 1 test: else if (c == QLatin1Char('I')end of blockExecuted by:
| 30-302 | ||||||||||||||||||||||||
| 3823 | input = InpI; | - | ||||||||||||||||||||||||
| 3824 | } executed 40 times by 1 test: else if (c == QLatin1Char('M')end of blockExecuted by:
| 40-251 | ||||||||||||||||||||||||
| 3825 | input = InpM; | - | ||||||||||||||||||||||||
| 3826 | } executed 51 times by 1 test: else if (c == QLatin1Char('N')end of blockExecuted by:
| 51-178 | ||||||||||||||||||||||||
| 3827 | input = InpN; | - | ||||||||||||||||||||||||
| 3828 | } executed 73 times by 1 test: else if (c == QLatin1Char('O')end of blockExecuted by:
| 21-157 | ||||||||||||||||||||||||
| 3829 | input = InpO; | - | ||||||||||||||||||||||||
| 3830 | } executed 21 times by 1 test: else if (c == QLatin1Char('R')end of blockExecuted by:
| 20-137 | ||||||||||||||||||||||||
| 3831 | input = InpR; | - | ||||||||||||||||||||||||
| 3832 | } executed 20 times by 1 test: else if (c == QLatin1Char('S')end of blockExecuted by:
| 20-77 | ||||||||||||||||||||||||
| 3833 | input = InpS; | - | ||||||||||||||||||||||||
| 3834 | } executed 60 times by 1 test: else if (c == QLatin1Char('Y')end of blockExecuted by:
| 20-60 | ||||||||||||||||||||||||
| 3835 | input = InpY; | - | ||||||||||||||||||||||||
| 3836 | } executed 20 times by 1 test: else {end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 3837 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 3838 | } executed 57 times by 1 test: end of blockExecuted by:
| 57 | ||||||||||||||||||||||||
| 3839 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 3840 | - | |||||||||||||||||||||||||
| 3841 | switch (state) { | - | ||||||||||||||||||||||||
| 3842 | case executed 472 times by 1 test: ST:case ST:Executed by:
executed 472 times by 1 test: case ST:Executed by:
| 472 | ||||||||||||||||||||||||
| 3843 | parseString_s = QLatin1String("CDATA"); | - | ||||||||||||||||||||||||
| 3844 | if (!parseString()
| 148-324 | ||||||||||||||||||||||||
| 3845 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3846 | return executed 324 times by 1 test: false;return false;Executed by:
executed 324 times by 1 test: return false;Executed by:
| 324 | ||||||||||||||||||||||||
| 3847 | } | - | ||||||||||||||||||||||||
| 3848 | break; executed 148 times by 1 test: break;Executed by:
| 148 | ||||||||||||||||||||||||
| 3849 | case executed 30 times by 1 test: TTI:case TTI:Executed by:
executed 30 times by 1 test: case TTI:Executed by:
| 30 | ||||||||||||||||||||||||
| 3850 | parseString_s = QLatin1String("ID"); | - | ||||||||||||||||||||||||
| 3851 | if (!parseString()
| 12-18 | ||||||||||||||||||||||||
| 3852 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3853 | return executed 18 times by 1 test: false;return false;Executed by:
executed 18 times by 1 test: return false;Executed by:
| 18 | ||||||||||||||||||||||||
| 3854 | } | - | ||||||||||||||||||||||||
| 3855 | break; executed 12 times by 1 test: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 3856 | case executed 20 times by 1 test: TTI2:case TTI2:Executed by:
executed 20 times by 1 test: case TTI2:Executed by:
| 20 | ||||||||||||||||||||||||
| 3857 | parseString_s = QLatin1String("REF"); | - | ||||||||||||||||||||||||
| 3858 | if (!parseString()
| 10 | ||||||||||||||||||||||||
| 3859 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3860 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 3861 | } | - | ||||||||||||||||||||||||
| 3862 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||
| 3863 | case executed 10 times by 1 test: TTI3:case TTI3:Executed by:
executed 10 times by 1 test: case TTI3:Executed by:
| 10 | ||||||||||||||||||||||||
| 3864 | next(); | - | ||||||||||||||||||||||||
| 3865 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||
| 3866 | case executed 30 times by 1 test: TTE:case TTE:Executed by:
executed 30 times by 1 test: case TTE:Executed by:
| 30 | ||||||||||||||||||||||||
| 3867 | parseString_s = QLatin1String("ENTIT"); | - | ||||||||||||||||||||||||
| 3868 | if (!parseString()
| 6-24 | ||||||||||||||||||||||||
| 3869 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3870 | return executed 24 times by 1 test: false;return false;Executed by:
executed 24 times by 1 test: return false;Executed by:
| 24 | ||||||||||||||||||||||||
| 3871 | } | - | ||||||||||||||||||||||||
| 3872 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||
| 3873 | case executed 20 times by 1 test: TTEY:case TTEY:Executed by:
executed 20 times by 1 test: case TTEY:Executed by:
| 20 | ||||||||||||||||||||||||
| 3874 | next(); | - | ||||||||||||||||||||||||
| 3875 | break; executed 20 times by 1 test: break;Executed by:
| 20 | ||||||||||||||||||||||||
| 3876 | case executed 10 times by 1 test: TTEI:case TTEI:Executed by:
executed 10 times by 1 test: case TTEI:Executed by:
| 10 | ||||||||||||||||||||||||
| 3877 | parseString_s = QLatin1String("IES"); | - | ||||||||||||||||||||||||
| 3878 | if (!parseString()
| 5 | ||||||||||||||||||||||||
| 3879 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3880 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 3881 | } | - | ||||||||||||||||||||||||
| 3882 | break; executed 5 times by 1 test: break;Executed by:
| 5 | ||||||||||||||||||||||||
| 3883 | case executed 73 times by 1 test: N:case N:Executed by:
executed 73 times by 1 test: case N:Executed by:
| 73 | ||||||||||||||||||||||||
| 3884 | next(); | - | ||||||||||||||||||||||||
| 3885 | break; executed 73 times by 1 test: break;Executed by:
| 73 | ||||||||||||||||||||||||
| 3886 | case executed 51 times by 1 test: TTNM:case TTNM:Executed by:
executed 51 times by 1 test: case TTNM:Executed by:
| 51 | ||||||||||||||||||||||||
| 3887 | parseString_s = QLatin1String("MTOKEN"); | - | ||||||||||||||||||||||||
| 3888 | if (!parseString()
| 11-40 | ||||||||||||||||||||||||
| 3889 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3890 | return executed 40 times by 1 test: false;return false;Executed by:
executed 40 times by 1 test: return false;Executed by:
| 40 | ||||||||||||||||||||||||
| 3891 | } | - | ||||||||||||||||||||||||
| 3892 | break; executed 11 times by 1 test: break;Executed by:
| 11 | ||||||||||||||||||||||||
| 3893 | case executed 50 times by 1 test: TTNM2:case TTNM2:Executed by:
executed 50 times by 1 test: case TTNM2:Executed by:
| 50 | ||||||||||||||||||||||||
| 3894 | next(); | - | ||||||||||||||||||||||||
| 3895 | break; executed 50 times by 1 test: break;Executed by:
| 50 | ||||||||||||||||||||||||
| 3896 | case executed 21 times by 1 test: NO:case NO:Executed by:
executed 21 times by 1 test: case NO:Executed by:
| 21 | ||||||||||||||||||||||||
| 3897 | parseString_s = QLatin1String("OTATION"); | - | ||||||||||||||||||||||||
| 3898 | if (!parseString()
| 4-17 | ||||||||||||||||||||||||
| 3899 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3900 | return executed 17 times by 1 test: false;return false;Executed by:
executed 17 times by 1 test: return false;Executed by:
| 17 | ||||||||||||||||||||||||
| 3901 | } | - | ||||||||||||||||||||||||
| 3902 | break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||
| 3903 | case executed 20 times by 1 test: NO2:case NO2:Executed by:
executed 20 times by 1 test: case NO2:Executed by:
| 20 | ||||||||||||||||||||||||
| 3904 | if (!eat_ws()
| 8-12 | ||||||||||||||||||||||||
| 3905 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3906 | return executed 8 times by 1 test: false;return false;Executed by:
executed 8 times by 1 test: return false;Executed by:
| 8 | ||||||||||||||||||||||||
| 3907 | } | - | ||||||||||||||||||||||||
| 3908 | break; executed 12 times by 1 test: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 3909 | case executed 30 times by 1 test: NO3:case NO3:Executed by:
executed 30 times by 1 test: case NO3:Executed by:
| 30 | ||||||||||||||||||||||||
| 3910 | if (!next_eat_ws()
| 10-20 | ||||||||||||||||||||||||
| 3911 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3912 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 3913 | } | - | ||||||||||||||||||||||||
| 3914 | break; executed 20 times by 1 test: break;Executed by:
| 20 | ||||||||||||||||||||||||
| 3915 | case executed 30 times by 1 test: NOName:case NOName:Executed by:
executed 30 times by 1 test: case NOName:Executed by:
| 30 | ||||||||||||||||||||||||
| 3916 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 3917 | if (!parseName()
| 11-19 | ||||||||||||||||||||||||
| 3918 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3919 | return executed 11 times by 1 test: false;return false;Executed by:
executed 11 times by 1 test: return false;Executed by:
| 11 | ||||||||||||||||||||||||
| 3920 | } | - | ||||||||||||||||||||||||
| 3921 | break; executed 19 times by 1 test: break;Executed by:
| 19 | ||||||||||||||||||||||||
| 3922 | case never executed: NO4:case NO4:never executed: case NO4: | 0 | ||||||||||||||||||||||||
| 3923 | if (!eat_ws()
| 0 | ||||||||||||||||||||||||
| 3924 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3925 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3926 | } | - | ||||||||||||||||||||||||
| 3927 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3928 | case executed 24 times by 1 test: EN:case EN:Executed by:
executed 24 times by 1 test: case EN:Executed by:
| 24 | ||||||||||||||||||||||||
| 3929 | if (!next_eat_ws()
| 8-16 | ||||||||||||||||||||||||
| 3930 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3931 | return executed 8 times by 1 test: false;return false;Executed by:
executed 8 times by 1 test: return false;Executed by:
| 8 | ||||||||||||||||||||||||
| 3932 | } | - | ||||||||||||||||||||||||
| 3933 | break; executed 16 times by 1 test: break;Executed by:
| 16 | ||||||||||||||||||||||||
| 3934 | case executed 24 times by 1 test: ENNmt:case ENNmt:Executed by:
executed 24 times by 1 test: case ENNmt:Executed by:
| 24 | ||||||||||||||||||||||||
| 3935 | if (!parseNmtoken()
| 5-19 | ||||||||||||||||||||||||
| 3936 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3937 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 3938 | } | - | ||||||||||||||||||||||||
| 3939 | break; executed 19 times by 1 test: break;Executed by:
| 19 | ||||||||||||||||||||||||
| 3940 | case never executed: EN2:case EN2:never executed: case EN2: | 0 | ||||||||||||||||||||||||
| 3941 | if (!eat_ws()
| 0 | ||||||||||||||||||||||||
| 3942 | parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); | - | ||||||||||||||||||||||||
| 3943 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3944 | } | - | ||||||||||||||||||||||||
| 3945 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 3946 | case executed 32 times by 1 test: ADone:case ADone:Executed by:
executed 32 times by 1 test: case ADone:Executed by:
| 32 | ||||||||||||||||||||||||
| 3947 | next(); | - | ||||||||||||||||||||||||
| 3948 | break; executed 32 times by 1 test: break;Executed by:
| 32 | ||||||||||||||||||||||||
| 3949 | } | - | ||||||||||||||||||||||||
| 3950 | } executed 1053 times by 1 test: end of blockExecuted by:
| 1053 | ||||||||||||||||||||||||
| 3951 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 3952 | } | - | ||||||||||||||||||||||||
| 3953 | bool QXmlSimpleReaderPrivate::parseAttValue() | - | ||||||||||||||||||||||||
| 3954 | { | - | ||||||||||||||||||||||||
| 3955 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 3956 | const signed char Dq = 1; | - | ||||||||||||||||||||||||
| 3957 | const signed char DqRef = 2; | - | ||||||||||||||||||||||||
| 3958 | const signed char DqC = 3; | - | ||||||||||||||||||||||||
| 3959 | const signed char Sq = 4; | - | ||||||||||||||||||||||||
| 3960 | const signed char SqRef = 5; | - | ||||||||||||||||||||||||
| 3961 | const signed char SqC = 6; | - | ||||||||||||||||||||||||
| 3962 | const signed char Done = 7; | - | ||||||||||||||||||||||||
| 3963 | - | |||||||||||||||||||||||||
| 3964 | const signed char InpDq = 0; | - | ||||||||||||||||||||||||
| 3965 | const signed char InpSq = 1; | - | ||||||||||||||||||||||||
| 3966 | const signed char InpAmp = 2; | - | ||||||||||||||||||||||||
| 3967 | const signed char InpLt = 3; | - | ||||||||||||||||||||||||
| 3968 | const signed char InpUnknown = 4; | - | ||||||||||||||||||||||||
| 3969 | - | |||||||||||||||||||||||||
| 3970 | static const signed char table[7][5] = { | - | ||||||||||||||||||||||||
| 3971 | - | |||||||||||||||||||||||||
| 3972 | { Dq, Sq, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 3973 | { Done, DqC, DqRef, -1, DqC }, | - | ||||||||||||||||||||||||
| 3974 | { Done, DqC, DqRef, -1, DqC }, | - | ||||||||||||||||||||||||
| 3975 | { Done, DqC, DqRef, -1, DqC }, | - | ||||||||||||||||||||||||
| 3976 | { SqC, Done, SqRef, -1, SqC }, | - | ||||||||||||||||||||||||
| 3977 | { SqC, Done, SqRef, -1, SqC }, | - | ||||||||||||||||||||||||
| 3978 | { SqC, Done, SqRef, -1, SqC } | - | ||||||||||||||||||||||||
| 3979 | }; | - | ||||||||||||||||||||||||
| 3980 | signed char state; | - | ||||||||||||||||||||||||
| 3981 | signed char input; | - | ||||||||||||||||||||||||
| 3982 | - | |||||||||||||||||||||||||
| 3983 | if (parseStack==0
| 729-12621 | ||||||||||||||||||||||||
| 3984 | state = Init; | - | ||||||||||||||||||||||||
| 3985 | } executed 13350 times by 6 tests: else {end of blockExecuted by:
| 13350 | ||||||||||||||||||||||||
| 3986 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 3987 | - | |||||||||||||||||||||||||
| 3988 | - | |||||||||||||||||||||||||
| 3989 | - | |||||||||||||||||||||||||
| 3990 | if (!parseStack->isEmpty()
| 193-948 | ||||||||||||||||||||||||
| 3991 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 3992 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0-193 | ||||||||||||||||||||||||
| 3993 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 3994 | - | |||||||||||||||||||||||||
| 3995 | - | |||||||||||||||||||||||||
| 3996 | - | |||||||||||||||||||||||||
| 3997 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 3998 | if (!(this->*function)()
| 69-124 | ||||||||||||||||||||||||
| 3999 | parseFailed(&QXmlSimpleReaderPrivate::parseAttValue, state); | - | ||||||||||||||||||||||||
| 4000 | return executed 69 times by 1 test: false;return false;Executed by:
executed 69 times by 1 test: return false;Executed by:
| 69 | ||||||||||||||||||||||||
| 4001 | } | - | ||||||||||||||||||||||||
| 4002 | } executed 124 times by 1 test: end of blockExecuted by:
| 124 | ||||||||||||||||||||||||
| 4003 | } executed 1072 times by 1 test: end of blockExecuted by:
| 1072 | ||||||||||||||||||||||||
| 4004 | - | |||||||||||||||||||||||||
| 4005 | for (;;) { | - | ||||||||||||||||||||||||
| 4006 | switch (state) { | - | ||||||||||||||||||||||||
| 4007 | case executed 13332 times by 6 tests: Done:case Done:Executed by:
executed 13332 times by 6 tests: case Done:Executed by:
| 13332 | ||||||||||||||||||||||||
| 4008 | return executed 13332 times by 6 tests: true;return true;Executed by:
executed 13332 times by 6 tests: return true;Executed by:
| 13332 | ||||||||||||||||||||||||
| 4009 | case executed 6 times by 1 test: -1:case -1:Executed by:
executed 6 times by 1 test: case -1:Executed by:
| 6 | ||||||||||||||||||||||||
| 4010 | - | |||||||||||||||||||||||||
| 4011 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 4012 | return executed 6 times by 1 test: false;return false;Executed by:
executed 6 times by 1 test: return false;Executed by:
| 6 | ||||||||||||||||||||||||
| 4013 | } | - | ||||||||||||||||||||||||
| 4014 | - | |||||||||||||||||||||||||
| 4015 | if (atEnd()
| 949-187156 | ||||||||||||||||||||||||
| 4016 | unexpectedEof(&QXmlSimpleReaderPrivate::parseAttValue, state); | - | ||||||||||||||||||||||||
| 4017 | return executed 949 times by 1 test: false;return false;Executed by:
executed 949 times by 1 test: return false;Executed by:
| 949 | ||||||||||||||||||||||||
| 4018 | } | - | ||||||||||||||||||||||||
| 4019 | if (c == QLatin1Char('"')
| 26529-160627 | ||||||||||||||||||||||||
| 4020 | input = InpDq; | - | ||||||||||||||||||||||||
| 4021 | } executed 26529 times by 5 tests: else if (c == QLatin1Char('\'')end of blockExecuted by:
| 296-160331 | ||||||||||||||||||||||||
| 4022 | input = InpSq; | - | ||||||||||||||||||||||||
| 4023 | } executed 296 times by 4 tests: else if (c == QLatin1Char('&')end of blockExecuted by:
| 258-160073 | ||||||||||||||||||||||||
| 4024 | input = InpAmp; | - | ||||||||||||||||||||||||
| 4025 | } executed 258 times by 2 tests: else if (c == QLatin1Char('<')end of blockExecuted by:
| 5-160068 | ||||||||||||||||||||||||
| 4026 | input = InpLt; | - | ||||||||||||||||||||||||
| 4027 | } executed 5 times by 1 test: else {end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 4028 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 4029 | } executed 160068 times by 6 tests: end of blockExecuted by:
| 160068 | ||||||||||||||||||||||||
| 4030 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 4031 | - | |||||||||||||||||||||||||
| 4032 | switch (state) { | - | ||||||||||||||||||||||||
| 4033 | case executed 13272 times by 5 tests: Dq:case Dq:Executed by:
executed 13272 times by 5 tests: case Dq:Executed by:
| 13272 | ||||||||||||||||||||||||
| 4034 | case executed 77 times by 3 tests: Sq:case Sq:Executed by:
executed 77 times by 3 tests: case Sq:Executed by:
| 77 | ||||||||||||||||||||||||
| 4035 | stringClear(); | - | ||||||||||||||||||||||||
| 4036 | next(); | - | ||||||||||||||||||||||||
| 4037 | break; executed 13349 times by 6 tests: break;Executed by:
| 13349 | ||||||||||||||||||||||||
| 4038 | case executed 257 times by 2 tests: DqRef:case DqRef:Executed by:
executed 257 times by 2 tests: case DqRef:Executed by:
| 257 | ||||||||||||||||||||||||
| 4039 | case executed 1 time by 1 test: SqRef:case SqRef:Executed by:
executed 1 time by 1 test: case SqRef:Executed by:
| 1 | ||||||||||||||||||||||||
| 4040 | parseReference_context = InAttributeValue; | - | ||||||||||||||||||||||||
| 4041 | if (!parseReference()
| 123-135 | ||||||||||||||||||||||||
| 4042 | parseFailed(&QXmlSimpleReaderPrivate::parseAttValue, state); | - | ||||||||||||||||||||||||
| 4043 | return executed 135 times by 1 test: false;return false;Executed by:
executed 135 times by 1 test: return false;Executed by:
| 135 | ||||||||||||||||||||||||
| 4044 | } | - | ||||||||||||||||||||||||
| 4045 | break; executed 123 times by 2 tests: break;Executed by:
| 123 | ||||||||||||||||||||||||
| 4046 | case executed 159958 times by 5 tests: DqC:case DqC:Executed by:
executed 159958 times by 5 tests: case DqC:Executed by:
| 159958 | ||||||||||||||||||||||||
| 4047 | case executed 253 times by 3 tests: SqC:case SqC:Executed by:
executed 253 times by 3 tests: case SqC:Executed by:
| 253 | ||||||||||||||||||||||||
| 4048 | stringAddC(); | - | ||||||||||||||||||||||||
| 4049 | next(); | - | ||||||||||||||||||||||||
| 4050 | break; executed 160211 times by 6 tests: break;Executed by:
| 160211 | ||||||||||||||||||||||||
| 4051 | case executed 13332 times by 6 tests: Done:case Done:Executed by:
executed 13332 times by 6 tests: case Done:Executed by:
| 13332 | ||||||||||||||||||||||||
| 4052 | next(); | - | ||||||||||||||||||||||||
| 4053 | break; executed 13332 times by 6 tests: break;Executed by:
| 13332 | ||||||||||||||||||||||||
| 4054 | } | - | ||||||||||||||||||||||||
| 4055 | } executed 187021 times by 6 tests: end of blockExecuted by:
| 187021 | ||||||||||||||||||||||||
| 4056 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4057 | } | - | ||||||||||||||||||||||||
| 4058 | - | |||||||||||||||||||||||||
| 4059 | - | |||||||||||||||||||||||||
| 4060 | - | |||||||||||||||||||||||||
| 4061 | - | |||||||||||||||||||||||||
| 4062 | - | |||||||||||||||||||||||||
| 4063 | - | |||||||||||||||||||||||||
| 4064 | - | |||||||||||||||||||||||||
| 4065 | bool QXmlSimpleReaderPrivate::parseElementDecl() | - | ||||||||||||||||||||||||
| 4066 | { | - | ||||||||||||||||||||||||
| 4067 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 4068 | const signed char Elem = 1; | - | ||||||||||||||||||||||||
| 4069 | const signed char Ws1 = 2; | - | ||||||||||||||||||||||||
| 4070 | const signed char Nam = 3; | - | ||||||||||||||||||||||||
| 4071 | const signed char Ws2 = 4; | - | ||||||||||||||||||||||||
| 4072 | const signed char Empty = 5; | - | ||||||||||||||||||||||||
| 4073 | const signed char Any = 6; | - | ||||||||||||||||||||||||
| 4074 | const signed char Cont = 7; | - | ||||||||||||||||||||||||
| 4075 | const signed char Mix = 8; | - | ||||||||||||||||||||||||
| 4076 | const signed char Mix2 = 9; | - | ||||||||||||||||||||||||
| 4077 | const signed char Mix3 = 10; | - | ||||||||||||||||||||||||
| 4078 | const signed char MixN1 = 11; | - | ||||||||||||||||||||||||
| 4079 | const signed char MixN2 = 12; | - | ||||||||||||||||||||||||
| 4080 | const signed char MixN3 = 13; | - | ||||||||||||||||||||||||
| 4081 | const signed char MixN4 = 14; | - | ||||||||||||||||||||||||
| 4082 | const signed char Cp = 15; | - | ||||||||||||||||||||||||
| 4083 | const signed char Cp2 = 16; | - | ||||||||||||||||||||||||
| 4084 | const signed char WsD = 17; | - | ||||||||||||||||||||||||
| 4085 | const signed char Done = 18; | - | ||||||||||||||||||||||||
| 4086 | - | |||||||||||||||||||||||||
| 4087 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 4088 | const signed char InpGt = 1; | - | ||||||||||||||||||||||||
| 4089 | const signed char InpPipe = 2; | - | ||||||||||||||||||||||||
| 4090 | const signed char InpOp = 3; | - | ||||||||||||||||||||||||
| 4091 | const signed char InpCp = 4; | - | ||||||||||||||||||||||||
| 4092 | const signed char InpHash = 5; | - | ||||||||||||||||||||||||
| 4093 | const signed char InpQm = 6; | - | ||||||||||||||||||||||||
| 4094 | const signed char InpAst = 7; | - | ||||||||||||||||||||||||
| 4095 | const signed char InpPlus = 8; | - | ||||||||||||||||||||||||
| 4096 | const signed char InpA = 9; | - | ||||||||||||||||||||||||
| 4097 | const signed char InpE = 10; | - | ||||||||||||||||||||||||
| 4098 | const signed char InpL = 11; | - | ||||||||||||||||||||||||
| 4099 | const signed char InpUnknown = 12; | - | ||||||||||||||||||||||||
| 4100 | - | |||||||||||||||||||||||||
| 4101 | static const signed char table[18][13] = { | - | ||||||||||||||||||||||||
| 4102 | - | |||||||||||||||||||||||||
| 4103 | { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, Elem, -1 }, | - | ||||||||||||||||||||||||
| 4104 | { Ws1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4105 | { -1, -1, -1, -1, -1, -1, -1, -1, -1, Nam, Nam, Nam, Nam }, | - | ||||||||||||||||||||||||
| 4106 | { Ws2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4107 | { -1, -1, -1, Cont, -1, -1, -1, -1, -1, Any, Empty, -1, -1 }, | - | ||||||||||||||||||||||||
| 4108 | { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4109 | { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4110 | { -1, -1, -1, Cp, Cp, Mix, -1, -1, -1, Cp, Cp, Cp, Cp }, | - | ||||||||||||||||||||||||
| 4111 | { Mix2, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4112 | { -1, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4113 | { WsD, Done, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4114 | { -1, -1, -1, -1, -1, -1, -1, -1, -1, MixN2, MixN2, MixN2, MixN2 }, | - | ||||||||||||||||||||||||
| 4115 | { MixN3, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4116 | { -1, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4117 | { -1, -1, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4118 | { WsD, Done, -1, -1, -1, -1, Cp2, Cp2, Cp2, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4119 | { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4120 | { -1, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } | - | ||||||||||||||||||||||||
| 4121 | }; | - | ||||||||||||||||||||||||
| 4122 | signed char state; | - | ||||||||||||||||||||||||
| 4123 | signed char input; | - | ||||||||||||||||||||||||
| 4124 | - | |||||||||||||||||||||||||
| 4125 | if (parseStack==0
| 218-9563 | ||||||||||||||||||||||||
| 4126 | state = Init; | - | ||||||||||||||||||||||||
| 4127 | } executed 1582 times by 1 test: else {end of blockExecuted by:
| 1582 | ||||||||||||||||||||||||
| 4128 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 4129 | - | |||||||||||||||||||||||||
| 4130 | - | |||||||||||||||||||||||||
| 4131 | - | |||||||||||||||||||||||||
| 4132 | if (!parseStack->isEmpty()
| 1215-6984 | ||||||||||||||||||||||||
| 4133 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 4134 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 1242-5742 | ||||||||||||||||||||||||
| 4135 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 4136 | - | |||||||||||||||||||||||||
| 4137 | - | |||||||||||||||||||||||||
| 4138 | - | |||||||||||||||||||||||||
| 4139 | } executed 1242 times by 1 test: end of blockExecuted by:
| 1242 | ||||||||||||||||||||||||
| 4140 | if (!(this->*function)()
| 2455-4529 | ||||||||||||||||||||||||
| 4141 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4142 | return executed 2455 times by 1 test: false;return false;Executed by:
executed 2455 times by 1 test: return false;Executed by:
| 2455 | ||||||||||||||||||||||||
| 4143 | } | - | ||||||||||||||||||||||||
| 4144 | } executed 4529 times by 1 test: end of blockExecuted by:
| 4529 | ||||||||||||||||||||||||
| 4145 | } executed 5744 times by 1 test: end of blockExecuted by:
| 5744 | ||||||||||||||||||||||||
| 4146 | - | |||||||||||||||||||||||||
| 4147 | for (;;) { | - | ||||||||||||||||||||||||
| 4148 | switch (state) { | - | ||||||||||||||||||||||||
| 4149 | case executed 1561 times by 1 test: Done:case Done:Executed by:
executed 1561 times by 1 test: case Done:Executed by:
| 1561 | ||||||||||||||||||||||||
| 4150 | return executed 1561 times by 1 test: true;return true;Executed by:
executed 1561 times by 1 test: return true;Executed by:
| 1561 | ||||||||||||||||||||||||
| 4151 | case executed 12 times by 1 test: -1:case -1:Executed by:
executed 12 times by 1 test: case -1:Executed by:
| 12 | ||||||||||||||||||||||||
| 4152 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 4153 | return executed 12 times by 1 test: false;return false;Executed by:
executed 12 times by 1 test: return false;Executed by:
| 12 | ||||||||||||||||||||||||
| 4154 | } | - | ||||||||||||||||||||||||
| 4155 | - | |||||||||||||||||||||||||
| 4156 | if (atEnd()
| 1215-12237 | ||||||||||||||||||||||||
| 4157 | unexpectedEof(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4158 | return executed 1215 times by 1 test: false;return false;Executed by:
executed 1215 times by 1 test: return false;Executed by:
| 1215 | ||||||||||||||||||||||||
| 4159 | } | - | ||||||||||||||||||||||||
| 4160 | if (is_S(c)
| 3168-9069 | ||||||||||||||||||||||||
| 4161 | input = InpWs; | - | ||||||||||||||||||||||||
| 4162 | } executed 3168 times by 1 test: else if (c == QLatin1Char('>')end of blockExecuted by:
| 1561-7508 | ||||||||||||||||||||||||
| 4163 | input = InpGt; | - | ||||||||||||||||||||||||
| 4164 | } executed 1561 times by 1 test: else if (c == QLatin1Char('|')end of blockExecuted by:
| 12-7496 | ||||||||||||||||||||||||
| 4165 | input = InpPipe; | - | ||||||||||||||||||||||||
| 4166 | } executed 12 times by 1 test: else if (c == QLatin1Char('(')end of blockExecuted by:
| 12-6048 | ||||||||||||||||||||||||
| 4167 | input = InpOp; | - | ||||||||||||||||||||||||
| 4168 | } executed 1448 times by 1 test: else if (c == QLatin1Char(')')end of blockExecuted by:
| 1247-4801 | ||||||||||||||||||||||||
| 4169 | input = InpCp; | - | ||||||||||||||||||||||||
| 4170 | } executed 1247 times by 1 test: else if (c == QLatin1Char('#')end of blockExecuted by:
| 1247-3554 | ||||||||||||||||||||||||
| 4171 | input = InpHash; | - | ||||||||||||||||||||||||
| 4172 | } executed 1247 times by 1 test: else if (c == QLatin1Char('?')end of blockExecuted by:
| 3-3551 | ||||||||||||||||||||||||
| 4173 | input = InpQm; | - | ||||||||||||||||||||||||
| 4174 | } executed 3 times by 1 test: else if (c == QLatin1Char('*')end of blockExecuted by:
| 3-3519 | ||||||||||||||||||||||||
| 4175 | input = InpAst; | - | ||||||||||||||||||||||||
| 4176 | } executed 32 times by 1 test: else if (c == QLatin1Char('+')end of blockExecuted by:
| 12-3507 | ||||||||||||||||||||||||
| 4177 | input = InpPlus; | - | ||||||||||||||||||||||||
| 4178 | } executed 12 times by 1 test: else if (c == QLatin1Char('A')end of blockExecuted by:
| 12-3477 | ||||||||||||||||||||||||
| 4179 | input = InpA; | - | ||||||||||||||||||||||||
| 4180 | } executed 30 times by 1 test: else if (c == QLatin1Char('E')end of blockExecuted by:
| 30-3373 | ||||||||||||||||||||||||
| 4181 | input = InpE; | - | ||||||||||||||||||||||||
| 4182 | } executed 104 times by 1 test: else if (c == QLatin1Char('L')end of blockExecuted by:
| 104-1791 | ||||||||||||||||||||||||
| 4183 | input = InpL; | - | ||||||||||||||||||||||||
| 4184 | } executed 1582 times by 1 test: else {end of blockExecuted by:
| 1582 | ||||||||||||||||||||||||
| 4185 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 4186 | } executed 1791 times by 1 test: end of blockExecuted by:
| 1791 | ||||||||||||||||||||||||
| 4187 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 4188 | - | |||||||||||||||||||||||||
| 4189 | switch (state) { | - | ||||||||||||||||||||||||
| 4190 | case executed 1582 times by 1 test: Elem:case Elem:Executed by:
executed 1582 times by 1 test: case Elem:Executed by:
| 1582 | ||||||||||||||||||||||||
| 4191 | parseString_s = QLatin1String("LEMENT"); | - | ||||||||||||||||||||||||
| 4192 | if (!parseString()
| 383-1199 | ||||||||||||||||||||||||
| 4193 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4194 | return executed 1199 times by 1 test: false;return false;Executed by:
executed 1199 times by 1 test: return false;Executed by:
| 1199 | ||||||||||||||||||||||||
| 4195 | } | - | ||||||||||||||||||||||||
| 4196 | break; executed 383 times by 1 test: break;Executed by:
| 383 | ||||||||||||||||||||||||
| 4197 | case executed 1582 times by 1 test: Ws1:case Ws1:Executed by:
executed 1582 times by 1 test: case Ws1:Executed by:
| 1582 | ||||||||||||||||||||||||
| 4198 | if (!eat_ws()
| 465-1117 | ||||||||||||||||||||||||
| 4199 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4200 | return executed 465 times by 1 test: false;return false;Executed by:
executed 465 times by 1 test: return false;Executed by:
| 465 | ||||||||||||||||||||||||
| 4201 | } | - | ||||||||||||||||||||||||
| 4202 | break; executed 1117 times by 1 test: break;Executed by:
| 1117 | ||||||||||||||||||||||||
| 4203 | case executed 1582 times by 1 test: Nam:case Nam:Executed by:
executed 1582 times by 1 test: case Nam:Executed by:
| 1582 | ||||||||||||||||||||||||
| 4204 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 4205 | if (!parseName()
| 621-961 | ||||||||||||||||||||||||
| 4206 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4207 | return executed 961 times by 1 test: false;return false;Executed by:
executed 961 times by 1 test: return false;Executed by:
| 961 | ||||||||||||||||||||||||
| 4208 | } | - | ||||||||||||||||||||||||
| 4209 | break; executed 621 times by 1 test: break;Executed by:
| 621 | ||||||||||||||||||||||||
| 4210 | case executed 1581 times by 1 test: Ws2:case Ws2:Executed by:
executed 1581 times by 1 test: case Ws2:Executed by:
| 1581 | ||||||||||||||||||||||||
| 4211 | if (!eat_ws()
| 254-1327 | ||||||||||||||||||||||||
| 4212 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4213 | return executed 254 times by 1 test: false;return false;Executed by:
executed 254 times by 1 test: return false;Executed by:
| 254 | ||||||||||||||||||||||||
| 4214 | } | - | ||||||||||||||||||||||||
| 4215 | break; executed 1327 times by 1 test: break;Executed by:
| 1327 | ||||||||||||||||||||||||
| 4216 | case executed 104 times by 1 test: Empty:case Empty:Executed by:
executed 104 times by 1 test: case Empty:Executed by:
| 104 | ||||||||||||||||||||||||
| 4217 | parseString_s = QLatin1String("EMPTY"); | - | ||||||||||||||||||||||||
| 4218 | if (!parseString()
| 39-65 | ||||||||||||||||||||||||
| 4219 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4220 | return executed 65 times by 1 test: false;return false;Executed by:
executed 65 times by 1 test: return false;Executed by:
| 65 | ||||||||||||||||||||||||
| 4221 | } | - | ||||||||||||||||||||||||
| 4222 | break; executed 39 times by 1 test: break;Executed by:
| 39 | ||||||||||||||||||||||||
| 4223 | case executed 30 times by 1 test: Any:case Any:Executed by:
executed 30 times by 1 test: case Any:Executed by:
| 30 | ||||||||||||||||||||||||
| 4224 | parseString_s = QLatin1String("ANY"); | - | ||||||||||||||||||||||||
| 4225 | if (!parseString()
| 14-16 | ||||||||||||||||||||||||
| 4226 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4227 | return executed 16 times by 1 test: false;return false;Executed by:
executed 16 times by 1 test: return false;Executed by:
| 16 | ||||||||||||||||||||||||
| 4228 | } | - | ||||||||||||||||||||||||
| 4229 | break; executed 14 times by 1 test: break;Executed by:
| 14 | ||||||||||||||||||||||||
| 4230 | case executed 1444 times by 1 test: Cont:case Cont:Executed by:
executed 1444 times by 1 test: case Cont:Executed by:
| 1444 | ||||||||||||||||||||||||
| 4231 | if (!next_eat_ws()
| 513-931 | ||||||||||||||||||||||||
| 4232 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4233 | return executed 513 times by 1 test: false;return false;Executed by:
executed 513 times by 1 test: return false;Executed by:
| 513 | ||||||||||||||||||||||||
| 4234 | } | - | ||||||||||||||||||||||||
| 4235 | break; executed 931 times by 1 test: break;Executed by:
| 931 | ||||||||||||||||||||||||
| 4236 | case executed 1247 times by 1 test: Mix:case Mix:Executed by:
executed 1247 times by 1 test: case Mix:Executed by:
| 1247 | ||||||||||||||||||||||||
| 4237 | parseString_s = QLatin1String("#PCDATA"); | - | ||||||||||||||||||||||||
| 4238 | if (!parseString()
| 283-964 | ||||||||||||||||||||||||
| 4239 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4240 | return executed 964 times by 1 test: false;return false;Executed by:
executed 964 times by 1 test: return false;Executed by:
| 964 | ||||||||||||||||||||||||
| 4241 | } | - | ||||||||||||||||||||||||
| 4242 | break; executed 283 times by 1 test: break;Executed by:
| 283 | ||||||||||||||||||||||||
| 4243 | case executed 2 times by 1 test: Mix2:case Mix2:Executed by:
executed 2 times by 1 test: case Mix2:Executed by:
| 2 | ||||||||||||||||||||||||
| 4244 | if (!eat_ws()
| 0-2 | ||||||||||||||||||||||||
| 4245 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4246 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4247 | } | - | ||||||||||||||||||||||||
| 4248 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||
| 4249 | case executed 1235 times by 1 test: Mix3:case Mix3:Executed by:
executed 1235 times by 1 test: case Mix3:Executed by:
| 1235 | ||||||||||||||||||||||||
| 4250 | next(); | - | ||||||||||||||||||||||||
| 4251 | break; executed 1235 times by 1 test: break;Executed by:
| 1235 | ||||||||||||||||||||||||
| 4252 | case executed 12 times by 1 test: MixN1:case MixN1:Executed by:
executed 12 times by 1 test: case MixN1:Executed by:
| 12 | ||||||||||||||||||||||||
| 4253 | if (!next_eat_ws()
| 5-7 | ||||||||||||||||||||||||
| 4254 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4255 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 4256 | } | - | ||||||||||||||||||||||||
| 4257 | break; executed 7 times by 1 test: break;Executed by:
| 7 | ||||||||||||||||||||||||
| 4258 | case executed 11 times by 1 test: MixN2:case MixN2:Executed by:
executed 11 times by 1 test: case MixN2:Executed by:
| 11 | ||||||||||||||||||||||||
| 4259 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 4260 | if (!parseName()
| 1-10 | ||||||||||||||||||||||||
| 4261 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4262 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 4263 | } | - | ||||||||||||||||||||||||
| 4264 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||
| 4265 | case never executed: MixN3:case MixN3:never executed: case MixN3: | 0 | ||||||||||||||||||||||||
| 4266 | if (!eat_ws()
| 0 | ||||||||||||||||||||||||
| 4267 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4268 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4269 | } | - | ||||||||||||||||||||||||
| 4270 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 4271 | case executed 10 times by 1 test: MixN4:case MixN4:Executed by:
executed 10 times by 1 test: case MixN4:Executed by:
| 10 | ||||||||||||||||||||||||
| 4272 | next(); | - | ||||||||||||||||||||||||
| 4273 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||
| 4274 | case executed 197 times by 1 test: Cp:case Cp:Executed by:
executed 197 times by 1 test: case Cp:Executed by:
| 197 | ||||||||||||||||||||||||
| 4275 | if (!parseChoiceSeq()
| 94-103 | ||||||||||||||||||||||||
| 4276 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4277 | return executed 94 times by 1 test: false;return false;Executed by:
executed 94 times by 1 test: return false;Executed by:
| 94 | ||||||||||||||||||||||||
| 4278 | } | - | ||||||||||||||||||||||||
| 4279 | break; executed 103 times by 1 test: break;Executed by:
| 103 | ||||||||||||||||||||||||
| 4280 | case executed 32 times by 1 test: Cp2:case Cp2:Executed by:
executed 32 times by 1 test: case Cp2:Executed by:
| 32 | ||||||||||||||||||||||||
| 4281 | next(); | - | ||||||||||||||||||||||||
| 4282 | break; executed 32 times by 1 test: break;Executed by:
| 32 | ||||||||||||||||||||||||
| 4283 | case executed 13 times by 1 test: WsD:case WsD:Executed by:
executed 13 times by 1 test: case WsD:Executed by:
| 13 | ||||||||||||||||||||||||
| 4284 | if (!next_eat_ws()
| 1-12 | ||||||||||||||||||||||||
| 4285 | parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); | - | ||||||||||||||||||||||||
| 4286 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 4287 | } | - | ||||||||||||||||||||||||
| 4288 | break; executed 12 times by 1 test: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 4289 | case executed 1561 times by 1 test: Done:case Done:Executed by:
executed 1561 times by 1 test: case Done:Executed by:
| 1561 | ||||||||||||||||||||||||
| 4290 | next(); | - | ||||||||||||||||||||||||
| 4291 | break; executed 1561 times by 1 test: break;Executed by:
| 1561 | ||||||||||||||||||||||||
| 4292 | } | - | ||||||||||||||||||||||||
| 4293 | } executed 7699 times by 1 test: end of blockExecuted by:
| 7699 | ||||||||||||||||||||||||
| 4294 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4295 | } | - | ||||||||||||||||||||||||
| 4296 | - | |||||||||||||||||||||||||
| 4297 | - | |||||||||||||||||||||||||
| 4298 | - | |||||||||||||||||||||||||
| 4299 | - | |||||||||||||||||||||||||
| 4300 | - | |||||||||||||||||||||||||
| 4301 | - | |||||||||||||||||||||||||
| 4302 | - | |||||||||||||||||||||||||
| 4303 | bool QXmlSimpleReaderPrivate::parseNotationDecl() | - | ||||||||||||||||||||||||
| 4304 | { | - | ||||||||||||||||||||||||
| 4305 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 4306 | const signed char Not = 1; | - | ||||||||||||||||||||||||
| 4307 | const signed char Ws1 = 2; | - | ||||||||||||||||||||||||
| 4308 | const signed char Nam = 3; | - | ||||||||||||||||||||||||
| 4309 | const signed char Ws2 = 4; | - | ||||||||||||||||||||||||
| 4310 | const signed char ExtID = 5; | - | ||||||||||||||||||||||||
| 4311 | const signed char ExtIDR = 6; | - | ||||||||||||||||||||||||
| 4312 | const signed char Ws3 = 7; | - | ||||||||||||||||||||||||
| 4313 | const signed char Done = 8; | - | ||||||||||||||||||||||||
| 4314 | - | |||||||||||||||||||||||||
| 4315 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 4316 | const signed char InpGt = 1; | - | ||||||||||||||||||||||||
| 4317 | const signed char InpN = 2; | - | ||||||||||||||||||||||||
| 4318 | const signed char InpUnknown = 3; | - | ||||||||||||||||||||||||
| 4319 | - | |||||||||||||||||||||||||
| 4320 | static const signed char table[8][4] = { | - | ||||||||||||||||||||||||
| 4321 | - | |||||||||||||||||||||||||
| 4322 | { -1, -1, Not, -1 }, | - | ||||||||||||||||||||||||
| 4323 | { Ws1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4324 | { -1, -1, Nam, Nam }, | - | ||||||||||||||||||||||||
| 4325 | { Ws2, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4326 | { -1, Done, ExtID, ExtID }, | - | ||||||||||||||||||||||||
| 4327 | { Ws3, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4328 | { Ws3, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4329 | { -1, Done, -1, -1 } | - | ||||||||||||||||||||||||
| 4330 | }; | - | ||||||||||||||||||||||||
| 4331 | signed char state; | - | ||||||||||||||||||||||||
| 4332 | signed char input; | - | ||||||||||||||||||||||||
| 4333 | - | |||||||||||||||||||||||||
| 4334 | if (parseStack==0
| 9-536 | ||||||||||||||||||||||||
| 4335 | state = Init; | - | ||||||||||||||||||||||||
| 4336 | } executed 54 times by 1 test: else {end of blockExecuted by:
| 54 | ||||||||||||||||||||||||
| 4337 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 4338 | - | |||||||||||||||||||||||||
| 4339 | - | |||||||||||||||||||||||||
| 4340 | - | |||||||||||||||||||||||||
| 4341 | if (!parseStack->isEmpty()
| 19-472 | ||||||||||||||||||||||||
| 4342 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 4343 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 30-442 | ||||||||||||||||||||||||
| 4344 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 4345 | - | |||||||||||||||||||||||||
| 4346 | - | |||||||||||||||||||||||||
| 4347 | - | |||||||||||||||||||||||||
| 4348 | } executed 30 times by 1 test: end of blockExecuted by:
| 30 | ||||||||||||||||||||||||
| 4349 | if (!(this->*function)()
| 139-333 | ||||||||||||||||||||||||
| 4350 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4351 | return executed 333 times by 1 test: false;return false;Executed by:
executed 333 times by 1 test: return false;Executed by:
| 333 | ||||||||||||||||||||||||
| 4352 | } | - | ||||||||||||||||||||||||
| 4353 | } executed 139 times by 1 test: end of blockExecuted by:
| 139 | ||||||||||||||||||||||||
| 4354 | } executed 158 times by 1 test: end of blockExecuted by:
| 158 | ||||||||||||||||||||||||
| 4355 | - | |||||||||||||||||||||||||
| 4356 | for (;;) { | - | ||||||||||||||||||||||||
| 4357 | switch (state) { | - | ||||||||||||||||||||||||
| 4358 | case executed 54 times by 1 test: ExtID:case ExtID:Executed by:
executed 54 times by 1 test: case ExtID:Executed by:
| 54 | ||||||||||||||||||||||||
| 4359 | - | |||||||||||||||||||||||||
| 4360 | if (dtdHnd
| 0-54 | ||||||||||||||||||||||||
| 4361 | if (!dtdHnd->notationDecl(name(), publicId, systemId)
| 0-54 | ||||||||||||||||||||||||
| 4362 | reportParseError(dtdHnd->errorString()); | - | ||||||||||||||||||||||||
| 4363 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4364 | } | - | ||||||||||||||||||||||||
| 4365 | } executed 54 times by 1 test: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||
| 4366 | state = ExtIDR; | - | ||||||||||||||||||||||||
| 4367 | break; executed 54 times by 1 test: break;Executed by:
| 54 | ||||||||||||||||||||||||
| 4368 | case executed 54 times by 1 test: Done:case Done:Executed by:
executed 54 times by 1 test: case Done:Executed by:
| 54 | ||||||||||||||||||||||||
| 4369 | return executed 54 times by 1 test: true;return true;Executed by:
executed 54 times by 1 test: return true;Executed by:
| 54 | ||||||||||||||||||||||||
| 4370 | case never executed: -1:case -1:never executed: case -1: | 0 | ||||||||||||||||||||||||
| 4371 | - | |||||||||||||||||||||||||
| 4372 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 4373 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4374 | } | - | ||||||||||||||||||||||||
| 4375 | - | |||||||||||||||||||||||||
| 4376 | if (atEnd()
| 19-324 | ||||||||||||||||||||||||
| 4377 | unexpectedEof(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4378 | return executed 19 times by 1 test: false;return false;Executed by:
executed 19 times by 1 test: return false;Executed by:
| 19 | ||||||||||||||||||||||||
| 4379 | } | - | ||||||||||||||||||||||||
| 4380 | if (is_S(c)
| 108-216 | ||||||||||||||||||||||||
| 4381 | input = InpWs; | - | ||||||||||||||||||||||||
| 4382 | } executed 108 times by 1 test: else if (c == QLatin1Char('>')end of blockExecuted by:
| 54-162 | ||||||||||||||||||||||||
| 4383 | input = InpGt; | - | ||||||||||||||||||||||||
| 4384 | } executed 54 times by 1 test: else if (c == QLatin1Char('N')end of blockExecuted by:
| 54-108 | ||||||||||||||||||||||||
| 4385 | input = InpN; | - | ||||||||||||||||||||||||
| 4386 | } executed 54 times by 1 test: else {end of blockExecuted by:
| 54 | ||||||||||||||||||||||||
| 4387 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 4388 | } executed 108 times by 1 test: end of blockExecuted by:
| 108 | ||||||||||||||||||||||||
| 4389 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 4390 | - | |||||||||||||||||||||||||
| 4391 | switch (state) { | - | ||||||||||||||||||||||||
| 4392 | case executed 54 times by 1 test: Not:case Not:Executed by:
executed 54 times by 1 test: case Not:Executed by:
| 54 | ||||||||||||||||||||||||
| 4393 | parseString_s = QLatin1String("NOTATION"); | - | ||||||||||||||||||||||||
| 4394 | if (!parseString()
| 11-43 | ||||||||||||||||||||||||
| 4395 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4396 | return executed 43 times by 1 test: false;return false;Executed by:
executed 43 times by 1 test: return false;Executed by:
| 43 | ||||||||||||||||||||||||
| 4397 | } | - | ||||||||||||||||||||||||
| 4398 | break; executed 11 times by 1 test: break;Executed by:
| 11 | ||||||||||||||||||||||||
| 4399 | case executed 54 times by 1 test: Ws1:case Ws1:Executed by:
executed 54 times by 1 test: case Ws1:Executed by:
| 54 | ||||||||||||||||||||||||
| 4400 | if (!eat_ws()
| 16-38 | ||||||||||||||||||||||||
| 4401 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4402 | return executed 16 times by 1 test: false;return false;Executed by:
executed 16 times by 1 test: return false;Executed by:
| 16 | ||||||||||||||||||||||||
| 4403 | } | - | ||||||||||||||||||||||||
| 4404 | break; executed 38 times by 1 test: break;Executed by:
| 38 | ||||||||||||||||||||||||
| 4405 | case executed 54 times by 1 test: Nam:case Nam:Executed by:
executed 54 times by 1 test: case Nam:Executed by:
| 54 | ||||||||||||||||||||||||
| 4406 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 4407 | if (!parseName()
| 21-33 | ||||||||||||||||||||||||
| 4408 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4409 | return executed 21 times by 1 test: false;return false;Executed by:
executed 21 times by 1 test: return false;Executed by:
| 21 | ||||||||||||||||||||||||
| 4410 | } | - | ||||||||||||||||||||||||
| 4411 | break; executed 33 times by 1 test: break;Executed by:
| 33 | ||||||||||||||||||||||||
| 4412 | case executed 54 times by 1 test: Ws2:case Ws2:Executed by:
executed 54 times by 1 test: case Ws2:Executed by:
| 54 | ||||||||||||||||||||||||
| 4413 | if (!eat_ws()
| 14-40 | ||||||||||||||||||||||||
| 4414 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4415 | return executed 14 times by 1 test: false;return false;Executed by:
executed 14 times by 1 test: return false;Executed by:
| 14 | ||||||||||||||||||||||||
| 4416 | } | - | ||||||||||||||||||||||||
| 4417 | break; executed 40 times by 1 test: break;Executed by:
| 40 | ||||||||||||||||||||||||
| 4418 | case executed 54 times by 1 test: ExtID:case ExtID:Executed by:
executed 54 times by 1 test: case ExtID:Executed by:
| 54 | ||||||||||||||||||||||||
| 4419 | case never executed: ExtIDR:case ExtIDR:never executed: case ExtIDR: | 0 | ||||||||||||||||||||||||
| 4420 | parseExternalID_allowPublicID = true; | - | ||||||||||||||||||||||||
| 4421 | if (!parseExternalID()
| 9-45 | ||||||||||||||||||||||||
| 4422 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4423 | return executed 45 times by 1 test: false;return false;Executed by:
executed 45 times by 1 test: return false;Executed by:
| 45 | ||||||||||||||||||||||||
| 4424 | } | - | ||||||||||||||||||||||||
| 4425 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||
| 4426 | case never executed: Ws3:case Ws3:never executed: case Ws3: | 0 | ||||||||||||||||||||||||
| 4427 | if (!eat_ws()
| 0 | ||||||||||||||||||||||||
| 4428 | parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); | - | ||||||||||||||||||||||||
| 4429 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4430 | } | - | ||||||||||||||||||||||||
| 4431 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 4432 | case executed 54 times by 1 test: Done:case Done:Executed by:
executed 54 times by 1 test: case Done:Executed by:
| 54 | ||||||||||||||||||||||||
| 4433 | next(); | - | ||||||||||||||||||||||||
| 4434 | break; executed 54 times by 1 test: break;Executed by:
| 54 | ||||||||||||||||||||||||
| 4435 | } | - | ||||||||||||||||||||||||
| 4436 | } executed 185 times by 1 test: end of blockExecuted by:
| 185 | ||||||||||||||||||||||||
| 4437 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4438 | } | - | ||||||||||||||||||||||||
| 4439 | - | |||||||||||||||||||||||||
| 4440 | - | |||||||||||||||||||||||||
| 4441 | - | |||||||||||||||||||||||||
| 4442 | - | |||||||||||||||||||||||||
| 4443 | - | |||||||||||||||||||||||||
| 4444 | - | |||||||||||||||||||||||||
| 4445 | - | |||||||||||||||||||||||||
| 4446 | bool QXmlSimpleReaderPrivate::parseChoiceSeq() | - | ||||||||||||||||||||||||
| 4447 | { | - | ||||||||||||||||||||||||
| 4448 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 4449 | const signed char Ws1 = 1; | - | ||||||||||||||||||||||||
| 4450 | const signed char CoS = 2; | - | ||||||||||||||||||||||||
| 4451 | const signed char Ws2 = 3; | - | ||||||||||||||||||||||||
| 4452 | const signed char More = 4; | - | ||||||||||||||||||||||||
| 4453 | const signed char Name = 5; | - | ||||||||||||||||||||||||
| 4454 | const signed char Done = 6; | - | ||||||||||||||||||||||||
| 4455 | - | |||||||||||||||||||||||||
| 4456 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 4457 | const signed char InpOp = 1; | - | ||||||||||||||||||||||||
| 4458 | const signed char InpCp = 2; | - | ||||||||||||||||||||||||
| 4459 | const signed char InpQm = 3; | - | ||||||||||||||||||||||||
| 4460 | const signed char InpAst = 4; | - | ||||||||||||||||||||||||
| 4461 | const signed char InpPlus = 5; | - | ||||||||||||||||||||||||
| 4462 | const signed char InpPipe = 6; | - | ||||||||||||||||||||||||
| 4463 | const signed char InpComm = 7; | - | ||||||||||||||||||||||||
| 4464 | const signed char InpUnknown = 8; | - | ||||||||||||||||||||||||
| 4465 | - | |||||||||||||||||||||||||
| 4466 | static const signed char table[6][9] = { | - | ||||||||||||||||||||||||
| 4467 | - | |||||||||||||||||||||||||
| 4468 | { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, | - | ||||||||||||||||||||||||
| 4469 | { -1, CoS, -1, -1, -1, -1, -1, -1, CoS }, | - | ||||||||||||||||||||||||
| 4470 | { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 }, | - | ||||||||||||||||||||||||
| 4471 | { -1, -1, Done, -1, -1, -1, More, More, -1 }, | - | ||||||||||||||||||||||||
| 4472 | { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, | - | ||||||||||||||||||||||||
| 4473 | { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 } | - | ||||||||||||||||||||||||
| 4474 | }; | - | ||||||||||||||||||||||||
| 4475 | signed char state; | - | ||||||||||||||||||||||||
| 4476 | signed char input; | - | ||||||||||||||||||||||||
| 4477 | - | |||||||||||||||||||||||||
| 4478 | if (parseStack==0
| 41-294 | ||||||||||||||||||||||||
| 4479 | state = Init; | - | ||||||||||||||||||||||||
| 4480 | } executed 203 times by 1 test: else {end of blockExecuted by:
| 203 | ||||||||||||||||||||||||
| 4481 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 4482 | - | |||||||||||||||||||||||||
| 4483 | - | |||||||||||||||||||||||||
| 4484 | - | |||||||||||||||||||||||||
| 4485 | if (!parseStack->isEmpty()
| 0-132 | ||||||||||||||||||||||||
| 4486 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 4487 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 59-73 | ||||||||||||||||||||||||
| 4488 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 4489 | - | |||||||||||||||||||||||||
| 4490 | - | |||||||||||||||||||||||||
| 4491 | - | |||||||||||||||||||||||||
| 4492 | } executed 59 times by 1 test: end of blockExecuted by:
| 59 | ||||||||||||||||||||||||
| 4493 | if (!(this->*function)()
| 14-118 | ||||||||||||||||||||||||
| 4494 | parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4495 | return executed 14 times by 1 test: false;return false;Executed by:
executed 14 times by 1 test: return false;Executed by:
| 14 | ||||||||||||||||||||||||
| 4496 | } | - | ||||||||||||||||||||||||
| 4497 | } executed 118 times by 1 test: end of blockExecuted by:
| 118 | ||||||||||||||||||||||||
| 4498 | } executed 118 times by 1 test: end of blockExecuted by:
| 118 | ||||||||||||||||||||||||
| 4499 | - | |||||||||||||||||||||||||
| 4500 | for (;;) { | - | ||||||||||||||||||||||||
| 4501 | switch (state) { | - | ||||||||||||||||||||||||
| 4502 | case executed 193 times by 1 test: Done:case Done:Executed by:
executed 193 times by 1 test: case Done:Executed by:
| 193 | ||||||||||||||||||||||||
| 4503 | return executed 193 times by 1 test: true;return true;Executed by:
executed 193 times by 1 test: return true;Executed by:
| 193 | ||||||||||||||||||||||||
| 4504 | case executed 4 times by 1 test: -1:case -1:Executed by:
executed 4 times by 1 test: case -1:Executed by:
| 4 | ||||||||||||||||||||||||
| 4505 | - | |||||||||||||||||||||||||
| 4506 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 4507 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 4508 | } | - | ||||||||||||||||||||||||
| 4509 | - | |||||||||||||||||||||||||
| 4510 | if (atEnd()
| 0-623 | ||||||||||||||||||||||||
| 4511 | unexpectedEof(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4512 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4513 | } | - | ||||||||||||||||||||||||
| 4514 | if (is_S(c)
| 24-599 | ||||||||||||||||||||||||
| 4515 | input = InpWs; | - | ||||||||||||||||||||||||
| 4516 | } executed 24 times by 1 test: else if (c == QLatin1Char('(')end of blockExecuted by:
| 6-593 | ||||||||||||||||||||||||
| 4517 | input = InpOp; | - | ||||||||||||||||||||||||
| 4518 | } executed 6 times by 1 test: else if (c == QLatin1Char(')')end of blockExecuted by:
| 6-399 | ||||||||||||||||||||||||
| 4519 | input = InpCp; | - | ||||||||||||||||||||||||
| 4520 | } executed 194 times by 1 test: else if (c == QLatin1Char('?')end of blockExecuted by:
| 14-385 | ||||||||||||||||||||||||
| 4521 | input = InpQm; | - | ||||||||||||||||||||||||
| 4522 | } executed 14 times by 1 test: else if (c == QLatin1Char('*')end of blockExecuted by:
| 14-303 | ||||||||||||||||||||||||
| 4523 | input = InpAst; | - | ||||||||||||||||||||||||
| 4524 | } executed 82 times by 1 test: else if (c == QLatin1Char('+')end of blockExecuted by:
| 2-301 | ||||||||||||||||||||||||
| 4525 | input = InpPlus; | - | ||||||||||||||||||||||||
| 4526 | } executed 2 times by 1 test: else if (c == QLatin1Char('|')end of blockExecuted by:
| 2-278 | ||||||||||||||||||||||||
| 4527 | input = InpPipe; | - | ||||||||||||||||||||||||
| 4528 | } executed 23 times by 1 test: else if (c == QLatin1Char(',')end of blockExecuted by:
| 23-252 | ||||||||||||||||||||||||
| 4529 | input = InpComm; | - | ||||||||||||||||||||||||
| 4530 | } executed 26 times by 1 test: else {end of blockExecuted by:
| 26 | ||||||||||||||||||||||||
| 4531 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 4532 | } executed 252 times by 1 test: end of blockExecuted by:
| 252 | ||||||||||||||||||||||||
| 4533 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 4534 | - | |||||||||||||||||||||||||
| 4535 | switch (state) { | - | ||||||||||||||||||||||||
| 4536 | case executed 6 times by 1 test: Ws1:case Ws1:Executed by:
executed 6 times by 1 test: case Ws1:Executed by:
| 6 | ||||||||||||||||||||||||
| 4537 | if (!next_eat_ws()
| 0-6 | ||||||||||||||||||||||||
| 4538 | parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4539 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4540 | } | - | ||||||||||||||||||||||||
| 4541 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||
| 4542 | case executed 6 times by 1 test: CoS:case CoS:Executed by:
executed 6 times by 1 test: case CoS:Executed by:
| 6 | ||||||||||||||||||||||||
| 4543 | if (!parseChoiceSeq()
| 1-5 | ||||||||||||||||||||||||
| 4544 | parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4545 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 4546 | } | - | ||||||||||||||||||||||||
| 4547 | break; executed 5 times by 1 test: break;Executed by:
| 5 | ||||||||||||||||||||||||
| 4548 | case executed 120 times by 1 test: Ws2:case Ws2:Executed by:
executed 120 times by 1 test: case Ws2:Executed by:
| 120 | ||||||||||||||||||||||||
| 4549 | if (!next_eat_ws()
| 38-82 | ||||||||||||||||||||||||
| 4550 | parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4551 | return executed 38 times by 1 test: false;return false;Executed by:
executed 38 times by 1 test: return false;Executed by:
| 38 | ||||||||||||||||||||||||
| 4552 | } | - | ||||||||||||||||||||||||
| 4553 | break; executed 82 times by 1 test: break;Executed by:
| 82 | ||||||||||||||||||||||||
| 4554 | case executed 49 times by 1 test: More:case More:Executed by:
executed 49 times by 1 test: case More:Executed by:
| 49 | ||||||||||||||||||||||||
| 4555 | if (!next_eat_ws()
| 17-32 | ||||||||||||||||||||||||
| 4556 | parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4557 | return executed 17 times by 1 test: false;return false;Executed by:
executed 17 times by 1 test: return false;Executed by:
| 17 | ||||||||||||||||||||||||
| 4558 | } | - | ||||||||||||||||||||||||
| 4559 | break; executed 32 times by 1 test: break;Executed by:
| 32 | ||||||||||||||||||||||||
| 4560 | case executed 245 times by 1 test: Name:case Name:Executed by:
executed 245 times by 1 test: case Name:Executed by:
| 245 | ||||||||||||||||||||||||
| 4561 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 4562 | if (!parseName()
| 68-177 | ||||||||||||||||||||||||
| 4563 | parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); | - | ||||||||||||||||||||||||
| 4564 | return executed 68 times by 1 test: false;return false;Executed by:
executed 68 times by 1 test: return false;Executed by:
| 68 | ||||||||||||||||||||||||
| 4565 | } | - | ||||||||||||||||||||||||
| 4566 | break; executed 177 times by 1 test: break;Executed by:
| 177 | ||||||||||||||||||||||||
| 4567 | case executed 193 times by 1 test: Done:case Done:Executed by:
executed 193 times by 1 test: case Done:Executed by:
| 193 | ||||||||||||||||||||||||
| 4568 | next(); | - | ||||||||||||||||||||||||
| 4569 | break; executed 193 times by 1 test: break;Executed by:
| 193 | ||||||||||||||||||||||||
| 4570 | } | - | ||||||||||||||||||||||||
| 4571 | } executed 499 times by 1 test: end of blockExecuted by:
| 499 | ||||||||||||||||||||||||
| 4572 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4573 | } | - | ||||||||||||||||||||||||
| 4574 | - | |||||||||||||||||||||||||
| 4575 | bool QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge(QString *errorMessage) | - | ||||||||||||||||||||||||
| 4576 | { | - | ||||||||||||||||||||||||
| 4577 | QString entityNameBuffer; | - | ||||||||||||||||||||||||
| 4578 | - | |||||||||||||||||||||||||
| 4579 | - | |||||||||||||||||||||||||
| 4580 | for (QMap<QString,QString>::const_iterator toSearchIt = entities.constBegin(); | - | ||||||||||||||||||||||||
| 4581 | toSearchIt != entities.constEnd()
| 145-321 | ||||||||||||||||||||||||
| 4582 | ++toSearchIt) { | - | ||||||||||||||||||||||||
| 4583 | const QString &toSearch = toSearchIt.key(); | - | ||||||||||||||||||||||||
| 4584 | - | |||||||||||||||||||||||||
| 4585 | - | |||||||||||||||||||||||||
| 4586 | if (!literalEntitySizes.contains(toSearch)
| 55-90 | ||||||||||||||||||||||||
| 4587 | - | |||||||||||||||||||||||||
| 4588 | QString leftOvers = entities.value(toSearch); | - | ||||||||||||||||||||||||
| 4589 | - | |||||||||||||||||||||||||
| 4590 | for (QMap<QString,QString>::const_iterator referencedIt = entities.constBegin(); | - | ||||||||||||||||||||||||
| 4591 | referencedIt != entities.constEnd()
| 90-145 | ||||||||||||||||||||||||
| 4592 | ++referencedIt) { | - | ||||||||||||||||||||||||
| 4593 | const QString &entityName = referencedIt.key(); | - | ||||||||||||||||||||||||
| 4594 | - | |||||||||||||||||||||||||
| 4595 | for (int i = 0; i < leftOvers.size()
| 2-350 | ||||||||||||||||||||||||
| 4596 | entityNameBuffer = QLatin1Char('&') + entityName + QLatin1Char(';'); | - | ||||||||||||||||||||||||
| 4597 | - | |||||||||||||||||||||||||
| 4598 | i = leftOvers.indexOf(entityNameBuffer, i); | - | ||||||||||||||||||||||||
| 4599 | if (i != -1
| 64-143 | ||||||||||||||||||||||||
| 4600 | leftOvers.remove(i, entityName.size() + 2); | - | ||||||||||||||||||||||||
| 4601 | - | |||||||||||||||||||||||||
| 4602 | ++referencesToOtherEntities[toSearch][entityName]; | - | ||||||||||||||||||||||||
| 4603 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||
| 4604 | } executed 207 times by 1 test: end of blockExecuted by:
| 207 | ||||||||||||||||||||||||
| 4605 | } executed 145 times by 1 test: end of blockExecuted by:
| 145 | ||||||||||||||||||||||||
| 4606 | literalEntitySizes[toSearch] = leftOvers.size(); | - | ||||||||||||||||||||||||
| 4607 | } executed 90 times by 1 test: end of blockExecuted by:
| 90 | ||||||||||||||||||||||||
| 4608 | } executed 145 times by 1 test: end of blockExecuted by:
| 145 | ||||||||||||||||||||||||
| 4609 | - | |||||||||||||||||||||||||
| 4610 | for (QHash<QString, QHash<QString, int> >::const_iterator entityIt = referencesToOtherEntities.constBegin(); | - | ||||||||||||||||||||||||
| 4611 | entityIt != referencesToOtherEntities.constEnd()
| 1-320 | ||||||||||||||||||||||||
| 4612 | ++entityIt) { | - | ||||||||||||||||||||||||
| 4613 | const QString &entity = entityIt.key(); | - | ||||||||||||||||||||||||
| 4614 | - | |||||||||||||||||||||||||
| 4615 | QHash<QString, int>::iterator expandedIt = expandedSizes.find(entity); | - | ||||||||||||||||||||||||
| 4616 | if (expandedIt == expandedSizes.end()
| 0-1 | ||||||||||||||||||||||||
| 4617 | expandedIt = expandedSizes.insert(entity, literalEntitySizes.value(entity)); | - | ||||||||||||||||||||||||
| 4618 | for (QHash<QString, int>::const_iterator referenceIt = entityIt->constBegin(); | - | ||||||||||||||||||||||||
| 4619 | referenceIt != entityIt->constEnd()
| 1 | ||||||||||||||||||||||||
| 4620 | ++referenceIt) { | - | ||||||||||||||||||||||||
| 4621 | const QString &referenceTo = referenceIt.key(); | - | ||||||||||||||||||||||||
| 4622 | const int references = referencesToOtherEntities.value(entity).value(referenceTo); | - | ||||||||||||||||||||||||
| 4623 | - | |||||||||||||||||||||||||
| 4624 | *expandedIt += expandedSizes.value(referenceTo) * references + literalEntitySizes.value(referenceTo) * references; | - | ||||||||||||||||||||||||
| 4625 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 4626 | - | |||||||||||||||||||||||||
| 4627 | if (*
| 0-1 | ||||||||||||||||||||||||
| 4628 | if (errorMessage
| 0-1 | ||||||||||||||||||||||||
| 4629 | *errorMessage = QString::fromLatin1("The XML entity \"%1\" expands to a string that is too large to process (%2 characters > %3).") | - | ||||||||||||||||||||||||
| 4630 | .arg(entity, QString::number(*expandedIt), QString::number(entityCharacterLimit)); | - | ||||||||||||||||||||||||
| 4631 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 4632 | return executed 1 time by 1 test: true;return true;Executed by:
executed 1 time by 1 test: return true;Executed by:
| 1 | ||||||||||||||||||||||||
| 4633 | } | - | ||||||||||||||||||||||||
| 4634 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4635 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4636 | return executed 320 times by 1 test: false;return false;Executed by:
executed 320 times by 1 test: return false;Executed by:
| 320 | ||||||||||||||||||||||||
| 4637 | } | - | ||||||||||||||||||||||||
| 4638 | - | |||||||||||||||||||||||||
| 4639 | - | |||||||||||||||||||||||||
| 4640 | - | |||||||||||||||||||||||||
| 4641 | - | |||||||||||||||||||||||||
| 4642 | - | |||||||||||||||||||||||||
| 4643 | - | |||||||||||||||||||||||||
| 4644 | - | |||||||||||||||||||||||||
| 4645 | bool QXmlSimpleReaderPrivate::parseEntityDecl() | - | ||||||||||||||||||||||||
| 4646 | { | - | ||||||||||||||||||||||||
| 4647 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 4648 | const signed char Ent = 1; | - | ||||||||||||||||||||||||
| 4649 | const signed char Ws1 = 2; | - | ||||||||||||||||||||||||
| 4650 | const signed char Name = 3; | - | ||||||||||||||||||||||||
| 4651 | const signed char Ws2 = 4; | - | ||||||||||||||||||||||||
| 4652 | const signed char EValue = 5; | - | ||||||||||||||||||||||||
| 4653 | const signed char EValueR = 6; | - | ||||||||||||||||||||||||
| 4654 | const signed char ExtID = 7; | - | ||||||||||||||||||||||||
| 4655 | const signed char Ws3 = 8; | - | ||||||||||||||||||||||||
| 4656 | const signed char Ndata = 9; | - | ||||||||||||||||||||||||
| 4657 | const signed char Ws4 = 10; | - | ||||||||||||||||||||||||
| 4658 | const signed char NNam = 11; | - | ||||||||||||||||||||||||
| 4659 | const signed char NNamR = 12; | - | ||||||||||||||||||||||||
| 4660 | const signed char PEDec = 13; | - | ||||||||||||||||||||||||
| 4661 | const signed char Ws6 = 14; | - | ||||||||||||||||||||||||
| 4662 | const signed char PENam = 15; | - | ||||||||||||||||||||||||
| 4663 | const signed char Ws7 = 16; | - | ||||||||||||||||||||||||
| 4664 | const signed char PEVal = 17; | - | ||||||||||||||||||||||||
| 4665 | const signed char PEValR = 18; | - | ||||||||||||||||||||||||
| 4666 | const signed char PEEID = 19; | - | ||||||||||||||||||||||||
| 4667 | const signed char PEEIDR = 20; | - | ||||||||||||||||||||||||
| 4668 | const signed char WsE = 21; | - | ||||||||||||||||||||||||
| 4669 | const signed char Done = 22; | - | ||||||||||||||||||||||||
| 4670 | const signed char EDDone = 23; | - | ||||||||||||||||||||||||
| 4671 | - | |||||||||||||||||||||||||
| 4672 | const signed char InpWs = 0; | - | ||||||||||||||||||||||||
| 4673 | const signed char InpPer = 1; | - | ||||||||||||||||||||||||
| 4674 | const signed char InpQuot = 2; | - | ||||||||||||||||||||||||
| 4675 | const signed char InpGt = 3; | - | ||||||||||||||||||||||||
| 4676 | const signed char InpN = 4; | - | ||||||||||||||||||||||||
| 4677 | const signed char InpUnknown = 5; | - | ||||||||||||||||||||||||
| 4678 | - | |||||||||||||||||||||||||
| 4679 | static const signed char table[22][6] = { | - | ||||||||||||||||||||||||
| 4680 | - | |||||||||||||||||||||||||
| 4681 | { -1, -1, -1, -1, Ent, -1 }, | - | ||||||||||||||||||||||||
| 4682 | { Ws1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4683 | { -1, PEDec, -1, -1, Name, Name }, | - | ||||||||||||||||||||||||
| 4684 | { Ws2, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4685 | { -1, -1, EValue, -1, -1, ExtID }, | - | ||||||||||||||||||||||||
| 4686 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4687 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4688 | { Ws3, -1, -1, EDDone,-1, -1 }, | - | ||||||||||||||||||||||||
| 4689 | { -1, -1, -1, EDDone,Ndata, -1 }, | - | ||||||||||||||||||||||||
| 4690 | { Ws4, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4691 | { -1, -1, -1, -1, NNam, NNam }, | - | ||||||||||||||||||||||||
| 4692 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4693 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4694 | { Ws6, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4695 | { -1, -1, -1, -1, PENam, PENam }, | - | ||||||||||||||||||||||||
| 4696 | { Ws7, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4697 | { -1, -1, PEVal, -1, -1, PEEID }, | - | ||||||||||||||||||||||||
| 4698 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4699 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4700 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4701 | { WsE, -1, -1, Done, -1, -1 }, | - | ||||||||||||||||||||||||
| 4702 | { -1, -1, -1, Done, -1, -1 } | - | ||||||||||||||||||||||||
| 4703 | }; | - | ||||||||||||||||||||||||
| 4704 | signed char state; | - | ||||||||||||||||||||||||
| 4705 | signed char input; | - | ||||||||||||||||||||||||
| 4706 | - | |||||||||||||||||||||||||
| 4707 | if (parseStack==0
| 145-3893 | ||||||||||||||||||||||||
| 4708 | state = Init; | - | ||||||||||||||||||||||||
| 4709 | } executed 667 times by 2 tests: else {end of blockExecuted by:
| 667 | ||||||||||||||||||||||||
| 4710 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 4711 | - | |||||||||||||||||||||||||
| 4712 | - | |||||||||||||||||||||||||
| 4713 | - | |||||||||||||||||||||||||
| 4714 | if (!parseStack->isEmpty()
| 345-3026 | ||||||||||||||||||||||||
| 4715 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 4716 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 431-2595 | ||||||||||||||||||||||||
| 4717 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 4718 | - | |||||||||||||||||||||||||
| 4719 | - | |||||||||||||||||||||||||
| 4720 | - | |||||||||||||||||||||||||
| 4721 | } executed 431 times by 1 test: end of blockExecuted by:
| 431 | ||||||||||||||||||||||||
| 4722 | if (!(this->*function)()
| 1477-1549 | ||||||||||||||||||||||||
| 4723 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4724 | return executed 1549 times by 1 test: false;return false;Executed by:
executed 1549 times by 1 test: return false;Executed by:
| 1549 | ||||||||||||||||||||||||
| 4725 | } | - | ||||||||||||||||||||||||
| 4726 | } executed 1477 times by 1 test: end of blockExecuted by:
| 1477 | ||||||||||||||||||||||||
| 4727 | } executed 1822 times by 1 test: end of blockExecuted by:
| 1822 | ||||||||||||||||||||||||
| 4728 | - | |||||||||||||||||||||||||
| 4729 | for (;;) { | - | ||||||||||||||||||||||||
| 4730 | switch (state) { | - | ||||||||||||||||||||||||
| 4731 | case executed 341 times by 1 test: EValue:case EValue:Executed by:
executed 341 times by 1 test: case EValue:Executed by:
| 341 | ||||||||||||||||||||||||
| 4732 | if ( !entityExist(name())
| 20-321 | ||||||||||||||||||||||||
| 4733 | QString errorMessage; | - | ||||||||||||||||||||||||
| 4734 | if (isExpandedEntityValueTooLarge(&errorMessage)
| 1-320 | ||||||||||||||||||||||||
| 4735 | reportParseError(errorMessage); | - | ||||||||||||||||||||||||
| 4736 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 4737 | } | - | ||||||||||||||||||||||||
| 4738 | - | |||||||||||||||||||||||||
| 4739 | entities.insert(name(), string()); | - | ||||||||||||||||||||||||
| 4740 | if (declHnd
| 0-320 | ||||||||||||||||||||||||
| 4741 | if (!declHnd->internalEntityDecl(name(), string())
| 0-320 | ||||||||||||||||||||||||
| 4742 | reportParseError(declHnd->errorString()); | - | ||||||||||||||||||||||||
| 4743 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4744 | } | - | ||||||||||||||||||||||||
| 4745 | } executed 320 times by 1 test: end of blockExecuted by:
| 320 | ||||||||||||||||||||||||
| 4746 | } executed 320 times by 1 test: end of blockExecuted by:
| 320 | ||||||||||||||||||||||||
| 4747 | state = EValueR; | - | ||||||||||||||||||||||||
| 4748 | break; executed 340 times by 1 test: break;Executed by:
| 340 | ||||||||||||||||||||||||
| 4749 | case executed 12 times by 1 test: NNam:case NNam:Executed by:
executed 12 times by 1 test: case NNam:Executed by:
| 12 | ||||||||||||||||||||||||
| 4750 | if ( !entityExist(name())
| 0-12 | ||||||||||||||||||||||||
| 4751 | externEntities.insert(name(), QXmlSimpleReaderPrivate::ExternEntity(publicId, systemId, ref())); | - | ||||||||||||||||||||||||
| 4752 | if (dtdHnd
| 0-12 | ||||||||||||||||||||||||
| 4753 | if (!dtdHnd->unparsedEntityDecl(name(), publicId, systemId, ref())
| 0-12 | ||||||||||||||||||||||||
| 4754 | reportParseError(declHnd->errorString()); | - | ||||||||||||||||||||||||
| 4755 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4756 | } | - | ||||||||||||||||||||||||
| 4757 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 4758 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 4759 | state = NNamR; | - | ||||||||||||||||||||||||
| 4760 | break; executed 12 times by 1 test: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 4761 | case executed 69 times by 1 test: PEVal:case PEVal:Executed by:
executed 69 times by 1 test: case PEVal:Executed by:
| 69 | ||||||||||||||||||||||||
| 4762 | if ( !entityExist(name())
| 0-69 | ||||||||||||||||||||||||
| 4763 | parameterEntities.insert(name(), string()); | - | ||||||||||||||||||||||||
| 4764 | if (declHnd
| 0-69 | ||||||||||||||||||||||||
| 4765 | if (!declHnd->internalEntityDecl(QLatin1Char('%') + name(), string())
| 0-69 | ||||||||||||||||||||||||
| 4766 | reportParseError(declHnd->errorString()); | - | ||||||||||||||||||||||||
| 4767 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4768 | } | - | ||||||||||||||||||||||||
| 4769 | } executed 69 times by 1 test: end of blockExecuted by:
| 69 | ||||||||||||||||||||||||
| 4770 | } executed 69 times by 1 test: end of blockExecuted by:
| 69 | ||||||||||||||||||||||||
| 4771 | state = PEValR; | - | ||||||||||||||||||||||||
| 4772 | break; executed 69 times by 1 test: break;Executed by:
| 69 | ||||||||||||||||||||||||
| 4773 | case executed 62 times by 1 test: PEEID:case PEEID:Executed by:
executed 62 times by 1 test: case PEEID:Executed by:
| 62 | ||||||||||||||||||||||||
| 4774 | if ( !entityExist(name())
| 0-62 | ||||||||||||||||||||||||
| 4775 | externParameterEntities.insert(name(), QXmlSimpleReaderPrivate::ExternParameterEntity(publicId, systemId)); | - | ||||||||||||||||||||||||
| 4776 | if (declHnd
| 0-62 | ||||||||||||||||||||||||
| 4777 | if (!declHnd->externalEntityDecl(QLatin1Char('%') + name(), publicId, systemId)
| 0-62 | ||||||||||||||||||||||||
| 4778 | reportParseError(declHnd->errorString()); | - | ||||||||||||||||||||||||
| 4779 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4780 | } | - | ||||||||||||||||||||||||
| 4781 | } executed 62 times by 1 test: end of blockExecuted by:
| 62 | ||||||||||||||||||||||||
| 4782 | } executed 62 times by 1 test: end of blockExecuted by:
| 62 | ||||||||||||||||||||||||
| 4783 | state = PEEIDR; | - | ||||||||||||||||||||||||
| 4784 | break; executed 62 times by 1 test: break;Executed by:
| 62 | ||||||||||||||||||||||||
| 4785 | case executed 172 times by 2 tests: EDDone:case EDDone:Executed by:
executed 172 times by 2 tests: case EDDone:Executed by:
| 172 | ||||||||||||||||||||||||
| 4786 | if ( !entityExist(name())
| 0-172 | ||||||||||||||||||||||||
| 4787 | externEntities.insert(name(), QXmlSimpleReaderPrivate::ExternEntity(publicId, systemId, QString())); | - | ||||||||||||||||||||||||
| 4788 | if (declHnd
| 19-153 | ||||||||||||||||||||||||
| 4789 | if (!declHnd->externalEntityDecl(name(), publicId, systemId)
| 0-153 | ||||||||||||||||||||||||
| 4790 | reportParseError(declHnd->errorString()); | - | ||||||||||||||||||||||||
| 4791 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4792 | } | - | ||||||||||||||||||||||||
| 4793 | } executed 153 times by 1 test: end of blockExecuted by:
| 153 | ||||||||||||||||||||||||
| 4794 | } executed 172 times by 2 tests: end of blockExecuted by:
| 172 | ||||||||||||||||||||||||
| 4795 | return executed 172 times by 2 tests: true;return true;Executed by:
executed 172 times by 2 tests: return true;Executed by:
| 172 | ||||||||||||||||||||||||
| 4796 | case executed 480 times by 1 test: Done:case Done:Executed by:
executed 480 times by 1 test: case Done:Executed by:
| 480 | ||||||||||||||||||||||||
| 4797 | return executed 480 times by 1 test: true;return true;Executed by:
executed 480 times by 1 test: return true;Executed by:
| 480 | ||||||||||||||||||||||||
| 4798 | case executed 6 times by 1 test: -1:case -1:Executed by:
executed 6 times by 1 test: case -1:Executed by:
| 6 | ||||||||||||||||||||||||
| 4799 | - | |||||||||||||||||||||||||
| 4800 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 4801 | return executed 6 times by 1 test: false;return false;Executed by:
executed 6 times by 1 test: return false;Executed by:
| 6 | ||||||||||||||||||||||||
| 4802 | } | - | ||||||||||||||||||||||||
| 4803 | - | |||||||||||||||||||||||||
| 4804 | if (atEnd()
| 345-4302 | ||||||||||||||||||||||||
| 4805 | unexpectedEof(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4806 | return executed 345 times by 1 test: false;return false;Executed by:
executed 345 times by 1 test: return false;Executed by:
| 345 | ||||||||||||||||||||||||
| 4807 | } | - | ||||||||||||||||||||||||
| 4808 | if (is_S(c)
| 1490-2812 | ||||||||||||||||||||||||
| 4809 | input = InpWs; | - | ||||||||||||||||||||||||
| 4810 | } executed 1490 times by 2 tests: else if (c == QLatin1Char('%')end of blockExecuted by:
| 134-2678 | ||||||||||||||||||||||||
| 4811 | input = InpPer; | - | ||||||||||||||||||||||||
| 4812 | } executed 134 times by 1 test: else if (c == QLatin1Char('"')end of blockExecuted by:
| 1-2263 | ||||||||||||||||||||||||
| 4813 | input = InpQuot; | - | ||||||||||||||||||||||||
| 4814 | } executed 416 times by 1 test: else if (c == QLatin1Char('>')end of blockExecuted by:
| 416-1610 | ||||||||||||||||||||||||
| 4815 | input = InpGt; | - | ||||||||||||||||||||||||
| 4816 | } executed 652 times by 2 tests: else if (c == QLatin1Char('N')end of blockExecuted by:
| 652-928 | ||||||||||||||||||||||||
| 4817 | input = InpN; | - | ||||||||||||||||||||||||
| 4818 | } executed 682 times by 2 tests: else {end of blockExecuted by:
| 682 | ||||||||||||||||||||||||
| 4819 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 4820 | } executed 928 times by 2 tests: end of blockExecuted by:
| 928 | ||||||||||||||||||||||||
| 4821 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 4822 | - | |||||||||||||||||||||||||
| 4823 | switch (state) { | - | ||||||||||||||||||||||||
| 4824 | case executed 667 times by 2 tests: Ent:case Ent:Executed by:
executed 667 times by 2 tests: case Ent:Executed by:
| 667 | ||||||||||||||||||||||||
| 4825 | parseString_s = QLatin1String("NTITY"); | - | ||||||||||||||||||||||||
| 4826 | if (!parseString()
| 240-427 | ||||||||||||||||||||||||
| 4827 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4828 | return executed 427 times by 1 test: false;return false;Executed by:
executed 427 times by 1 test: return false;Executed by:
| 427 | ||||||||||||||||||||||||
| 4829 | } | - | ||||||||||||||||||||||||
| 4830 | break; executed 240 times by 2 tests: break;Executed by:
| 240 | ||||||||||||||||||||||||
| 4831 | case executed 666 times by 2 tests: Ws1:case Ws1:Executed by:
executed 666 times by 2 tests: case Ws1:Executed by:
| 666 | ||||||||||||||||||||||||
| 4832 | if (!eat_ws()
| 162-504 | ||||||||||||||||||||||||
| 4833 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4834 | return executed 162 times by 1 test: false;return false;Executed by:
executed 162 times by 1 test: return false;Executed by:
| 162 | ||||||||||||||||||||||||
| 4835 | } | - | ||||||||||||||||||||||||
| 4836 | break; executed 504 times by 2 tests: break;Executed by:
| 504 | ||||||||||||||||||||||||
| 4837 | case executed 533 times by 2 tests: Name:case Name:Executed by:
executed 533 times by 2 tests: case Name:Executed by:
| 533 | ||||||||||||||||||||||||
| 4838 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 4839 | if (!parseName()
| 145-388 | ||||||||||||||||||||||||
| 4840 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4841 | return executed 145 times by 1 test: false;return false;Executed by:
executed 145 times by 1 test: return false;Executed by:
| 145 | ||||||||||||||||||||||||
| 4842 | } | - | ||||||||||||||||||||||||
| 4843 | break; executed 388 times by 2 tests: break;Executed by:
| 388 | ||||||||||||||||||||||||
| 4844 | case executed 531 times by 2 tests: Ws2:case Ws2:Executed by:
executed 531 times by 2 tests: case Ws2:Executed by:
| 531 | ||||||||||||||||||||||||
| 4845 | if (!eat_ws()
| 164-367 | ||||||||||||||||||||||||
| 4846 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4847 | return executed 164 times by 1 test: false;return false;Executed by:
executed 164 times by 1 test: return false;Executed by:
| 164 | ||||||||||||||||||||||||
| 4848 | } | - | ||||||||||||||||||||||||
| 4849 | break; executed 367 times by 2 tests: break;Executed by:
| 367 | ||||||||||||||||||||||||
| 4850 | case executed 344 times by 1 test: EValue:case EValue:Executed by:
executed 344 times by 1 test: case EValue:Executed by:
| 344 | ||||||||||||||||||||||||
| 4851 | case never executed: EValueR:case EValueR:never executed: case EValueR: | 0 | ||||||||||||||||||||||||
| 4852 | if (!parseEntityValue()
| 137-207 | ||||||||||||||||||||||||
| 4853 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4854 | return executed 207 times by 1 test: false;return false;Executed by:
executed 207 times by 1 test: return false;Executed by:
| 207 | ||||||||||||||||||||||||
| 4855 | } | - | ||||||||||||||||||||||||
| 4856 | break; executed 137 times by 1 test: break;Executed by:
| 137 | ||||||||||||||||||||||||
| 4857 | case executed 187 times by 2 tests: ExtID:case ExtID:Executed by:
executed 187 times by 2 tests: case ExtID:Executed by:
| 187 | ||||||||||||||||||||||||
| 4858 | parseExternalID_allowPublicID = false; | - | ||||||||||||||||||||||||
| 4859 | if (!parseExternalID()
| 41-146 | ||||||||||||||||||||||||
| 4860 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4861 | return executed 146 times by 1 test: false;return false;Executed by:
executed 146 times by 1 test: return false;Executed by:
| 146 | ||||||||||||||||||||||||
| 4862 | } | - | ||||||||||||||||||||||||
| 4863 | break; executed 41 times by 2 tests: break;Executed by:
| 41 | ||||||||||||||||||||||||
| 4864 | case executed 12 times by 1 test: Ws3:case Ws3:Executed by:
executed 12 times by 1 test: case Ws3:Executed by:
| 12 | ||||||||||||||||||||||||
| 4865 | if (!eat_ws()
| 3-9 | ||||||||||||||||||||||||
| 4866 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4867 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 4868 | } | - | ||||||||||||||||||||||||
| 4869 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||
| 4870 | case executed 12 times by 1 test: Ndata:case Ndata:Executed by:
executed 12 times by 1 test: case Ndata:Executed by:
| 12 | ||||||||||||||||||||||||
| 4871 | parseString_s = QLatin1String("NDATA"); | - | ||||||||||||||||||||||||
| 4872 | if (!parseString()
| 6 | ||||||||||||||||||||||||
| 4873 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4874 | return executed 6 times by 1 test: false;return false;Executed by:
executed 6 times by 1 test: return false;Executed by:
| 6 | ||||||||||||||||||||||||
| 4875 | } | - | ||||||||||||||||||||||||
| 4876 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||
| 4877 | case executed 12 times by 1 test: Ws4:case Ws4:Executed by:
executed 12 times by 1 test: case Ws4:Executed by:
| 12 | ||||||||||||||||||||||||
| 4878 | if (!eat_ws()
| 4-8 | ||||||||||||||||||||||||
| 4879 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4880 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 4881 | } | - | ||||||||||||||||||||||||
| 4882 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||
| 4883 | case executed 12 times by 1 test: NNam:case NNam:Executed by:
executed 12 times by 1 test: case NNam:Executed by:
| 12 | ||||||||||||||||||||||||
| 4884 | case never executed: NNamR:case NNamR:never executed: case NNamR: | 0 | ||||||||||||||||||||||||
| 4885 | parseName_useRef = true; | - | ||||||||||||||||||||||||
| 4886 | if (!parseName()
| 2-10 | ||||||||||||||||||||||||
| 4887 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4888 | return executed 2 times by 1 test: false;return false;Executed by:
executed 2 times by 1 test: return false;Executed by:
| 2 | ||||||||||||||||||||||||
| 4889 | } | - | ||||||||||||||||||||||||
| 4890 | break; executed 10 times by 1 test: break;Executed by:
| 10 | ||||||||||||||||||||||||
| 4891 | case executed 133 times by 1 test: PEDec:case PEDec:Executed by:
executed 133 times by 1 test: case PEDec:Executed by:
| 133 | ||||||||||||||||||||||||
| 4892 | next(); | - | ||||||||||||||||||||||||
| 4893 | break; executed 133 times by 1 test: break;Executed by:
| 133 | ||||||||||||||||||||||||
| 4894 | case executed 133 times by 1 test: Ws6:case Ws6:Executed by:
executed 133 times by 1 test: case Ws6:Executed by:
| 133 | ||||||||||||||||||||||||
| 4895 | if (!eat_ws()
| 52-81 | ||||||||||||||||||||||||
| 4896 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4897 | return executed 52 times by 1 test: false;return false;Executed by:
executed 52 times by 1 test: return false;Executed by:
| 52 | ||||||||||||||||||||||||
| 4898 | } | - | ||||||||||||||||||||||||
| 4899 | break; executed 81 times by 1 test: break;Executed by:
| 81 | ||||||||||||||||||||||||
| 4900 | case executed 133 times by 1 test: PENam:case PENam:Executed by:
executed 133 times by 1 test: case PENam:Executed by:
| 133 | ||||||||||||||||||||||||
| 4901 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 4902 | if (!parseName()
| 18-115 | ||||||||||||||||||||||||
| 4903 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4904 | return executed 18 times by 1 test: false;return false;Executed by:
executed 18 times by 1 test: return false;Executed by:
| 18 | ||||||||||||||||||||||||
| 4905 | } | - | ||||||||||||||||||||||||
| 4906 | break; executed 115 times by 1 test: break;Executed by:
| 115 | ||||||||||||||||||||||||
| 4907 | case executed 133 times by 1 test: Ws7:case Ws7:Executed by:
executed 133 times by 1 test: case Ws7:Executed by:
| 133 | ||||||||||||||||||||||||
| 4908 | if (!eat_ws()
| 46-87 | ||||||||||||||||||||||||
| 4909 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4910 | return executed 46 times by 1 test: false;return false;Executed by:
executed 46 times by 1 test: return false;Executed by:
| 46 | ||||||||||||||||||||||||
| 4911 | } | - | ||||||||||||||||||||||||
| 4912 | break; executed 87 times by 1 test: break;Executed by:
| 87 | ||||||||||||||||||||||||
| 4913 | case executed 71 times by 1 test: PEVal:case PEVal:Executed by:
executed 71 times by 1 test: case PEVal:Executed by:
| 71 | ||||||||||||||||||||||||
| 4914 | case never executed: PEValR:case PEValR:never executed: case PEValR: | 0 | ||||||||||||||||||||||||
| 4915 | if (!parseEntityValue()
| 22-49 | ||||||||||||||||||||||||
| 4916 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4917 | return executed 49 times by 1 test: false;return false;Executed by:
executed 49 times by 1 test: return false;Executed by:
| 49 | ||||||||||||||||||||||||
| 4918 | } | - | ||||||||||||||||||||||||
| 4919 | break; executed 22 times by 1 test: break;Executed by:
| 22 | ||||||||||||||||||||||||
| 4920 | case executed 62 times by 1 test: PEEID:case PEEID:Executed by:
executed 62 times by 1 test: case PEEID:Executed by:
| 62 | ||||||||||||||||||||||||
| 4921 | case never executed: PEEIDR:case PEEIDR:never executed: case PEEIDR: | 0 | ||||||||||||||||||||||||
| 4922 | parseExternalID_allowPublicID = false; | - | ||||||||||||||||||||||||
| 4923 | if (!parseExternalID()
| 8-54 | ||||||||||||||||||||||||
| 4924 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4925 | return executed 54 times by 1 test: false;return false;Executed by:
executed 54 times by 1 test: return false;Executed by:
| 54 | ||||||||||||||||||||||||
| 4926 | } | - | ||||||||||||||||||||||||
| 4927 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||
| 4928 | case executed 3 times by 1 test: WsE:case WsE:Executed by:
executed 3 times by 1 test: case WsE:Executed by:
| 3 | ||||||||||||||||||||||||
| 4929 | if (!eat_ws()
| 0-3 | ||||||||||||||||||||||||
| 4930 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); | - | ||||||||||||||||||||||||
| 4931 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4932 | } | - | ||||||||||||||||||||||||
| 4933 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||
| 4934 | case executed 172 times by 2 tests: EDDone:case EDDone:Executed by:
executed 172 times by 2 tests: case EDDone:Executed by:
| 172 | ||||||||||||||||||||||||
| 4935 | next(); | - | ||||||||||||||||||||||||
| 4936 | break; executed 172 times by 2 tests: break;Executed by:
| 172 | ||||||||||||||||||||||||
| 4937 | case executed 480 times by 1 test: Done:case Done:Executed by:
executed 480 times by 1 test: case Done:Executed by:
| 480 | ||||||||||||||||||||||||
| 4938 | next(); | - | ||||||||||||||||||||||||
| 4939 | break; executed 480 times by 1 test: break;Executed by:
| 480 | ||||||||||||||||||||||||
| 4940 | } | - | ||||||||||||||||||||||||
| 4941 | } executed 2817 times by 2 tests: end of blockExecuted by:
| 2817 | ||||||||||||||||||||||||
| 4942 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 4943 | } | - | ||||||||||||||||||||||||
| 4944 | - | |||||||||||||||||||||||||
| 4945 | - | |||||||||||||||||||||||||
| 4946 | - | |||||||||||||||||||||||||
| 4947 | - | |||||||||||||||||||||||||
| 4948 | bool QXmlSimpleReaderPrivate::parseEntityValue() | - | ||||||||||||||||||||||||
| 4949 | { | - | ||||||||||||||||||||||||
| 4950 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 4951 | const signed char Dq = 1; | - | ||||||||||||||||||||||||
| 4952 | const signed char DqC = 2; | - | ||||||||||||||||||||||||
| 4953 | const signed char DqPER = 3; | - | ||||||||||||||||||||||||
| 4954 | const signed char DqRef = 4; | - | ||||||||||||||||||||||||
| 4955 | const signed char Sq = 5; | - | ||||||||||||||||||||||||
| 4956 | const signed char SqC = 6; | - | ||||||||||||||||||||||||
| 4957 | const signed char SqPER = 7; | - | ||||||||||||||||||||||||
| 4958 | const signed char SqRef = 8; | - | ||||||||||||||||||||||||
| 4959 | const signed char Done = 9; | - | ||||||||||||||||||||||||
| 4960 | - | |||||||||||||||||||||||||
| 4961 | const signed char InpDq = 0; | - | ||||||||||||||||||||||||
| 4962 | const signed char InpSq = 1; | - | ||||||||||||||||||||||||
| 4963 | const signed char InpAmp = 2; | - | ||||||||||||||||||||||||
| 4964 | const signed char InpPer = 3; | - | ||||||||||||||||||||||||
| 4965 | const signed char InpUnknown = 4; | - | ||||||||||||||||||||||||
| 4966 | - | |||||||||||||||||||||||||
| 4967 | static const signed char table[9][5] = { | - | ||||||||||||||||||||||||
| 4968 | - | |||||||||||||||||||||||||
| 4969 | { Dq, Sq, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 4970 | { Done, DqC, DqRef, DqPER, DqC }, | - | ||||||||||||||||||||||||
| 4971 | { Done, DqC, DqRef, DqPER, DqC }, | - | ||||||||||||||||||||||||
| 4972 | { Done, DqC, DqRef, DqPER, DqC }, | - | ||||||||||||||||||||||||
| 4973 | { Done, DqC, DqRef, DqPER, DqC }, | - | ||||||||||||||||||||||||
| 4974 | { SqC, Done, SqRef, SqPER, SqC }, | - | ||||||||||||||||||||||||
| 4975 | { SqC, Done, SqRef, SqPER, SqC }, | - | ||||||||||||||||||||||||
| 4976 | { SqC, Done, SqRef, SqPER, SqC }, | - | ||||||||||||||||||||||||
| 4977 | { SqC, Done, SqRef, SqPER, SqC } | - | ||||||||||||||||||||||||
| 4978 | }; | - | ||||||||||||||||||||||||
| 4979 | signed char state; | - | ||||||||||||||||||||||||
| 4980 | signed char input; | - | ||||||||||||||||||||||||
| 4981 | - | |||||||||||||||||||||||||
| 4982 | if (parseStack==0
| 91-957 | ||||||||||||||||||||||||
| 4983 | state = Init; | - | ||||||||||||||||||||||||
| 4984 | } executed 415 times by 1 test: else {end of blockExecuted by:
| 415 | ||||||||||||||||||||||||
| 4985 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 4986 | - | |||||||||||||||||||||||||
| 4987 | - | |||||||||||||||||||||||||
| 4988 | - | |||||||||||||||||||||||||
| 4989 | if (!parseStack->isEmpty()
| 172-461 | ||||||||||||||||||||||||
| 4990 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 4991 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0-172 | ||||||||||||||||||||||||
| 4992 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 4993 | - | |||||||||||||||||||||||||
| 4994 | - | |||||||||||||||||||||||||
| 4995 | - | |||||||||||||||||||||||||
| 4996 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 4997 | if (!(this->*function)()
| 60-112 | ||||||||||||||||||||||||
| 4998 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state); | - | ||||||||||||||||||||||||
| 4999 | return executed 60 times by 1 test: false;return false;Executed by:
executed 60 times by 1 test: return false;Executed by:
| 60 | ||||||||||||||||||||||||
| 5000 | } | - | ||||||||||||||||||||||||
| 5001 | } executed 112 times by 1 test: end of blockExecuted by:
| 112 | ||||||||||||||||||||||||
| 5002 | } executed 573 times by 1 test: end of blockExecuted by:
| 573 | ||||||||||||||||||||||||
| 5003 | - | |||||||||||||||||||||||||
| 5004 | for (;;) { | - | ||||||||||||||||||||||||
| 5005 | switch (state) { | - | ||||||||||||||||||||||||
| 5006 | case executed 410 times by 1 test: Done:case Done:Executed by:
executed 410 times by 1 test: case Done:Executed by:
| 410 | ||||||||||||||||||||||||
| 5007 | return executed 410 times by 1 test: true;return true;Executed by:
executed 410 times by 1 test: return true;Executed by:
| 410 | ||||||||||||||||||||||||
| 5008 | case never executed: -1:case -1:never executed: case -1: | 0 | ||||||||||||||||||||||||
| 5009 | - | |||||||||||||||||||||||||
| 5010 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 5011 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5012 | } | - | ||||||||||||||||||||||||
| 5013 | - | |||||||||||||||||||||||||
| 5014 | if (atEnd()
| 463-2711 | ||||||||||||||||||||||||
| 5015 | unexpectedEof(&QXmlSimpleReaderPrivate::parseEntityValue, state); | - | ||||||||||||||||||||||||
| 5016 | return executed 463 times by 1 test: false;return false;Executed by:
executed 463 times by 1 test: return false;Executed by:
| 463 | ||||||||||||||||||||||||
| 5017 | } | - | ||||||||||||||||||||||||
| 5018 | if (c == QLatin1Char('"')
| 824-1887 | ||||||||||||||||||||||||
| 5019 | input = InpDq; | - | ||||||||||||||||||||||||
| 5020 | } executed 824 times by 1 test: else if (c == QLatin1Char('\'')end of blockExecuted by:
| 10-1877 | ||||||||||||||||||||||||
| 5021 | input = InpSq; | - | ||||||||||||||||||||||||
| 5022 | } executed 10 times by 1 test: else if (c == QLatin1Char('&')end of blockExecuted by:
| 10-1535 | ||||||||||||||||||||||||
| 5023 | input = InpAmp; | - | ||||||||||||||||||||||||
| 5024 | } executed 342 times by 1 test: else if (c == QLatin1Char('%')end of blockExecuted by:
| 15-1520 | ||||||||||||||||||||||||
| 5025 | input = InpPer; | - | ||||||||||||||||||||||||
| 5026 | } executed 15 times by 1 test: else {end of blockExecuted by:
| 15 | ||||||||||||||||||||||||
| 5027 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5028 | } executed 1520 times by 1 test: end of blockExecuted by:
| 1520 | ||||||||||||||||||||||||
| 5029 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 5030 | - | |||||||||||||||||||||||||
| 5031 | switch (state) { | - | ||||||||||||||||||||||||
| 5032 | case executed 414 times by 1 test: Dq:case Dq:Executed by:
executed 414 times by 1 test: case Dq:Executed by:
| 414 | ||||||||||||||||||||||||
| 5033 | case executed 1 time by 1 test: Sq:case Sq:Executed by:
executed 1 time by 1 test: case Sq:Executed by:
| 1 | ||||||||||||||||||||||||
| 5034 | stringClear(); | - | ||||||||||||||||||||||||
| 5035 | next(); | - | ||||||||||||||||||||||||
| 5036 | break; executed 415 times by 1 test: break;Executed by:
| 415 | ||||||||||||||||||||||||
| 5037 | case executed 1528 times by 1 test: DqC:case DqC:Executed by:
executed 1528 times by 1 test: case DqC:Executed by:
| 1528 | ||||||||||||||||||||||||
| 5038 | case executed 1 time by 1 test: SqC:case SqC:Executed by:
executed 1 time by 1 test: case SqC:Executed by:
| 1 | ||||||||||||||||||||||||
| 5039 | stringAddC(); | - | ||||||||||||||||||||||||
| 5040 | next(); | - | ||||||||||||||||||||||||
| 5041 | break; executed 1529 times by 1 test: break;Executed by:
| 1529 | ||||||||||||||||||||||||
| 5042 | case executed 15 times by 1 test: DqPER:case DqPER:Executed by:
executed 15 times by 1 test: case DqPER:Executed by:
| 15 | ||||||||||||||||||||||||
| 5043 | case never executed: SqPER:case SqPER:never executed: case SqPER: | 0 | ||||||||||||||||||||||||
| 5044 | parsePEReference_context = InEntityValue; | - | ||||||||||||||||||||||||
| 5045 | if (!parsePEReference()
| 0-15 | ||||||||||||||||||||||||
| 5046 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state); | - | ||||||||||||||||||||||||
| 5047 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5048 | } | - | ||||||||||||||||||||||||
| 5049 | break; executed 15 times by 1 test: break;Executed by:
| 15 | ||||||||||||||||||||||||
| 5050 | case executed 342 times by 1 test: DqRef:case DqRef:Executed by:
executed 342 times by 1 test: case DqRef:Executed by:
| 342 | ||||||||||||||||||||||||
| 5051 | case never executed: SqRef:case SqRef:never executed: case SqRef: | 0 | ||||||||||||||||||||||||
| 5052 | parseReference_context = InEntityValue; | - | ||||||||||||||||||||||||
| 5053 | if (!parseReference()
| 115-227 | ||||||||||||||||||||||||
| 5054 | parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state); | - | ||||||||||||||||||||||||
| 5055 | return executed 115 times by 1 test: false;return false;Executed by:
executed 115 times by 1 test: return false;Executed by:
| 115 | ||||||||||||||||||||||||
| 5056 | } | - | ||||||||||||||||||||||||
| 5057 | break; executed 227 times by 1 test: break;Executed by:
| 227 | ||||||||||||||||||||||||
| 5058 | case executed 410 times by 1 test: Done:case Done:Executed by:
executed 410 times by 1 test: case Done:Executed by:
| 410 | ||||||||||||||||||||||||
| 5059 | next(); | - | ||||||||||||||||||||||||
| 5060 | break; executed 410 times by 1 test: break;Executed by:
| 410 | ||||||||||||||||||||||||
| 5061 | } | - | ||||||||||||||||||||||||
| 5062 | } executed 2596 times by 1 test: end of blockExecuted by:
| 2596 | ||||||||||||||||||||||||
| 5063 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5064 | } | - | ||||||||||||||||||||||||
| 5065 | bool QXmlSimpleReaderPrivate::parseComment() | - | ||||||||||||||||||||||||
| 5066 | { | - | ||||||||||||||||||||||||
| 5067 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 5068 | const signed char Dash1 = 1; | - | ||||||||||||||||||||||||
| 5069 | const signed char Dash2 = 2; | - | ||||||||||||||||||||||||
| 5070 | const signed char Com = 3; | - | ||||||||||||||||||||||||
| 5071 | const signed char Com2 = 4; | - | ||||||||||||||||||||||||
| 5072 | const signed char ComE = 5; | - | ||||||||||||||||||||||||
| 5073 | const signed char Done = 6; | - | ||||||||||||||||||||||||
| 5074 | - | |||||||||||||||||||||||||
| 5075 | const signed char InpDash = 0; | - | ||||||||||||||||||||||||
| 5076 | const signed char InpGt = 1; | - | ||||||||||||||||||||||||
| 5077 | const signed char InpUnknown = 2; | - | ||||||||||||||||||||||||
| 5078 | - | |||||||||||||||||||||||||
| 5079 | static const signed char table[6][3] = { | - | ||||||||||||||||||||||||
| 5080 | - | |||||||||||||||||||||||||
| 5081 | { Dash1, -1, -1 }, | - | ||||||||||||||||||||||||
| 5082 | { Dash2, -1, -1 }, | - | ||||||||||||||||||||||||
| 5083 | { Com2, Com, Com }, | - | ||||||||||||||||||||||||
| 5084 | { Com2, Com, Com }, | - | ||||||||||||||||||||||||
| 5085 | { ComE, Com, Com }, | - | ||||||||||||||||||||||||
| 5086 | { -1, Done, -1 } | - | ||||||||||||||||||||||||
| 5087 | }; | - | ||||||||||||||||||||||||
| 5088 | signed char state; | - | ||||||||||||||||||||||||
| 5089 | signed char input; | - | ||||||||||||||||||||||||
| 5090 | - | |||||||||||||||||||||||||
| 5091 | if (parseStack==0
| 63-527 | ||||||||||||||||||||||||
| 5092 | state = Init; | - | ||||||||||||||||||||||||
| 5093 | } executed 151 times by 2 tests: else {end of blockExecuted by:
| 151 | ||||||||||||||||||||||||
| 5094 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 5095 | - | |||||||||||||||||||||||||
| 5096 | - | |||||||||||||||||||||||||
| 5097 | - | |||||||||||||||||||||||||
| 5098 | if (!parseStack->isEmpty()
| 0-464 | ||||||||||||||||||||||||
| 5099 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 5100 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0 | ||||||||||||||||||||||||
| 5101 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 5102 | - | |||||||||||||||||||||||||
| 5103 | - | |||||||||||||||||||||||||
| 5104 | - | |||||||||||||||||||||||||
| 5105 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5106 | if (!(this->*function)()
| 0 | ||||||||||||||||||||||||
| 5107 | parseFailed(&QXmlSimpleReaderPrivate::parseComment, state); | - | ||||||||||||||||||||||||
| 5108 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5109 | } | - | ||||||||||||||||||||||||
| 5110 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5111 | } executed 464 times by 1 test: end of blockExecuted by:
| 464 | ||||||||||||||||||||||||
| 5112 | - | |||||||||||||||||||||||||
| 5113 | for (;;) { | - | ||||||||||||||||||||||||
| 5114 | switch (state) { | - | ||||||||||||||||||||||||
| 5115 | case executed 176 times by 2 tests: Dash2:case Dash2:Executed by:
executed 176 times by 2 tests: case Dash2:Executed by:
| 176 | ||||||||||||||||||||||||
| 5116 | stringClear(); | - | ||||||||||||||||||||||||
| 5117 | break; executed 176 times by 2 tests: break;Executed by:
| 176 | ||||||||||||||||||||||||
| 5118 | case executed 234 times by 2 tests: Com2:case Com2:Executed by:
executed 234 times by 2 tests: case Com2:Executed by:
| 234 | ||||||||||||||||||||||||
| 5119 | - | |||||||||||||||||||||||||
| 5120 | if (!atEnd()
| 30-204 | ||||||||||||||||||||||||
| 5121 | stringAddC(QLatin1Char('-')); executed 56 times by 2 tests: stringAddC(QLatin1Char('-'));Executed by:
| 56 | ||||||||||||||||||||||||
| 5122 | break; executed 234 times by 2 tests: break;Executed by:
| 234 | ||||||||||||||||||||||||
| 5123 | case executed 146 times by 2 tests: Done:case Done:Executed by:
executed 146 times by 2 tests: case Done:Executed by:
| 146 | ||||||||||||||||||||||||
| 5124 | return executed 146 times by 2 tests: true;return true;Executed by:
executed 146 times by 2 tests: return true;Executed by:
| 146 | ||||||||||||||||||||||||
| 5125 | case executed 3 times by 1 test: -1:case -1:Executed by:
executed 3 times by 1 test: case -1:Executed by:
| 3 | ||||||||||||||||||||||||
| 5126 | - | |||||||||||||||||||||||||
| 5127 | reportParseError(QLatin1String("error occurred while parsing comment")); | - | ||||||||||||||||||||||||
| 5128 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 5129 | } | - | ||||||||||||||||||||||||
| 5130 | - | |||||||||||||||||||||||||
| 5131 | if (atEnd()
| 466-10856 | ||||||||||||||||||||||||
| 5132 | unexpectedEof(&QXmlSimpleReaderPrivate::parseComment, state); | - | ||||||||||||||||||||||||
| 5133 | return executed 466 times by 1 test: false;return false;Executed by:
executed 466 times by 1 test: return false;Executed by:
| 466 | ||||||||||||||||||||||||
| 5134 | } | - | ||||||||||||||||||||||||
| 5135 | if (c == QLatin1Char('-')
| 653-10203 | ||||||||||||||||||||||||
| 5136 | input = InpDash; | - | ||||||||||||||||||||||||
| 5137 | } executed 653 times by 2 tests: else if (c == QLatin1Char('>')end of blockExecuted by:
| 159-10044 | ||||||||||||||||||||||||
| 5138 | input = InpGt; | - | ||||||||||||||||||||||||
| 5139 | } executed 159 times by 2 tests: else {end of blockExecuted by:
| 159 | ||||||||||||||||||||||||
| 5140 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5141 | } executed 10044 times by 2 tests: end of blockExecuted by:
| 10044 | ||||||||||||||||||||||||
| 5142 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 5143 | - | |||||||||||||||||||||||||
| 5144 | switch (state) { | - | ||||||||||||||||||||||||
| 5145 | case executed 150 times by 2 tests: Dash1:case Dash1:Executed by:
executed 150 times by 2 tests: case Dash1:Executed by:
| 150 | ||||||||||||||||||||||||
| 5146 | next(); | - | ||||||||||||||||||||||||
| 5147 | break; executed 150 times by 2 tests: break;Executed by:
| 150 | ||||||||||||||||||||||||
| 5148 | case executed 150 times by 2 tests: Dash2:case Dash2:Executed by:
executed 150 times by 2 tests: case Dash2:Executed by:
| 150 | ||||||||||||||||||||||||
| 5149 | next(); | - | ||||||||||||||||||||||||
| 5150 | break; executed 150 times by 2 tests: break;Executed by:
| 150 | ||||||||||||||||||||||||
| 5151 | case executed 10055 times by 2 tests: Com:case Com:Executed by:
executed 10055 times by 2 tests: case Com:Executed by:
| 10055 | ||||||||||||||||||||||||
| 5152 | stringAddC(); | - | ||||||||||||||||||||||||
| 5153 | next(); | - | ||||||||||||||||||||||||
| 5154 | break; executed 10055 times by 2 tests: break;Executed by:
| 10055 | ||||||||||||||||||||||||
| 5155 | case executed 204 times by 2 tests: Com2:case Com2:Executed by:
executed 204 times by 2 tests: case Com2:Executed by:
| 204 | ||||||||||||||||||||||||
| 5156 | next(); | - | ||||||||||||||||||||||||
| 5157 | break; executed 204 times by 2 tests: break;Executed by:
| 204 | ||||||||||||||||||||||||
| 5158 | case executed 148 times by 2 tests: ComE:case ComE:Executed by:
executed 148 times by 2 tests: case ComE:Executed by:
| 148 | ||||||||||||||||||||||||
| 5159 | next(); | - | ||||||||||||||||||||||||
| 5160 | break; executed 148 times by 2 tests: break;Executed by:
| 148 | ||||||||||||||||||||||||
| 5161 | case executed 146 times by 2 tests: Done:case Done:Executed by:
executed 146 times by 2 tests: case Done:Executed by:
| 146 | ||||||||||||||||||||||||
| 5162 | next(); | - | ||||||||||||||||||||||||
| 5163 | break; executed 146 times by 2 tests: break;Executed by:
| 146 | ||||||||||||||||||||||||
| 5164 | } | - | ||||||||||||||||||||||||
| 5165 | } executed 10856 times by 2 tests: end of blockExecuted by:
| 10856 | ||||||||||||||||||||||||
| 5166 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5167 | } | - | ||||||||||||||||||||||||
| 5168 | bool QXmlSimpleReaderPrivate::parseAttribute() | - | ||||||||||||||||||||||||
| 5169 | { | - | ||||||||||||||||||||||||
| 5170 | const int Init = 0; | - | ||||||||||||||||||||||||
| 5171 | const int PName = 1; | - | ||||||||||||||||||||||||
| 5172 | const int Ws = 2; | - | ||||||||||||||||||||||||
| 5173 | const int Eq = 3; | - | ||||||||||||||||||||||||
| 5174 | const int Quotes = 4; | - | ||||||||||||||||||||||||
| 5175 | - | |||||||||||||||||||||||||
| 5176 | const int InpNameBe = 0; | - | ||||||||||||||||||||||||
| 5177 | const int InpEq = 1; | - | ||||||||||||||||||||||||
| 5178 | const int InpDq = 2; | - | ||||||||||||||||||||||||
| 5179 | const int InpSq = 3; | - | ||||||||||||||||||||||||
| 5180 | const int InpUnknown = 4; | - | ||||||||||||||||||||||||
| 5181 | - | |||||||||||||||||||||||||
| 5182 | static const int table[4][5] = { | - | ||||||||||||||||||||||||
| 5183 | - | |||||||||||||||||||||||||
| 5184 | { PName, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 5185 | { -1, Eq, -1, -1, Ws }, | - | ||||||||||||||||||||||||
| 5186 | { -1, Eq, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 5187 | { -1, -1, Quotes, Quotes, -1 } | - | ||||||||||||||||||||||||
| 5188 | }; | - | ||||||||||||||||||||||||
| 5189 | int state; | - | ||||||||||||||||||||||||
| 5190 | int input; | - | ||||||||||||||||||||||||
| 5191 | - | |||||||||||||||||||||||||
| 5192 | if (parseStack==0
| 549-12597 | ||||||||||||||||||||||||
| 5193 | state = Init; | - | ||||||||||||||||||||||||
| 5194 | } executed 13146 times by 6 tests: else {end of blockExecuted by:
| 13146 | ||||||||||||||||||||||||
| 5195 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 5196 | - | |||||||||||||||||||||||||
| 5197 | - | |||||||||||||||||||||||||
| 5198 | - | |||||||||||||||||||||||||
| 5199 | if (!parseStack->isEmpty()
| 0-1897 | ||||||||||||||||||||||||
| 5200 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 5201 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 158-1739 | ||||||||||||||||||||||||
| 5202 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 5203 | - | |||||||||||||||||||||||||
| 5204 | - | |||||||||||||||||||||||||
| 5205 | - | |||||||||||||||||||||||||
| 5206 | } executed 158 times by 1 test: end of blockExecuted by:
| 158 | ||||||||||||||||||||||||
| 5207 | if (!(this->*function)()
| 933-964 | ||||||||||||||||||||||||
| 5208 | parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); | - | ||||||||||||||||||||||||
| 5209 | return executed 933 times by 1 test: false;return false;Executed by:
executed 933 times by 1 test: return false;Executed by:
| 933 | ||||||||||||||||||||||||
| 5210 | } | - | ||||||||||||||||||||||||
| 5211 | } executed 964 times by 1 test: end of blockExecuted by:
| 964 | ||||||||||||||||||||||||
| 5212 | } executed 964 times by 1 test: end of blockExecuted by:
| 964 | ||||||||||||||||||||||||
| 5213 | - | |||||||||||||||||||||||||
| 5214 | for (;;) { | - | ||||||||||||||||||||||||
| 5215 | switch (state) { | - | ||||||||||||||||||||||||
| 5216 | case executed 13130 times by 6 tests: Quotes:case Quotes:Executed by:
executed 13130 times by 6 tests: case Quotes:Executed by:
| 13130 | ||||||||||||||||||||||||
| 5217 | - | |||||||||||||||||||||||||
| 5218 | return executed 13130 times by 6 tests: true;return true;Executed by:
executed 13130 times by 6 tests: return true;Executed by:
| 13130 | ||||||||||||||||||||||||
| 5219 | case executed 3 times by 1 test: -1:case -1:Executed by:
executed 3 times by 1 test: case -1:Executed by:
| 3 | ||||||||||||||||||||||||
| 5220 | - | |||||||||||||||||||||||||
| 5221 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 5222 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 5223 | } | - | ||||||||||||||||||||||||
| 5224 | - | |||||||||||||||||||||||||
| 5225 | if (atEnd()
| 0-39458 | ||||||||||||||||||||||||
| 5226 | unexpectedEof(&QXmlSimpleReaderPrivate::parseAttribute, state); | - | ||||||||||||||||||||||||
| 5227 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5228 | } | - | ||||||||||||||||||||||||
| 5229 | if (determineNameChar(c) == NameBeginning
| 13147-26311 | ||||||||||||||||||||||||
| 5230 | input = InpNameBe; | - | ||||||||||||||||||||||||
| 5231 | } executed 13147 times by 6 tests: else if (c == QLatin1Char('=')end of blockExecuted by:
| 13145-13166 | ||||||||||||||||||||||||
| 5232 | input = InpEq; | - | ||||||||||||||||||||||||
| 5233 | } executed 13145 times by 6 tests: else if (c == QLatin1Char('"')end of blockExecuted by:
| 100-13145 | ||||||||||||||||||||||||
| 5234 | input = InpDq; | - | ||||||||||||||||||||||||
| 5235 | } executed 13066 times by 5 tests: else if (c == QLatin1Char('\'')end of blockExecuted by:
| 23-13066 | ||||||||||||||||||||||||
| 5236 | input = InpSq; | - | ||||||||||||||||||||||||
| 5237 | } executed 77 times by 3 tests: else {end of blockExecuted by:
| 77 | ||||||||||||||||||||||||
| 5238 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5239 | } executed 23 times by 1 test: end of blockExecuted by:
| 23 | ||||||||||||||||||||||||
| 5240 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 5241 | - | |||||||||||||||||||||||||
| 5242 | switch (state) { | - | ||||||||||||||||||||||||
| 5243 | case executed 13146 times by 6 tests: PName:case PName:Executed by:
executed 13146 times by 6 tests: case PName:Executed by:
| 13146 | ||||||||||||||||||||||||
| 5244 | parseName_useRef = false; | - | ||||||||||||||||||||||||
| 5245 | if (!parseName()
| 362-12784 | ||||||||||||||||||||||||
| 5246 | parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); | - | ||||||||||||||||||||||||
| 5247 | return executed 362 times by 1 test: false;return false;Executed by:
executed 362 times by 1 test: return false;Executed by:
| 362 | ||||||||||||||||||||||||
| 5248 | } | - | ||||||||||||||||||||||||
| 5249 | break; executed 12784 times by 6 tests: break;Executed by:
| 12784 | ||||||||||||||||||||||||
| 5250 | case executed 21 times by 1 test: Ws:case Ws:Executed by:
executed 21 times by 1 test: case Ws:Executed by:
| 21 | ||||||||||||||||||||||||
| 5251 | if (!eat_ws()
| 4-17 | ||||||||||||||||||||||||
| 5252 | parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); | - | ||||||||||||||||||||||||
| 5253 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 5254 | } | - | ||||||||||||||||||||||||
| 5255 | break; executed 17 times by 1 test: break;Executed by:
| 17 | ||||||||||||||||||||||||
| 5256 | case executed 13145 times by 6 tests: Eq:case Eq:Executed by:
executed 13145 times by 6 tests: case Eq:Executed by:
| 13145 | ||||||||||||||||||||||||
| 5257 | if (!next_eat_ws()
| 152-12993 | ||||||||||||||||||||||||
| 5258 | parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); | - | ||||||||||||||||||||||||
| 5259 | return executed 152 times by 1 test: false;return false;Executed by:
executed 152 times by 1 test: return false;Executed by:
| 152 | ||||||||||||||||||||||||
| 5260 | } | - | ||||||||||||||||||||||||
| 5261 | break; executed 12993 times by 6 tests: break;Executed by:
| 12993 | ||||||||||||||||||||||||
| 5262 | case executed 13143 times by 6 tests: Quotes:case Quotes:Executed by:
executed 13143 times by 6 tests: case Quotes:Executed by:
| 13143 | ||||||||||||||||||||||||
| 5263 | if (!parseAttValue()
| 459-12684 | ||||||||||||||||||||||||
| 5264 | parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); | - | ||||||||||||||||||||||||
| 5265 | return executed 459 times by 1 test: false;return false;Executed by:
executed 459 times by 1 test: return false;Executed by:
| 459 | ||||||||||||||||||||||||
| 5266 | } | - | ||||||||||||||||||||||||
| 5267 | break; executed 12684 times by 6 tests: break;Executed by:
| 12684 | ||||||||||||||||||||||||
| 5268 | } | - | ||||||||||||||||||||||||
| 5269 | } executed 38481 times by 6 tests: end of blockExecuted by:
| 38481 | ||||||||||||||||||||||||
| 5270 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5271 | } | - | ||||||||||||||||||||||||
| 5272 | - | |||||||||||||||||||||||||
| 5273 | - | |||||||||||||||||||||||||
| 5274 | - | |||||||||||||||||||||||||
| 5275 | - | |||||||||||||||||||||||||
| 5276 | bool QXmlSimpleReaderPrivate::parseName() | - | ||||||||||||||||||||||||
| 5277 | { | - | ||||||||||||||||||||||||
| 5278 | const int Init = 0; | - | ||||||||||||||||||||||||
| 5279 | const int Name1 = 1; | - | ||||||||||||||||||||||||
| 5280 | const int Name = 2; | - | ||||||||||||||||||||||||
| 5281 | const int Done = 3; | - | ||||||||||||||||||||||||
| 5282 | - | |||||||||||||||||||||||||
| 5283 | static const int table[3][3] = { | - | ||||||||||||||||||||||||
| 5284 | - | |||||||||||||||||||||||||
| 5285 | { Name1, -1, -1 }, | - | ||||||||||||||||||||||||
| 5286 | { Name, Name, Done }, | - | ||||||||||||||||||||||||
| 5287 | { Name, Name, Done } | - | ||||||||||||||||||||||||
| 5288 | }; | - | ||||||||||||||||||||||||
| 5289 | int state; | - | ||||||||||||||||||||||||
| 5290 | - | |||||||||||||||||||||||||
| 5291 | if (parseStack==0
| 8415-21597 | ||||||||||||||||||||||||
| 5292 | state = Init; | - | ||||||||||||||||||||||||
| 5293 | } executed 31355 times by 6 tests: else {end of blockExecuted by:
| 31355 | ||||||||||||||||||||||||
| 5294 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 5295 | - | |||||||||||||||||||||||||
| 5296 | - | |||||||||||||||||||||||||
| 5297 | - | |||||||||||||||||||||||||
| 5298 | if (!parseStack->isEmpty()
| 0-8415 | ||||||||||||||||||||||||
| 5299 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 5300 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0 | ||||||||||||||||||||||||
| 5301 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 5302 | - | |||||||||||||||||||||||||
| 5303 | - | |||||||||||||||||||||||||
| 5304 | - | |||||||||||||||||||||||||
| 5305 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5306 | if (!(this->*function)()
| 0 | ||||||||||||||||||||||||
| 5307 | parseFailed(&QXmlSimpleReaderPrivate::parseName, state); | - | ||||||||||||||||||||||||
| 5308 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5309 | } | - | ||||||||||||||||||||||||
| 5310 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5311 | } executed 8415 times by 1 test: end of blockExecuted by:
| 8415 | ||||||||||||||||||||||||
| 5312 | - | |||||||||||||||||||||||||
| 5313 | for (;;) { | - | ||||||||||||||||||||||||
| 5314 | switch (state) { | - | ||||||||||||||||||||||||
| 5315 | case executed 31340 times by 6 tests: Done:case Done:Executed by:
executed 31340 times by 6 tests: case Done:Executed by:
| 31340 | ||||||||||||||||||||||||
| 5316 | return executed 31340 times by 6 tests: true;return true;Executed by:
executed 31340 times by 6 tests: return true;Executed by:
| 31340 | ||||||||||||||||||||||||
| 5317 | case executed 15 times by 1 test: -1:case -1:Executed by:
executed 15 times by 1 test: case -1:Executed by:
| 15 | ||||||||||||||||||||||||
| 5318 | - | |||||||||||||||||||||||||
| 5319 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 5320 | return executed 15 times by 1 test: false;return false;Executed by:
executed 15 times by 1 test: return false;Executed by:
| 15 | ||||||||||||||||||||||||
| 5321 | } | - | ||||||||||||||||||||||||
| 5322 | - | |||||||||||||||||||||||||
| 5323 | if (atEnd()
| 8415-160573 | ||||||||||||||||||||||||
| 5324 | unexpectedEof(&QXmlSimpleReaderPrivate::parseName, state); | - | ||||||||||||||||||||||||
| 5325 | return executed 8415 times by 1 test: false;return false;Executed by:
executed 8415 times by 1 test: return false;Executed by:
| 8415 | ||||||||||||||||||||||||
| 5326 | } | - | ||||||||||||||||||||||||
| 5327 | - | |||||||||||||||||||||||||
| 5328 | - | |||||||||||||||||||||||||
| 5329 | state = table[state][(int)fastDetermineNameChar(c)]; | - | ||||||||||||||||||||||||
| 5330 | - | |||||||||||||||||||||||||
| 5331 | switch (state) { | - | ||||||||||||||||||||||||
| 5332 | case executed 31340 times by 6 tests: Name1:case Name1:Executed by:
executed 31340 times by 6 tests: case Name1:Executed by:
| 31340 | ||||||||||||||||||||||||
| 5333 | if (parseName_useRef
| 1343-29997 | ||||||||||||||||||||||||
| 5334 | refClear(); | - | ||||||||||||||||||||||||
| 5335 | refAddC(); | - | ||||||||||||||||||||||||
| 5336 | } executed 1343 times by 3 tests: else {end of blockExecuted by:
| 1343 | ||||||||||||||||||||||||
| 5337 | nameClear(); | - | ||||||||||||||||||||||||
| 5338 | nameAddC(); | - | ||||||||||||||||||||||||
| 5339 | } executed 29997 times by 6 tests: end of blockExecuted by:
| 29997 | ||||||||||||||||||||||||
| 5340 | next(); | - | ||||||||||||||||||||||||
| 5341 | break; executed 31340 times by 6 tests: break;Executed by:
| 31340 | ||||||||||||||||||||||||
| 5342 | case executed 97878 times by 6 tests: Name:case Name:Executed by:
executed 97878 times by 6 tests: case Name:Executed by:
| 97878 | ||||||||||||||||||||||||
| 5343 | if (parseName_useRef
| 1538-96340 | ||||||||||||||||||||||||
| 5344 | refAddC(); | - | ||||||||||||||||||||||||
| 5345 | } executed 1538 times by 3 tests: else {end of blockExecuted by:
| 1538 | ||||||||||||||||||||||||
| 5346 | nameAddC(); | - | ||||||||||||||||||||||||
| 5347 | } executed 96340 times by 6 tests: end of blockExecuted by:
| 96340 | ||||||||||||||||||||||||
| 5348 | next(); | - | ||||||||||||||||||||||||
| 5349 | break; executed 97878 times by 6 tests: break;Executed by:
| 97878 | ||||||||||||||||||||||||
| 5350 | } | - | ||||||||||||||||||||||||
| 5351 | } executed 160573 times by 6 tests: end of blockExecuted by:
| 160573 | ||||||||||||||||||||||||
| 5352 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5353 | } | - | ||||||||||||||||||||||||
| 5354 | - | |||||||||||||||||||||||||
| 5355 | - | |||||||||||||||||||||||||
| 5356 | - | |||||||||||||||||||||||||
| 5357 | - | |||||||||||||||||||||||||
| 5358 | bool QXmlSimpleReaderPrivate::parseNmtoken() | - | ||||||||||||||||||||||||
| 5359 | { | - | ||||||||||||||||||||||||
| 5360 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 5361 | const signed char NameF = 1; | - | ||||||||||||||||||||||||
| 5362 | const signed char Name = 2; | - | ||||||||||||||||||||||||
| 5363 | const signed char Done = 3; | - | ||||||||||||||||||||||||
| 5364 | - | |||||||||||||||||||||||||
| 5365 | const signed char InpNameCh = 0; | - | ||||||||||||||||||||||||
| 5366 | const signed char InpUnknown = 1; | - | ||||||||||||||||||||||||
| 5367 | - | |||||||||||||||||||||||||
| 5368 | static const signed char table[3][2] = { | - | ||||||||||||||||||||||||
| 5369 | - | |||||||||||||||||||||||||
| 5370 | { NameF, -1 }, | - | ||||||||||||||||||||||||
| 5371 | { Name, Done }, | - | ||||||||||||||||||||||||
| 5372 | { Name, Done } | - | ||||||||||||||||||||||||
| 5373 | }; | - | ||||||||||||||||||||||||
| 5374 | signed char state; | - | ||||||||||||||||||||||||
| 5375 | signed char input; | - | ||||||||||||||||||||||||
| 5376 | - | |||||||||||||||||||||||||
| 5377 | if (parseStack==0
| 5-23 | ||||||||||||||||||||||||
| 5378 | state = Init; | - | ||||||||||||||||||||||||
| 5379 | } executed 24 times by 1 test: else {end of blockExecuted by:
| 24 | ||||||||||||||||||||||||
| 5380 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 5381 | - | |||||||||||||||||||||||||
| 5382 | - | |||||||||||||||||||||||||
| 5383 | - | |||||||||||||||||||||||||
| 5384 | if (!parseStack->isEmpty()
| 0-5 | ||||||||||||||||||||||||
| 5385 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 5386 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0 | ||||||||||||||||||||||||
| 5387 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 5388 | - | |||||||||||||||||||||||||
| 5389 | - | |||||||||||||||||||||||||
| 5390 | - | |||||||||||||||||||||||||
| 5391 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5392 | if (!(this->*function)()
| 0 | ||||||||||||||||||||||||
| 5393 | parseFailed(&QXmlSimpleReaderPrivate::parseNmtoken, state); | - | ||||||||||||||||||||||||
| 5394 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5395 | } | - | ||||||||||||||||||||||||
| 5396 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5397 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||
| 5398 | - | |||||||||||||||||||||||||
| 5399 | for (;;) { | - | ||||||||||||||||||||||||
| 5400 | switch (state) { | - | ||||||||||||||||||||||||
| 5401 | case executed 24 times by 1 test: Done:case Done:Executed by:
executed 24 times by 1 test: case Done:Executed by:
| 24 | ||||||||||||||||||||||||
| 5402 | return executed 24 times by 1 test: true;return true;Executed by:
executed 24 times by 1 test: return true;Executed by:
| 24 | ||||||||||||||||||||||||
| 5403 | case never executed: -1:case -1:never executed: case -1: | 0 | ||||||||||||||||||||||||
| 5404 | - | |||||||||||||||||||||||||
| 5405 | reportParseError(QLatin1String("letter is expected")); | - | ||||||||||||||||||||||||
| 5406 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5407 | } | - | ||||||||||||||||||||||||
| 5408 | - | |||||||||||||||||||||||||
| 5409 | if (atEnd()
| 5-56 | ||||||||||||||||||||||||
| 5410 | unexpectedEof(&QXmlSimpleReaderPrivate::parseNmtoken, state); | - | ||||||||||||||||||||||||
| 5411 | return executed 5 times by 1 test: false;return false;Executed by:
executed 5 times by 1 test: return false;Executed by:
| 5 | ||||||||||||||||||||||||
| 5412 | } | - | ||||||||||||||||||||||||
| 5413 | if (determineNameChar(c) == NotName
| 24-32 | ||||||||||||||||||||||||
| 5414 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5415 | } executed 24 times by 1 test: else {end of blockExecuted by:
| 24 | ||||||||||||||||||||||||
| 5416 | input = InpNameCh; | - | ||||||||||||||||||||||||
| 5417 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||
| 5418 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 5419 | - | |||||||||||||||||||||||||
| 5420 | switch (state) { | - | ||||||||||||||||||||||||
| 5421 | case executed 24 times by 1 test: NameF:case NameF:Executed by:
executed 24 times by 1 test: case NameF:Executed by:
| 24 | ||||||||||||||||||||||||
| 5422 | nameClear(); | - | ||||||||||||||||||||||||
| 5423 | nameAddC(); | - | ||||||||||||||||||||||||
| 5424 | next(); | - | ||||||||||||||||||||||||
| 5425 | break; executed 24 times by 1 test: break;Executed by:
| 24 | ||||||||||||||||||||||||
| 5426 | case executed 8 times by 1 test: Name:case Name:Executed by:
executed 8 times by 1 test: case Name:Executed by:
| 8 | ||||||||||||||||||||||||
| 5427 | nameAddC(); | - | ||||||||||||||||||||||||
| 5428 | next(); | - | ||||||||||||||||||||||||
| 5429 | break; executed 8 times by 1 test: break;Executed by:
| 8 | ||||||||||||||||||||||||
| 5430 | } | - | ||||||||||||||||||||||||
| 5431 | } executed 56 times by 1 test: end of blockExecuted by:
| 56 | ||||||||||||||||||||||||
| 5432 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5433 | } | - | ||||||||||||||||||||||||
| 5434 | bool QXmlSimpleReaderPrivate::parseReference() | - | ||||||||||||||||||||||||
| 5435 | { | - | ||||||||||||||||||||||||
| 5436 | - | |||||||||||||||||||||||||
| 5437 | - | |||||||||||||||||||||||||
| 5438 | uint tmp; | - | ||||||||||||||||||||||||
| 5439 | bool ok; | - | ||||||||||||||||||||||||
| 5440 | - | |||||||||||||||||||||||||
| 5441 | const signed char Init = 0; | - | ||||||||||||||||||||||||
| 5442 | const signed char SRef = 1; | - | ||||||||||||||||||||||||
| 5443 | const signed char ChRef = 2; | - | ||||||||||||||||||||||||
| 5444 | const signed char ChDec = 3; | - | ||||||||||||||||||||||||
| 5445 | const signed char ChHexS = 4; | - | ||||||||||||||||||||||||
| 5446 | const signed char ChHex = 5; | - | ||||||||||||||||||||||||
| 5447 | const signed char Name = 6; | - | ||||||||||||||||||||||||
| 5448 | const signed char DoneD = 7; | - | ||||||||||||||||||||||||
| 5449 | const signed char DoneH = 8; | - | ||||||||||||||||||||||||
| 5450 | const signed char DoneN = 9; | - | ||||||||||||||||||||||||
| 5451 | - | |||||||||||||||||||||||||
| 5452 | const signed char InpAmp = 0; | - | ||||||||||||||||||||||||
| 5453 | const signed char InpSemi = 1; | - | ||||||||||||||||||||||||
| 5454 | const signed char InpHash = 2; | - | ||||||||||||||||||||||||
| 5455 | const signed char InpX = 3; | - | ||||||||||||||||||||||||
| 5456 | const signed char InpNum = 4; | - | ||||||||||||||||||||||||
| 5457 | const signed char InpHex = 5; | - | ||||||||||||||||||||||||
| 5458 | const signed char InpUnknown = 6; | - | ||||||||||||||||||||||||
| 5459 | - | |||||||||||||||||||||||||
| 5460 | static const signed char table[8][7] = { | - | ||||||||||||||||||||||||
| 5461 | - | |||||||||||||||||||||||||
| 5462 | { SRef, -1, -1, -1, -1, -1, -1 }, | - | ||||||||||||||||||||||||
| 5463 | { -1, -1, ChRef, Name, Name, Name, Name }, | - | ||||||||||||||||||||||||
| 5464 | { -1, -1, -1, ChHexS, ChDec, -1, -1 }, | - | ||||||||||||||||||||||||
| 5465 | { -1, DoneD, -1, -1, ChDec, -1, -1 }, | - | ||||||||||||||||||||||||
| 5466 | { -1, -1, -1, -1, ChHex, ChHex, -1 }, | - | ||||||||||||||||||||||||
| 5467 | { -1, DoneH, -1, -1, ChHex, ChHex, -1 }, | - | ||||||||||||||||||||||||
| 5468 | { -1, DoneN, -1, -1, -1, -1, -1 } | - | ||||||||||||||||||||||||
| 5469 | }; | - | ||||||||||||||||||||||||
| 5470 | signed char state; | - | ||||||||||||||||||||||||
| 5471 | signed char input; | - | ||||||||||||||||||||||||
| 5472 | - | |||||||||||||||||||||||||
| 5473 | if (parseStack==0
| 453-2474 | ||||||||||||||||||||||||
| 5474 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5475 | state = Init; | - | ||||||||||||||||||||||||
| 5476 | } executed 1614 times by 3 tests: else {end of blockExecuted by:
| 1614 | ||||||||||||||||||||||||
| 5477 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 5478 | - | |||||||||||||||||||||||||
| 5479 | - | |||||||||||||||||||||||||
| 5480 | - | |||||||||||||||||||||||||
| 5481 | if (!parseStack->isEmpty()
| 504-809 | ||||||||||||||||||||||||
| 5482 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 5483 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0-504 | ||||||||||||||||||||||||
| 5484 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 5485 | - | |||||||||||||||||||||||||
| 5486 | - | |||||||||||||||||||||||||
| 5487 | - | |||||||||||||||||||||||||
| 5488 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5489 | if (!(this->*function)()
| 130-374 | ||||||||||||||||||||||||
| 5490 | parseFailed(&QXmlSimpleReaderPrivate::parseReference, state); | - | ||||||||||||||||||||||||
| 5491 | return executed 130 times by 1 test: false;return false;Executed by:
executed 130 times by 1 test: return false;Executed by:
| 130 | ||||||||||||||||||||||||
| 5492 | } | - | ||||||||||||||||||||||||
| 5493 | } executed 374 times by 1 test: end of blockExecuted by:
| 374 | ||||||||||||||||||||||||
| 5494 | } executed 1183 times by 1 test: end of blockExecuted by:
| 1183 | ||||||||||||||||||||||||
| 5495 | - | |||||||||||||||||||||||||
| 5496 | for (;;) { | - | ||||||||||||||||||||||||
| 5497 | switch (state) { | - | ||||||||||||||||||||||||
| 5498 | case executed 255 times by 1 test: DoneD:case DoneD:Executed by:
executed 255 times by 1 test: case DoneD:Executed by:
| 255 | ||||||||||||||||||||||||
| 5499 | return executed 255 times by 1 test: true;return true;Executed by:
executed 255 times by 1 test: return true;Executed by:
| 255 | ||||||||||||||||||||||||
| 5500 | case executed 80 times by 1 test: DoneH:case DoneH:Executed by:
executed 80 times by 1 test: case DoneH:Executed by:
| 80 | ||||||||||||||||||||||||
| 5501 | return executed 80 times by 1 test: true;return true;Executed by:
executed 80 times by 1 test: return true;Executed by:
| 80 | ||||||||||||||||||||||||
| 5502 | case executed 1256 times by 3 tests: DoneN:case DoneN:Executed by:
executed 1256 times by 3 tests: case DoneN:Executed by:
| 1256 | ||||||||||||||||||||||||
| 5503 | return executed 1256 times by 3 tests: true;return true;Executed by:
executed 1256 times by 3 tests: return true;Executed by:
| 1256 | ||||||||||||||||||||||||
| 5504 | case executed 6 times by 1 test: -1:case -1:Executed by:
executed 6 times by 1 test: case -1:Executed by:
| 6 | ||||||||||||||||||||||||
| 5505 | - | |||||||||||||||||||||||||
| 5506 | reportParseError(QLatin1String("error occurred while parsing reference")); | - | ||||||||||||||||||||||||
| 5507 | return executed 6 times by 1 test: false;return false;Executed by:
executed 6 times by 1 test: return false;Executed by:
| 6 | ||||||||||||||||||||||||
| 5508 | } | - | ||||||||||||||||||||||||
| 5509 | - | |||||||||||||||||||||||||
| 5510 | if (atEnd()
| 809-6427 | ||||||||||||||||||||||||
| 5511 | unexpectedEof(&QXmlSimpleReaderPrivate::parseReference, state); | - | ||||||||||||||||||||||||
| 5512 | return executed 809 times by 1 test: false;return false;Executed by:
executed 809 times by 1 test: return false;Executed by:
| 809 | ||||||||||||||||||||||||
| 5513 | } | - | ||||||||||||||||||||||||
| 5514 | if (c.row()
| 0-6427 | ||||||||||||||||||||||||
| 5515 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5516 | } never executed: else if (c.cell() == '&'end of block
| 0-4812 | ||||||||||||||||||||||||
| 5517 | input = InpAmp; | - | ||||||||||||||||||||||||
| 5518 | } executed 1615 times by 3 tests: else if (c.cell() == ';'end of blockExecuted by:
| 1599-3213 | ||||||||||||||||||||||||
| 5519 | input = InpSemi; | - | ||||||||||||||||||||||||
| 5520 | } executed 1599 times by 3 tests: else if (c.cell() == '#'end of blockExecuted by:
| 338-2875 | ||||||||||||||||||||||||
| 5521 | input = InpHash; | - | ||||||||||||||||||||||||
| 5522 | } executed 338 times by 1 test: else if (c.cell() == 'x'end of blockExecuted by:
| 90-2785 | ||||||||||||||||||||||||
| 5523 | input = InpX; | - | ||||||||||||||||||||||||
| 5524 | } executed 90 times by 1 test: else if ('0' <= c.cell()end of blockExecuted by:
| 11-2774 | ||||||||||||||||||||||||
| 5525 | input = InpNum; | - | ||||||||||||||||||||||||
| 5526 | } executed 1426 times by 1 test: else if ('a' <= c.cell()end of blockExecuted by:
| 67-1426 | ||||||||||||||||||||||||
| 5527 | input = InpHex; | - | ||||||||||||||||||||||||
| 5528 | } executed 1034 times by 3 tests: else if ('A' <= c.cell()end of blockExecuted by:
| 12-1034 | ||||||||||||||||||||||||
| 5529 | input = InpHex; | - | ||||||||||||||||||||||||
| 5530 | } executed 53 times by 1 test: else {end of blockExecuted by:
| 53 | ||||||||||||||||||||||||
| 5531 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5532 | } executed 272 times by 3 tests: end of blockExecuted by:
| 272 | ||||||||||||||||||||||||
| 5533 | state = table[state][input]; | - | ||||||||||||||||||||||||
| 5534 | - | |||||||||||||||||||||||||
| 5535 | switch (state) { | - | ||||||||||||||||||||||||
| 5536 | case executed 1614 times by 3 tests: SRef:case SRef:Executed by:
executed 1614 times by 3 tests: case SRef:Executed by:
| 1614 | ||||||||||||||||||||||||
| 5537 | refClear(); | - | ||||||||||||||||||||||||
| 5538 | next(); | - | ||||||||||||||||||||||||
| 5539 | break; executed 1614 times by 3 tests: break;Executed by:
| 1614 | ||||||||||||||||||||||||
| 5540 | case executed 338 times by 1 test: ChRef:case ChRef:Executed by:
executed 338 times by 1 test: case ChRef:Executed by:
| 338 | ||||||||||||||||||||||||
| 5541 | next(); | - | ||||||||||||||||||||||||
| 5542 | break; executed 338 times by 1 test: break;Executed by:
| 338 | ||||||||||||||||||||||||
| 5543 | case executed 850 times by 1 test: ChDec:case ChDec:Executed by:
executed 850 times by 1 test: case ChDec:Executed by:
| 850 | ||||||||||||||||||||||||
| 5544 | refAddC(); | - | ||||||||||||||||||||||||
| 5545 | next(); | - | ||||||||||||||||||||||||
| 5546 | break; executed 850 times by 1 test: break;Executed by:
| 850 | ||||||||||||||||||||||||
| 5547 | case executed 80 times by 1 test: ChHexS:case ChHexS:Executed by:
executed 80 times by 1 test: case ChHexS:Executed by:
| 80 | ||||||||||||||||||||||||
| 5548 | next(); | - | ||||||||||||||||||||||||
| 5549 | break; executed 80 times by 1 test: break;Executed by:
| 80 | ||||||||||||||||||||||||
| 5550 | case executed 665 times by 1 test: ChHex:case ChHex:Executed by:
executed 665 times by 1 test: case ChHex:Executed by:
| 665 | ||||||||||||||||||||||||
| 5551 | refAddC(); | - | ||||||||||||||||||||||||
| 5552 | next(); | - | ||||||||||||||||||||||||
| 5553 | break; executed 665 times by 1 test: break;Executed by:
| 665 | ||||||||||||||||||||||||
| 5554 | case executed 1275 times by 3 tests: Name:case Name:Executed by:
executed 1275 times by 3 tests: case Name:Executed by:
| 1275 | ||||||||||||||||||||||||
| 5555 | - | |||||||||||||||||||||||||
| 5556 | parseName_useRef = true; | - | ||||||||||||||||||||||||
| 5557 | if (!parseName()
| 383-892 | ||||||||||||||||||||||||
| 5558 | parseFailed(&QXmlSimpleReaderPrivate::parseReference, state); | - | ||||||||||||||||||||||||
| 5559 | return executed 383 times by 1 test: false;return false;Executed by:
executed 383 times by 1 test: return false;Executed by:
| 383 | ||||||||||||||||||||||||
| 5560 | } | - | ||||||||||||||||||||||||
| 5561 | break; executed 892 times by 3 tests: break;Executed by:
| 892 | ||||||||||||||||||||||||
| 5562 | case executed 255 times by 1 test: DoneD:case DoneD:Executed by:
executed 255 times by 1 test: case DoneD:Executed by:
| 255 | ||||||||||||||||||||||||
| 5563 | tmp = ref().toUInt(&ok, 10); | - | ||||||||||||||||||||||||
| 5564 | if (ok
| 0-255 | ||||||||||||||||||||||||
| 5565 | stringAddC(QChar(tmp)); | - | ||||||||||||||||||||||||
| 5566 | } executed 255 times by 1 test: else {end of blockExecuted by:
| 255 | ||||||||||||||||||||||||
| 5567 | reportParseError(QLatin1String("error occurred while parsing reference")); | - | ||||||||||||||||||||||||
| 5568 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5569 | } | - | ||||||||||||||||||||||||
| 5570 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5571 | next(); | - | ||||||||||||||||||||||||
| 5572 | break; executed 255 times by 1 test: break;Executed by:
| 255 | ||||||||||||||||||||||||
| 5573 | case executed 80 times by 1 test: DoneH:case DoneH:Executed by:
executed 80 times by 1 test: case DoneH:Executed by:
| 80 | ||||||||||||||||||||||||
| 5574 | tmp = ref().toUInt(&ok, 16); | - | ||||||||||||||||||||||||
| 5575 | if (ok
| 0-80 | ||||||||||||||||||||||||
| 5576 | stringAddC(QChar(tmp)); | - | ||||||||||||||||||||||||
| 5577 | } executed 80 times by 1 test: else {end of blockExecuted by:
| 80 | ||||||||||||||||||||||||
| 5578 | reportParseError(QLatin1String("error occurred while parsing reference")); | - | ||||||||||||||||||||||||
| 5579 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5580 | } | - | ||||||||||||||||||||||||
| 5581 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5582 | next(); | - | ||||||||||||||||||||||||
| 5583 | break; executed 80 times by 1 test: break;Executed by:
| 80 | ||||||||||||||||||||||||
| 5584 | case executed 1264 times by 3 tests: DoneN:case DoneN:Executed by:
executed 1264 times by 3 tests: case DoneN:Executed by:
| 1264 | ||||||||||||||||||||||||
| 5585 | if (!processReference()
| 8-1256 | ||||||||||||||||||||||||
| 5586 | return executed 8 times by 1 test: false;return false;Executed by:
executed 8 times by 1 test: return false;Executed by:
| 8 | ||||||||||||||||||||||||
| 5587 | next(); | - | ||||||||||||||||||||||||
| 5588 | break; executed 1256 times by 3 tests: break;Executed by:
| 1256 | ||||||||||||||||||||||||
| 5589 | } | - | ||||||||||||||||||||||||
| 5590 | } executed 6036 times by 3 tests: end of blockExecuted by:
| 6036 | ||||||||||||||||||||||||
| 5591 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5592 | } | - | ||||||||||||||||||||||||
| 5593 | - | |||||||||||||||||||||||||
| 5594 | - | |||||||||||||||||||||||||
| 5595 | - | |||||||||||||||||||||||||
| 5596 | - | |||||||||||||||||||||||||
| 5597 | bool QXmlSimpleReaderPrivate::processReference() | - | ||||||||||||||||||||||||
| 5598 | { | - | ||||||||||||||||||||||||
| 5599 | QString reference = ref(); | - | ||||||||||||||||||||||||
| 5600 | if (reference == QLatin1String("amp")
| 36-1228 | ||||||||||||||||||||||||
| 5601 | if (parseReference_context == InEntityValue
| 0-36 | ||||||||||||||||||||||||
| 5602 | - | |||||||||||||||||||||||||
| 5603 | stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('a')); stringAddC(QLatin1Char('m')); stringAddC(QLatin1Char('p')); stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5604 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5605 | - | |||||||||||||||||||||||||
| 5606 | stringAddC(QLatin1Char('&')); | - | ||||||||||||||||||||||||
| 5607 | } executed 36 times by 3 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 5608 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5609 | } executed 36 times by 3 tests: else if (reference == QLatin1String("lt")end of blockExecuted by:
| 36-1159 | ||||||||||||||||||||||||
| 5610 | if (parseReference_context == InEntityValue
| 10-59 | ||||||||||||||||||||||||
| 5611 | - | |||||||||||||||||||||||||
| 5612 | stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('l')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5613 | } executed 10 times by 1 test: else {end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 5614 | - | |||||||||||||||||||||||||
| 5615 | stringAddC(QLatin1Char('<')); | - | ||||||||||||||||||||||||
| 5616 | } executed 59 times by 3 tests: end of blockExecuted by:
| 59 | ||||||||||||||||||||||||
| 5617 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5618 | } executed 69 times by 3 tests: else if (reference == QLatin1String("gt")end of blockExecuted by:
| 54-1105 | ||||||||||||||||||||||||
| 5619 | if (parseReference_context == InEntityValue
| 0-54 | ||||||||||||||||||||||||
| 5620 | - | |||||||||||||||||||||||||
| 5621 | stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('g')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5622 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5623 | - | |||||||||||||||||||||||||
| 5624 | stringAddC(QLatin1Char('>')); | - | ||||||||||||||||||||||||
| 5625 | } executed 54 times by 3 tests: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||
| 5626 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5627 | } executed 54 times by 3 tests: else if (reference == QLatin1String("apos")end of blockExecuted by:
| 20-1085 | ||||||||||||||||||||||||
| 5628 | if (parseReference_context == InEntityValue
| 0-20 | ||||||||||||||||||||||||
| 5629 | - | |||||||||||||||||||||||||
| 5630 | stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('a')); stringAddC(QLatin1Char('p')); stringAddC(QLatin1Char('o')); stringAddC(QLatin1Char('s')); stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5631 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5632 | - | |||||||||||||||||||||||||
| 5633 | stringAddC(QLatin1Char('\'')); | - | ||||||||||||||||||||||||
| 5634 | } executed 20 times by 1 test: end of blockExecuted by:
| 20 | ||||||||||||||||||||||||
| 5635 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5636 | } executed 20 times by 1 test: else if (reference == QLatin1String("quot")end of blockExecuted by:
| 20-1050 | ||||||||||||||||||||||||
| 5637 | if (parseReference_context == InEntityValue
| 0-35 | ||||||||||||||||||||||||
| 5638 | - | |||||||||||||||||||||||||
| 5639 | stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('q')); stringAddC(QLatin1Char('u')); stringAddC(QLatin1Char('o')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5640 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5641 | - | |||||||||||||||||||||||||
| 5642 | stringAddC(QLatin1Char('"')); | - | ||||||||||||||||||||||||
| 5643 | } executed 35 times by 2 tests: end of blockExecuted by:
| 35 | ||||||||||||||||||||||||
| 5644 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5645 | } executed 35 times by 2 tests: else {end of blockExecuted by:
| 35 | ||||||||||||||||||||||||
| 5646 | QMap<QString,QString>::Iterator it; | - | ||||||||||||||||||||||||
| 5647 | it = entities.find(reference); | - | ||||||||||||||||||||||||
| 5648 | if (it != entities.end()
| 440-610 | ||||||||||||||||||||||||
| 5649 | - | |||||||||||||||||||||||||
| 5650 | switch (parseReference_context) { | - | ||||||||||||||||||||||||
| 5651 | case executed 400 times by 1 test: InContent:case InContent:Executed by:
executed 400 times by 1 test: case InContent:Executed by:
| 400 | ||||||||||||||||||||||||
| 5652 | - | |||||||||||||||||||||||||
| 5653 | if (!insertXmlRef(*it, reference, false)
| 1-399 | ||||||||||||||||||||||||
| 5654 | return executed 1 time by 1 test: false;return false;Executed by:
executed 1 time by 1 test: return false;Executed by:
| 1 | ||||||||||||||||||||||||
| 5655 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5656 | break; executed 399 times by 1 test: break;Executed by:
| 399 | ||||||||||||||||||||||||
| 5657 | case executed 78 times by 1 test: InAttributeValue:case InAttributeValue:Executed by:
executed 78 times by 1 test: case InAttributeValue:Executed by:
| 78 | ||||||||||||||||||||||||
| 5658 | - | |||||||||||||||||||||||||
| 5659 | if (!insertXmlRef(*it, reference, true)
| 3-75 | ||||||||||||||||||||||||
| 5660 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 5661 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5662 | break; executed 75 times by 1 test: break;Executed by:
| 75 | ||||||||||||||||||||||||
| 5663 | case executed 132 times by 1 test: InEntityValue:case InEntityValue:Executed by:
executed 132 times by 1 test: case InEntityValue:Executed by:
| 132 | ||||||||||||||||||||||||
| 5664 | { | - | ||||||||||||||||||||||||
| 5665 | - | |||||||||||||||||||||||||
| 5666 | stringAddC(QLatin1Char('&')); | - | ||||||||||||||||||||||||
| 5667 | for (int i=0; i<(int)reference.length()
| 132-264 | ||||||||||||||||||||||||
| 5668 | stringAddC(reference[i]); | - | ||||||||||||||||||||||||
| 5669 | } executed 264 times by 1 test: end of blockExecuted by:
| 264 | ||||||||||||||||||||||||
| 5670 | stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5671 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5672 | } | - | ||||||||||||||||||||||||
| 5673 | break; executed 132 times by 1 test: break;Executed by:
| 132 | ||||||||||||||||||||||||
| 5674 | case never executed: InDTD:case InDTD:never executed: case InDTD: | 0 | ||||||||||||||||||||||||
| 5675 | - | |||||||||||||||||||||||||
| 5676 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5677 | reportParseError(QLatin1String("internal general entity reference not allowed in DTD")); | - | ||||||||||||||||||||||||
| 5678 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5679 | } | - | ||||||||||||||||||||||||
| 5680 | } executed 606 times by 1 test: else {end of blockExecuted by:
| 606 | ||||||||||||||||||||||||
| 5681 | QMap<QString,QXmlSimpleReaderPrivate::ExternEntity>::Iterator itExtern; | - | ||||||||||||||||||||||||
| 5682 | itExtern = externEntities.find(reference); | - | ||||||||||||||||||||||||
| 5683 | if (itExtern == externEntities.end()
| 144-296 | ||||||||||||||||||||||||
| 5684 | - | |||||||||||||||||||||||||
| 5685 | - | |||||||||||||||||||||||||
| 5686 | if (parseReference_context == InEntityValue
| 99-197 | ||||||||||||||||||||||||
| 5687 | - | |||||||||||||||||||||||||
| 5688 | stringAddC(QLatin1Char('&')); | - | ||||||||||||||||||||||||
| 5689 | for (int i=0; i<(int)reference.length()
| 99-209 | ||||||||||||||||||||||||
| 5690 | stringAddC(reference[i]); | - | ||||||||||||||||||||||||
| 5691 | } executed 209 times by 1 test: end of blockExecuted by:
| 209 | ||||||||||||||||||||||||
| 5692 | stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5693 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5694 | } executed 99 times by 1 test: else {end of blockExecuted by:
| 99 | ||||||||||||||||||||||||
| 5695 | - | |||||||||||||||||||||||||
| 5696 | if (parseReference_context == InContent
| 14-183 | ||||||||||||||||||||||||
| 5697 | if (contentCharDataRead
| 83-100 | ||||||||||||||||||||||||
| 5698 | if (reportWhitespaceCharData
| 0-100 | ||||||||||||||||||||||||
| 5699 | if (contentHnd != 0
| 0-100 | ||||||||||||||||||||||||
| 5700 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 5701 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5702 | } | - | ||||||||||||||||||||||||
| 5703 | } executed 100 times by 1 test: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||
| 5704 | stringClear(); | - | ||||||||||||||||||||||||
| 5705 | contentCharDataRead = false; | - | ||||||||||||||||||||||||
| 5706 | } executed 100 times by 1 test: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||
| 5707 | } executed 183 times by 1 test: end of blockExecuted by:
| 183 | ||||||||||||||||||||||||
| 5708 | - | |||||||||||||||||||||||||
| 5709 | if (contentHnd
| 0-197 | ||||||||||||||||||||||||
| 5710 | skipped_entity_in_content = parseReference_context == InContent; | - | ||||||||||||||||||||||||
| 5711 | if (!contentHnd->skippedEntity(reference)
| 0-197 | ||||||||||||||||||||||||
| 5712 | skipped_entity_in_content = false; | - | ||||||||||||||||||||||||
| 5713 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 5714 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5715 | } | - | ||||||||||||||||||||||||
| 5716 | skipped_entity_in_content = false; | - | ||||||||||||||||||||||||
| 5717 | } executed 197 times by 1 test: end of blockExecuted by:
| 197 | ||||||||||||||||||||||||
| 5718 | } executed 197 times by 1 test: end of blockExecuted by:
| 197 | ||||||||||||||||||||||||
| 5719 | } else if ((*
| 2-142 | ||||||||||||||||||||||||
| 5720 | - | |||||||||||||||||||||||||
| 5721 | switch (parseReference_context) { | - | ||||||||||||||||||||||||
| 5722 | case executed 140 times by 1 test: InContent:case InContent:Executed by:
executed 140 times by 1 test: case InContent:Executed by:
| 140 | ||||||||||||||||||||||||
| 5723 | { | - | ||||||||||||||||||||||||
| 5724 | - | |||||||||||||||||||||||||
| 5725 | bool skipIt = true; | - | ||||||||||||||||||||||||
| 5726 | if (entityRes
| 0-140 | ||||||||||||||||||||||||
| 5727 | QXmlInputSource *ret = 0; | - | ||||||||||||||||||||||||
| 5728 | if (!entityRes->resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)
| 0-140 | ||||||||||||||||||||||||
| 5729 | delete ret; | - | ||||||||||||||||||||||||
| 5730 | reportParseError(entityRes->errorString()); | - | ||||||||||||||||||||||||
| 5731 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5732 | } | - | ||||||||||||||||||||||||
| 5733 | if (ret
| 0-140 | ||||||||||||||||||||||||
| 5734 | QString xmlRefString; | - | ||||||||||||||||||||||||
| 5735 | QString buffer = ret->data(); | - | ||||||||||||||||||||||||
| 5736 | while (!buffer.isEmpty()
| 0 | ||||||||||||||||||||||||
| 5737 | xmlRefString += buffer; | - | ||||||||||||||||||||||||
| 5738 | ret->fetchData(); | - | ||||||||||||||||||||||||
| 5739 | buffer = ret->data(); | - | ||||||||||||||||||||||||
| 5740 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5741 | - | |||||||||||||||||||||||||
| 5742 | delete ret; | - | ||||||||||||||||||||||||
| 5743 | if (!stripTextDecl(xmlRefString)
| 0 | ||||||||||||||||||||||||
| 5744 | reportParseError(QLatin1String("error in the text declaration of an external entity")); | - | ||||||||||||||||||||||||
| 5745 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5746 | } | - | ||||||||||||||||||||||||
| 5747 | if (!insertXmlRef(xmlRefString, reference, false)
| 0 | ||||||||||||||||||||||||
| 5748 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5749 | skipIt = false; | - | ||||||||||||||||||||||||
| 5750 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5751 | } executed 140 times by 1 test: end of blockExecuted by:
| 140 | ||||||||||||||||||||||||
| 5752 | if (skipIt
| 0-140 | ||||||||||||||||||||||||
| 5753 | skipped_entity_in_content = true; | - | ||||||||||||||||||||||||
| 5754 | if (!contentHnd->skippedEntity(reference)
| 0-140 | ||||||||||||||||||||||||
| 5755 | skipped_entity_in_content = false; | - | ||||||||||||||||||||||||
| 5756 | reportParseError(contentHnd->errorString()); | - | ||||||||||||||||||||||||
| 5757 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5758 | } | - | ||||||||||||||||||||||||
| 5759 | skipped_entity_in_content = false; | - | ||||||||||||||||||||||||
| 5760 | } executed 140 times by 1 test: end of blockExecuted by:
| 140 | ||||||||||||||||||||||||
| 5761 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5762 | } break; executed 140 times by 1 test: break;Executed by:
| 140 | ||||||||||||||||||||||||
| 5763 | case executed 2 times by 1 test: InAttributeValue:case InAttributeValue:Executed by:
executed 2 times by 1 test: case InAttributeValue:Executed by:
| 2 | ||||||||||||||||||||||||
| 5764 | - | |||||||||||||||||||||||||
| 5765 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5766 | reportParseError(QLatin1String("external parsed general entity reference not allowed in attribute value")); | - | ||||||||||||||||||||||||
| 5767 | return executed 2 times by 1 test: false;return false;Executed by:
executed 2 times by 1 test: return false;Executed by:
| 2 | ||||||||||||||||||||||||
| 5768 | case never executed: InEntityValue:case InEntityValue:never executed: case InEntityValue: | 0 | ||||||||||||||||||||||||
| 5769 | { | - | ||||||||||||||||||||||||
| 5770 | - | |||||||||||||||||||||||||
| 5771 | stringAddC(QLatin1Char('&')); | - | ||||||||||||||||||||||||
| 5772 | for (int i=0; i<(int)reference.length()
| 0 | ||||||||||||||||||||||||
| 5773 | stringAddC(reference[i]); | - | ||||||||||||||||||||||||
| 5774 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5775 | stringAddC(QLatin1Char(';')); | - | ||||||||||||||||||||||||
| 5776 | parseReference_charDataRead = true; | - | ||||||||||||||||||||||||
| 5777 | } | - | ||||||||||||||||||||||||
| 5778 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 5779 | case never executed: InDTD:case InDTD:never executed: case InDTD: | 0 | ||||||||||||||||||||||||
| 5780 | - | |||||||||||||||||||||||||
| 5781 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5782 | reportParseError(QLatin1String("external parsed general entity reference not allowed in DTD")); | - | ||||||||||||||||||||||||
| 5783 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5784 | } | - | ||||||||||||||||||||||||
| 5785 | } executed 140 times by 1 test: else {end of blockExecuted by:
| 140 | ||||||||||||||||||||||||
| 5786 | - | |||||||||||||||||||||||||
| 5787 | - | |||||||||||||||||||||||||
| 5788 | - | |||||||||||||||||||||||||
| 5789 | parseReference_charDataRead = false; | - | ||||||||||||||||||||||||
| 5790 | reportParseError(QLatin1String("unparsed entity reference in wrong context")); | - | ||||||||||||||||||||||||
| 5791 | return executed 2 times by 1 test: false;return false;Executed by:
executed 2 times by 1 test: return false;Executed by:
| 2 | ||||||||||||||||||||||||
| 5792 | } | - | ||||||||||||||||||||||||
| 5793 | } | - | ||||||||||||||||||||||||
| 5794 | } | - | ||||||||||||||||||||||||
| 5795 | return executed 1256 times by 3 tests: true;return true;Executed by:
executed 1256 times by 3 tests: return true;Executed by:
| 1256 | ||||||||||||||||||||||||
| 5796 | } | - | ||||||||||||||||||||||||
| 5797 | bool QXmlSimpleReaderPrivate::parseString() | - | ||||||||||||||||||||||||
| 5798 | { | - | ||||||||||||||||||||||||
| 5799 | const signed char InpCharExpected = 0; | - | ||||||||||||||||||||||||
| 5800 | const signed char InpUnknown = 1; | - | ||||||||||||||||||||||||
| 5801 | - | |||||||||||||||||||||||||
| 5802 | signed char state; | - | ||||||||||||||||||||||||
| 5803 | signed char input; | - | ||||||||||||||||||||||||
| 5804 | - | |||||||||||||||||||||||||
| 5805 | if (parseStack==0
| 1360-17594 | ||||||||||||||||||||||||
| 5806 | Done = parseString_s.length(); | - | ||||||||||||||||||||||||
| 5807 | state = 0; | - | ||||||||||||||||||||||||
| 5808 | } executed 7972 times by 4 tests: else {end of blockExecuted by:
| 7972 | ||||||||||||||||||||||||
| 5809 | state = parseStack->pop().state; | - | ||||||||||||||||||||||||
| 5810 | - | |||||||||||||||||||||||||
| 5811 | - | |||||||||||||||||||||||||
| 5812 | - | |||||||||||||||||||||||||
| 5813 | if (!parseStack->isEmpty()
| 0-10982 | ||||||||||||||||||||||||
| 5814 | ParseFunction function = parseStack->top().function; | - | ||||||||||||||||||||||||
| 5815 | if (function == &QXmlSimpleReaderPrivate::eat_ws
| 0 | ||||||||||||||||||||||||
| 5816 | parseStack->pop(); | - | ||||||||||||||||||||||||
| 5817 | - | |||||||||||||||||||||||||
| 5818 | - | |||||||||||||||||||||||||
| 5819 | - | |||||||||||||||||||||||||
| 5820 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5821 | if (!(this->*function)()
| 0 | ||||||||||||||||||||||||
| 5822 | parseFailed(&QXmlSimpleReaderPrivate::parseString, state); | - | ||||||||||||||||||||||||
| 5823 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5824 | } | - | ||||||||||||||||||||||||
| 5825 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5826 | } executed 10982 times by 1 test: end of blockExecuted by:
| 10982 | ||||||||||||||||||||||||
| 5827 | - | |||||||||||||||||||||||||
| 5828 | for (;;) { | - | ||||||||||||||||||||||||
| 5829 | if (state == Done
| 7969-61524 | ||||||||||||||||||||||||
| 5830 | return executed 7969 times by 4 tests: true;return true;Executed by:
executed 7969 times by 4 tests: return true;Executed by:
| 7969 | ||||||||||||||||||||||||
| 5831 | } | - | ||||||||||||||||||||||||
| 5832 | - | |||||||||||||||||||||||||
| 5833 | if (atEnd()
| 10982-50542 | ||||||||||||||||||||||||
| 5834 | unexpectedEof(&QXmlSimpleReaderPrivate::parseString, state); | - | ||||||||||||||||||||||||
| 5835 | return executed 10982 times by 1 test: false;return false;Executed by:
executed 10982 times by 1 test: return false;Executed by:
| 10982 | ||||||||||||||||||||||||
| 5836 | } | - | ||||||||||||||||||||||||
| 5837 | if (c == parseString_s[(int)state]
| 3-50539 | ||||||||||||||||||||||||
| 5838 | input = InpCharExpected; | - | ||||||||||||||||||||||||
| 5839 | } executed 50539 times by 4 tests: else {end of blockExecuted by:
| 50539 | ||||||||||||||||||||||||
| 5840 | input = InpUnknown; | - | ||||||||||||||||||||||||
| 5841 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||
| 5842 | if (input == InpCharExpected
| 3-50539 | ||||||||||||||||||||||||
| 5843 | state++; | - | ||||||||||||||||||||||||
| 5844 | } executed 50539 times by 4 tests: else {end of blockExecuted by:
| 50539 | ||||||||||||||||||||||||
| 5845 | - | |||||||||||||||||||||||||
| 5846 | reportParseError(QLatin1String("unexpected character")); | - | ||||||||||||||||||||||||
| 5847 | return executed 3 times by 1 test: false;return false;Executed by:
executed 3 times by 1 test: return false;Executed by:
| 3 | ||||||||||||||||||||||||
| 5848 | } | - | ||||||||||||||||||||||||
| 5849 | - | |||||||||||||||||||||||||
| 5850 | next(); | - | ||||||||||||||||||||||||
| 5851 | } executed 50539 times by 4 tests: end of blockExecuted by:
| 50539 | ||||||||||||||||||||||||
| 5852 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5853 | } | - | ||||||||||||||||||||||||
| 5854 | bool QXmlSimpleReaderPrivate::insertXmlRef(const QString &data, const QString &name, bool inLiteral) | - | ||||||||||||||||||||||||
| 5855 | { | - | ||||||||||||||||||||||||
| 5856 | if (inLiteral
| 93-410 | ||||||||||||||||||||||||
| 5857 | QString tmp = data; | - | ||||||||||||||||||||||||
| 5858 | xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1Char('\"'), | - | ||||||||||||||||||||||||
| 5859 | QLatin1String(""")).replace(QLatin1Char('\''), QLatin1String("'")))); | - | ||||||||||||||||||||||||
| 5860 | } executed 93 times by 1 test: else {end of blockExecuted by:
| 93 | ||||||||||||||||||||||||
| 5861 | xmlRefStack.push(XmlRef(name, data)); | - | ||||||||||||||||||||||||
| 5862 | } executed 410 times by 1 test: end of blockExecuted by:
| 410 | ||||||||||||||||||||||||
| 5863 | int n = qMax(parameterEntities.count(), entities.count()); | - | ||||||||||||||||||||||||
| 5864 | if (xmlRefStack.count() > n+1
| 4-499 | ||||||||||||||||||||||||
| 5865 | - | |||||||||||||||||||||||||
| 5866 | reportParseError(QLatin1String("recursive entities")); | - | ||||||||||||||||||||||||
| 5867 | return executed 4 times by 1 test: false;return false;Executed by:
executed 4 times by 1 test: return false;Executed by:
| 4 | ||||||||||||||||||||||||
| 5868 | } | - | ||||||||||||||||||||||||
| 5869 | if (reportEntities
| 0-499 | ||||||||||||||||||||||||
| 5870 | if (!lexicalHnd->startEntity(name)
| 0 | ||||||||||||||||||||||||
| 5871 | reportParseError(lexicalHnd->errorString()); | - | ||||||||||||||||||||||||
| 5872 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 5873 | } | - | ||||||||||||||||||||||||
| 5874 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 5875 | return executed 499 times by 1 test: true;return true;Executed by:
executed 499 times by 1 test: return true;Executed by:
| 499 | ||||||||||||||||||||||||
| 5876 | } | - | ||||||||||||||||||||||||
| 5877 | - | |||||||||||||||||||||||||
| 5878 | - | |||||||||||||||||||||||||
| 5879 | - | |||||||||||||||||||||||||
| 5880 | - | |||||||||||||||||||||||||
| 5881 | void QXmlSimpleReaderPrivate::next() | - | ||||||||||||||||||||||||
| 5882 | { | - | ||||||||||||||||||||||||
| 5883 | int count = xmlRefStack.size(); | - | ||||||||||||||||||||||||
| 5884 | while (count != 0
| 2697-791592 | ||||||||||||||||||||||||
| 5885 | if (xmlRefStack.top().isEmpty()
| 477-2220 | ||||||||||||||||||||||||
| 5886 | xmlRefStack.pop_back(); | - | ||||||||||||||||||||||||
| 5887 | count--; | - | ||||||||||||||||||||||||
| 5888 | } executed 477 times by 1 test: else {end of blockExecuted by:
| 477 | ||||||||||||||||||||||||
| 5889 | c = xmlRefStack.top().next(); | - | ||||||||||||||||||||||||
| 5890 | return; executed 2220 times by 1 test: return;Executed by:
| 2220 | ||||||||||||||||||||||||
| 5891 | } | - | ||||||||||||||||||||||||
| 5892 | } | - | ||||||||||||||||||||||||
| 5893 | - | |||||||||||||||||||||||||
| 5894 | - | |||||||||||||||||||||||||
| 5895 | - | |||||||||||||||||||||||||
| 5896 | ushort uc = c.unicode(); | - | ||||||||||||||||||||||||
| 5897 | c = inputSource->next(); | - | ||||||||||||||||||||||||
| 5898 | - | |||||||||||||||||||||||||
| 5899 | - | |||||||||||||||||||||||||
| 5900 | if (c == QXmlInputSource::EndOfData
| 989-745695 | ||||||||||||||||||||||||
| 5901 | c = inputSource->next(); executed 989 times by 6 tests: c = inputSource->next();Executed by:
| 989 | ||||||||||||||||||||||||
| 5902 | if (uc == '\n'
| 18010-773582 | ||||||||||||||||||||||||
| 5903 | lineNr++; | - | ||||||||||||||||||||||||
| 5904 | columnNr = -1; | - | ||||||||||||||||||||||||
| 5905 | } executed 18010 times by 5 tests: else if (uc == '\r'end of blockExecuted by:
| 8363-765219 | ||||||||||||||||||||||||
| 5906 | if (c != QLatin1Char('\n')
| 2546-5817 | ||||||||||||||||||||||||
| 5907 | lineNr++; | - | ||||||||||||||||||||||||
| 5908 | columnNr = -1; | - | ||||||||||||||||||||||||
| 5909 | } executed 2546 times by 1 test: end of blockExecuted by:
| 2546 | ||||||||||||||||||||||||
| 5910 | } executed 8363 times by 2 tests: end of blockExecuted by:
| 8363 | ||||||||||||||||||||||||
| 5911 | ++columnNr; | - | ||||||||||||||||||||||||
| 5912 | } executed 791592 times by 6 tests: end of blockExecuted by:
| 791592 | ||||||||||||||||||||||||
| 5913 | bool QXmlSimpleReaderPrivate::eat_ws() | - | ||||||||||||||||||||||||
| 5914 | { | - | ||||||||||||||||||||||||
| 5915 | while (!atEnd()
| 10298-90379 | ||||||||||||||||||||||||
| 5916 | if (!is_S(c)
| 41757-48622 | ||||||||||||||||||||||||
| 5917 | return executed 48622 times by 6 tests: true;return true;Executed by:
executed 48622 times by 6 tests: return true;Executed by:
| 48622 | ||||||||||||||||||||||||
| 5918 | } | - | ||||||||||||||||||||||||
| 5919 | next(); | - | ||||||||||||||||||||||||
| 5920 | } executed 41757 times by 6 tests: end of blockExecuted by:
| 41757 | ||||||||||||||||||||||||
| 5921 | if (parseStack != 0
| 210-10088 | ||||||||||||||||||||||||
| 5922 | unexpectedEof(&QXmlSimpleReaderPrivate::eat_ws, 0); | - | ||||||||||||||||||||||||
| 5923 | return executed 10088 times by 1 test: false;return false;Executed by:
executed 10088 times by 1 test: return false;Executed by:
| 10088 | ||||||||||||||||||||||||
| 5924 | } | - | ||||||||||||||||||||||||
| 5925 | return executed 210 times by 2 tests: true;return true;Executed by:
executed 210 times by 2 tests: return true;Executed by:
| 210 | ||||||||||||||||||||||||
| 5926 | } | - | ||||||||||||||||||||||||
| 5927 | - | |||||||||||||||||||||||||
| 5928 | bool QXmlSimpleReaderPrivate::next_eat_ws() | - | ||||||||||||||||||||||||
| 5929 | { | - | ||||||||||||||||||||||||
| 5930 | next(); | - | ||||||||||||||||||||||||
| 5931 | return executed 17906 times by 6 tests: eat_ws();return eat_ws();Executed by:
executed 17906 times by 6 tests: return eat_ws();Executed by:
| 17906 | ||||||||||||||||||||||||
| 5932 | } | - | ||||||||||||||||||||||||
| 5933 | - | |||||||||||||||||||||||||
| 5934 | - | |||||||||||||||||||||||||
| 5935 | - | |||||||||||||||||||||||||
| 5936 | - | |||||||||||||||||||||||||
| 5937 | - | |||||||||||||||||||||||||
| 5938 | - | |||||||||||||||||||||||||
| 5939 | void QXmlSimpleReaderPrivate::init(const QXmlInputSource *i) | - | ||||||||||||||||||||||||
| 5940 | { | - | ||||||||||||||||||||||||
| 5941 | lineNr = 0; | - | ||||||||||||||||||||||||
| 5942 | columnNr = -1; | - | ||||||||||||||||||||||||
| 5943 | inputSource = const_cast<QXmlInputSource *>(i); | - | ||||||||||||||||||||||||
| 5944 | initData(); | - | ||||||||||||||||||||||||
| 5945 | - | |||||||||||||||||||||||||
| 5946 | externParameterEntities.clear(); | - | ||||||||||||||||||||||||
| 5947 | parameterEntities.clear(); | - | ||||||||||||||||||||||||
| 5948 | externEntities.clear(); | - | ||||||||||||||||||||||||
| 5949 | entities.clear(); | - | ||||||||||||||||||||||||
| 5950 | - | |||||||||||||||||||||||||
| 5951 | tags.clear(); | - | ||||||||||||||||||||||||
| 5952 | - | |||||||||||||||||||||||||
| 5953 | doctype.clear(); | - | ||||||||||||||||||||||||
| 5954 | xmlVersion.clear(); | - | ||||||||||||||||||||||||
| 5955 | encoding.clear(); | - | ||||||||||||||||||||||||
| 5956 | standalone = QXmlSimpleReaderPrivate::Unknown; | - | ||||||||||||||||||||||||
| 5957 | error.clear(); | - | ||||||||||||||||||||||||
| 5958 | } executed 2106 times by 6 tests: end of blockExecuted by:
| 2106 | ||||||||||||||||||||||||
| 5959 | - | |||||||||||||||||||||||||
| 5960 | - | |||||||||||||||||||||||||
| 5961 | - | |||||||||||||||||||||||||
| 5962 | - | |||||||||||||||||||||||||
| 5963 | - | |||||||||||||||||||||||||
| 5964 | void QXmlSimpleReaderPrivate::initData() | - | ||||||||||||||||||||||||
| 5965 | { | - | ||||||||||||||||||||||||
| 5966 | c = QXmlInputSource::EndOfData; | - | ||||||||||||||||||||||||
| 5967 | xmlRefStack.clear(); | - | ||||||||||||||||||||||||
| 5968 | next(); | - | ||||||||||||||||||||||||
| 5969 | } executed 47014 times by 6 tests: end of blockExecuted by:
| 47014 | ||||||||||||||||||||||||
| 5970 | - | |||||||||||||||||||||||||
| 5971 | - | |||||||||||||||||||||||||
| 5972 | - | |||||||||||||||||||||||||
| 5973 | - | |||||||||||||||||||||||||
| 5974 | - | |||||||||||||||||||||||||
| 5975 | bool QXmlSimpleReaderPrivate::entityExist(const QString& e) const | - | ||||||||||||||||||||||||
| 5976 | { | - | ||||||||||||||||||||||||
| 5977 | if ( parameterEntities.find(e) == parameterEntities.end()
| 10-646 | ||||||||||||||||||||||||
| 5978 | externParameterEntities.find(e) == externParameterEntities.end()
| 0-646 | ||||||||||||||||||||||||
| 5979 | externEntities.find(e) == externEntities.end()
| 0-646 | ||||||||||||||||||||||||
| 5980 | entities.find(e) == entities.end()
| 10-636 | ||||||||||||||||||||||||
| 5981 | return executed 636 times by 2 tests: false;return false;Executed by:
executed 636 times by 2 tests: return false;Executed by:
| 636 | ||||||||||||||||||||||||
| 5982 | } else { | - | ||||||||||||||||||||||||
| 5983 | return executed 20 times by 1 test: true;return true;Executed by:
executed 20 times by 1 test: return true;Executed by:
| 20 | ||||||||||||||||||||||||
| 5984 | } | - | ||||||||||||||||||||||||
| 5985 | } | - | ||||||||||||||||||||||||
| 5986 | - | |||||||||||||||||||||||||
| 5987 | void QXmlSimpleReaderPrivate::reportParseError(const QString& error) | - | ||||||||||||||||||||||||
| 5988 | { | - | ||||||||||||||||||||||||
| 5989 | this->error = error; | - | ||||||||||||||||||||||||
| 5990 | if (errorHnd
| 0-155 | ||||||||||||||||||||||||
| 5991 | if (this->error.isNull()
| 0-155 | ||||||||||||||||||||||||
| 5992 | const QXmlParseException ex(QLatin1String("no error occurred"), columnNr+1, lineNr+1, | - | ||||||||||||||||||||||||
| 5993 | thisPublicId, thisSystemId); | - | ||||||||||||||||||||||||
| 5994 | errorHnd->fatalError(ex); | - | ||||||||||||||||||||||||
| 5995 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 5996 | const QXmlParseException ex(this->error, columnNr+1, lineNr+1, | - | ||||||||||||||||||||||||
| 5997 | thisPublicId, thisSystemId); | - | ||||||||||||||||||||||||
| 5998 | errorHnd->fatalError(ex); | - | ||||||||||||||||||||||||
| 5999 | } executed 155 times by 1 test: end of blockExecuted by:
| 155 | ||||||||||||||||||||||||
| 6000 | } | - | ||||||||||||||||||||||||
| 6001 | } executed 155 times by 1 test: end of blockExecuted by:
| 155 | ||||||||||||||||||||||||
| 6002 | - | |||||||||||||||||||||||||
| 6003 | - | |||||||||||||||||||||||||
| 6004 | - | |||||||||||||||||||||||||
| 6005 | - | |||||||||||||||||||||||||
| 6006 | - | |||||||||||||||||||||||||
| 6007 | - | |||||||||||||||||||||||||
| 6008 | - | |||||||||||||||||||||||||
| 6009 | void QXmlSimpleReaderPrivate::unexpectedEof(ParseFunction where, int state) | - | ||||||||||||||||||||||||
| 6010 | { | - | ||||||||||||||||||||||||
| 6011 | if (parseStack == 0
| 19-44467 | ||||||||||||||||||||||||
| 6012 | reportParseError(QLatin1String("unexpected end of file")); | - | ||||||||||||||||||||||||
| 6013 | } executed 19 times by 1 test: else {end of blockExecuted by:
| 19 | ||||||||||||||||||||||||
| 6014 | if (c == QXmlInputSource::EndOfDocument
| 0-44467 | ||||||||||||||||||||||||
| 6015 | reportParseError(QLatin1String("unexpected end of file")); | - | ||||||||||||||||||||||||
| 6016 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 6017 | pushParseState(where, state); | - | ||||||||||||||||||||||||
| 6018 | } executed 44467 times by 1 test: end of blockExecuted by:
| 44467 | ||||||||||||||||||||||||
| 6019 | } | - | ||||||||||||||||||||||||
| 6020 | } | - | ||||||||||||||||||||||||
| 6021 | void QXmlSimpleReaderPrivate::parseFailed(ParseFunction where, int state) | - | ||||||||||||||||||||||||
| 6022 | { | - | ||||||||||||||||||||||||
| 6023 | if (parseStack!=0
| 0-111660 | ||||||||||||||||||||||||
| 6024 | pushParseState(where, state); | - | ||||||||||||||||||||||||
| 6025 | } executed 111660 times by 1 test: end of blockExecuted by:
| 111660 | ||||||||||||||||||||||||
| 6026 | } executed 112002 times by 1 test: end of blockExecuted by:
| 112002 | ||||||||||||||||||||||||
| 6027 | void QXmlSimpleReaderPrivate::pushParseState(ParseFunction function, int state) | - | ||||||||||||||||||||||||
| 6028 | { | - | ||||||||||||||||||||||||
| 6029 | QXmlSimpleReaderPrivate::ParseState ps; | - | ||||||||||||||||||||||||
| 6030 | ps.function = function; | - | ||||||||||||||||||||||||
| 6031 | ps.state = state; | - | ||||||||||||||||||||||||
| 6032 | parseStack->push(ps); | - | ||||||||||||||||||||||||
| 6033 | } executed 201035 times by 1 test: end of blockExecuted by:
| 201035 | ||||||||||||||||||||||||
| 6034 | - | |||||||||||||||||||||||||
| 6035 | inline static void updateValue(QString &value, const QChar *array, int &arrayPos, int &valueLen) | - | ||||||||||||||||||||||||
| 6036 | { | - | ||||||||||||||||||||||||
| 6037 | value.resize(valueLen + arrayPos); | - | ||||||||||||||||||||||||
| 6038 | memcpy(value.data() + valueLen, array, arrayPos * sizeof(QChar)); | - | ||||||||||||||||||||||||
| 6039 | valueLen += arrayPos; | - | ||||||||||||||||||||||||
| 6040 | arrayPos = 0; | - | ||||||||||||||||||||||||
| 6041 | } executed 53191 times by 6 tests: end of blockExecuted by:
| 53191 | ||||||||||||||||||||||||
| 6042 | - | |||||||||||||||||||||||||
| 6043 | - | |||||||||||||||||||||||||
| 6044 | const QString& QXmlSimpleReaderPrivate::string() | - | ||||||||||||||||||||||||
| 6045 | { | - | ||||||||||||||||||||||||
| 6046 | updateValue(stringValue, stringArray, stringArrayPos, stringValueLen); | - | ||||||||||||||||||||||||
| 6047 | return executed 21656 times by 6 tests: stringValue;return stringValue;Executed by:
executed 21656 times by 6 tests: return stringValue;Executed by:
| 21656 | ||||||||||||||||||||||||
| 6048 | } | - | ||||||||||||||||||||||||
| 6049 | const QString& QXmlSimpleReaderPrivate::name() | - | ||||||||||||||||||||||||
| 6050 | { | - | ||||||||||||||||||||||||
| 6051 | updateValue(nameValue, nameArray, nameArrayPos, nameValueLen); | - | ||||||||||||||||||||||||
| 6052 | return executed 29710 times by 6 tests: nameValue;return nameValue;Executed by:
executed 29710 times by 6 tests: return nameValue;Executed by:
| 29710 | ||||||||||||||||||||||||
| 6053 | } | - | ||||||||||||||||||||||||
| 6054 | const QString& QXmlSimpleReaderPrivate::ref() | - | ||||||||||||||||||||||||
| 6055 | { | - | ||||||||||||||||||||||||
| 6056 | updateValue(refValue, refArray, refArrayPos, refValueLen); | - | ||||||||||||||||||||||||
| 6057 | return executed 1793 times by 3 tests: refValue;return refValue;Executed by:
executed 1793 times by 3 tests: return refValue;Executed by:
| 1793 | ||||||||||||||||||||||||
| 6058 | } | - | ||||||||||||||||||||||||
| 6059 | - | |||||||||||||||||||||||||
| 6060 | void QXmlSimpleReaderPrivate::stringAddC(QChar ch) | - | ||||||||||||||||||||||||
| 6061 | { | - | ||||||||||||||||||||||||
| 6062 | if (stringArrayPos == 256
| 32-426009 | ||||||||||||||||||||||||
| 6063 | updateValue(stringValue, stringArray, stringArrayPos, stringValueLen); executed 32 times by 1 test: updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);Executed by:
| 32 | ||||||||||||||||||||||||
| 6064 | stringArray[stringArrayPos++] = ch; | - | ||||||||||||||||||||||||
| 6065 | } executed 426041 times by 6 tests: end of blockExecuted by:
| 426041 | ||||||||||||||||||||||||
| 6066 | void QXmlSimpleReaderPrivate::nameAddC(QChar ch) | - | ||||||||||||||||||||||||
| 6067 | { | - | ||||||||||||||||||||||||
| 6068 | if (nameArrayPos == 256
| 0-126369 | ||||||||||||||||||||||||
| 6069 | updateValue(nameValue, nameArray, nameArrayPos, nameValueLen); never executed: updateValue(nameValue, nameArray, nameArrayPos, nameValueLen); | 0 | ||||||||||||||||||||||||
| 6070 | nameArray[nameArrayPos++] = ch; | - | ||||||||||||||||||||||||
| 6071 | } executed 126369 times by 6 tests: end of blockExecuted by:
| 126369 | ||||||||||||||||||||||||
| 6072 | void QXmlSimpleReaderPrivate::refAddC(QChar ch) | - | ||||||||||||||||||||||||
| 6073 | { | - | ||||||||||||||||||||||||
| 6074 | if (refArrayPos == 256
| 0-4396 | ||||||||||||||||||||||||
| 6075 | updateValue(refValue, refArray, refArrayPos, refValueLen); never executed: updateValue(refValue, refArray, refArrayPos, refValueLen); | 0 | ||||||||||||||||||||||||
| 6076 | refArray[refArrayPos++] = ch; | - | ||||||||||||||||||||||||
| 6077 | } executed 4396 times by 3 tests: end of blockExecuted by:
| 4396 | ||||||||||||||||||||||||
| 6078 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |