| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/xml/qxmlstream.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||
| 9 | enum { StreamEOF = ~0U }; | - | ||||||||||||||||||||||||||||||
| 10 | QXmlStreamEntityResolver::~QXmlStreamEntityResolver() | - | ||||||||||||||||||||||||||||||
| 11 | { | - | ||||||||||||||||||||||||||||||
| 12 | } | - | ||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||||||||
| 19 | QString QXmlStreamEntityResolver::resolveEntity(const QString& , const QString& ) | - | ||||||||||||||||||||||||||||||
| 20 | { | - | ||||||||||||||||||||||||||||||
| 21 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||
| 22 | } | - | ||||||||||||||||||||||||||||||
| 23 | QString QXmlStreamEntityResolver::resolveUndeclaredEntity(const QString & ) | - | ||||||||||||||||||||||||||||||
| 24 | { | - | ||||||||||||||||||||||||||||||
| 25 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||
| 26 | } | - | ||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||||||||
| 30 | QString QXmlStreamReaderPrivate::resolveUndeclaredEntity(const QString &name) | - | ||||||||||||||||||||||||||||||
| 31 | { | - | ||||||||||||||||||||||||||||||
| 32 | if (entityResolver
| 0-2 | ||||||||||||||||||||||||||||||
| 33 | return executed 2 times by 1 test: entityResolver->resolveUndeclaredEntity(name);return entityResolver->resolveUndeclaredEntity(name);Executed by:
executed 2 times by 1 test: return entityResolver->resolveUndeclaredEntity(name);Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 34 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||
| 35 | } | - | ||||||||||||||||||||||||||||||
| 36 | void QXmlStreamReader::setEntityResolver(QXmlStreamEntityResolver *resolver) | - | ||||||||||||||||||||||||||||||
| 37 | { | - | ||||||||||||||||||||||||||||||
| 38 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 39 | d->entityResolver = resolver; | - | ||||||||||||||||||||||||||||||
| 40 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 41 | QXmlStreamEntityResolver *QXmlStreamReader::entityResolver() const | - | ||||||||||||||||||||||||||||||
| 42 | { | - | ||||||||||||||||||||||||||||||
| 43 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 44 | return never executed: d->entityResolver;return d->entityResolver;never executed: return d->entityResolver; | 0 | ||||||||||||||||||||||||||||||
| 45 | } | - | ||||||||||||||||||||||||||||||
| 46 | QXmlStreamReader::QXmlStreamReader() | - | ||||||||||||||||||||||||||||||
| 47 | : d_ptr(new QXmlStreamReaderPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 48 | { | - | ||||||||||||||||||||||||||||||
| 49 | } executed 3174 times by 1 test: end of blockExecuted by:
| 3174 | ||||||||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||||||||
| 54 | - | |||||||||||||||||||||||||||||||
| 55 | QXmlStreamReader::QXmlStreamReader(QIODevice *device) | - | ||||||||||||||||||||||||||||||
| 56 | : d_ptr(new QXmlStreamReaderPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 57 | { | - | ||||||||||||||||||||||||||||||
| 58 | setDevice(device); | - | ||||||||||||||||||||||||||||||
| 59 | } executed 519 times by 2 tests: end of blockExecuted by:
| 519 | ||||||||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||||||||
| 66 | QXmlStreamReader::QXmlStreamReader(const QByteArray &data) | - | ||||||||||||||||||||||||||||||
| 67 | : d_ptr(new QXmlStreamReaderPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 68 | { | - | ||||||||||||||||||||||||||||||
| 69 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 70 | d->dataBuffer = data; | - | ||||||||||||||||||||||||||||||
| 71 | } executed 845 times by 2 tests: end of blockExecuted by:
| 845 | ||||||||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||||||||
| 78 | QXmlStreamReader::QXmlStreamReader(const QString &data) | - | ||||||||||||||||||||||||||||||
| 79 | : d_ptr(new QXmlStreamReaderPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 80 | { | - | ||||||||||||||||||||||||||||||
| 81 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||||||||
| 85 | d->dataBuffer = d->codec->fromUnicode(data); | - | ||||||||||||||||||||||||||||||
| 86 | d->decoder = d->codec->makeDecoder(); | - | ||||||||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||||||||
| 88 | d->lockEncoding = true; | - | ||||||||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||||||||
| 90 | } executed 378 times by 13 tests: end of blockExecuted by:
| 378 | ||||||||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||||||||
| 97 | QXmlStreamReader::QXmlStreamReader(const char *data) | - | ||||||||||||||||||||||||||||||
| 98 | : d_ptr(new QXmlStreamReaderPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 99 | { | - | ||||||||||||||||||||||||||||||
| 100 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 101 | d->dataBuffer = QByteArray(data); | - | ||||||||||||||||||||||||||||||
| 102 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||
| 107 | QXmlStreamReader::~QXmlStreamReader() | - | ||||||||||||||||||||||||||||||
| 108 | { | - | ||||||||||||||||||||||||||||||
| 109 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 110 | if (d->deleteDevice
| 0-4922 | ||||||||||||||||||||||||||||||
| 111 | delete d->device; never executed: delete d->device; | 0 | ||||||||||||||||||||||||||||||
| 112 | } executed 4922 times by 15 tests: end of blockExecuted by:
| 4922 | ||||||||||||||||||||||||||||||
| 113 | void QXmlStreamReader::setDevice(QIODevice *device) | - | ||||||||||||||||||||||||||||||
| 114 | { | - | ||||||||||||||||||||||||||||||
| 115 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 116 | if (d->deleteDevice
| 0-2240 | ||||||||||||||||||||||||||||||
| 117 | delete d->device; | - | ||||||||||||||||||||||||||||||
| 118 | d->deleteDevice = false; | - | ||||||||||||||||||||||||||||||
| 119 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 120 | d->device = device; | - | ||||||||||||||||||||||||||||||
| 121 | d->init(); | - | ||||||||||||||||||||||||||||||
| 122 | - | |||||||||||||||||||||||||||||||
| 123 | } executed 2240 times by 2 tests: end of blockExecuted by:
| 2240 | ||||||||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||||||||
| 125 | - | |||||||||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||||||||
| 130 | - | |||||||||||||||||||||||||||||||
| 131 | QIODevice *QXmlStreamReader::device() const | - | ||||||||||||||||||||||||||||||
| 132 | { | - | ||||||||||||||||||||||||||||||
| 133 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 134 | return never executed: d->device;return d->device;never executed: return d->device; | 0 | ||||||||||||||||||||||||||||||
| 135 | } | - | ||||||||||||||||||||||||||||||
| 136 | void QXmlStreamReader::addData(const QByteArray &data) | - | ||||||||||||||||||||||||||||||
| 137 | { | - | ||||||||||||||||||||||||||||||
| 138 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 139 | if (d->device
| 0-57484 | ||||||||||||||||||||||||||||||
| 140 | QMessageLogger(__FILE__, 491, __PRETTY_FUNCTION__).warning("QXmlStreamReader: addData() with device()"); | - | ||||||||||||||||||||||||||||||
| 141 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 142 | } | - | ||||||||||||||||||||||||||||||
| 143 | d->dataBuffer += data; | - | ||||||||||||||||||||||||||||||
| 144 | } executed 57484 times by 1 test: end of blockExecuted by:
| 57484 | ||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||||||||
| 148 | - | |||||||||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||
| 152 | void QXmlStreamReader::addData(const QString &data) | - | ||||||||||||||||||||||||||||||
| 153 | { | - | ||||||||||||||||||||||||||||||
| 154 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 155 | d->lockEncoding = true; | - | ||||||||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||
| 159 | addData(d->codec->fromUnicode(data)); | - | ||||||||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||||||||
| 161 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||||||||
| 164 | - | |||||||||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||||||||
| 166 | - | |||||||||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||
| 169 | void QXmlStreamReader::addData(const char *data) | - | ||||||||||||||||||||||||||||||
| 170 | { | - | ||||||||||||||||||||||||||||||
| 171 | addData(QByteArray(data)); | - | ||||||||||||||||||||||||||||||
| 172 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||||||||
| 176 | - | |||||||||||||||||||||||||||||||
| 177 | - | |||||||||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||||||||
| 180 | void QXmlStreamReader::clear() | - | ||||||||||||||||||||||||||||||
| 181 | { | - | ||||||||||||||||||||||||||||||
| 182 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 183 | d->init(); | - | ||||||||||||||||||||||||||||||
| 184 | if (d->device
| 0-3 | ||||||||||||||||||||||||||||||
| 185 | if (d->deleteDevice
| 0 | ||||||||||||||||||||||||||||||
| 186 | delete d->device; never executed: delete d->device; | 0 | ||||||||||||||||||||||||||||||
| 187 | d->device = 0; | - | ||||||||||||||||||||||||||||||
| 188 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 189 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||
| 190 | bool QXmlStreamReader::atEnd() const | - | ||||||||||||||||||||||||||||||
| 191 | { | - | ||||||||||||||||||||||||||||||
| 192 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 193 | if (d->atEnd
| 118570-690755 | ||||||||||||||||||||||||||||||
| 194 | && ((d->type == QXmlStreamReader::Invalid
| 0-115547 | ||||||||||||||||||||||||||||||
| 195 | || (
| 0-3023 | ||||||||||||||||||||||||||||||
| 196 | if (d->device
| 551-118019 | ||||||||||||||||||||||||||||||
| 197 | return executed 551 times by 2 tests: d->device->atEnd();return d->device->atEnd();Executed by:
executed 551 times by 2 tests: return d->device->atEnd();Executed by:
| 551 | ||||||||||||||||||||||||||||||
| 198 | else | - | ||||||||||||||||||||||||||||||
| 199 | return executed 118019 times by 14 tests: !d->dataBuffer.size();return !d->dataBuffer.size();Executed by:
executed 118019 times by 14 tests: return !d->dataBuffer.size();Executed by:
| 118019 | ||||||||||||||||||||||||||||||
| 200 | } | - | ||||||||||||||||||||||||||||||
| 201 | return executed 690755 times by 15 tests: (d->atEndreturn (d->atEnd || d->type == QXmlStreamReader::Invalid);Executed by:
executed 690755 times by 15 tests: return (d->atEnd || d->type == QXmlStreamReader::Invalid);Executed by:
| 0-690755 | ||||||||||||||||||||||||||||||
| 202 | } | - | ||||||||||||||||||||||||||||||
| 203 | QXmlStreamReader::TokenType QXmlStreamReader::readNext() | - | ||||||||||||||||||||||||||||||
| 204 | { | - | ||||||||||||||||||||||||||||||
| 205 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 206 | if (d->type != Invalid
| 57494-1035578 | ||||||||||||||||||||||||||||||
| 207 | if (!d->hasCheckedStartDocument
| 5954-1029624 | ||||||||||||||||||||||||||||||
| 208 | if (!d->checkStartDocument()
| 1285-4669 | ||||||||||||||||||||||||||||||
| 209 | return executed 4669 times by 13 tests: d->type;return d->type;Executed by:
executed 4669 times by 13 tests: return d->type;Executed by:
| 4669 | ||||||||||||||||||||||||||||||
| 210 | d->parse(); | - | ||||||||||||||||||||||||||||||
| 211 | if (d->atEnd
| 2371-972500 | ||||||||||||||||||||||||||||||
| 212 | d->raiseError(PrematureEndOfDocumentError); executed 45171 times by 1 test: d->raiseError(PrematureEndOfDocumentError);Executed by:
| 45171 | ||||||||||||||||||||||||||||||
| 213 | else if (!d->atEnd
| 5-972500 | ||||||||||||||||||||||||||||||
| 214 | d->raiseWellFormedError(QXmlStream::tr("Extra content at end of document.")); executed 5 times by 1 test: d->raiseWellFormedError(QXmlStream::tr("Extra content at end of document."));Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 215 | } executed 1030909 times by 15 tests: else if (d->error == PrematureEndOfDocumentErrorend of blockExecuted by:
| 12-1030909 | ||||||||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||||||||
| 217 | d->type = NoToken; | - | ||||||||||||||||||||||||||||||
| 218 | d->atEnd = false; | - | ||||||||||||||||||||||||||||||
| 219 | d->token = -1; | - | ||||||||||||||||||||||||||||||
| 220 | return executed 57482 times by 1 test: readNext();return readNext();Executed by:
executed 57482 times by 1 test: return readNext();Executed by:
| 57482 | ||||||||||||||||||||||||||||||
| 221 | } | - | ||||||||||||||||||||||||||||||
| 222 | return executed 1030921 times by 15 tests: d->type;return d->type;Executed by:
executed 1030921 times by 15 tests: return d->type;Executed by:
| 1030921 | ||||||||||||||||||||||||||||||
| 223 | } | - | ||||||||||||||||||||||||||||||
| 224 | QXmlStreamReader::TokenType QXmlStreamReader::tokenType() const | - | ||||||||||||||||||||||||||||||
| 225 | { | - | ||||||||||||||||||||||||||||||
| 226 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 227 | return executed 604486 times by 14 tests: d->type;return d->type;Executed by:
executed 604486 times by 14 tests: return d->type;Executed by:
| 604486 | ||||||||||||||||||||||||||||||
| 228 | } | - | ||||||||||||||||||||||||||||||
| 229 | bool QXmlStreamReader::readNextStartElement() | - | ||||||||||||||||||||||||||||||
| 230 | { | - | ||||||||||||||||||||||||||||||
| 231 | while (readNext() != Invalid
| 12-15735 | ||||||||||||||||||||||||||||||
| 232 | if (isEndElement()
| 2626-13109 | ||||||||||||||||||||||||||||||
| 233 | return executed 2626 times by 14 tests: false;return false;Executed by:
executed 2626 times by 14 tests: return false;Executed by:
| 2626 | ||||||||||||||||||||||||||||||
| 234 | else if (isStartElement()
| 5437-7672 | ||||||||||||||||||||||||||||||
| 235 | return executed 5437 times by 14 tests: true;return true;Executed by:
executed 5437 times by 14 tests: return true;Executed by:
| 5437 | ||||||||||||||||||||||||||||||
| 236 | } executed 7672 times by 12 tests: end of blockExecuted by:
| 7672 | ||||||||||||||||||||||||||||||
| 237 | return executed 12 times by 1 test: false;return false;Executed by:
executed 12 times by 1 test: return false;Executed by:
| 12 | ||||||||||||||||||||||||||||||
| 238 | } | - | ||||||||||||||||||||||||||||||
| 239 | void QXmlStreamReader::skipCurrentElement() | - | ||||||||||||||||||||||||||||||
| 240 | { | - | ||||||||||||||||||||||||||||||
| 241 | int depth = 1; | - | ||||||||||||||||||||||||||||||
| 242 | while (depth
| 7-2686 | ||||||||||||||||||||||||||||||
| 243 | if (isEndElement()
| 24-2655 | ||||||||||||||||||||||||||||||
| 244 | -- executed 2655 times by 14 tests: depth;--depth;Executed by:
executed 2655 times by 14 tests: --depth;Executed by:
| 2655 | ||||||||||||||||||||||||||||||
| 245 | else if (isStartElement()
| 11-13 | ||||||||||||||||||||||||||||||
| 246 | ++ executed 13 times by 2 tests: depth;++depth;Executed by:
executed 13 times by 2 tests: ++depth;Executed by:
| 13 | ||||||||||||||||||||||||||||||
| 247 | } executed 2679 times by 14 tests: end of blockExecuted by:
| 2679 | ||||||||||||||||||||||||||||||
| 248 | } executed 2649 times by 14 tests: end of blockExecuted by:
| 2649 | ||||||||||||||||||||||||||||||
| 249 | static const char QXmlStreamReader_tokenTypeString_string[] = | - | ||||||||||||||||||||||||||||||
| 250 | "NoToken\0" | - | ||||||||||||||||||||||||||||||
| 251 | "Invalid\0" | - | ||||||||||||||||||||||||||||||
| 252 | "StartDocument\0" | - | ||||||||||||||||||||||||||||||
| 253 | "EndDocument\0" | - | ||||||||||||||||||||||||||||||
| 254 | "StartElement\0" | - | ||||||||||||||||||||||||||||||
| 255 | "EndElement\0" | - | ||||||||||||||||||||||||||||||
| 256 | "Characters\0" | - | ||||||||||||||||||||||||||||||
| 257 | "Comment\0" | - | ||||||||||||||||||||||||||||||
| 258 | "DTD\0" | - | ||||||||||||||||||||||||||||||
| 259 | "EntityReference\0" | - | ||||||||||||||||||||||||||||||
| 260 | "ProcessingInstruction\0"; | - | ||||||||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||||||||
| 262 | static const short QXmlStreamReader_tokenTypeString_indices[] = { | - | ||||||||||||||||||||||||||||||
| 263 | 0, 8, 16, 30, 42, 55, 66, 77, 85, 89, 105, 0 | - | ||||||||||||||||||||||||||||||
| 264 | }; | - | ||||||||||||||||||||||||||||||
| 265 | void QXmlStreamReader::setNamespaceProcessing(bool enable) | - | ||||||||||||||||||||||||||||||
| 266 | { | - | ||||||||||||||||||||||||||||||
| 267 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 268 | d->namespaceProcessing = enable; | - | ||||||||||||||||||||||||||||||
| 269 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||||||||
| 271 | bool QXmlStreamReader::namespaceProcessing() const | - | ||||||||||||||||||||||||||||||
| 272 | { | - | ||||||||||||||||||||||||||||||
| 273 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 274 | return never executed: d->namespaceProcessing;return d->namespaceProcessing;never executed: return d->namespaceProcessing; | 0 | ||||||||||||||||||||||||||||||
| 275 | } | - | ||||||||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||||||||
| 281 | QString QXmlStreamReader::tokenString() const | - | ||||||||||||||||||||||||||||||
| 282 | { | - | ||||||||||||||||||||||||||||||
| 283 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 284 | return executed 1903 times by 1 test: QLatin1String(QXmlStreamReader_tokenTypeString_string +return QLatin1String(QXmlStreamReader_tokenTypeString_string + QXmlStreamReader_tokenTypeString_indices[d->type]);Executed by:
executed 1903 times by 1 test: return QLatin1String(QXmlStreamReader_tokenTypeString_string + QXmlStreamReader_tokenTypeString_indices[d->type]);Executed by:
| 1903 | ||||||||||||||||||||||||||||||
| 285 | QXmlStreamReader_tokenTypeString_indices[d->type]); executed 1903 times by 1 test: return QLatin1String(QXmlStreamReader_tokenTypeString_string + QXmlStreamReader_tokenTypeString_indices[d->type]);Executed by:
| 1903 | ||||||||||||||||||||||||||||||
| 286 | } | - | ||||||||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||||||||
| 290 | QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack() | - | ||||||||||||||||||||||||||||||
| 291 | { | - | ||||||||||||||||||||||||||||||
| 292 | tagStack.reserve(16); | - | ||||||||||||||||||||||||||||||
| 293 | tagStackStringStorage.reserve(32); | - | ||||||||||||||||||||||||||||||
| 294 | tagStackStringStorageSize = 0; | - | ||||||||||||||||||||||||||||||
| 295 | NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 296 | namespaceDeclaration.prefix = addToStringStorage(QLatin1String("xml")); | - | ||||||||||||||||||||||||||||||
| 297 | namespaceDeclaration.namespaceUri = addToStringStorage(QLatin1String("http://www.w3.org/XML/1998/namespace")); | - | ||||||||||||||||||||||||||||||
| 298 | initialTagStackStringStorageSize = tagStackStringStorageSize; | - | ||||||||||||||||||||||||||||||
| 299 | } executed 5757 times by 17 tests: end of blockExecuted by:
| 5757 | ||||||||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||||||||
| 303 | QXmlStreamReaderPrivate::QXmlStreamReaderPrivate(QXmlStreamReader *q) | - | ||||||||||||||||||||||||||||||
| 304 | :q_ptr(q) | - | ||||||||||||||||||||||||||||||
| 305 | { | - | ||||||||||||||||||||||||||||||
| 306 | device = 0; | - | ||||||||||||||||||||||||||||||
| 307 | deleteDevice = false; | - | ||||||||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||||||||
| 309 | decoder = 0; | - | ||||||||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||||||||
| 311 | stack_size = 64; | - | ||||||||||||||||||||||||||||||
| 312 | sym_stack = 0; | - | ||||||||||||||||||||||||||||||
| 313 | state_stack = 0; | - | ||||||||||||||||||||||||||||||
| 314 | reallocateStack(); | - | ||||||||||||||||||||||||||||||
| 315 | entityResolver = 0; | - | ||||||||||||||||||||||||||||||
| 316 | init(); | - | ||||||||||||||||||||||||||||||
| 317 | entityHash.insert(QLatin1String("lt"), Entity::createLiteral(QLatin1String("<"))); | - | ||||||||||||||||||||||||||||||
| 318 | entityHash.insert(QLatin1String("gt"), Entity::createLiteral(QLatin1String(">"))); | - | ||||||||||||||||||||||||||||||
| 319 | entityHash.insert(QLatin1String("amp"), Entity::createLiteral(QLatin1String("&"))); | - | ||||||||||||||||||||||||||||||
| 320 | entityHash.insert(QLatin1String("apos"), Entity::createLiteral(QLatin1String("'"))); | - | ||||||||||||||||||||||||||||||
| 321 | entityHash.insert(QLatin1String("quot"), Entity::createLiteral(QLatin1String("\""))); | - | ||||||||||||||||||||||||||||||
| 322 | } executed 5013 times by 15 tests: end of blockExecuted by:
| 5013 | ||||||||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||||||||
| 324 | void QXmlStreamReaderPrivate::init() | - | ||||||||||||||||||||||||||||||
| 325 | { | - | ||||||||||||||||||||||||||||||
| 326 | scanDtd = false; | - | ||||||||||||||||||||||||||||||
| 327 | token = -1; | - | ||||||||||||||||||||||||||||||
| 328 | token_char = 0; | - | ||||||||||||||||||||||||||||||
| 329 | isEmptyElement = false; | - | ||||||||||||||||||||||||||||||
| 330 | isWhitespace = true; | - | ||||||||||||||||||||||||||||||
| 331 | isCDATA = false; | - | ||||||||||||||||||||||||||||||
| 332 | standalone = false; | - | ||||||||||||||||||||||||||||||
| 333 | tos = 0; | - | ||||||||||||||||||||||||||||||
| 334 | resumeReduction = 0; | - | ||||||||||||||||||||||||||||||
| 335 | state_stack[tos++] = 0; | - | ||||||||||||||||||||||||||||||
| 336 | state_stack[tos] = 0; | - | ||||||||||||||||||||||||||||||
| 337 | putStack.clear(); | - | ||||||||||||||||||||||||||||||
| 338 | putStack.reserve(32); | - | ||||||||||||||||||||||||||||||
| 339 | textBuffer.clear(); | - | ||||||||||||||||||||||||||||||
| 340 | textBuffer.reserve(256); | - | ||||||||||||||||||||||||||||||
| 341 | tagStack.clear(); | - | ||||||||||||||||||||||||||||||
| 342 | tagsDone = false; | - | ||||||||||||||||||||||||||||||
| 343 | attributes.clear(); | - | ||||||||||||||||||||||||||||||
| 344 | attributes.reserve(16); | - | ||||||||||||||||||||||||||||||
| 345 | lineNumber = lastLineStart = characterOffset = 0; | - | ||||||||||||||||||||||||||||||
| 346 | readBufferPos = 0; | - | ||||||||||||||||||||||||||||||
| 347 | nbytesread = 0; | - | ||||||||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||||||||
| 349 | codec = QTextCodec::codecForMib(106); | - | ||||||||||||||||||||||||||||||
| 350 | delete decoder; | - | ||||||||||||||||||||||||||||||
| 351 | decoder = 0; | - | ||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||
| 353 | attributeStack.clear(); | - | ||||||||||||||||||||||||||||||
| 354 | attributeStack.reserve(16); | - | ||||||||||||||||||||||||||||||
| 355 | entityParser = 0; | - | ||||||||||||||||||||||||||||||
| 356 | hasCheckedStartDocument = false; | - | ||||||||||||||||||||||||||||||
| 357 | normalizeLiterals = false; | - | ||||||||||||||||||||||||||||||
| 358 | hasSeenTag = false; | - | ||||||||||||||||||||||||||||||
| 359 | atEnd = false; | - | ||||||||||||||||||||||||||||||
| 360 | inParseEntity = false; | - | ||||||||||||||||||||||||||||||
| 361 | referenceToUnparsedEntityDetected = false; | - | ||||||||||||||||||||||||||||||
| 362 | referenceToParameterEntityDetected = false; | - | ||||||||||||||||||||||||||||||
| 363 | hasExternalDtdSubset = false; | - | ||||||||||||||||||||||||||||||
| 364 | lockEncoding = false; | - | ||||||||||||||||||||||||||||||
| 365 | namespaceProcessing = true; | - | ||||||||||||||||||||||||||||||
| 366 | rawReadBuffer.clear(); | - | ||||||||||||||||||||||||||||||
| 367 | dataBuffer.clear(); | - | ||||||||||||||||||||||||||||||
| 368 | readBuffer.clear(); | - | ||||||||||||||||||||||||||||||
| 369 | tagStackStringStorageSize = initialTagStackStringStorageSize; | - | ||||||||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||||||||
| 371 | type = QXmlStreamReader::NoToken; | - | ||||||||||||||||||||||||||||||
| 372 | error = QXmlStreamReader::NoError; | - | ||||||||||||||||||||||||||||||
| 373 | } executed 7289 times by 15 tests: end of blockExecuted by:
| 7289 | ||||||||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||||||||
| 375 | - | |||||||||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||||||||
| 378 | - | |||||||||||||||||||||||||||||||
| 379 | void QXmlStreamReaderPrivate::parseEntity(const QString &value) | - | ||||||||||||||||||||||||||||||
| 380 | { | - | ||||||||||||||||||||||||||||||
| 381 | QXmlStreamReader * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 382 | - | |||||||||||||||||||||||||||||||
| 383 | if (value.isEmpty()
| 14-124 | ||||||||||||||||||||||||||||||
| 384 | return; executed 14 times by 1 test: return;Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||
| 386 | - | |||||||||||||||||||||||||||||||
| 387 | if (!entityParser
| 33-91 | ||||||||||||||||||||||||||||||
| 388 | entityParser = new QXmlStreamReaderPrivate(q); executed 91 times by 1 test: entityParser = new QXmlStreamReaderPrivate(q);Executed by:
| 91 | ||||||||||||||||||||||||||||||
| 389 | else | - | ||||||||||||||||||||||||||||||
| 390 | entityParser->init(); executed 33 times by 1 test: entityParser->init();Executed by:
| 33 | ||||||||||||||||||||||||||||||
| 391 | entityParser->inParseEntity = true; | - | ||||||||||||||||||||||||||||||
| 392 | entityParser->readBuffer = value; | - | ||||||||||||||||||||||||||||||
| 393 | entityParser->injectToken(PARSE_ENTITY); | - | ||||||||||||||||||||||||||||||
| 394 | while (!entityParser->atEnd
| 6-215 | ||||||||||||||||||||||||||||||
| 395 | entityParser->parse(); executed 209 times by 1 test: entityParser->parse();Executed by:
| 209 | ||||||||||||||||||||||||||||||
| 396 | if (entityParser->type == QXmlStreamReader::Invalid
| 2-108 | ||||||||||||||||||||||||||||||
| 397 | raiseWellFormedError(QXmlStream::tr("Invalid entity value.")); executed 18 times by 1 test: raiseWellFormedError(QXmlStream::tr("Invalid entity value."));Executed by:
| 18 | ||||||||||||||||||||||||||||||
| 398 | - | |||||||||||||||||||||||||||||||
| 399 | } executed 124 times by 1 test: end of blockExecuted by:
| 124 | ||||||||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||||||||
| 401 | inline void QXmlStreamReaderPrivate::reallocateStack() | - | ||||||||||||||||||||||||||||||
| 402 | { | - | ||||||||||||||||||||||||||||||
| 403 | stack_size <<= 1; | - | ||||||||||||||||||||||||||||||
| 404 | sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value))); | - | ||||||||||||||||||||||||||||||
| 405 | do { if (!(sym_stack)
never executed: } while (0);qBadAlloc(); | 0-5014 | ||||||||||||||||||||||||||||||
| 406 | state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int))); | - | ||||||||||||||||||||||||||||||
| 407 | do { if (!(state_stack)
never executed: } while (0);qBadAlloc(); | 0-5014 | ||||||||||||||||||||||||||||||
| 408 | } executed 5014 times by 15 tests: end of blockExecuted by:
| 5014 | ||||||||||||||||||||||||||||||
| 409 | - | |||||||||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||||||||
| 411 | QXmlStreamReaderPrivate::~QXmlStreamReaderPrivate() | - | ||||||||||||||||||||||||||||||
| 412 | { | - | ||||||||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||||||||
| 414 | delete decoder; | - | ||||||||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||||||||
| 416 | free(sym_stack); | - | ||||||||||||||||||||||||||||||
| 417 | free(state_stack); | - | ||||||||||||||||||||||||||||||
| 418 | delete entityParser; | - | ||||||||||||||||||||||||||||||
| 419 | } executed 5013 times by 15 tests: end of blockExecuted by:
| 5013 | ||||||||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||||||||
| 422 | inline uint QXmlStreamReaderPrivate::filterCarriageReturn() | - | ||||||||||||||||||||||||||||||
| 423 | { | - | ||||||||||||||||||||||||||||||
| 424 | uint peekc = peekChar(); | - | ||||||||||||||||||||||||||||||
| 425 | if (peekc == '\n'
| 2158-8307 | ||||||||||||||||||||||||||||||
| 426 | if (putStack.size()
| 0-8307 | ||||||||||||||||||||||||||||||
| 427 | putStack.pop(); never executed: putStack.pop(); | 0 | ||||||||||||||||||||||||||||||
| 428 | else | - | ||||||||||||||||||||||||||||||
| 429 | ++ executed 8307 times by 1 test: readBufferPos;++readBufferPos;Executed by:
executed 8307 times by 1 test: ++readBufferPos;Executed by:
| 8307 | ||||||||||||||||||||||||||||||
| 430 | return executed 8307 times by 1 test: peekc;return peekc;Executed by:
executed 8307 times by 1 test: return peekc;Executed by:
| 8307 | ||||||||||||||||||||||||||||||
| 431 | } | - | ||||||||||||||||||||||||||||||
| 432 | if (peekc == StreamEOF
| 12-2146 | ||||||||||||||||||||||||||||||
| 433 | putChar('\r'); | - | ||||||||||||||||||||||||||||||
| 434 | return executed 2146 times by 1 test: 0;return 0;Executed by:
executed 2146 times by 1 test: return 0;Executed by:
| 2146 | ||||||||||||||||||||||||||||||
| 435 | } | - | ||||||||||||||||||||||||||||||
| 436 | return executed 12 times by 1 test: '\n';return '\n';Executed by:
executed 12 times by 1 test: return '\n';Executed by:
| 12 | ||||||||||||||||||||||||||||||
| 437 | } | - | ||||||||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||||||||
| 440 | - | |||||||||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||||||||
| 442 | - | |||||||||||||||||||||||||||||||
| 443 | inline uint QXmlStreamReaderPrivate::getChar() | - | ||||||||||||||||||||||||||||||
| 444 | { | - | ||||||||||||||||||||||||||||||
| 445 | uint c; | - | ||||||||||||||||||||||||||||||
| 446 | if (putStack.size()
| 2030335-13769355 | ||||||||||||||||||||||||||||||
| 447 | c = atEnd
| 4859-2025476 | ||||||||||||||||||||||||||||||
| 448 | } executed 2030335 times by 15 tests: else {end of blockExecuted by:
| 2030335 | ||||||||||||||||||||||||||||||
| 449 | if (readBufferPos < readBuffer.size()
| 114655-13654700 | ||||||||||||||||||||||||||||||
| 450 | c = readBuffer.at(readBufferPos++).unicode(); executed 13654700 times by 15 tests: c = readBuffer.at(readBufferPos++).unicode();Executed by:
| 13654700 | ||||||||||||||||||||||||||||||
| 451 | else | - | ||||||||||||||||||||||||||||||
| 452 | c = getChar_helper(); executed 114655 times by 15 tests: c = getChar_helper();Executed by:
| 114655 | ||||||||||||||||||||||||||||||
| 453 | } | - | ||||||||||||||||||||||||||||||
| 454 | - | |||||||||||||||||||||||||||||||
| 455 | return executed 15799690 times by 15 tests: c;return c;Executed by:
executed 15799690 times by 15 tests: return c;Executed by:
| 15799690 | ||||||||||||||||||||||||||||||
| 456 | } | - | ||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||
| 458 | inline uint QXmlStreamReaderPrivate::peekChar() | - | ||||||||||||||||||||||||||||||
| 459 | { | - | ||||||||||||||||||||||||||||||
| 460 | uint c; | - | ||||||||||||||||||||||||||||||
| 461 | if (putStack.size()
| 14016-81284 | ||||||||||||||||||||||||||||||
| 462 | c = putStack.top(); | - | ||||||||||||||||||||||||||||||
| 463 | } executed 14016 times by 13 tests: else if (readBufferPos < readBuffer.size()end of blockExecuted by:
| 6682-74602 | ||||||||||||||||||||||||||||||
| 464 | c = readBuffer.at(readBufferPos).unicode(); | - | ||||||||||||||||||||||||||||||
| 465 | } executed 74602 times by 14 tests: else {end of blockExecuted by:
| 74602 | ||||||||||||||||||||||||||||||
| 466 | if ((
| 3331-3351 | ||||||||||||||||||||||||||||||
| 467 | -- executed 3331 times by 1 test: readBufferPos;--readBufferPos;Executed by:
executed 3331 times by 1 test: --readBufferPos;Executed by:
| 3331 | ||||||||||||||||||||||||||||||
| 468 | } executed 6682 times by 1 test: end of blockExecuted by:
| 6682 | ||||||||||||||||||||||||||||||
| 469 | - | |||||||||||||||||||||||||||||||
| 470 | return executed 95300 times by 14 tests: c;return c;Executed by:
executed 95300 times by 14 tests: return c;Executed by:
| 95300 | ||||||||||||||||||||||||||||||
| 471 | } | - | ||||||||||||||||||||||||||||||
| 472 | bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject) | - | ||||||||||||||||||||||||||||||
| 473 | { | - | ||||||||||||||||||||||||||||||
| 474 | int pos = textBuffer.size(); | - | ||||||||||||||||||||||||||||||
| 475 | int oldLineNumber = lineNumber; | - | ||||||||||||||||||||||||||||||
| 476 | - | |||||||||||||||||||||||||||||||
| 477 | uint c; | - | ||||||||||||||||||||||||||||||
| 478 | while ((
| 5870-1102147 | ||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||
| 480 | switch (c) { | - | ||||||||||||||||||||||||||||||
| 481 | case executed 407 times by 1 test: '\r':case '\r':Executed by:
executed 407 times by 1 test: case '\r':Executed by:
| 407 | ||||||||||||||||||||||||||||||
| 482 | if ((
| 3-404 | ||||||||||||||||||||||||||||||
| 483 | break; executed 3 times by 1 test: break;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 484 | - | |||||||||||||||||||||||||||||||
| 485 | case executed 1704 times by 3 tests: '\n':case '\n':Executed by:
executed 1704 times by 3 tests: case '\n':Executed by:
code before this statement executed 404 times by 1 test: case '\n':Executed by:
| 404-1704 | ||||||||||||||||||||||||||||||
| 486 | ++lineNumber; | - | ||||||||||||||||||||||||||||||
| 487 | lastLineStart = characterOffset + readBufferPos; | - | ||||||||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||||||||
| 489 | case executed 723 times by 1 test: '\t':case '\t':Executed by:
executed 723 times by 1 test: case '\t':Executed by:
code before this statement executed 2108 times by 3 tests: case '\t':Executed by:
| 723-2108 | ||||||||||||||||||||||||||||||
| 490 | textBuffer += QChar(c); | - | ||||||||||||||||||||||||||||||
| 491 | continue; executed 2831 times by 3 tests: continue;Executed by:
| 2831 | ||||||||||||||||||||||||||||||
| 492 | default executed 1099313 times by 4 tests: :default:Executed by:
executed 1099313 times by 4 tests: default:Executed by:
| 1099313 | ||||||||||||||||||||||||||||||
| 493 | if (c < 0x20
| 0-1099277 | ||||||||||||||||||||||||||||||
| 494 | raiseWellFormedError(QXmlStream::tr("Invalid XML character.")); | - | ||||||||||||||||||||||||||||||
| 495 | lineNumber = oldLineNumber; | - | ||||||||||||||||||||||||||||||
| 496 | return executed 41 times by 1 test: false;return false;Executed by:
executed 41 times by 1 test: return false;Executed by:
| 41 | ||||||||||||||||||||||||||||||
| 497 | } | - | ||||||||||||||||||||||||||||||
| 498 | textBuffer += QChar(c); | - | ||||||||||||||||||||||||||||||
| 499 | } executed 1099272 times by 4 tests: end of blockExecuted by:
| 1099272 | ||||||||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||||||||
| 503 | if (c == uint(*str)
| 64450-1034825 | ||||||||||||||||||||||||||||||
| 504 | if (!*(str + 1)
| 0-64450 | ||||||||||||||||||||||||||||||
| 505 | if (tokenToInject >= 0
| 0 | ||||||||||||||||||||||||||||||
| 506 | injectToken(tokenToInject); never executed: injectToken(tokenToInject); | 0 | ||||||||||||||||||||||||||||||
| 507 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||
| 508 | } else { | - | ||||||||||||||||||||||||||||||
| 509 | if (scanString(str + 1, tokenToInject, false)
| 894-63556 | ||||||||||||||||||||||||||||||
| 510 | return executed 63556 times by 4 tests: true;return true;Executed by:
executed 63556 times by 4 tests: return true;Executed by:
| 63556 | ||||||||||||||||||||||||||||||
| 511 | } executed 894 times by 3 tests: end of blockExecuted by:
| 894 | ||||||||||||||||||||||||||||||
| 512 | } | - | ||||||||||||||||||||||||||||||
| 513 | } executed 1035719 times by 4 tests: end of blockExecuted by:
| 1035719 | ||||||||||||||||||||||||||||||
| 514 | putString(textBuffer, pos); | - | ||||||||||||||||||||||||||||||
| 515 | textBuffer.resize(pos); | - | ||||||||||||||||||||||||||||||
| 516 | lineNumber = oldLineNumber; | - | ||||||||||||||||||||||||||||||
| 517 | return executed 5870 times by 1 test: false;return false;Executed by:
executed 5870 times by 1 test: return false;Executed by:
| 5870 | ||||||||||||||||||||||||||||||
| 518 | } | - | ||||||||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||||||||
| 520 | bool QXmlStreamReaderPrivate::scanString(const char *str, short tokenToInject, bool requireSpace) | - | ||||||||||||||||||||||||||||||
| 521 | { | - | ||||||||||||||||||||||||||||||
| 522 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 523 | while (str[n]
| 125737-598096 | ||||||||||||||||||||||||||||||
| 524 | uint c = getChar(); | - | ||||||||||||||||||||||||||||||
| 525 | if (c != ushort(str[n])
| 24872-573224 | ||||||||||||||||||||||||||||||
| 526 | if (c != StreamEOF
| 6701-18171 | ||||||||||||||||||||||||||||||
| 527 | putChar(c); executed 6701 times by 14 tests: putChar(c);Executed by:
| 6701 | ||||||||||||||||||||||||||||||
| 528 | while (n--
| 24872-39487 | ||||||||||||||||||||||||||||||
| 529 | putChar(ushort(str[n])); | - | ||||||||||||||||||||||||||||||
| 530 | } executed 39487 times by 13 tests: end of blockExecuted by:
| 39487 | ||||||||||||||||||||||||||||||
| 531 | return executed 24872 times by 14 tests: false;return false;Executed by:
executed 24872 times by 14 tests: return false;Executed by:
| 24872 | ||||||||||||||||||||||||||||||
| 532 | } | - | ||||||||||||||||||||||||||||||
| 533 | ++n; | - | ||||||||||||||||||||||||||||||
| 534 | } executed 573224 times by 15 tests: end of blockExecuted by:
| 573224 | ||||||||||||||||||||||||||||||
| 535 | for (int i = 0; i < n
| 125737-533737 | ||||||||||||||||||||||||||||||
| 536 | textBuffer += QChar(ushort(str[i])); executed 533737 times by 14 tests: textBuffer += QChar(ushort(str[i]));Executed by:
| 533737 | ||||||||||||||||||||||||||||||
| 537 | if (requireSpace
| 11286-114451 | ||||||||||||||||||||||||||||||
| 538 | int s = fastScanSpace(); | - | ||||||||||||||||||||||||||||||
| 539 | if (!s
| 1435-9677 | ||||||||||||||||||||||||||||||
| 540 | int pos = textBuffer.size() - n - s; | - | ||||||||||||||||||||||||||||||
| 541 | putString(textBuffer, pos); | - | ||||||||||||||||||||||||||||||
| 542 | textBuffer.resize(pos); | - | ||||||||||||||||||||||||||||||
| 543 | return executed 3044 times by 1 test: false;return false;Executed by:
executed 3044 times by 1 test: return false;Executed by:
| 3044 | ||||||||||||||||||||||||||||||
| 544 | } | - | ||||||||||||||||||||||||||||||
| 545 | } executed 8242 times by 14 tests: end of blockExecuted by:
| 8242 | ||||||||||||||||||||||||||||||
| 546 | if (tokenToInject >= 0
| 59137-63556 | ||||||||||||||||||||||||||||||
| 547 | injectToken(tokenToInject); executed 59137 times by 14 tests: injectToken(tokenToInject);Executed by:
| 59137 | ||||||||||||||||||||||||||||||
| 548 | return executed 122693 times by 14 tests: true;return true;Executed by:
executed 122693 times by 14 tests: return true;Executed by:
| 122693 | ||||||||||||||||||||||||||||||
| 549 | } | - | ||||||||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||||||||
| 551 | bool QXmlStreamReaderPrivate::scanAfterLangleBang() | - | ||||||||||||||||||||||||||||||
| 552 | { | - | ||||||||||||||||||||||||||||||
| 553 | switch (peekChar()) { | - | ||||||||||||||||||||||||||||||
| 554 | case executed 46900 times by 2 tests: '[':case '[':Executed by:
executed 46900 times by 2 tests: case '[':Executed by:
| 46900 | ||||||||||||||||||||||||||||||
| 555 | return executed 46900 times by 2 tests: scanString(spell[CDATA_START], CDATA_START, false);return scanString(spell[CDATA_START], CDATA_START, false);Executed by:
executed 46900 times by 2 tests: return scanString(spell[CDATA_START], CDATA_START, false);Executed by:
| 46900 | ||||||||||||||||||||||||||||||
| 556 | case executed 3815 times by 13 tests: 'D':case 'D':Executed by:
executed 3815 times by 13 tests: case 'D':Executed by:
| 3815 | ||||||||||||||||||||||||||||||
| 557 | return executed 3815 times by 13 tests: scanString(spell[DOCTYPE], DOCTYPE);return scanString(spell[DOCTYPE], DOCTYPE);Executed by:
executed 3815 times by 13 tests: return scanString(spell[DOCTYPE], DOCTYPE);Executed by:
| 3815 | ||||||||||||||||||||||||||||||
| 558 | case executed 2355 times by 2 tests: 'A':case 'A':Executed by:
executed 2355 times by 2 tests: case 'A':Executed by:
| 2355 | ||||||||||||||||||||||||||||||
| 559 | return executed 2355 times by 2 tests: scanString(spell[ATTLIST], ATTLIST);return scanString(spell[ATTLIST], ATTLIST);Executed by:
executed 2355 times by 2 tests: return scanString(spell[ATTLIST], ATTLIST);Executed by:
| 2355 | ||||||||||||||||||||||||||||||
| 560 | case executed 382 times by 1 test: 'N':case 'N':Executed by:
executed 382 times by 1 test: case 'N':Executed by:
| 382 | ||||||||||||||||||||||||||||||
| 561 | return executed 382 times by 1 test: scanString(spell[NOTATION], NOTATION);return scanString(spell[NOTATION], NOTATION);Executed by:
executed 382 times by 1 test: return scanString(spell[NOTATION], NOTATION);Executed by:
| 382 | ||||||||||||||||||||||||||||||
| 562 | case executed 6772 times by 2 tests: 'E':case 'E':Executed by:
executed 6772 times by 2 tests: case 'E':Executed by:
| 6772 | ||||||||||||||||||||||||||||||
| 563 | if (scanString(spell[ELEMENT], ELEMENT)
| 2196-4576 | ||||||||||||||||||||||||||||||
| 564 | return executed 2196 times by 2 tests: true;return true;Executed by:
executed 2196 times by 2 tests: return true;Executed by:
| 2196 | ||||||||||||||||||||||||||||||
| 565 | return executed 4576 times by 1 test: scanString(spell[ENTITY], ENTITY);return scanString(spell[ENTITY], ENTITY);Executed by:
executed 4576 times by 1 test: return scanString(spell[ENTITY], ENTITY);Executed by:
| 4576 | ||||||||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||||||||
| 567 | default executed 17408 times by 4 tests: :default:Executed by:
executed 17408 times by 4 tests: default:Executed by:
| 17408 | ||||||||||||||||||||||||||||||
| 568 | ; | - | ||||||||||||||||||||||||||||||
| 569 | } executed 17408 times by 4 tests: ;end of blockExecuted by:
| 17408 | ||||||||||||||||||||||||||||||
| 570 | return executed 17408 times by 4 tests: false;return false;Executed by:
executed 17408 times by 4 tests: return false;Executed by:
| 17408 | ||||||||||||||||||||||||||||||
| 571 | } | - | ||||||||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||||||||
| 573 | bool QXmlStreamReaderPrivate::scanPublicOrSystem() | - | ||||||||||||||||||||||||||||||
| 574 | { | - | ||||||||||||||||||||||||||||||
| 575 | switch (peekChar()) { | - | ||||||||||||||||||||||||||||||
| 576 | case executed 440 times by 1 test: 'S':case 'S':Executed by:
executed 440 times by 1 test: case 'S':Executed by:
| 440 | ||||||||||||||||||||||||||||||
| 577 | return executed 440 times by 1 test: scanString(spell[SYSTEM], SYSTEM);return scanString(spell[SYSTEM], SYSTEM);Executed by:
executed 440 times by 1 test: return scanString(spell[SYSTEM], SYSTEM);Executed by:
| 440 | ||||||||||||||||||||||||||||||
| 578 | case executed 386 times by 12 tests: 'P':case 'P':Executed by:
executed 386 times by 12 tests: case 'P':Executed by:
| 386 | ||||||||||||||||||||||||||||||
| 579 | return executed 386 times by 12 tests: scanString(spell[PUBLIC], PUBLIC);return scanString(spell[PUBLIC], PUBLIC);Executed by:
executed 386 times by 12 tests: return scanString(spell[PUBLIC], PUBLIC);Executed by:
| 386 | ||||||||||||||||||||||||||||||
| 580 | default executed 1864 times by 2 tests: :default:Executed by:
executed 1864 times by 2 tests: default:Executed by:
| 1864 | ||||||||||||||||||||||||||||||
| 581 | ; | - | ||||||||||||||||||||||||||||||
| 582 | } executed 1864 times by 2 tests: end of blockExecuted by:
| 1864 | ||||||||||||||||||||||||||||||
| 583 | return executed 1864 times by 2 tests: false;return false;Executed by:
executed 1864 times by 2 tests: return false;Executed by:
| 1864 | ||||||||||||||||||||||||||||||
| 584 | } | - | ||||||||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||||||||
| 586 | bool QXmlStreamReaderPrivate::scanNData() | - | ||||||||||||||||||||||||||||||
| 587 | { | - | ||||||||||||||||||||||||||||||
| 588 | if (fastScanSpace()
| 48-150 | ||||||||||||||||||||||||||||||
| 589 | if (scanString(spell[NDATA], NDATA)
| 47-103 | ||||||||||||||||||||||||||||||
| 590 | return executed 47 times by 1 test: true;return true;Executed by:
executed 47 times by 1 test: return true;Executed by:
| 47 | ||||||||||||||||||||||||||||||
| 591 | putChar(' '); | - | ||||||||||||||||||||||||||||||
| 592 | } executed 103 times by 1 test: end of blockExecuted by:
| 103 | ||||||||||||||||||||||||||||||
| 593 | return executed 151 times by 1 test: false;return false;Executed by:
executed 151 times by 1 test: return false;Executed by:
| 151 | ||||||||||||||||||||||||||||||
| 594 | } | - | ||||||||||||||||||||||||||||||
| 595 | - | |||||||||||||||||||||||||||||||
| 596 | bool QXmlStreamReaderPrivate::scanAfterDefaultDecl() | - | ||||||||||||||||||||||||||||||
| 597 | { | - | ||||||||||||||||||||||||||||||
| 598 | switch (peekChar()) { | - | ||||||||||||||||||||||||||||||
| 599 | case executed 615 times by 2 tests: 'R':case 'R':Executed by:
executed 615 times by 2 tests: case 'R':Executed by:
| 615 | ||||||||||||||||||||||||||||||
| 600 | return executed 615 times by 2 tests: scanString(spell[REQUIRED], REQUIRED, false);return scanString(spell[REQUIRED], REQUIRED, false);Executed by:
executed 615 times by 2 tests: return scanString(spell[REQUIRED], REQUIRED, false);Executed by:
| 615 | ||||||||||||||||||||||||||||||
| 601 | case executed 1387 times by 2 tests: 'I':case 'I':Executed by:
executed 1387 times by 2 tests: case 'I':Executed by:
| 1387 | ||||||||||||||||||||||||||||||
| 602 | return executed 1387 times by 2 tests: scanString(spell[IMPLIED], IMPLIED, false);return scanString(spell[IMPLIED], IMPLIED, false);Executed by:
executed 1387 times by 2 tests: return scanString(spell[IMPLIED], IMPLIED, false);Executed by:
| 1387 | ||||||||||||||||||||||||||||||
| 603 | case executed 77 times by 2 tests: 'F':case 'F':Executed by:
executed 77 times by 2 tests: case 'F':Executed by:
| 77 | ||||||||||||||||||||||||||||||
| 604 | return executed 77 times by 2 tests: scanString(spell[FIXED], FIXED, false);return scanString(spell[FIXED], FIXED, false);Executed by:
executed 77 times by 2 tests: return scanString(spell[FIXED], FIXED, false);Executed by:
| 77 | ||||||||||||||||||||||||||||||
| 605 | default executed 200 times by 1 test: :default:Executed by:
executed 200 times by 1 test: default:Executed by:
| 200 | ||||||||||||||||||||||||||||||
| 606 | ; | - | ||||||||||||||||||||||||||||||
| 607 | } executed 200 times by 1 test: end of blockExecuted by:
| 200 | ||||||||||||||||||||||||||||||
| 608 | return executed 200 times by 1 test: false;return false;Executed by:
executed 200 times by 1 test: return false;Executed by:
| 200 | ||||||||||||||||||||||||||||||
| 609 | } | - | ||||||||||||||||||||||||||||||
| 610 | - | |||||||||||||||||||||||||||||||
| 611 | bool QXmlStreamReaderPrivate::scanAttType() | - | ||||||||||||||||||||||||||||||
| 612 | { | - | ||||||||||||||||||||||||||||||
| 613 | switch (peekChar()) { | - | ||||||||||||||||||||||||||||||
| 614 | case executed 1351 times by 2 tests: 'C':case 'C':Executed by:
executed 1351 times by 2 tests: case 'C':Executed by:
| 1351 | ||||||||||||||||||||||||||||||
| 615 | return executed 1351 times by 2 tests: scanString(spell[CDATA], CDATA);return scanString(spell[CDATA], CDATA);Executed by:
executed 1351 times by 2 tests: return scanString(spell[CDATA], CDATA);Executed by:
| 1351 | ||||||||||||||||||||||||||||||
| 616 | case executed 272 times by 1 test: 'I':case 'I':Executed by:
executed 272 times by 1 test: case 'I':Executed by:
| 272 | ||||||||||||||||||||||||||||||
| 617 | if (scanString(spell[ID], ID)
| 70-202 | ||||||||||||||||||||||||||||||
| 618 | return executed 70 times by 1 test: true;return true;Executed by:
executed 70 times by 1 test: return true;Executed by:
| 70 | ||||||||||||||||||||||||||||||
| 619 | if (scanString(spell[IDREF], IDREF)
| 23-179 | ||||||||||||||||||||||||||||||
| 620 | return executed 23 times by 1 test: true;return true;Executed by:
executed 23 times by 1 test: return true;Executed by:
| 23 | ||||||||||||||||||||||||||||||
| 621 | return executed 179 times by 1 test: scanString(spell[IDREFS], IDREFS);return scanString(spell[IDREFS], IDREFS);Executed by:
executed 179 times by 1 test: return scanString(spell[IDREFS], IDREFS);Executed by:
| 179 | ||||||||||||||||||||||||||||||
| 622 | case executed 163 times by 1 test: 'E':case 'E':Executed by:
executed 163 times by 1 test: case 'E':Executed by:
| 163 | ||||||||||||||||||||||||||||||
| 623 | if (scanString(spell[ENTITY], ENTITY)
| 26-137 | ||||||||||||||||||||||||||||||
| 624 | return executed 26 times by 1 test: true;return true;Executed by:
executed 26 times by 1 test: return true;Executed by:
| 26 | ||||||||||||||||||||||||||||||
| 625 | return executed 137 times by 1 test: scanString(spell[ENTITIES], ENTITIES);return scanString(spell[ENTITIES], ENTITIES);Executed by:
executed 137 times by 1 test: return scanString(spell[ENTITIES], ENTITIES);Executed by:
| 137 | ||||||||||||||||||||||||||||||
| 626 | case executed 334 times by 1 test: 'N':case 'N':Executed by:
executed 334 times by 1 test: case 'N':Executed by:
| 334 | ||||||||||||||||||||||||||||||
| 627 | if (scanString(spell[NOTATION], NOTATION)
| 42-292 | ||||||||||||||||||||||||||||||
| 628 | return executed 42 times by 1 test: true;return true;Executed by:
executed 42 times by 1 test: return true;Executed by:
| 42 | ||||||||||||||||||||||||||||||
| 629 | if (scanString(spell[NMTOKEN], NMTOKEN)
| 24-268 | ||||||||||||||||||||||||||||||
| 630 | return executed 24 times by 1 test: true;return true;Executed by:
executed 24 times by 1 test: return true;Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 631 | return executed 268 times by 1 test: scanString(spell[NMTOKENS], NMTOKENS);return scanString(spell[NMTOKENS], NMTOKENS);Executed by:
executed 268 times by 1 test: return scanString(spell[NMTOKENS], NMTOKENS);Executed by:
| 268 | ||||||||||||||||||||||||||||||
| 632 | default executed 114 times by 2 tests: :default:Executed by:
executed 114 times by 2 tests: default:Executed by:
| 114 | ||||||||||||||||||||||||||||||
| 633 | ; | - | ||||||||||||||||||||||||||||||
| 634 | } executed 114 times by 2 tests: end of blockExecuted by:
| 114 | ||||||||||||||||||||||||||||||
| 635 | return executed 114 times by 2 tests: false;return false;Executed by:
executed 114 times by 2 tests: return false;Executed by:
| 114 | ||||||||||||||||||||||||||||||
| 636 | } | - | ||||||||||||||||||||||||||||||
| 637 | inline int QXmlStreamReaderPrivate::fastScanLiteralContent() | - | ||||||||||||||||||||||||||||||
| 638 | { | - | ||||||||||||||||||||||||||||||
| 639 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 640 | uint c; | - | ||||||||||||||||||||||||||||||
| 641 | while ((
| 2235-1095169 | ||||||||||||||||||||||||||||||
| 642 | switch (ushort(c)) { | - | ||||||||||||||||||||||||||||||
| 643 | case never executed: 0xfffe:case 0xfffe:never executed: case 0xfffe: | 0 | ||||||||||||||||||||||||||||||
| 644 | case never executed: 0xffff:case 0xffff:never executed: case 0xffff: | 0 | ||||||||||||||||||||||||||||||
| 645 | case executed 82 times by 1 test: 0:case 0:Executed by:
executed 82 times by 1 test: case 0:Executed by:
| 82 | ||||||||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||||||||
| 648 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 649 | return executed 82 times by 1 test: n;return n;Executed by:
executed 82 times by 1 test: return n;Executed by:
| 82 | ||||||||||||||||||||||||||||||
| 650 | case executed 24 times by 1 test: '\r':case '\r':Executed by:
executed 24 times by 1 test: case '\r':Executed by:
| 24 | ||||||||||||||||||||||||||||||
| 651 | if (filterCarriageReturn() == 0
| 1-23 | ||||||||||||||||||||||||||||||
| 652 | return executed 1 time by 1 test: n;return n;Executed by:
executed 1 time by 1 test: return n;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||||||||
| 654 | case executed 478 times by 2 tests: '\n':case '\n':Executed by:
executed 478 times by 2 tests: case '\n':Executed by:
code before this statement executed 23 times by 1 test: case '\n':Executed by:
| 23-478 | ||||||||||||||||||||||||||||||
| 655 | ++lineNumber; | - | ||||||||||||||||||||||||||||||
| 656 | lastLineStart = characterOffset + readBufferPos; | - | ||||||||||||||||||||||||||||||
| 657 | - | |||||||||||||||||||||||||||||||
| 658 | case executed 15480 times by 14 tests: ' ':case ' ':Executed by:
executed 15480 times by 14 tests: case ' ':Executed by:
code before this statement executed 501 times by 2 tests: case ' ':Executed by:
| 501-15480 | ||||||||||||||||||||||||||||||
| 659 | case executed 18 times by 1 test: '\t':case '\t':Executed by:
executed 18 times by 1 test: case '\t':Executed by:
| 18 | ||||||||||||||||||||||||||||||
| 660 | if (normalizeLiterals
| 1049-14950 | ||||||||||||||||||||||||||||||
| 661 | textBuffer += QLatin1Char(' '); executed 14950 times by 4 tests: textBuffer += QLatin1Char(' ');Executed by:
| 14950 | ||||||||||||||||||||||||||||||
| 662 | else | - | ||||||||||||||||||||||||||||||
| 663 | textBuffer += QChar(c); executed 1049 times by 12 tests: textBuffer += QChar(c);Executed by:
| 1049 | ||||||||||||||||||||||||||||||
| 664 | ++n; | - | ||||||||||||||||||||||||||||||
| 665 | break; executed 15999 times by 14 tests: break;Executed by:
| 15999 | ||||||||||||||||||||||||||||||
| 666 | case executed 1657 times by 4 tests: '&':case '&':Executed by:
executed 1657 times by 4 tests: case '&':Executed by:
| 1657 | ||||||||||||||||||||||||||||||
| 667 | case executed 19 times by 1 test: '<':case '<':Executed by:
executed 19 times by 1 test: case '<':Executed by:
| 19 | ||||||||||||||||||||||||||||||
| 668 | case executed 244773 times by 15 tests: '\"':case '\"':Executed by:
executed 244773 times by 15 tests: case '\"':Executed by:
| 244773 | ||||||||||||||||||||||||||||||
| 669 | case executed 245 times by 2 tests: '\'':case '\'':Executed by:
executed 245 times by 2 tests: case '\'':Executed by:
| 245 | ||||||||||||||||||||||||||||||
| 670 | if (!(c & 0xff0000)
| 0-246694 | ||||||||||||||||||||||||||||||
| 671 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 672 | return executed 246694 times by 15 tests: n;return n;Executed by:
executed 246694 times by 15 tests: return n;Executed by:
| 246694 | ||||||||||||||||||||||||||||||
| 673 | } | - | ||||||||||||||||||||||||||||||
| 674 | - | |||||||||||||||||||||||||||||||
| 675 | default executed 832393 times by 15 tests: default:Executed by:
code before this statement never executed: default:executed 832393 times by 15 tests: :default:Executed by:
code before this statement never executed: default:executed 832393 times by 15 tests: default:Executed by:
| 0-832393 | ||||||||||||||||||||||||||||||
| 676 | if (c < 0x20
| 3-832390 | ||||||||||||||||||||||||||||||
| 677 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 678 | return executed 3 times by 1 test: n;return n;Executed by:
executed 3 times by 1 test: return n;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 679 | } | - | ||||||||||||||||||||||||||||||
| 680 | textBuffer += QChar(c); | - | ||||||||||||||||||||||||||||||
| 681 | ++n; | - | ||||||||||||||||||||||||||||||
| 682 | } executed 832390 times by 15 tests: end of blockExecuted by:
| 832390 | ||||||||||||||||||||||||||||||
| 683 | } | - | ||||||||||||||||||||||||||||||
| 684 | return executed 2235 times by 1 test: n;return n;Executed by:
executed 2235 times by 1 test: return n;Executed by:
| 2235 | ||||||||||||||||||||||||||||||
| 685 | } | - | ||||||||||||||||||||||||||||||
| 686 | - | |||||||||||||||||||||||||||||||
| 687 | inline int QXmlStreamReaderPrivate::fastScanSpace() | - | ||||||||||||||||||||||||||||||
| 688 | { | - | ||||||||||||||||||||||||||||||
| 689 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 690 | uint c; | - | ||||||||||||||||||||||||||||||
| 691 | while ((
| 6683-309203 | ||||||||||||||||||||||||||||||
| 692 | switch (c) { | - | ||||||||||||||||||||||||||||||
| 693 | case executed 323 times by 1 test: '\r':case '\r':Executed by:
executed 323 times by 1 test: case '\r':Executed by:
| 323 | ||||||||||||||||||||||||||||||
| 694 | if ((
| 45-278 | ||||||||||||||||||||||||||||||
| 695 | return executed 45 times by 1 test: n;return n;Executed by:
executed 45 times by 1 test: return n;Executed by:
| 45 | ||||||||||||||||||||||||||||||
| 696 | - | |||||||||||||||||||||||||||||||
| 697 | case executed 135 times by 2 tests: '\n':case '\n':Executed by:
executed 135 times by 2 tests: case '\n':Executed by:
code before this statement executed 278 times by 1 test: case '\n':Executed by:
| 135-278 | ||||||||||||||||||||||||||||||
| 698 | ++lineNumber; | - | ||||||||||||||||||||||||||||||
| 699 | lastLineStart = characterOffset + readBufferPos; | - | ||||||||||||||||||||||||||||||
| 700 | - | |||||||||||||||||||||||||||||||
| 701 | case executed 14003 times by 14 tests: ' ':case ' ':Executed by:
executed 14003 times by 14 tests: case ' ':Executed by:
code before this statement executed 413 times by 2 tests: case ' ':Executed by:
| 413-14003 | ||||||||||||||||||||||||||||||
| 702 | case executed 562 times by 1 test: '\t':case '\t':Executed by:
executed 562 times by 1 test: case '\t':Executed by:
| 562 | ||||||||||||||||||||||||||||||
| 703 | textBuffer += QChar(c); | - | ||||||||||||||||||||||||||||||
| 704 | ++n; | - | ||||||||||||||||||||||||||||||
| 705 | break; executed 14978 times by 14 tests: break;Executed by:
| 14978 | ||||||||||||||||||||||||||||||
| 706 | default executed 294180 times by 15 tests: :default:Executed by:
executed 294180 times by 15 tests: default:Executed by:
| 294180 | ||||||||||||||||||||||||||||||
| 707 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 708 | return executed 294180 times by 15 tests: n;return n;Executed by:
executed 294180 times by 15 tests: return n;Executed by:
| 294180 | ||||||||||||||||||||||||||||||
| 709 | } | - | ||||||||||||||||||||||||||||||
| 710 | } | - | ||||||||||||||||||||||||||||||
| 711 | return executed 6683 times by 1 test: n;return n;Executed by:
executed 6683 times by 1 test: return n;Executed by:
| 6683 | ||||||||||||||||||||||||||||||
| 712 | } | - | ||||||||||||||||||||||||||||||
| 713 | - | |||||||||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||||||||
| 716 | - | |||||||||||||||||||||||||||||||
| 717 | - | |||||||||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||||||||
| 720 | inline int QXmlStreamReaderPrivate::fastScanContentCharList() | - | ||||||||||||||||||||||||||||||
| 721 | { | - | ||||||||||||||||||||||||||||||
| 722 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 723 | uint c; | - | ||||||||||||||||||||||||||||||
| 724 | while ((
| 8002-3619062 | ||||||||||||||||||||||||||||||
| 725 | switch (ushort(c)) { | - | ||||||||||||||||||||||||||||||
| 726 | case never executed: 0xfffe:case 0xfffe:never executed: case 0xfffe: | 0 | ||||||||||||||||||||||||||||||
| 727 | case executed 1 time by 1 test: 0xffff:case 0xffff:Executed by:
executed 1 time by 1 test: case 0xffff:Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 728 | case executed 60 times by 1 test: 0:case 0:Executed by:
executed 60 times by 1 test: case 0:Executed by:
| 60 | ||||||||||||||||||||||||||||||
| 729 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 730 | return executed 61 times by 1 test: n;return n;Executed by:
executed 61 times by 1 test: return n;Executed by:
| 61 | ||||||||||||||||||||||||||||||
| 731 | case executed 17 times by 1 test: ']':case ']':Executed by:
executed 17 times by 1 test: {case ']':Executed by:
| 17 | ||||||||||||||||||||||||||||||
| 732 | isWhitespace = false; | - | ||||||||||||||||||||||||||||||
| 733 | int pos = textBuffer.size(); | - | ||||||||||||||||||||||||||||||
| 734 | textBuffer += QChar(ushort(c)); | - | ||||||||||||||||||||||||||||||
| 735 | ++n; | - | ||||||||||||||||||||||||||||||
| 736 | while ((
| 11-17 | ||||||||||||||||||||||||||||||
| 737 | textBuffer += QChar(ushort(c)); | - | ||||||||||||||||||||||||||||||
| 738 | ++n; | - | ||||||||||||||||||||||||||||||
| 739 | } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||||||||||||||||||||
| 740 | if (c == 0
| 0-17 | ||||||||||||||||||||||||||||||
| 741 | putString(textBuffer, pos); | - | ||||||||||||||||||||||||||||||
| 742 | textBuffer.resize(pos); | - | ||||||||||||||||||||||||||||||
| 743 | } never executed: else if (c == '>'end of block
| 0-9 | ||||||||||||||||||||||||||||||
| 744 | raiseWellFormedError(QXmlStream::tr("Sequence ']]>' not allowed in content.")); | - | ||||||||||||||||||||||||||||||
| 745 | } executed 8 times by 1 test: else {end of blockExecuted by:
| 8 | ||||||||||||||||||||||||||||||
| 746 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 747 | break; executed 9 times by 1 test: break;Executed by:
| 9 | ||||||||||||||||||||||||||||||
| 748 | } | - | ||||||||||||||||||||||||||||||
| 749 | return executed 8 times by 1 test: n;return n;Executed by:
executed 8 times by 1 test: return n;Executed by:
| 8 | ||||||||||||||||||||||||||||||
| 750 | } break; dead code: break; | - | ||||||||||||||||||||||||||||||
| 751 | case executed 389 times by 1 test: '\r':case '\r':Executed by:
executed 389 times by 1 test: case '\r':Executed by:
| 389 | ||||||||||||||||||||||||||||||
| 752 | if ((
| 127-262 | ||||||||||||||||||||||||||||||
| 753 | return executed 127 times by 1 test: n;return n;Executed by:
executed 127 times by 1 test: return n;Executed by:
| 127 | ||||||||||||||||||||||||||||||
| 754 | - | |||||||||||||||||||||||||||||||
| 755 | case executed 439 times by 3 tests: '\n':case '\n':Executed by:
executed 439 times by 3 tests: case '\n':Executed by:
code before this statement executed 262 times by 1 test: case '\n':Executed by:
| 262-439 | ||||||||||||||||||||||||||||||
| 756 | ++lineNumber; | - | ||||||||||||||||||||||||||||||
| 757 | lastLineStart = characterOffset + readBufferPos; | - | ||||||||||||||||||||||||||||||
| 758 | - | |||||||||||||||||||||||||||||||
| 759 | case executed 1097530 times by 13 tests: ' ':case ' ':Executed by:
executed 1097530 times by 13 tests: case ' ':Executed by:
code before this statement executed 701 times by 3 tests: case ' ':Executed by:
| 701-1097530 | ||||||||||||||||||||||||||||||
| 760 | case never executed: '\t':case '\t':never executed: case '\t': | 0 | ||||||||||||||||||||||||||||||
| 761 | textBuffer += QChar(ushort(c)); | - | ||||||||||||||||||||||||||||||
| 762 | ++n; | - | ||||||||||||||||||||||||||||||
| 763 | break; executed 1098231 times by 13 tests: break;Executed by:
| 1098231 | ||||||||||||||||||||||||||||||
| 764 | case executed 967 times by 2 tests: '&':case '&':Executed by:
executed 967 times by 2 tests: case '&':Executed by:
| 967 | ||||||||||||||||||||||||||||||
| 765 | case executed 440423 times by 13 tests: '<':case '<':Executed by:
executed 440423 times by 13 tests: case '<':Executed by:
| 440423 | ||||||||||||||||||||||||||||||
| 766 | if (!(c & 0xff0000)
| 0-441390 | ||||||||||||||||||||||||||||||
| 767 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 768 | return executed 441390 times by 13 tests: n;return n;Executed by:
executed 441390 times by 13 tests: return n;Executed by:
| 441390 | ||||||||||||||||||||||||||||||
| 769 | } | - | ||||||||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||||||||
| 771 | default executed 2079236 times by 3 tests: default:Executed by:
code before this statement never executed: default:executed 2079236 times by 3 tests: :default:Executed by:
code before this statement never executed: default:executed 2079236 times by 3 tests: default:Executed by:
| 0-2079236 | ||||||||||||||||||||||||||||||
| 772 | if (c < 0x20
| 5-2079231 | ||||||||||||||||||||||||||||||
| 773 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 774 | return executed 5 times by 1 test: n;return n;Executed by:
executed 5 times by 1 test: return n;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 775 | } | - | ||||||||||||||||||||||||||||||
| 776 | isWhitespace = false; | - | ||||||||||||||||||||||||||||||
| 777 | textBuffer += QChar(ushort(c)); | - | ||||||||||||||||||||||||||||||
| 778 | ++n; | - | ||||||||||||||||||||||||||||||
| 779 | } executed 2079231 times by 3 tests: end of blockExecuted by:
| 2079231 | ||||||||||||||||||||||||||||||
| 780 | } | - | ||||||||||||||||||||||||||||||
| 781 | return executed 8002 times by 1 test: n;return n;Executed by:
executed 8002 times by 1 test: return n;Executed by:
| 8002 | ||||||||||||||||||||||||||||||
| 782 | } | - | ||||||||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||||||||
| 784 | inline int QXmlStreamReaderPrivate::fastScanName(int *prefix) | - | ||||||||||||||||||||||||||||||
| 785 | { | - | ||||||||||||||||||||||||||||||
| 786 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 787 | uint c; | - | ||||||||||||||||||||||||||||||
| 788 | while ((
| 9761-5104556 | ||||||||||||||||||||||||||||||
| 789 | switch (c) { | - | ||||||||||||||||||||||||||||||
| 790 | case executed 46 times by 1 test: '\n':case '\n':Executed by:
executed 46 times by 1 test: case '\n':Executed by:
| 46 | ||||||||||||||||||||||||||||||
| 791 | case executed 199582 times by 15 tests: ' ':case ' ':Executed by:
executed 199582 times by 15 tests: case ' ':Executed by:
| 199582 | ||||||||||||||||||||||||||||||
| 792 | case executed 63 times by 1 test: '\t':case '\t':Executed by:
executed 63 times by 1 test: case '\t':Executed by:
| 63 | ||||||||||||||||||||||||||||||
| 793 | case executed 300 times by 1 test: '\r':case '\r':Executed by:
executed 300 times by 1 test: case '\r':Executed by:
| 300 | ||||||||||||||||||||||||||||||
| 794 | case executed 1 time by 1 test: '&':case '&':Executed by:
executed 1 time by 1 test: case '&':Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 795 | case executed 1 time by 1 test: '#':case '#':Executed by:
executed 1 time by 1 test: case '#':Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 796 | case executed 1 time by 1 test: '\'':case '\'':Executed by:
executed 1 time by 1 test: case '\'':Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 797 | case executed 13 times by 1 test: '\"':case '\"':Executed by:
executed 13 times by 1 test: case '\"':Executed by:
| 13 | ||||||||||||||||||||||||||||||
| 798 | case executed 2 times by 1 test: '<':case '<':Executed by:
executed 2 times by 1 test: case '<':Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 799 | case executed 251479 times by 15 tests: '>':case '>':Executed by:
executed 251479 times by 15 tests: case '>':Executed by:
| 251479 | ||||||||||||||||||||||||||||||
| 800 | case executed 1 time by 1 test: '[':case '[':Executed by:
executed 1 time by 1 test: case '[':Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 801 | case executed 2 times by 1 test: ']':case ']':Executed by:
executed 2 times by 1 test: case ']':Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 802 | case executed 270432 times by 15 tests: '=':case '=':Executed by:
executed 270432 times by 15 tests: case '=':Executed by:
| 270432 | ||||||||||||||||||||||||||||||
| 803 | case never executed: '%':case '%':never executed: case '%': | 0 | ||||||||||||||||||||||||||||||
| 804 | case executed 374 times by 4 tests: '/':case '/':Executed by:
executed 374 times by 4 tests: case '/':Executed by:
| 374 | ||||||||||||||||||||||||||||||
| 805 | case executed 2130 times by 4 tests: ';':case ';':Executed by:
executed 2130 times by 4 tests: case ';':Executed by:
| 2130 | ||||||||||||||||||||||||||||||
| 806 | case executed 61 times by 2 tests: '?':case '?':Executed by:
executed 61 times by 2 tests: case '?':Executed by:
| 61 | ||||||||||||||||||||||||||||||
| 807 | case executed 2 times by 1 test: '!':case '!':Executed by:
executed 2 times by 1 test: case '!':Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 808 | case executed 2 times by 1 test: '^':case '^':Executed by:
executed 2 times by 1 test: case '^':Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 809 | case executed 102 times by 1 test: '|':case '|':Executed by:
executed 102 times by 1 test: case '|':Executed by:
| 102 | ||||||||||||||||||||||||||||||
| 810 | case executed 97 times by 2 tests: ',':case ',':Executed by:
executed 97 times by 2 tests: case ',':Executed by:
| 97 | ||||||||||||||||||||||||||||||
| 811 | case executed 7 times by 1 test: '(':case '(':Executed by:
executed 7 times by 1 test: case '(':Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 812 | case executed 227 times by 2 tests: ')':case ')':Executed by:
executed 227 times by 2 tests: case ')':Executed by:
| 227 | ||||||||||||||||||||||||||||||
| 813 | case executed 14 times by 2 tests: '+':case '+':Executed by:
executed 14 times by 2 tests: case '+':Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 814 | case executed 31 times by 1 test: '*':case '*':Executed by:
executed 31 times by 1 test: case '*':Executed by:
| 31 | ||||||||||||||||||||||||||||||
| 815 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 816 | if (prefix
| 4-721747 | ||||||||||||||||||||||||||||||
| 817 | *prefix = 0; | - | ||||||||||||||||||||||||||||||
| 818 | putChar(':'); | - | ||||||||||||||||||||||||||||||
| 819 | --n; | - | ||||||||||||||||||||||||||||||
| 820 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||
| 821 | return executed 724970 times by 15 tests: n;return n;Executed by:
executed 724970 times by 15 tests: return n;Executed by:
| 724970 | ||||||||||||||||||||||||||||||
| 822 | case executed 132009 times by 3 tests: ':':case ':':Executed by:
executed 132009 times by 3 tests: case ':':Executed by:
| 132009 | ||||||||||||||||||||||||||||||
| 823 | if (prefix
| 7-132002 | ||||||||||||||||||||||||||||||
| 824 | if (*
| 2-132000 | ||||||||||||||||||||||||||||||
| 825 | *prefix = n+2; | - | ||||||||||||||||||||||||||||||
| 826 | } executed 132000 times by 3 tests: else {end of blockExecuted by:
| 132000 | ||||||||||||||||||||||||||||||
| 827 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 828 | return executed 2 times by 1 test: n;return n;Executed by:
executed 2 times by 1 test: return n;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 829 | } | - | ||||||||||||||||||||||||||||||
| 830 | } else { | - | ||||||||||||||||||||||||||||||
| 831 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 832 | return executed 7 times by 1 test: n;return n;Executed by:
executed 7 times by 1 test: return n;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 833 | } | - | ||||||||||||||||||||||||||||||
| 834 | - | |||||||||||||||||||||||||||||||
| 835 | default executed 4247577 times by 15 tests: :default:Executed by:
executed 4247577 times by 15 tests: default:Executed by:
code before this statement executed 132000 times by 3 tests: default:Executed by:
| 132000-4247577 | ||||||||||||||||||||||||||||||
| 836 | textBuffer += QChar(c); | - | ||||||||||||||||||||||||||||||
| 837 | ++n; | - | ||||||||||||||||||||||||||||||
| 838 | } executed 4379577 times by 15 tests: end of blockExecuted by:
| 4379577 | ||||||||||||||||||||||||||||||
| 839 | } | - | ||||||||||||||||||||||||||||||
| 840 | - | |||||||||||||||||||||||||||||||
| 841 | if (prefix
| 991-8770 | ||||||||||||||||||||||||||||||
| 842 | * executed 8770 times by 1 test: prefix = 0;*prefix = 0;Executed by:
executed 8770 times by 1 test: *prefix = 0;Executed by:
| 8770 | ||||||||||||||||||||||||||||||
| 843 | int pos = textBuffer.size() - n; | - | ||||||||||||||||||||||||||||||
| 844 | putString(textBuffer, pos); | - | ||||||||||||||||||||||||||||||
| 845 | textBuffer.resize(pos); | - | ||||||||||||||||||||||||||||||
| 846 | return executed 9761 times by 1 test: 0;return 0;Executed by:
executed 9761 times by 1 test: return 0;Executed by:
| 9761 | ||||||||||||||||||||||||||||||
| 847 | } | - | ||||||||||||||||||||||||||||||
| 848 | - | |||||||||||||||||||||||||||||||
| 849 | enum NameChar { NameBeginning, NameNotBeginning, NotName }; | - | ||||||||||||||||||||||||||||||
| 850 | - | |||||||||||||||||||||||||||||||
| 851 | static const char Begi = static_cast<char>(NameBeginning); | - | ||||||||||||||||||||||||||||||
| 852 | static const char NtBg = static_cast<char>(NameNotBeginning); | - | ||||||||||||||||||||||||||||||
| 853 | static const char NotN = static_cast<char>(NotName); | - | ||||||||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||||||||
| 855 | static const char nameCharTable[128] = | - | ||||||||||||||||||||||||||||||
| 856 | { | - | ||||||||||||||||||||||||||||||
| 857 | - | |||||||||||||||||||||||||||||||
| 858 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||||||||
| 859 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||||||||
| 860 | - | |||||||||||||||||||||||||||||||
| 861 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||||||||
| 862 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||||||||
| 864 | NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||||||||
| 865 | NotN, NotN, NotN, NotN, NotN, NtBg, NtBg, NotN, | - | ||||||||||||||||||||||||||||||
| 866 | - | |||||||||||||||||||||||||||||||
| 867 | NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, | - | ||||||||||||||||||||||||||||||
| 868 | NtBg, NtBg, Begi, NotN, NotN, NotN, NotN, NotN, | - | ||||||||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||||||||
| 870 | NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||||||||
| 871 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||
| 873 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||||||||
| 874 | Begi, Begi, Begi, NotN, NotN, NotN, NotN, Begi, | - | ||||||||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||||||||
| 876 | NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||||||||
| 877 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||||||||
| 878 | - | |||||||||||||||||||||||||||||||
| 879 | Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, | - | ||||||||||||||||||||||||||||||
| 880 | Begi, Begi, Begi, NotN, NotN, NotN, NotN, NotN | - | ||||||||||||||||||||||||||||||
| 881 | }; | - | ||||||||||||||||||||||||||||||
| 882 | - | |||||||||||||||||||||||||||||||
| 883 | static inline NameChar fastDetermineNameChar(QChar ch) | - | ||||||||||||||||||||||||||||||
| 884 | { | - | ||||||||||||||||||||||||||||||
| 885 | ushort uc = ch.unicode(); | - | ||||||||||||||||||||||||||||||
| 886 | if (!(uc & ~0x7f)
| 0-2874 | ||||||||||||||||||||||||||||||
| 887 | return executed 2874 times by 2 tests: static_cast<NameChar>(nameCharTable[uc]);return static_cast<NameChar>(nameCharTable[uc]);Executed by:
executed 2874 times by 2 tests: return static_cast<NameChar>(nameCharTable[uc]);Executed by:
| 2874 | ||||||||||||||||||||||||||||||
| 888 | - | |||||||||||||||||||||||||||||||
| 889 | QChar::Category cat = ch.category(); | - | ||||||||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||||||||
| 891 | if ((cat >= QChar::Letter_Uppercase
| 0 | ||||||||||||||||||||||||||||||
| 892 | || cat == QChar::Number_Letter
| 0 | ||||||||||||||||||||||||||||||
| 893 | return never executed: NameBeginning;return NameBeginning;never executed: return NameBeginning; | 0 | ||||||||||||||||||||||||||||||
| 894 | if ((cat >= QChar::Number_DecimalDigit
| 0 | ||||||||||||||||||||||||||||||
| 895 | || (cat >= QChar::Mark_NonSpacing
| 0 | ||||||||||||||||||||||||||||||
| 896 | return never executed: NameNotBeginning;return NameNotBeginning;never executed: return NameNotBeginning; | 0 | ||||||||||||||||||||||||||||||
| 897 | return never executed: NotName;return NotName;never executed: return NotName; | 0 | ||||||||||||||||||||||||||||||
| 898 | } | - | ||||||||||||||||||||||||||||||
| 899 | - | |||||||||||||||||||||||||||||||
| 900 | inline int QXmlStreamReaderPrivate::fastScanNMTOKEN() | - | ||||||||||||||||||||||||||||||
| 901 | { | - | ||||||||||||||||||||||||||||||
| 902 | int n = 0; | - | ||||||||||||||||||||||||||||||
| 903 | uint c; | - | ||||||||||||||||||||||||||||||
| 904 | while ((
| 229-2874 | ||||||||||||||||||||||||||||||
| 905 | if (fastDetermineNameChar(c) == NotName
| 350-2524 | ||||||||||||||||||||||||||||||
| 906 | putChar(c); | - | ||||||||||||||||||||||||||||||
| 907 | return executed 350 times by 2 tests: n;return n;Executed by:
executed 350 times by 2 tests: return n;Executed by:
| 350 | ||||||||||||||||||||||||||||||
| 908 | } else { | - | ||||||||||||||||||||||||||||||
| 909 | ++n; | - | ||||||||||||||||||||||||||||||
| 910 | textBuffer += QChar(c); | - | ||||||||||||||||||||||||||||||
| 911 | } executed 2524 times by 2 tests: end of blockExecuted by:
| 2524 | ||||||||||||||||||||||||||||||
| 912 | } | - | ||||||||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||||||||
| 914 | int pos = textBuffer.size() - n; | - | ||||||||||||||||||||||||||||||
| 915 | putString(textBuffer, pos); | - | ||||||||||||||||||||||||||||||
| 916 | textBuffer.resize(pos); | - | ||||||||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||||||||
| 918 | return executed 229 times by 1 test: n;return n;Executed by:
executed 229 times by 1 test: return n;Executed by:
| 229 | ||||||||||||||||||||||||||||||
| 919 | } | - | ||||||||||||||||||||||||||||||
| 920 | - | |||||||||||||||||||||||||||||||
| 921 | void QXmlStreamReaderPrivate::putString(const QString &s, int from) | - | ||||||||||||||||||||||||||||||
| 922 | { | - | ||||||||||||||||||||||||||||||
| 923 | putStack.reserve(s.size()); | - | ||||||||||||||||||||||||||||||
| 924 | for (int i = s.size()-1; i >= from
| 18909-205554 | ||||||||||||||||||||||||||||||
| 925 | putStack.rawPush() = s.at(i).unicode(); executed 205554 times by 1 test: putStack.rawPush() = s.at(i).unicode();Executed by:
| 205554 | ||||||||||||||||||||||||||||||
| 926 | } executed 18909 times by 1 test: end of blockExecuted by:
| 18909 | ||||||||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||||||||
| 928 | void QXmlStreamReaderPrivate::putStringLiteral(const QString &s) | - | ||||||||||||||||||||||||||||||
| 929 | { | - | ||||||||||||||||||||||||||||||
| 930 | putStack.reserve(s.size()); | - | ||||||||||||||||||||||||||||||
| 931 | for (int i = s.size()-1; i >= 0
| 1792-1805 | ||||||||||||||||||||||||||||||
| 932 | putStack.rawPush() = ((LETTER << 16) | s.at(i).unicode()); executed 1805 times by 4 tests: putStack.rawPush() = ((LETTER << 16) | s.at(i).unicode());Executed by:
| 1805 | ||||||||||||||||||||||||||||||
| 933 | } executed 1792 times by 4 tests: end of blockExecuted by:
| 1792 | ||||||||||||||||||||||||||||||
| 934 | - | |||||||||||||||||||||||||||||||
| 935 | void QXmlStreamReaderPrivate::putReplacement(const QString &s) | - | ||||||||||||||||||||||||||||||
| 936 | { | - | ||||||||||||||||||||||||||||||
| 937 | putStack.reserve(s.size()); | - | ||||||||||||||||||||||||||||||
| 938 | for (int i = s.size()-1; i >= 0
| 117-1077 | ||||||||||||||||||||||||||||||
| 939 | ushort c = s.at(i).unicode(); | - | ||||||||||||||||||||||||||||||
| 940 | if (c == '\n'
| 2-1075 | ||||||||||||||||||||||||||||||
| 941 | putStack.rawPush() = ((LETTER << 16) | c); executed 4 times by 1 test: putStack.rawPush() = ((LETTER << 16) | c);Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 942 | else | - | ||||||||||||||||||||||||||||||
| 943 | putStack.rawPush() = c; executed 1073 times by 1 test: putStack.rawPush() = c;Executed by:
| 1073 | ||||||||||||||||||||||||||||||
| 944 | } | - | ||||||||||||||||||||||||||||||
| 945 | } executed 117 times by 1 test: end of blockExecuted by:
| 117 | ||||||||||||||||||||||||||||||
| 946 | void QXmlStreamReaderPrivate::putReplacementInAttributeValue(const QString &s) | - | ||||||||||||||||||||||||||||||
| 947 | { | - | ||||||||||||||||||||||||||||||
| 948 | putStack.reserve(s.size()); | - | ||||||||||||||||||||||||||||||
| 949 | for (int i = s.size()-1; i >= 0
| 98-990 | ||||||||||||||||||||||||||||||
| 950 | ushort c = s.at(i).unicode(); | - | ||||||||||||||||||||||||||||||
| 951 | if (c == '&'
| 49-941 | ||||||||||||||||||||||||||||||
| 952 | putStack.rawPush() = c; executed 109 times by 1 test: putStack.rawPush() = c;Executed by:
| 109 | ||||||||||||||||||||||||||||||
| 953 | else if (c == '\n'
| 2-877 | ||||||||||||||||||||||||||||||
| 954 | putStack.rawPush() = ' '; executed 6 times by 1 test: putStack.rawPush() = ' ';Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 955 | else | - | ||||||||||||||||||||||||||||||
| 956 | putStack.rawPush() = ((LETTER << 16) | c); executed 875 times by 1 test: putStack.rawPush() = ((LETTER << 16) | c);Executed by:
| 875 | ||||||||||||||||||||||||||||||
| 957 | } | - | ||||||||||||||||||||||||||||||
| 958 | } executed 98 times by 1 test: end of blockExecuted by:
| 98 | ||||||||||||||||||||||||||||||
| 959 | - | |||||||||||||||||||||||||||||||
| 960 | uint QXmlStreamReaderPrivate::getChar_helper() | - | ||||||||||||||||||||||||||||||
| 961 | { | - | ||||||||||||||||||||||||||||||
| 962 | const int BUFFER_SIZE = 8192; | - | ||||||||||||||||||||||||||||||
| 963 | characterOffset += readBufferPos; | - | ||||||||||||||||||||||||||||||
| 964 | readBufferPos = 0; | - | ||||||||||||||||||||||||||||||
| 965 | readBuffer.resize(0); | - | ||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||
| 967 | if (decoder
| 5317-116020 | ||||||||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||||||||
| 969 | nbytesread = 0; executed 116020 times by 15 tests: nbytesread = 0;Executed by:
| 116020 | ||||||||||||||||||||||||||||||
| 970 | if (device
| 3400-117937 | ||||||||||||||||||||||||||||||
| 971 | rawReadBuffer.resize(BUFFER_SIZE); | - | ||||||||||||||||||||||||||||||
| 972 | int nbytesreadOrMinus1 = device->read(rawReadBuffer.data() + nbytesread, BUFFER_SIZE - nbytesread); | - | ||||||||||||||||||||||||||||||
| 973 | nbytesread += qMax(nbytesreadOrMinus1, 0); | - | ||||||||||||||||||||||||||||||
| 974 | } executed 3400 times by 2 tests: else {end of blockExecuted by:
| 3400 | ||||||||||||||||||||||||||||||
| 975 | if (nbytesread
| 780-117157 | ||||||||||||||||||||||||||||||
| 976 | rawReadBuffer += dataBuffer; executed 780 times by 1 test: rawReadBuffer += dataBuffer;Executed by:
| 780 | ||||||||||||||||||||||||||||||
| 977 | else | - | ||||||||||||||||||||||||||||||
| 978 | rawReadBuffer = dataBuffer; executed 117157 times by 14 tests: rawReadBuffer = dataBuffer;Executed by:
| 117157 | ||||||||||||||||||||||||||||||
| 979 | nbytesread = rawReadBuffer.size(); | - | ||||||||||||||||||||||||||||||
| 980 | dataBuffer.clear(); | - | ||||||||||||||||||||||||||||||
| 981 | } executed 117937 times by 14 tests: end of blockExecuted by:
| 117937 | ||||||||||||||||||||||||||||||
| 982 | if (!nbytesread
| 59780-61557 | ||||||||||||||||||||||||||||||
| 983 | atEnd = true; | - | ||||||||||||||||||||||||||||||
| 984 | return executed 59780 times by 15 tests: StreamEOF;return StreamEOF;Executed by:
executed 59780 times by 15 tests: return StreamEOF;Executed by:
| 59780 | ||||||||||||||||||||||||||||||
| 985 | } | - | ||||||||||||||||||||||||||||||
| 986 | - | |||||||||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||||||||
| 988 | if (!decoder
| 3679-57878 | ||||||||||||||||||||||||||||||
| 989 | if (nbytesread < 4
| 782-2897 | ||||||||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||||||||
| 991 | atEnd = true; | - | ||||||||||||||||||||||||||||||
| 992 | return executed 782 times by 1 test: StreamEOF;return StreamEOF;Executed by:
executed 782 times by 1 test: return StreamEOF;Executed by:
| 782 | ||||||||||||||||||||||||||||||
| 993 | } | - | ||||||||||||||||||||||||||||||
| 994 | int mib = 106; | - | ||||||||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||||||||
| 996 | - | |||||||||||||||||||||||||||||||
| 997 | uchar ch1 = rawReadBuffer.at(0); | - | ||||||||||||||||||||||||||||||
| 998 | uchar ch2 = rawReadBuffer.at(1); | - | ||||||||||||||||||||||||||||||
| 999 | uchar ch3 = rawReadBuffer.at(2); | - | ||||||||||||||||||||||||||||||
| 1000 | uchar ch4 = rawReadBuffer.at(3); | - | ||||||||||||||||||||||||||||||
| 1001 | - | |||||||||||||||||||||||||||||||
| 1002 | if ((ch1 == 0
| 0-2896 | ||||||||||||||||||||||||||||||
| 1003 | (ch1 == 0xff
| 0-2857 | ||||||||||||||||||||||||||||||
| 1004 | mib = 1017; never executed: mib = 1017; | 0 | ||||||||||||||||||||||||||||||
| 1005 | else if (ch1 == 0x3c
| 0-2819 | ||||||||||||||||||||||||||||||
| 1006 | mib = 1019; never executed: mib = 1019; | 0 | ||||||||||||||||||||||||||||||
| 1007 | else if (ch1 == 0x00
| 0-2896 | ||||||||||||||||||||||||||||||
| 1008 | mib = 1018; never executed: mib = 1018; | 0 | ||||||||||||||||||||||||||||||
| 1009 | else if ((ch1 == 0xfe
| 0-2896 | ||||||||||||||||||||||||||||||
| 1010 | mib = 1015; executed 41 times by 1 test: mib = 1015;Executed by:
| 41 | ||||||||||||||||||||||||||||||
| 1011 | else if (ch1 == 0x3c
| 0-2819 | ||||||||||||||||||||||||||||||
| 1012 | mib = 1014; never executed: mib = 1014; | 0 | ||||||||||||||||||||||||||||||
| 1013 | else if (ch1 == 0x00
| 0-2855 | ||||||||||||||||||||||||||||||
| 1014 | mib = 1013; executed 1 time by 1 test: mib = 1013;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 1015 | codec = QTextCodec::codecForMib(mib); | - | ||||||||||||||||||||||||||||||
| 1016 | ((!(codec)) ? qt_assert("codec",__FILE__,1518) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 1017 | decoder = codec->makeDecoder(); | - | ||||||||||||||||||||||||||||||
| 1018 | } executed 2897 times by 3 tests: end of blockExecuted by:
| 2897 | ||||||||||||||||||||||||||||||
| 1019 | - | |||||||||||||||||||||||||||||||
| 1020 | decoder->toUnicode(&readBuffer, rawReadBuffer.constData(), nbytesread); | - | ||||||||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||||||||
| 1022 | if(lockEncoding
| 0-55226 | ||||||||||||||||||||||||||||||
| 1023 | raiseWellFormedError(QXmlStream::tr("Encountered incorrectly encoded content.")); | - | ||||||||||||||||||||||||||||||
| 1024 | readBuffer.clear(); | - | ||||||||||||||||||||||||||||||
| 1025 | return never executed: StreamEOF;return StreamEOF;never executed: return StreamEOF; | 0 | ||||||||||||||||||||||||||||||
| 1026 | } | - | ||||||||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||||||||
| 1028 | - | |||||||||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||||||||
| 1031 | readBuffer.reserve(1); | - | ||||||||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||||||||
| 1033 | if (readBufferPos < readBuffer.size()
| 243-60532 | ||||||||||||||||||||||||||||||
| 1034 | ushort c = readBuffer.at(readBufferPos++).unicode(); | - | ||||||||||||||||||||||||||||||
| 1035 | return executed 60532 times by 15 tests: c;return c;Executed by:
executed 60532 times by 15 tests: return c;Executed by:
| 60532 | ||||||||||||||||||||||||||||||
| 1036 | } | - | ||||||||||||||||||||||||||||||
| 1037 | - | |||||||||||||||||||||||||||||||
| 1038 | atEnd = true; | - | ||||||||||||||||||||||||||||||
| 1039 | return executed 243 times by 1 test: StreamEOF;return StreamEOF;Executed by:
executed 243 times by 1 test: return StreamEOF;Executed by:
| 243 | ||||||||||||||||||||||||||||||
| 1040 | } | - | ||||||||||||||||||||||||||||||
| 1041 | - | |||||||||||||||||||||||||||||||
| 1042 | QStringRef QXmlStreamReaderPrivate::namespaceForPrefix(const QStringRef &prefix) | - | ||||||||||||||||||||||||||||||
| 1043 | { | - | ||||||||||||||||||||||||||||||
| 1044 | for (int j = namespaceDeclarations.size() - 1; j >= 0
| 78422-627652 | ||||||||||||||||||||||||||||||
| 1045 | const NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(j); | - | ||||||||||||||||||||||||||||||
| 1046 | if (namespaceDeclaration.prefix == prefix
| 286132-341520 | ||||||||||||||||||||||||||||||
| 1047 | return executed 286132 times by 3 tests: namespaceDeclaration.namespaceUri;return namespaceDeclaration.namespaceUri;Executed by:
executed 286132 times by 3 tests: return namespaceDeclaration.namespaceUri;Executed by:
| 286132 | ||||||||||||||||||||||||||||||
| 1048 | } | - | ||||||||||||||||||||||||||||||
| 1049 | } executed 341520 times by 15 tests: end of blockExecuted by:
| 341520 | ||||||||||||||||||||||||||||||
| 1050 | - | |||||||||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||||||||
| 1052 | if (namespaceProcessing
| 0-78422 | ||||||||||||||||||||||||||||||
| 1053 | raiseWellFormedError(QXmlStream::tr("Namespace prefix '%1' not declared").arg(prefix.toString())); executed 6 times by 1 test: raiseWellFormedError(QXmlStream::tr("Namespace prefix '%1' not declared").arg(prefix.toString()));Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 1054 | - | |||||||||||||||||||||||||||||||
| 1055 | - | |||||||||||||||||||||||||||||||
| 1056 | return executed 78422 times by 14 tests: QStringRef();return QStringRef();Executed by:
executed 78422 times by 14 tests: return QStringRef();Executed by:
| 78422 | ||||||||||||||||||||||||||||||
| 1057 | } | - | ||||||||||||||||||||||||||||||
| 1058 | - | |||||||||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||||||||
| 1060 | - | |||||||||||||||||||||||||||||||
| 1061 | - | |||||||||||||||||||||||||||||||
| 1062 | void QXmlStreamReaderPrivate::resolveTag() | - | ||||||||||||||||||||||||||||||
| 1063 | { | - | ||||||||||||||||||||||||||||||
| 1064 | int n = attributeStack.size(); | - | ||||||||||||||||||||||||||||||
| 1065 | - | |||||||||||||||||||||||||||||||
| 1066 | if (namespaceProcessing
| 0-232942 | ||||||||||||||||||||||||||||||
| 1067 | for (int a = 0; a < dtdAttributes.size()
| 232942-3832797 | ||||||||||||||||||||||||||||||
| 1068 | DtdAttribute &dtdAttribute = dtdAttributes[a]; | - | ||||||||||||||||||||||||||||||
| 1069 | if (!dtdAttribute.isNamespaceAttribute
| 153669-3679128 | ||||||||||||||||||||||||||||||
| 1070 | || dtdAttribute.defaultValue.isNull()
| 91-153578 | ||||||||||||||||||||||||||||||
| 1071 | || dtdAttribute.tagName != qualifiedName
| 9-153569 | ||||||||||||||||||||||||||||||
| 1072 | || dtdAttribute.attributeQualifiedName.isNull()
| 0-9 | ||||||||||||||||||||||||||||||
| 1073 | continue; executed 3832788 times by 2 tests: continue;Executed by:
| 3832788 | ||||||||||||||||||||||||||||||
| 1074 | int i = 0; | - | ||||||||||||||||||||||||||||||
| 1075 | while (i < n
| 0-9 | ||||||||||||||||||||||||||||||
| 1076 | ++ executed 3 times by 1 test: i;++i;Executed by:
executed 3 times by 1 test: ++i;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 1077 | if (i != n
| 0-9 | ||||||||||||||||||||||||||||||
| 1078 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||
| 1079 | if (dtdAttribute.attributePrefix.isEmpty()
| 0-7 | ||||||||||||||||||||||||||||||
| 1080 | NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 1081 | namespaceDeclaration.prefix.clear(); | - | ||||||||||||||||||||||||||||||
| 1082 | - | |||||||||||||||||||||||||||||||
| 1083 | const QStringRef ns(dtdAttribute.defaultValue); | - | ||||||||||||||||||||||||||||||
| 1084 | if(ns == QLatin1String("http://www.w3.org/2000/xmlns/")
| 0-7 | ||||||||||||||||||||||||||||||
| 1085 | ns == QLatin1String("http://www.w3.org/XML/1998/namespace")
| 0-7 | ||||||||||||||||||||||||||||||
| 1086 | raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration.")); never executed: raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration.")); | 0 | ||||||||||||||||||||||||||||||
| 1087 | else | - | ||||||||||||||||||||||||||||||
| 1088 | namespaceDeclaration.namespaceUri = ns; executed 7 times by 2 tests: namespaceDeclaration.namespaceUri = ns;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 1089 | } else if (dtdAttribute.attributePrefix == QLatin1String("xmlns")
| 0-2 | ||||||||||||||||||||||||||||||
| 1090 | NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 1091 | QStringRef namespacePrefix = dtdAttribute.attributeName; | - | ||||||||||||||||||||||||||||||
| 1092 | QStringRef namespaceUri = dtdAttribute.defaultValue; | - | ||||||||||||||||||||||||||||||
| 1093 | if (((
| 0-2 | ||||||||||||||||||||||||||||||
| 1094 | ^ (namespaceUri == QLatin1String("http://www.w3.org/XML/1998/namespace")))
| 0-2 | ||||||||||||||||||||||||||||||
| 1095 | || namespaceUri == QLatin1String("http://www.w3.org/2000/xmlns/")
| 0-2 | ||||||||||||||||||||||||||||||
| 1096 | || namespaceUri.isEmpty()
| 0-2 | ||||||||||||||||||||||||||||||
| 1097 | || namespacePrefix == QLatin1String("xmlns")
| 0-2 | ||||||||||||||||||||||||||||||
| 1098 | raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration.")); never executed: raiseWellFormedError(QXmlStream::tr("Illegal namespace declaration.")); | 0 | ||||||||||||||||||||||||||||||
| 1099 | - | |||||||||||||||||||||||||||||||
| 1100 | namespaceDeclaration.prefix = namespacePrefix; | - | ||||||||||||||||||||||||||||||
| 1101 | namespaceDeclaration.namespaceUri = namespaceUri; | - | ||||||||||||||||||||||||||||||
| 1102 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 1103 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||||||||||||||||||||
| 1104 | } executed 232942 times by 15 tests: end of blockExecuted by:
| 232942 | ||||||||||||||||||||||||||||||
| 1105 | - | |||||||||||||||||||||||||||||||
| 1106 | tagStack.top().namespaceDeclaration.namespaceUri = namespaceUri = namespaceForPrefix(prefix); | - | ||||||||||||||||||||||||||||||
| 1107 | - | |||||||||||||||||||||||||||||||
| 1108 | attributes.resize(n); | - | ||||||||||||||||||||||||||||||
| 1109 | - | |||||||||||||||||||||||||||||||
| 1110 | for (int i = 0; i < n
| 232942-269638 | ||||||||||||||||||||||||||||||
| 1111 | QXmlStreamAttribute &attribute = attributes[i]; | - | ||||||||||||||||||||||||||||||
| 1112 | Attribute &attrib = attributeStack[i]; | - | ||||||||||||||||||||||||||||||
| 1113 | QStringRef prefix(symPrefix(attrib.key)); | - | ||||||||||||||||||||||||||||||
| 1114 | QStringRef name(symString(attrib.key)); | - | ||||||||||||||||||||||||||||||
| 1115 | QStringRef qualifiedName(symName(attrib.key)); | - | ||||||||||||||||||||||||||||||
| 1116 | QStringRef value(symString(attrib.value)); | - | ||||||||||||||||||||||||||||||
| 1117 | - | |||||||||||||||||||||||||||||||
| 1118 | attribute.m_name = QXmlStreamStringRef(name); | - | ||||||||||||||||||||||||||||||
| 1119 | attribute.m_qualifiedName = QXmlStreamStringRef(qualifiedName); | - | ||||||||||||||||||||||||||||||
| 1120 | attribute.m_value = QXmlStreamStringRef(value); | - | ||||||||||||||||||||||||||||||
| 1121 | - | |||||||||||||||||||||||||||||||
| 1122 | if (!prefix.isEmpty()
| 131612-138026 | ||||||||||||||||||||||||||||||
| 1123 | QStringRef attributeNamespaceUri = namespaceForPrefix(prefix); | - | ||||||||||||||||||||||||||||||
| 1124 | attribute.m_namespaceUri = QXmlStreamStringRef(attributeNamespaceUri); | - | ||||||||||||||||||||||||||||||
| 1125 | } executed 131612 times by 2 tests: end of blockExecuted by:
| 131612 | ||||||||||||||||||||||||||||||
| 1126 | - | |||||||||||||||||||||||||||||||
| 1127 | for (int j = 0; j < i
| 114354-269638 | ||||||||||||||||||||||||||||||
| 1128 | if (attributes[j].name() == attribute.name()
| 38-114316 | ||||||||||||||||||||||||||||||
| 1129 | && attributes[j].namespaceUri() == attribute.namespaceUri()
| 16-22 | ||||||||||||||||||||||||||||||
| 1130 | && (namespaceProcessing
| 0-16 | ||||||||||||||||||||||||||||||
| 1131 | raiseWellFormedError(QXmlStream::tr("Attribute '%1' redefined.").arg(attribute.qualifiedName().toString())); executed 16 times by 1 test: raiseWellFormedError(QXmlStream::tr("Attribute '%1' redefined.").arg(attribute.qualifiedName().toString()));Executed by:
| 16 | ||||||||||||||||||||||||||||||
| 1132 | } executed 114354 times by 15 tests: end of blockExecuted by:
| 114354 | ||||||||||||||||||||||||||||||
| 1133 | } executed 269638 times by 15 tests: end of blockExecuted by:
| 269638 | ||||||||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||||||||
| 1135 | for (int a = 0; a < dtdAttributes.size()
| 232942-3832797 | ||||||||||||||||||||||||||||||
| 1136 | DtdAttribute &dtdAttribute = dtdAttributes[a]; | - | ||||||||||||||||||||||||||||||
| 1137 | if (dtdAttribute.isNamespaceAttribute
| 153669-3679128 | ||||||||||||||||||||||||||||||
| 1138 | || dtdAttribute.defaultValue.isNull()
| 168-3678960 | ||||||||||||||||||||||||||||||
| 1139 | || dtdAttribute.tagName != qualifiedName
| 75-93 | ||||||||||||||||||||||||||||||
| 1140 | || dtdAttribute.attributeQualifiedName.isNull()
| 2-91 | ||||||||||||||||||||||||||||||
| 1141 | continue; executed 3832706 times by 2 tests: continue;Executed by:
| 3832706 | ||||||||||||||||||||||||||||||
| 1142 | int i = 0; | - | ||||||||||||||||||||||||||||||
| 1143 | while (i < n
| 36-117 | ||||||||||||||||||||||||||||||
| 1144 | ++ executed 62 times by 1 test: i;++i;Executed by:
executed 62 times by 1 test: ++i;Executed by:
| 62 | ||||||||||||||||||||||||||||||
| 1145 | if (i != n
| 36-55 | ||||||||||||||||||||||||||||||
| 1146 | continue; executed 55 times by 1 test: continue;Executed by:
| 55 | ||||||||||||||||||||||||||||||
| 1147 | - | |||||||||||||||||||||||||||||||
| 1148 | - | |||||||||||||||||||||||||||||||
| 1149 | - | |||||||||||||||||||||||||||||||
| 1150 | QXmlStreamAttribute attribute; | - | ||||||||||||||||||||||||||||||
| 1151 | attribute.m_name = QXmlStreamStringRef(dtdAttribute.attributeName); | - | ||||||||||||||||||||||||||||||
| 1152 | attribute.m_qualifiedName = QXmlStreamStringRef(dtdAttribute.attributeQualifiedName); | - | ||||||||||||||||||||||||||||||
| 1153 | attribute.m_value = QXmlStreamStringRef(dtdAttribute.defaultValue); | - | ||||||||||||||||||||||||||||||
| 1154 | - | |||||||||||||||||||||||||||||||
| 1155 | if (!dtdAttribute.attributePrefix.isEmpty()
| 0-36 | ||||||||||||||||||||||||||||||
| 1156 | QStringRef attributeNamespaceUri = namespaceForPrefix(dtdAttribute.attributePrefix); | - | ||||||||||||||||||||||||||||||
| 1157 | attribute.m_namespaceUri = QXmlStreamStringRef(attributeNamespaceUri); | - | ||||||||||||||||||||||||||||||
| 1158 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1159 | attribute.m_isDefault = true; | - | ||||||||||||||||||||||||||||||
| 1160 | attributes.append(attribute); | - | ||||||||||||||||||||||||||||||
| 1161 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||
| 1162 | - | |||||||||||||||||||||||||||||||
| 1163 | attributeStack.clear(); | - | ||||||||||||||||||||||||||||||
| 1164 | } executed 232942 times by 15 tests: end of blockExecuted by:
| 232942 | ||||||||||||||||||||||||||||||
| 1165 | - | |||||||||||||||||||||||||||||||
| 1166 | void QXmlStreamReaderPrivate::resolvePublicNamespaces() | - | ||||||||||||||||||||||||||||||
| 1167 | { | - | ||||||||||||||||||||||||||||||
| 1168 | const Tag &tag = tagStack.top(); | - | ||||||||||||||||||||||||||||||
| 1169 | int n = namespaceDeclarations.size() - tag.namespaceDeclarationsSize; | - | ||||||||||||||||||||||||||||||
| 1170 | publicNamespaceDeclarations.resize(n); | - | ||||||||||||||||||||||||||||||
| 1171 | for (int i = 0; i < n
| 54-446 | ||||||||||||||||||||||||||||||
| 1172 | const NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(tag.namespaceDeclarationsSize + i); | - | ||||||||||||||||||||||||||||||
| 1173 | QXmlStreamNamespaceDeclaration &publicNamespaceDeclaration = publicNamespaceDeclarations[i]; | - | ||||||||||||||||||||||||||||||
| 1174 | publicNamespaceDeclaration.m_prefix = QXmlStreamStringRef(namespaceDeclaration.prefix); | - | ||||||||||||||||||||||||||||||
| 1175 | publicNamespaceDeclaration.m_namespaceUri = QXmlStreamStringRef(namespaceDeclaration.namespaceUri); | - | ||||||||||||||||||||||||||||||
| 1176 | } executed 54 times by 1 test: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||||||||
| 1177 | } executed 446 times by 1 test: end of blockExecuted by:
| 446 | ||||||||||||||||||||||||||||||
| 1178 | - | |||||||||||||||||||||||||||||||
| 1179 | void QXmlStreamReaderPrivate::resolveDtd() | - | ||||||||||||||||||||||||||||||
| 1180 | { | - | ||||||||||||||||||||||||||||||
| 1181 | publicNotationDeclarations.resize(notationDeclarations.size()); | - | ||||||||||||||||||||||||||||||
| 1182 | for (int i = 0; i < notationDeclarations.size()
| 52-79 | ||||||||||||||||||||||||||||||
| 1183 | const QXmlStreamReaderPrivate::NotationDeclaration ¬ationDeclaration = notationDeclarations.at(i); | - | ||||||||||||||||||||||||||||||
| 1184 | QXmlStreamNotationDeclaration &publicNotationDeclaration = publicNotationDeclarations[i]; | - | ||||||||||||||||||||||||||||||
| 1185 | publicNotationDeclaration.m_name = QXmlStreamStringRef(notationDeclaration.name); | - | ||||||||||||||||||||||||||||||
| 1186 | publicNotationDeclaration.m_systemId = QXmlStreamStringRef(notationDeclaration.systemId); | - | ||||||||||||||||||||||||||||||
| 1187 | publicNotationDeclaration.m_publicId = QXmlStreamStringRef(notationDeclaration.publicId); | - | ||||||||||||||||||||||||||||||
| 1188 | - | |||||||||||||||||||||||||||||||
| 1189 | } executed 79 times by 1 test: end of blockExecuted by:
| 79 | ||||||||||||||||||||||||||||||
| 1190 | notationDeclarations.clear(); | - | ||||||||||||||||||||||||||||||
| 1191 | publicEntityDeclarations.resize(entityDeclarations.size()); | - | ||||||||||||||||||||||||||||||
| 1192 | for (int i = 0; i < entityDeclarations.size()
| 44-52 | ||||||||||||||||||||||||||||||
| 1193 | const QXmlStreamReaderPrivate::EntityDeclaration &entityDeclaration = entityDeclarations.at(i); | - | ||||||||||||||||||||||||||||||
| 1194 | QXmlStreamEntityDeclaration &publicEntityDeclaration = publicEntityDeclarations[i]; | - | ||||||||||||||||||||||||||||||
| 1195 | publicEntityDeclaration.m_name = QXmlStreamStringRef(entityDeclaration.name); | - | ||||||||||||||||||||||||||||||
| 1196 | publicEntityDeclaration.m_notationName = QXmlStreamStringRef(entityDeclaration.notationName); | - | ||||||||||||||||||||||||||||||
| 1197 | publicEntityDeclaration.m_systemId = QXmlStreamStringRef(entityDeclaration.systemId); | - | ||||||||||||||||||||||||||||||
| 1198 | publicEntityDeclaration.m_publicId = QXmlStreamStringRef(entityDeclaration.publicId); | - | ||||||||||||||||||||||||||||||
| 1199 | publicEntityDeclaration.m_value = QXmlStreamStringRef(entityDeclaration.value); | - | ||||||||||||||||||||||||||||||
| 1200 | } executed 44 times by 1 test: end of blockExecuted by:
| 44 | ||||||||||||||||||||||||||||||
| 1201 | entityDeclarations.clear(); | - | ||||||||||||||||||||||||||||||
| 1202 | parameterEntityHash.clear(); | - | ||||||||||||||||||||||||||||||
| 1203 | } executed 52 times by 1 test: end of blockExecuted by:
| 52 | ||||||||||||||||||||||||||||||
| 1204 | - | |||||||||||||||||||||||||||||||
| 1205 | uint QXmlStreamReaderPrivate::resolveCharRef(int symbolIndex) | - | ||||||||||||||||||||||||||||||
| 1206 | { | - | ||||||||||||||||||||||||||||||
| 1207 | bool ok = true; | - | ||||||||||||||||||||||||||||||
| 1208 | uint s; | - | ||||||||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||||||||
| 1210 | if (sym(symbolIndex).c == 'x'
| 143-1284 | ||||||||||||||||||||||||||||||
| 1211 | s = symString(symbolIndex, 1).toUInt(&ok, 16); executed 1284 times by 2 tests: s = symString(symbolIndex, 1).toUInt(&ok, 16);Executed by:
| 1284 | ||||||||||||||||||||||||||||||
| 1212 | else | - | ||||||||||||||||||||||||||||||
| 1213 | s = symString(symbolIndex).toUInt(&ok, 10); executed 143 times by 1 test: s = symString(symbolIndex).toUInt(&ok, 10);Executed by:
| 143 | ||||||||||||||||||||||||||||||
| 1214 | - | |||||||||||||||||||||||||||||||
| 1215 | ok &= (s == 0x9
| 13-1413 | ||||||||||||||||||||||||||||||
| 1216 | || (s >= 0xe000
| 1-25 | ||||||||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||||||||
| 1218 | return executed 1427 times by 2 tests: okreturn ok ? s : 0;Executed by:
executed 1427 times by 2 tests: return ok ? s : 0;Executed by:
| 26-1427 | ||||||||||||||||||||||||||||||
| 1219 | } | - | ||||||||||||||||||||||||||||||
| 1220 | - | |||||||||||||||||||||||||||||||
| 1221 | - | |||||||||||||||||||||||||||||||
| 1222 | void QXmlStreamReaderPrivate::checkPublicLiteral(const QStringRef &publicId) | - | ||||||||||||||||||||||||||||||
| 1223 | { | - | ||||||||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||||||||
| 1226 | const ushort *data = reinterpret_cast<const ushort *>(publicId.constData()); | - | ||||||||||||||||||||||||||||||
| 1227 | uchar c = 0; | - | ||||||||||||||||||||||||||||||
| 1228 | int i; | - | ||||||||||||||||||||||||||||||
| 1229 | for (i = publicId.size() - 1; i >= 0
| 295-13888 | ||||||||||||||||||||||||||||||
| 1230 | if (data[i] < 256
| 0-13888 | ||||||||||||||||||||||||||||||
| 1231 | switch ((c = data[i])) { | - | ||||||||||||||||||||||||||||||
| 1232 | case executed 987 times by 12 tests: ' ':case ' ':Executed by:
executed 987 times by 12 tests: casecase ' ':Executed by:
never executed: '\n':case '\n':never executed: casecase '\n':executed 1 time by 1 test: '\r':case '\r':Executed by:
executed 1 time by 1 test: casecase '\r':Executed by:
executed 501 times by 12 tests: '-':case '-':Executed by:
executed 501 times by 12 tests: casecase '-':Executed by:
executed 3 times by 1 test: '(':case '(':Executed by:
executed 3 times by 1 test: casecase '(':Executed by:
executed 3 times by 1 test: ')':case ')':Executed by:
executed 3 times by 1 test: case ')':Executed by:
| 0-987 | ||||||||||||||||||||||||||||||
| 1233 | case executed 3 times by 1 test: '+':case '+':Executed by:
executed 3 times by 1 test: casecase '+':Executed by:
executed 3 times by 1 test: ',':case ',':Executed by:
executed 3 times by 1 test: casecase ',':Executed by:
executed 246 times by 12 tests: '.':case '.':Executed by:
executed 246 times by 12 tests: casecase '.':Executed by:
executed 1546 times by 12 tests: '/':case '/':Executed by:
executed 1546 times by 12 tests: casecase '/':Executed by:
executed 3 times by 1 test: ':':case ':':Executed by:
executed 3 times by 1 test: casecase ':':Executed by:
executed 3 times by 1 test: '=':case '=':Executed by:
executed 3 times by 1 test: case '=':Executed by:
| 3-1546 | ||||||||||||||||||||||||||||||
| 1234 | case executed 3 times by 1 test: '?':case '?':Executed by:
executed 3 times by 1 test: casecase '?':Executed by:
executed 5 times by 1 test: ';':case ';':Executed by:
executed 5 times by 1 test: casecase ';':Executed by:
executed 5 times by 1 test: '!':case '!':Executed by:
executed 5 times by 1 test: casecase '!':Executed by:
executed 5 times by 1 test: '*':case '*':Executed by:
executed 5 times by 1 test: casecase '*':Executed by:
executed 5 times by 1 test: '#':case '#':Executed by:
executed 5 times by 1 test: casecase '#':Executed by:
executed 5 times by 1 test: '@':case '@':Executed by:
executed 5 times by 1 test: case '@':Executed by:
| 3-5 | ||||||||||||||||||||||||||||||
| 1235 | case executed 5 times by 1 test: '$':case '$':Executed by:
executed 5 times by 1 test: casecase '$':Executed by:
executed 5 times by 1 test: '_':case '_':Executed by:
executed 5 times by 1 test: casecase '_':Executed by:
executed 5 times by 1 test: '%':case '%':Executed by:
executed 5 times by 1 test: casecase '%':Executed by:
executed 3 times by 1 test: '\'':case '\'':Executed by:
executed 3 times by 1 test: casecase '\'':Executed by:
never executed: '\"':case '\"':never executed: case '\"': | 0-5 | ||||||||||||||||||||||||||||||
| 1236 | continue; executed 3345 times by 12 tests: continue;Executed by:
| 3345 | ||||||||||||||||||||||||||||||
| 1237 | default executed 10543 times by 12 tests: :default:Executed by:
executed 10543 times by 12 tests: default:Executed by:
| 10543 | ||||||||||||||||||||||||||||||
| 1238 | if ((c >= 'a'
| 0-7242 | ||||||||||||||||||||||||||||||
| 1239 | || (c >= 'A'
| 0-2782 | ||||||||||||||||||||||||||||||
| 1240 | || (c >= '0'
| 0-519 | ||||||||||||||||||||||||||||||
| 1241 | continue; executed 10543 times by 12 tests: continue;Executed by:
| 10543 | ||||||||||||||||||||||||||||||
| 1242 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1243 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 1244 | } | - | ||||||||||||||||||||||||||||||
| 1245 | if (i >= 0
| 0-295 | ||||||||||||||||||||||||||||||
| 1246 | raiseWellFormedError(QXmlStream::tr("Unexpected character '%1' in public id literal.").arg(QChar(QLatin1Char(c)))); never executed: raiseWellFormedError(QXmlStream::tr("Unexpected character '%1' in public id literal.").arg(QChar(QLatin1Char(c)))); | 0 | ||||||||||||||||||||||||||||||
| 1247 | } executed 295 times by 12 tests: end of blockExecuted by:
| 295 | ||||||||||||||||||||||||||||||
| 1248 | - | |||||||||||||||||||||||||||||||
| 1249 | - | |||||||||||||||||||||||||||||||
| 1250 | - | |||||||||||||||||||||||||||||||
| 1251 | - | |||||||||||||||||||||||||||||||
| 1252 | - | |||||||||||||||||||||||||||||||
| 1253 | - | |||||||||||||||||||||||||||||||
| 1254 | bool QXmlStreamReaderPrivate::checkStartDocument() | - | ||||||||||||||||||||||||||||||
| 1255 | { | - | ||||||||||||||||||||||||||||||
| 1256 | hasCheckedStartDocument = true; | - | ||||||||||||||||||||||||||||||
| 1257 | - | |||||||||||||||||||||||||||||||
| 1258 | if (scanString(spell[XML], XML)
| 1285-4669 | ||||||||||||||||||||||||||||||
| 1259 | return executed 1285 times by 5 tests: true;return true;Executed by:
executed 1285 times by 5 tests: return true;Executed by:
| 1285 | ||||||||||||||||||||||||||||||
| 1260 | - | |||||||||||||||||||||||||||||||
| 1261 | type = QXmlStreamReader::StartDocument; | - | ||||||||||||||||||||||||||||||
| 1262 | if (atEnd
| 1984-2685 | ||||||||||||||||||||||||||||||
| 1263 | hasCheckedStartDocument = false; | - | ||||||||||||||||||||||||||||||
| 1264 | raiseError(QXmlStreamReader::PrematureEndOfDocumentError); | - | ||||||||||||||||||||||||||||||
| 1265 | } executed 2685 times by 2 tests: end of blockExecuted by:
| 2685 | ||||||||||||||||||||||||||||||
| 1266 | return executed 4669 times by 13 tests: false;return false;Executed by:
executed 4669 times by 13 tests: return false;Executed by:
| 4669 | ||||||||||||||||||||||||||||||
| 1267 | } | - | ||||||||||||||||||||||||||||||
| 1268 | - | |||||||||||||||||||||||||||||||
| 1269 | void QXmlStreamReaderPrivate::startDocument() | - | ||||||||||||||||||||||||||||||
| 1270 | { | - | ||||||||||||||||||||||||||||||
| 1271 | QString err; | - | ||||||||||||||||||||||||||||||
| 1272 | if (documentVersion != QLatin1String("1.0")
| 4-1237 | ||||||||||||||||||||||||||||||
| 1273 | if (documentVersion.contains(QLatin1Char(' '))
| 1-3 | ||||||||||||||||||||||||||||||
| 1274 | err = QXmlStream::tr("Invalid XML version string."); executed 1 time by 1 test: err = QXmlStream::tr("Invalid XML version string.");Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 1275 | else | - | ||||||||||||||||||||||||||||||
| 1276 | err = QXmlStream::tr("Unsupported XML version."); executed 3 times by 1 test: err = QXmlStream::tr("Unsupported XML version.");Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 1277 | } | - | ||||||||||||||||||||||||||||||
| 1278 | int n = attributeStack.size(); | - | ||||||||||||||||||||||||||||||
| 1279 | - | |||||||||||||||||||||||||||||||
| 1280 | - | |||||||||||||||||||||||||||||||
| 1281 | - | |||||||||||||||||||||||||||||||
| 1282 | - | |||||||||||||||||||||||||||||||
| 1283 | - | |||||||||||||||||||||||||||||||
| 1284 | bool hasStandalone = false; | - | ||||||||||||||||||||||||||||||
| 1285 | - | |||||||||||||||||||||||||||||||
| 1286 | for (int i = 0; err.isNull()
| 31-1902 | ||||||||||||||||||||||||||||||
| 1287 | Attribute &attrib = attributeStack[i]; | - | ||||||||||||||||||||||||||||||
| 1288 | QStringRef prefix(symPrefix(attrib.key)); | - | ||||||||||||||||||||||||||||||
| 1289 | QStringRef key(symString(attrib.key)); | - | ||||||||||||||||||||||||||||||
| 1290 | QStringRef value(symString(attrib.value)); | - | ||||||||||||||||||||||||||||||
| 1291 | - | |||||||||||||||||||||||||||||||
| 1292 | if (prefix.isEmpty()
| 0-692 | ||||||||||||||||||||||||||||||
| 1293 | const QString name(value.toString()); | - | ||||||||||||||||||||||||||||||
| 1294 | documentEncoding = value; | - | ||||||||||||||||||||||||||||||
| 1295 | - | |||||||||||||||||||||||||||||||
| 1296 | if(hasStandalone
| 1-658 | ||||||||||||||||||||||||||||||
| 1297 | err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding."); executed 1 time by 1 test: err = QXmlStream::tr("The standalone pseudo attribute must appear after the encoding.");Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 1298 | if(!QXmlUtils::isEncName(name)
| 16-643 | ||||||||||||||||||||||||||||||
| 1299 | err = QXmlStream::tr("%1 is an invalid encoding name.").arg(name); executed 16 times by 1 test: err = QXmlStream::tr("%1 is an invalid encoding name.").arg(name);Executed by:
| 16 | ||||||||||||||||||||||||||||||
| 1300 | else { | - | ||||||||||||||||||||||||||||||
| 1301 | - | |||||||||||||||||||||||||||||||
| 1302 | - | |||||||||||||||||||||||||||||||
| 1303 | - | |||||||||||||||||||||||||||||||
| 1304 | QTextCodec *const newCodec = QTextCodec::codecForName(name.toLatin1()); | - | ||||||||||||||||||||||||||||||
| 1305 | if (!newCodec
| 0-643 | ||||||||||||||||||||||||||||||
| 1306 | err = QXmlStream::tr("Encoding %1 is unsupported").arg(name); never executed: err = QXmlStream::tr("Encoding %1 is unsupported").arg(name); | 0 | ||||||||||||||||||||||||||||||
| 1307 | else if (newCodec != codec
| 0-639 | ||||||||||||||||||||||||||||||
| 1308 | codec = newCodec; | - | ||||||||||||||||||||||||||||||
| 1309 | delete decoder; | - | ||||||||||||||||||||||||||||||
| 1310 | decoder = codec->makeDecoder(); | - | ||||||||||||||||||||||||||||||
| 1311 | decoder->toUnicode(&readBuffer, rawReadBuffer.data(), nbytesread); | - | ||||||||||||||||||||||||||||||
| 1312 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||
| 1313 | - | |||||||||||||||||||||||||||||||
| 1314 | } executed 643 times by 4 tests: end of blockExecuted by:
| 643 | ||||||||||||||||||||||||||||||
| 1315 | } else if (prefix.isEmpty()
| 0-33 | ||||||||||||||||||||||||||||||
| 1316 | hasStandalone = true; | - | ||||||||||||||||||||||||||||||
| 1317 | if (value == QLatin1String("yes")
| 8-21 | ||||||||||||||||||||||||||||||
| 1318 | standalone = true; executed 21 times by 1 test: standalone = true;Executed by:
| 21 | ||||||||||||||||||||||||||||||
| 1319 | else if (value == QLatin1String("no")
| 2-6 | ||||||||||||||||||||||||||||||
| 1320 | standalone = false; executed 2 times by 1 test: standalone = false;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1321 | else | - | ||||||||||||||||||||||||||||||
| 1322 | err = QXmlStream::tr("Standalone accepts only yes or no."); executed 6 times by 1 test: err = QXmlStream::tr("Standalone accepts only yes or no.");Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 1323 | } else { | - | ||||||||||||||||||||||||||||||
| 1324 | err = QXmlStream::tr("Invalid attribute in XML declaration."); | - | ||||||||||||||||||||||||||||||
| 1325 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||
| 1326 | } | - | ||||||||||||||||||||||||||||||
| 1327 | - | |||||||||||||||||||||||||||||||
| 1328 | if (!err.isNull()
| 31-1210 | ||||||||||||||||||||||||||||||
| 1329 | raiseWellFormedError(err); executed 31 times by 1 test: raiseWellFormedError(err);Executed by:
| 31 | ||||||||||||||||||||||||||||||
| 1330 | attributeStack.clear(); | - | ||||||||||||||||||||||||||||||
| 1331 | } executed 1241 times by 5 tests: end of blockExecuted by:
| 1241 | ||||||||||||||||||||||||||||||
| 1332 | - | |||||||||||||||||||||||||||||||
| 1333 | - | |||||||||||||||||||||||||||||||
| 1334 | void QXmlStreamReaderPrivate::raiseError(QXmlStreamReader::Error error, const QString& message) | - | ||||||||||||||||||||||||||||||
| 1335 | { | - | ||||||||||||||||||||||||||||||
| 1336 | this->error = error; | - | ||||||||||||||||||||||||||||||
| 1337 | errorString = message; | - | ||||||||||||||||||||||||||||||
| 1338 | if (errorString.isNull()
| 1235-58733 | ||||||||||||||||||||||||||||||
| 1339 | if (error == QXmlStreamReader::PrematureEndOfDocumentError
| 0-58733 | ||||||||||||||||||||||||||||||
| 1340 | errorString = QXmlStream::tr("Premature end of document."); executed 58733 times by 2 tests: errorString = QXmlStream::tr("Premature end of document.");Executed by:
| 58733 | ||||||||||||||||||||||||||||||
| 1341 | else if (error == QXmlStreamReader::CustomError
| 0 | ||||||||||||||||||||||||||||||
| 1342 | errorString = QXmlStream::tr("Invalid document."); never executed: errorString = QXmlStream::tr("Invalid document."); | 0 | ||||||||||||||||||||||||||||||
| 1343 | } executed 58733 times by 2 tests: end of blockExecuted by:
| 58733 | ||||||||||||||||||||||||||||||
| 1344 | - | |||||||||||||||||||||||||||||||
| 1345 | type = QXmlStreamReader::Invalid; | - | ||||||||||||||||||||||||||||||
| 1346 | } executed 59968 times by 3 tests: end of blockExecuted by:
| 59968 | ||||||||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||||||||
| 1348 | void QXmlStreamReaderPrivate::raiseWellFormedError(const QString &message) | - | ||||||||||||||||||||||||||||||
| 1349 | { | - | ||||||||||||||||||||||||||||||
| 1350 | raiseError(QXmlStreamReader::NotWellFormedError, message); | - | ||||||||||||||||||||||||||||||
| 1351 | } executed 1196 times by 2 tests: end of blockExecuted by:
| 1196 | ||||||||||||||||||||||||||||||
| 1352 | - | |||||||||||||||||||||||||||||||
| 1353 | void QXmlStreamReaderPrivate::parseError() | - | ||||||||||||||||||||||||||||||
| 1354 | { | - | ||||||||||||||||||||||||||||||
| 1355 | - | |||||||||||||||||||||||||||||||
| 1356 | if (token == EOF_SYMBOL
| 613-6305 | ||||||||||||||||||||||||||||||
| 1357 | raiseError(QXmlStreamReader::PrematureEndOfDocumentError); | - | ||||||||||||||||||||||||||||||
| 1358 | return; executed 6305 times by 1 test: return;Executed by:
| 6305 | ||||||||||||||||||||||||||||||
| 1359 | } | - | ||||||||||||||||||||||||||||||
| 1360 | const int nmax = 4; | - | ||||||||||||||||||||||||||||||
| 1361 | QString error_message; | - | ||||||||||||||||||||||||||||||
| 1362 | int ers = state_stack[tos]; | - | ||||||||||||||||||||||||||||||
| 1363 | int nexpected = 0; | - | ||||||||||||||||||||||||||||||
| 1364 | int expected[nmax]; | - | ||||||||||||||||||||||||||||||
| 1365 | if (token != ERROR
| 7-606 | ||||||||||||||||||||||||||||||
| 1366 | for (int tk = 0; tk < TERMINAL_COUNT
| 606-34542 | ||||||||||||||||||||||||||||||
| 1367 | int k = t_action(ers, tk); | - | ||||||||||||||||||||||||||||||
| 1368 | if (k <= 0
| 3323-31219 | ||||||||||||||||||||||||||||||
| 1369 | continue; executed 31219 times by 1 test: continue;Executed by:
| 31219 | ||||||||||||||||||||||||||||||
| 1370 | if (spell[tk]
| 96-3227 | ||||||||||||||||||||||||||||||
| 1371 | if (nexpected < nmax
| 1391-1836 | ||||||||||||||||||||||||||||||
| 1372 | expected[nexpected++] = tk; executed 1391 times by 1 test: expected[nexpected++] = tk;Executed by:
| 1391 | ||||||||||||||||||||||||||||||
| 1373 | } executed 3227 times by 1 test: end of blockExecuted by:
| 3227 | ||||||||||||||||||||||||||||||
| 1374 | } executed 3323 times by 1 test: end of blockExecuted by:
| 3323 | ||||||||||||||||||||||||||||||
| 1375 | - | |||||||||||||||||||||||||||||||
| 1376 | error_message.clear (); | - | ||||||||||||||||||||||||||||||
| 1377 | if (nexpected
| 7-606 | ||||||||||||||||||||||||||||||
| 1378 | bool first = true; | - | ||||||||||||||||||||||||||||||
| 1379 | - | |||||||||||||||||||||||||||||||
| 1380 | for (int s = 0; s < nexpected
| 448-759 | ||||||||||||||||||||||||||||||
| 1381 | if (first
| 311-448 | ||||||||||||||||||||||||||||||
| 1382 | error_message += QXmlStream::tr ("Expected "); executed 448 times by 1 test: error_message += QXmlStream::tr ("Expected ");Executed by:
| 448 | ||||||||||||||||||||||||||||||
| 1383 | else if (s == nexpected - 1
| 89-222 | ||||||||||||||||||||||||||||||
| 1384 | error_message += QLatin1String (nexpected > 2 ? ", or " : " or "); executed 222 times by 1 test: error_message += QLatin1String (nexpected > 2 ? ", or " : " or ");Executed by:
| 222 | ||||||||||||||||||||||||||||||
| 1385 | else | - | ||||||||||||||||||||||||||||||
| 1386 | error_message += QLatin1String (", "); executed 89 times by 1 test: error_message += QLatin1String (", ");Executed by:
| 89 | ||||||||||||||||||||||||||||||
| 1387 | - | |||||||||||||||||||||||||||||||
| 1388 | first = false; | - | ||||||||||||||||||||||||||||||
| 1389 | error_message += QLatin1String("\'"); | - | ||||||||||||||||||||||||||||||
| 1390 | error_message += QLatin1String (spell [expected[s]]); | - | ||||||||||||||||||||||||||||||
| 1391 | error_message += QLatin1String("\'"); | - | ||||||||||||||||||||||||||||||
| 1392 | } executed 759 times by 1 test: end of blockExecuted by:
| 759 | ||||||||||||||||||||||||||||||
| 1393 | error_message += QXmlStream::tr(", but got \'"); | - | ||||||||||||||||||||||||||||||
| 1394 | error_message += QLatin1String(spell [token]); | - | ||||||||||||||||||||||||||||||
| 1395 | error_message += QLatin1String("\'"); | - | ||||||||||||||||||||||||||||||
| 1396 | } executed 448 times by 1 test: else {end of blockExecuted by:
| 448 | ||||||||||||||||||||||||||||||
| 1397 | error_message += QXmlStream::tr("Unexpected \'"); | - | ||||||||||||||||||||||||||||||
| 1398 | error_message += QLatin1String(spell [token]); | - | ||||||||||||||||||||||||||||||
| 1399 | error_message += QLatin1String("\'"); | - | ||||||||||||||||||||||||||||||
| 1400 | } executed 165 times by 1 test: end of blockExecuted by:
| 165 | ||||||||||||||||||||||||||||||
| 1401 | error_message += QLatin1Char('.'); | - | ||||||||||||||||||||||||||||||
| 1402 | - | |||||||||||||||||||||||||||||||
| 1403 | raiseWellFormedError(error_message); | - | ||||||||||||||||||||||||||||||
| 1404 | } executed 613 times by 1 test: end of blockExecuted by:
| 613 | ||||||||||||||||||||||||||||||
| 1405 | - | |||||||||||||||||||||||||||||||
| 1406 | void QXmlStreamReaderPrivate::resume(int rule) { | - | ||||||||||||||||||||||||||||||
| 1407 | resumeReduction = rule; | - | ||||||||||||||||||||||||||||||
| 1408 | if (error == QXmlStreamReader::NoError
| 26-44571 | ||||||||||||||||||||||||||||||
| 1409 | raiseError(QXmlStreamReader::PrematureEndOfDocumentError); executed 26 times by 1 test: raiseError(QXmlStreamReader::PrematureEndOfDocumentError);Executed by:
| 26 | ||||||||||||||||||||||||||||||
| 1410 | } executed 44597 times by 1 test: end of blockExecuted by:
| 44597 | ||||||||||||||||||||||||||||||
| 1411 | - | |||||||||||||||||||||||||||||||
| 1412 | - | |||||||||||||||||||||||||||||||
| 1413 | - | |||||||||||||||||||||||||||||||
| 1414 | - | |||||||||||||||||||||||||||||||
| 1415 | - | |||||||||||||||||||||||||||||||
| 1416 | qint64 QXmlStreamReader::lineNumber() const | - | ||||||||||||||||||||||||||||||
| 1417 | { | - | ||||||||||||||||||||||||||||||
| 1418 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1419 | return executed 584 times by 1 test: d->lineNumber + 1;return d->lineNumber + 1;Executed by:
executed 584 times by 1 test: return d->lineNumber + 1;Executed by:
| 584 | ||||||||||||||||||||||||||||||
| 1420 | } | - | ||||||||||||||||||||||||||||||
| 1421 | - | |||||||||||||||||||||||||||||||
| 1422 | - | |||||||||||||||||||||||||||||||
| 1423 | - | |||||||||||||||||||||||||||||||
| 1424 | - | |||||||||||||||||||||||||||||||
| 1425 | - | |||||||||||||||||||||||||||||||
| 1426 | qint64 QXmlStreamReader::columnNumber() const | - | ||||||||||||||||||||||||||||||
| 1427 | { | - | ||||||||||||||||||||||||||||||
| 1428 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1429 | return executed 584 times by 1 test: d->characterOffset - d->lastLineStart + d->readBufferPos;return d->characterOffset - d->lastLineStart + d->readBufferPos;Executed by:
executed 584 times by 1 test: return d->characterOffset - d->lastLineStart + d->readBufferPos;Executed by:
| 584 | ||||||||||||||||||||||||||||||
| 1430 | } | - | ||||||||||||||||||||||||||||||
| 1431 | - | |||||||||||||||||||||||||||||||
| 1432 | - | |||||||||||||||||||||||||||||||
| 1433 | - | |||||||||||||||||||||||||||||||
| 1434 | - | |||||||||||||||||||||||||||||||
| 1435 | - | |||||||||||||||||||||||||||||||
| 1436 | qint64 QXmlStreamReader::characterOffset() const | - | ||||||||||||||||||||||||||||||
| 1437 | { | - | ||||||||||||||||||||||||||||||
| 1438 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1439 | return never executed: d->characterOffset + d->readBufferPos;return d->characterOffset + d->readBufferPos;never executed: return d->characterOffset + d->readBufferPos; | 0 | ||||||||||||||||||||||||||||||
| 1440 | } | - | ||||||||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||
| 1445 | - | |||||||||||||||||||||||||||||||
| 1446 | QStringRef QXmlStreamReader::text() const | - | ||||||||||||||||||||||||||||||
| 1447 | { | - | ||||||||||||||||||||||||||||||
| 1448 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1449 | return executed 3556 times by 1 test: d->text;return d->text;Executed by:
executed 3556 times by 1 test: return d->text;Executed by:
| 3556 | ||||||||||||||||||||||||||||||
| 1450 | } | - | ||||||||||||||||||||||||||||||
| 1451 | QXmlStreamNotationDeclarations QXmlStreamReader::notationDeclarations() const | - | ||||||||||||||||||||||||||||||
| 1452 | { | - | ||||||||||||||||||||||||||||||
| 1453 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1454 | if (d->notationDeclarations.size()
| 47-2545 | ||||||||||||||||||||||||||||||
| 1455 | const_cast< executed 47 times by 1 test: QXmlStreamReaderPrivate *>(d)->resolveDtd();const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();Executed by:
executed 47 times by 1 test: const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();Executed by:
| 47 | ||||||||||||||||||||||||||||||
| 1456 | return executed 2592 times by 1 test: d->publicNotationDeclarations;return d->publicNotationDeclarations;Executed by:
executed 2592 times by 1 test: return d->publicNotationDeclarations;Executed by:
| 2592 | ||||||||||||||||||||||||||||||
| 1457 | } | - | ||||||||||||||||||||||||||||||
| 1458 | QXmlStreamEntityDeclarations QXmlStreamReader::entityDeclarations() const | - | ||||||||||||||||||||||||||||||
| 1459 | { | - | ||||||||||||||||||||||||||||||
| 1460 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1461 | if (d->entityDeclarations.size()
| 5-1903 | ||||||||||||||||||||||||||||||
| 1462 | const_cast< executed 5 times by 1 test: QXmlStreamReaderPrivate *>(d)->resolveDtd();const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();Executed by:
executed 5 times by 1 test: const_cast<QXmlStreamReaderPrivate *>(d)->resolveDtd();Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 1463 | return executed 1908 times by 1 test: d->publicEntityDeclarations;return d->publicEntityDeclarations;Executed by:
executed 1908 times by 1 test: return d->publicEntityDeclarations;Executed by:
| 1908 | ||||||||||||||||||||||||||||||
| 1464 | } | - | ||||||||||||||||||||||||||||||
| 1465 | QStringRef QXmlStreamReader::dtdName() const | - | ||||||||||||||||||||||||||||||
| 1466 | { | - | ||||||||||||||||||||||||||||||
| 1467 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1468 | if (d->type == QXmlStreamReader::DTD
| 50-1878 | ||||||||||||||||||||||||||||||
| 1469 | return executed 50 times by 1 test: d->dtdName;return d->dtdName;Executed by:
executed 50 times by 1 test: return d->dtdName;Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 1470 | return executed 1878 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 1878 times by 1 test: return QStringRef();Executed by:
| 1878 | ||||||||||||||||||||||||||||||
| 1471 | } | - | ||||||||||||||||||||||||||||||
| 1472 | QStringRef QXmlStreamReader::dtdPublicId() const | - | ||||||||||||||||||||||||||||||
| 1473 | { | - | ||||||||||||||||||||||||||||||
| 1474 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1475 | if (d->type == QXmlStreamReader::DTD
| 27-1878 | ||||||||||||||||||||||||||||||
| 1476 | return executed 27 times by 1 test: d->dtdPublicId;return d->dtdPublicId;Executed by:
executed 27 times by 1 test: return d->dtdPublicId;Executed by:
| 27 | ||||||||||||||||||||||||||||||
| 1477 | return executed 1878 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 1878 times by 1 test: return QStringRef();Executed by:
| 1878 | ||||||||||||||||||||||||||||||
| 1478 | } | - | ||||||||||||||||||||||||||||||
| 1479 | QStringRef QXmlStreamReader::dtdSystemId() const | - | ||||||||||||||||||||||||||||||
| 1480 | { | - | ||||||||||||||||||||||||||||||
| 1481 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1482 | if (d->type == QXmlStreamReader::DTD
| 27-1878 | ||||||||||||||||||||||||||||||
| 1483 | return executed 27 times by 1 test: d->dtdSystemId;return d->dtdSystemId;Executed by:
executed 27 times by 1 test: return d->dtdSystemId;Executed by:
| 27 | ||||||||||||||||||||||||||||||
| 1484 | return executed 1878 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 1878 times by 1 test: return QStringRef();Executed by:
| 1878 | ||||||||||||||||||||||||||||||
| 1485 | } | - | ||||||||||||||||||||||||||||||
| 1486 | QXmlStreamNamespaceDeclarations QXmlStreamReader::namespaceDeclarations() const | - | ||||||||||||||||||||||||||||||
| 1487 | { | - | ||||||||||||||||||||||||||||||
| 1488 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1489 | if (d->publicNamespaceDeclarations.isEmpty()
| 38-1907 | ||||||||||||||||||||||||||||||
| 1490 | const_cast< executed 446 times by 1 test: QXmlStreamReaderPrivate *>(d)->resolvePublicNamespaces();const_cast<QXmlStreamReaderPrivate *>(d)->resolvePublicNamespaces();Executed by:
executed 446 times by 1 test: const_cast<QXmlStreamReaderPrivate *>(d)->resolvePublicNamespaces();Executed by:
| 446 | ||||||||||||||||||||||||||||||
| 1491 | return executed 1945 times by 1 test: d->publicNamespaceDeclarations;return d->publicNamespaceDeclarations;Executed by:
executed 1945 times by 1 test: return d->publicNamespaceDeclarations;Executed by:
| 1945 | ||||||||||||||||||||||||||||||
| 1492 | } | - | ||||||||||||||||||||||||||||||
| 1493 | void QXmlStreamReader::addExtraNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &extraNamespaceDeclaration) | - | ||||||||||||||||||||||||||||||
| 1494 | { | - | ||||||||||||||||||||||||||||||
| 1495 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1496 | QXmlStreamReaderPrivate::NamespaceDeclaration &namespaceDeclaration = d->namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 1497 | namespaceDeclaration.prefix = d->addToStringStorage(extraNamespaceDeclaration.prefix()); | - | ||||||||||||||||||||||||||||||
| 1498 | namespaceDeclaration.namespaceUri = d->addToStringStorage(extraNamespaceDeclaration.namespaceUri()); | - | ||||||||||||||||||||||||||||||
| 1499 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 1500 | void QXmlStreamReader::addExtraNamespaceDeclarations(const QXmlStreamNamespaceDeclarations &extraNamespaceDeclarations) | - | ||||||||||||||||||||||||||||||
| 1501 | { | - | ||||||||||||||||||||||||||||||
| 1502 | for (int i = 0; i < extraNamespaceDeclarations.size()
| 0 | ||||||||||||||||||||||||||||||
| 1503 | addExtraNamespaceDeclaration(extraNamespaceDeclarations.at(i)); never executed: addExtraNamespaceDeclaration(extraNamespaceDeclarations.at(i)); | 0 | ||||||||||||||||||||||||||||||
| 1504 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1505 | QString QXmlStreamReader::readElementText(ReadElementTextBehaviour behaviour) | - | ||||||||||||||||||||||||||||||
| 1506 | { | - | ||||||||||||||||||||||||||||||
| 1507 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1508 | if (isStartElement()
| 0-134858 | ||||||||||||||||||||||||||||||
| 1509 | QString result; | - | ||||||||||||||||||||||||||||||
| 1510 | for(;;) { | - | ||||||||||||||||||||||||||||||
| 1511 | switch (readNext()) { | - | ||||||||||||||||||||||||||||||
| 1512 | case executed 134861 times by 2 tests: Characters:case Characters:Executed by:
executed 134861 times by 2 tests: case Characters:Executed by:
| 134861 | ||||||||||||||||||||||||||||||
| 1513 | case never executed: EntityReference:case EntityReference:never executed: case EntityReference: | 0 | ||||||||||||||||||||||||||||||
| 1514 | result.insert(result.size(), d->text.unicode(), d->text.size()); | - | ||||||||||||||||||||||||||||||
| 1515 | break; executed 134861 times by 2 tests: break;Executed by:
| 134861 | ||||||||||||||||||||||||||||||
| 1516 | case executed 134853 times by 2 tests: EndElement:case EndElement:Executed by:
executed 134853 times by 2 tests: case EndElement:Executed by:
| 134853 | ||||||||||||||||||||||||||||||
| 1517 | return executed 134853 times by 2 tests: result;return result;Executed by:
executed 134853 times by 2 tests: return result;Executed by:
| 134853 | ||||||||||||||||||||||||||||||
| 1518 | case never executed: ProcessingInstruction:case ProcessingInstruction:never executed: case ProcessingInstruction: | 0 | ||||||||||||||||||||||||||||||
| 1519 | case executed 2 times by 1 test: Comment:case Comment:Executed by:
executed 2 times by 1 test: case Comment:Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1520 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1521 | case executed 6 times by 1 test: StartElement:case StartElement:Executed by:
executed 6 times by 1 test: case StartElement:Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 1522 | if (behaviour == SkipChildElements
| 2-4 | ||||||||||||||||||||||||||||||
| 1523 | skipCurrentElement(); | - | ||||||||||||||||||||||||||||||
| 1524 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1525 | } else if (behaviour == IncludeChildElements
| 2 | ||||||||||||||||||||||||||||||
| 1526 | result += readElementText(behaviour); | - | ||||||||||||||||||||||||||||||
| 1527 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1528 | } | - | ||||||||||||||||||||||||||||||
| 1529 | - | |||||||||||||||||||||||||||||||
| 1530 | default executed 5 times by 1 test: :default:Executed by:
executed 5 times by 1 test: default:Executed by:
code before this statement executed 2 times by 1 test: default:Executed by:
| 2-5 | ||||||||||||||||||||||||||||||
| 1531 | if (d->error || behaviour == ErrorOnUnexpectedElement
| 0-2 | ||||||||||||||||||||||||||||||
| 1532 | if (!d->error
| 2-3 | ||||||||||||||||||||||||||||||
| 1533 | d->raiseError(UnexpectedElementError, QXmlStream::tr("Expected character data.")); executed 2 times by 1 test: d->raiseError(UnexpectedElementError, QXmlStream::tr("Expected character data."));Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1534 | return executed 5 times by 1 test: result;return result;Executed by:
executed 5 times by 1 test: return result;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 1535 | } | - | ||||||||||||||||||||||||||||||
| 1536 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1537 | } | - | ||||||||||||||||||||||||||||||
| 1538 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1539 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||
| 1540 | } | - | ||||||||||||||||||||||||||||||
| 1541 | - | |||||||||||||||||||||||||||||||
| 1542 | - | |||||||||||||||||||||||||||||||
| 1543 | - | |||||||||||||||||||||||||||||||
| 1544 | - | |||||||||||||||||||||||||||||||
| 1545 | - | |||||||||||||||||||||||||||||||
| 1546 | void QXmlStreamReader::raiseError(const QString& message) | - | ||||||||||||||||||||||||||||||
| 1547 | { | - | ||||||||||||||||||||||||||||||
| 1548 | QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1549 | d->raiseError(CustomError, message); | - | ||||||||||||||||||||||||||||||
| 1550 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1551 | - | |||||||||||||||||||||||||||||||
| 1552 | - | |||||||||||||||||||||||||||||||
| 1553 | - | |||||||||||||||||||||||||||||||
| 1554 | - | |||||||||||||||||||||||||||||||
| 1555 | - | |||||||||||||||||||||||||||||||
| 1556 | - | |||||||||||||||||||||||||||||||
| 1557 | QString QXmlStreamReader::errorString() const | - | ||||||||||||||||||||||||||||||
| 1558 | { | - | ||||||||||||||||||||||||||||||
| 1559 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1560 | if (d->type == QXmlStreamReader::Invalid
| 39-586 | ||||||||||||||||||||||||||||||
| 1561 | return executed 39 times by 1 test: d->errorString;return d->errorString;Executed by:
executed 39 times by 1 test: return d->errorString;Executed by:
| 39 | ||||||||||||||||||||||||||||||
| 1562 | return executed 586 times by 2 tests: QString();return QString();Executed by:
executed 586 times by 2 tests: return QString();Executed by:
| 586 | ||||||||||||||||||||||||||||||
| 1563 | } | - | ||||||||||||||||||||||||||||||
| 1564 | - | |||||||||||||||||||||||||||||||
| 1565 | - | |||||||||||||||||||||||||||||||
| 1566 | - | |||||||||||||||||||||||||||||||
| 1567 | - | |||||||||||||||||||||||||||||||
| 1568 | - | |||||||||||||||||||||||||||||||
| 1569 | QXmlStreamReader::Error QXmlStreamReader::error() const | - | ||||||||||||||||||||||||||||||
| 1570 | { | - | ||||||||||||||||||||||||||||||
| 1571 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1572 | if (d->type == QXmlStreamReader::Invalid
| 2921-59946 | ||||||||||||||||||||||||||||||
| 1573 | return executed 59946 times by 3 tests: d->error;return d->error;Executed by:
executed 59946 times by 3 tests: return d->error;Executed by:
| 59946 | ||||||||||||||||||||||||||||||
| 1574 | return executed 2921 times by 15 tests: NoError;return NoError;Executed by:
executed 2921 times by 15 tests: return NoError;Executed by:
| 2921 | ||||||||||||||||||||||||||||||
| 1575 | } | - | ||||||||||||||||||||||||||||||
| 1576 | - | |||||||||||||||||||||||||||||||
| 1577 | - | |||||||||||||||||||||||||||||||
| 1578 | - | |||||||||||||||||||||||||||||||
| 1579 | - | |||||||||||||||||||||||||||||||
| 1580 | QStringRef QXmlStreamReader::processingInstructionTarget() const | - | ||||||||||||||||||||||||||||||
| 1581 | { | - | ||||||||||||||||||||||||||||||
| 1582 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1583 | return executed 1988 times by 1 test: d->processingInstructionTarget;return d->processingInstructionTarget;Executed by:
executed 1988 times by 1 test: return d->processingInstructionTarget;Executed by:
| 1988 | ||||||||||||||||||||||||||||||
| 1584 | } | - | ||||||||||||||||||||||||||||||
| 1585 | - | |||||||||||||||||||||||||||||||
| 1586 | - | |||||||||||||||||||||||||||||||
| 1587 | - | |||||||||||||||||||||||||||||||
| 1588 | - | |||||||||||||||||||||||||||||||
| 1589 | QStringRef QXmlStreamReader::processingInstructionData() const | - | ||||||||||||||||||||||||||||||
| 1590 | { | - | ||||||||||||||||||||||||||||||
| 1591 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1592 | return executed 2024 times by 1 test: d->processingInstructionData;return d->processingInstructionData;Executed by:
executed 2024 times by 1 test: return d->processingInstructionData;Executed by:
| 2024 | ||||||||||||||||||||||||||||||
| 1593 | } | - | ||||||||||||||||||||||||||||||
| 1594 | QStringRef QXmlStreamReader::name() const | - | ||||||||||||||||||||||||||||||
| 1595 | { | - | ||||||||||||||||||||||||||||||
| 1596 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1597 | return executed 190123 times by 14 tests: d->name;return d->name;Executed by:
executed 190123 times by 14 tests: return d->name;Executed by:
| 190123 | ||||||||||||||||||||||||||||||
| 1598 | } | - | ||||||||||||||||||||||||||||||
| 1599 | - | |||||||||||||||||||||||||||||||
| 1600 | - | |||||||||||||||||||||||||||||||
| 1601 | - | |||||||||||||||||||||||||||||||
| 1602 | - | |||||||||||||||||||||||||||||||
| 1603 | - | |||||||||||||||||||||||||||||||
| 1604 | - | |||||||||||||||||||||||||||||||
| 1605 | QStringRef QXmlStreamReader::namespaceUri() const | - | ||||||||||||||||||||||||||||||
| 1606 | { | - | ||||||||||||||||||||||||||||||
| 1607 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1608 | return executed 3754 times by 1 test: d->namespaceUri;return d->namespaceUri;Executed by:
executed 3754 times by 1 test: return d->namespaceUri;Executed by:
| 3754 | ||||||||||||||||||||||||||||||
| 1609 | } | - | ||||||||||||||||||||||||||||||
| 1610 | QStringRef QXmlStreamReader::qualifiedName() const | - | ||||||||||||||||||||||||||||||
| 1611 | { | - | ||||||||||||||||||||||||||||||
| 1612 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1613 | return executed 3055 times by 1 test: d->qualifiedName;return d->qualifiedName;Executed by:
executed 3055 times by 1 test: return d->qualifiedName;Executed by:
| 3055 | ||||||||||||||||||||||||||||||
| 1614 | } | - | ||||||||||||||||||||||||||||||
| 1615 | QStringRef QXmlStreamReader::prefix() const | - | ||||||||||||||||||||||||||||||
| 1616 | { | - | ||||||||||||||||||||||||||||||
| 1617 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1618 | return executed 1943 times by 2 tests: d->prefix;return d->prefix;Executed by:
executed 1943 times by 2 tests: return d->prefix;Executed by:
| 1943 | ||||||||||||||||||||||||||||||
| 1619 | } | - | ||||||||||||||||||||||||||||||
| 1620 | - | |||||||||||||||||||||||||||||||
| 1621 | - | |||||||||||||||||||||||||||||||
| 1622 | - | |||||||||||||||||||||||||||||||
| 1623 | - | |||||||||||||||||||||||||||||||
| 1624 | QXmlStreamAttributes QXmlStreamReader::attributes() const | - | ||||||||||||||||||||||||||||||
| 1625 | { | - | ||||||||||||||||||||||||||||||
| 1626 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1627 | return executed 162995 times by 14 tests: d->attributes;return d->attributes;Executed by:
executed 162995 times by 14 tests: return d->attributes;Executed by:
| 162995 | ||||||||||||||||||||||||||||||
| 1628 | } | - | ||||||||||||||||||||||||||||||
| 1629 | QXmlStreamAttribute::QXmlStreamAttribute() | - | ||||||||||||||||||||||||||||||
| 1630 | { | - | ||||||||||||||||||||||||||||||
| 1631 | m_isDefault = false; | - | ||||||||||||||||||||||||||||||
| 1632 | } executed 269674 times by 15 tests: end of blockExecuted by:
| 269674 | ||||||||||||||||||||||||||||||
| 1633 | - | |||||||||||||||||||||||||||||||
| 1634 | - | |||||||||||||||||||||||||||||||
| 1635 | - | |||||||||||||||||||||||||||||||
| 1636 | - | |||||||||||||||||||||||||||||||
| 1637 | QXmlStreamAttribute::~QXmlStreamAttribute() | - | ||||||||||||||||||||||||||||||
| 1638 | { | - | ||||||||||||||||||||||||||||||
| 1639 | } | - | ||||||||||||||||||||||||||||||
| 1640 | - | |||||||||||||||||||||||||||||||
| 1641 | - | |||||||||||||||||||||||||||||||
| 1642 | - | |||||||||||||||||||||||||||||||
| 1643 | - | |||||||||||||||||||||||||||||||
| 1644 | QXmlStreamAttribute::QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value) | - | ||||||||||||||||||||||||||||||
| 1645 | { | - | ||||||||||||||||||||||||||||||
| 1646 | m_namespaceUri = QXmlStreamStringRef(QStringRef(&namespaceUri)); | - | ||||||||||||||||||||||||||||||
| 1647 | m_name = m_qualifiedName = QXmlStreamStringRef(QStringRef(&name)); | - | ||||||||||||||||||||||||||||||
| 1648 | m_value = QXmlStreamStringRef(QStringRef(&value)); | - | ||||||||||||||||||||||||||||||
| 1649 | m_namespaceUri = QXmlStreamStringRef(QStringRef(&namespaceUri)); | - | ||||||||||||||||||||||||||||||
| 1650 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1651 | - | |||||||||||||||||||||||||||||||
| 1652 | - | |||||||||||||||||||||||||||||||
| 1653 | - | |||||||||||||||||||||||||||||||
| 1654 | - | |||||||||||||||||||||||||||||||
| 1655 | QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QString &value) | - | ||||||||||||||||||||||||||||||
| 1656 | { | - | ||||||||||||||||||||||||||||||
| 1657 | int colon = qualifiedName.indexOf(QLatin1Char(':')); | - | ||||||||||||||||||||||||||||||
| 1658 | m_name = QXmlStreamStringRef(QStringRef(&qualifiedName, | - | ||||||||||||||||||||||||||||||
| 1659 | colon + 1, | - | ||||||||||||||||||||||||||||||
| 1660 | qualifiedName.size() - (colon + 1))); | - | ||||||||||||||||||||||||||||||
| 1661 | m_qualifiedName = QXmlStreamStringRef(QStringRef(&qualifiedName)); | - | ||||||||||||||||||||||||||||||
| 1662 | m_value = QXmlStreamStringRef(QStringRef(&value)); | - | ||||||||||||||||||||||||||||||
| 1663 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1664 | QXmlStreamAttribute::QXmlStreamAttribute(const QXmlStreamAttribute &other) | - | ||||||||||||||||||||||||||||||
| 1665 | { | - | ||||||||||||||||||||||||||||||
| 1666 | *this = other; | - | ||||||||||||||||||||||||||||||
| 1667 | } executed 2543 times by 1 test: end of blockExecuted by:
| 2543 | ||||||||||||||||||||||||||||||
| 1668 | - | |||||||||||||||||||||||||||||||
| 1669 | - | |||||||||||||||||||||||||||||||
| 1670 | - | |||||||||||||||||||||||||||||||
| 1671 | - | |||||||||||||||||||||||||||||||
| 1672 | QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &other) | - | ||||||||||||||||||||||||||||||
| 1673 | { | - | ||||||||||||||||||||||||||||||
| 1674 | m_name = other.m_name; | - | ||||||||||||||||||||||||||||||
| 1675 | m_namespaceUri = other.m_namespaceUri; | - | ||||||||||||||||||||||||||||||
| 1676 | m_qualifiedName = other.m_qualifiedName; | - | ||||||||||||||||||||||||||||||
| 1677 | m_value = other.m_value; | - | ||||||||||||||||||||||||||||||
| 1678 | m_isDefault = other.m_isDefault; | - | ||||||||||||||||||||||||||||||
| 1679 | return executed 2552 times by 1 test: *this;return *this;Executed by:
executed 2552 times by 1 test: return *this;Executed by:
| 2552 | ||||||||||||||||||||||||||||||
| 1680 | } | - | ||||||||||||||||||||||||||||||
| 1681 | QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration() | - | ||||||||||||||||||||||||||||||
| 1682 | { | - | ||||||||||||||||||||||||||||||
| 1683 | } | - | ||||||||||||||||||||||||||||||
| 1684 | - | |||||||||||||||||||||||||||||||
| 1685 | - | |||||||||||||||||||||||||||||||
| 1686 | - | |||||||||||||||||||||||||||||||
| 1687 | QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration(const QXmlStreamNotationDeclaration &other) | - | ||||||||||||||||||||||||||||||
| 1688 | { | - | ||||||||||||||||||||||||||||||
| 1689 | *this = other; | - | ||||||||||||||||||||||||||||||
| 1690 | } executed 304 times by 1 test: end of blockExecuted by:
| 304 | ||||||||||||||||||||||||||||||
| 1691 | - | |||||||||||||||||||||||||||||||
| 1692 | - | |||||||||||||||||||||||||||||||
| 1693 | - | |||||||||||||||||||||||||||||||
| 1694 | - | |||||||||||||||||||||||||||||||
| 1695 | QXmlStreamNotationDeclaration& QXmlStreamNotationDeclaration::operator=(const QXmlStreamNotationDeclaration &other) | - | ||||||||||||||||||||||||||||||
| 1696 | { | - | ||||||||||||||||||||||||||||||
| 1697 | m_name = other.m_name; | - | ||||||||||||||||||||||||||||||
| 1698 | m_systemId = other.m_systemId; | - | ||||||||||||||||||||||||||||||
| 1699 | m_publicId = other.m_publicId; | - | ||||||||||||||||||||||||||||||
| 1700 | return executed 304 times by 1 test: *this;return *this;Executed by:
executed 304 times by 1 test: return *this;Executed by:
| 304 | ||||||||||||||||||||||||||||||
| 1701 | } | - | ||||||||||||||||||||||||||||||
| 1702 | - | |||||||||||||||||||||||||||||||
| 1703 | - | |||||||||||||||||||||||||||||||
| 1704 | - | |||||||||||||||||||||||||||||||
| 1705 | - | |||||||||||||||||||||||||||||||
| 1706 | QXmlStreamNotationDeclaration::~QXmlStreamNotationDeclaration() | - | ||||||||||||||||||||||||||||||
| 1707 | { | - | ||||||||||||||||||||||||||||||
| 1708 | } | - | ||||||||||||||||||||||||||||||
| 1709 | QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration() | - | ||||||||||||||||||||||||||||||
| 1710 | { | - | ||||||||||||||||||||||||||||||
| 1711 | } | - | ||||||||||||||||||||||||||||||
| 1712 | - | |||||||||||||||||||||||||||||||
| 1713 | - | |||||||||||||||||||||||||||||||
| 1714 | - | |||||||||||||||||||||||||||||||
| 1715 | - | |||||||||||||||||||||||||||||||
| 1716 | - | |||||||||||||||||||||||||||||||
| 1717 | - | |||||||||||||||||||||||||||||||
| 1718 | QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QString &prefix, const QString &namespaceUri) | - | ||||||||||||||||||||||||||||||
| 1719 | { | - | ||||||||||||||||||||||||||||||
| 1720 | m_prefix = prefix; | - | ||||||||||||||||||||||||||||||
| 1721 | m_namespaceUri = namespaceUri; | - | ||||||||||||||||||||||||||||||
| 1722 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 1723 | - | |||||||||||||||||||||||||||||||
| 1724 | - | |||||||||||||||||||||||||||||||
| 1725 | - | |||||||||||||||||||||||||||||||
| 1726 | - | |||||||||||||||||||||||||||||||
| 1727 | QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &other) | - | ||||||||||||||||||||||||||||||
| 1728 | { | - | ||||||||||||||||||||||||||||||
| 1729 | *this = other; | - | ||||||||||||||||||||||||||||||
| 1730 | } executed 54 times by 1 test: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||||||||
| 1731 | - | |||||||||||||||||||||||||||||||
| 1732 | - | |||||||||||||||||||||||||||||||
| 1733 | - | |||||||||||||||||||||||||||||||
| 1734 | - | |||||||||||||||||||||||||||||||
| 1735 | QXmlStreamNamespaceDeclaration& QXmlStreamNamespaceDeclaration::operator=(const QXmlStreamNamespaceDeclaration &other) | - | ||||||||||||||||||||||||||||||
| 1736 | { | - | ||||||||||||||||||||||||||||||
| 1737 | m_prefix = other.m_prefix; | - | ||||||||||||||||||||||||||||||
| 1738 | m_namespaceUri = other.m_namespaceUri; | - | ||||||||||||||||||||||||||||||
| 1739 | return executed 54 times by 1 test: *this;return *this;Executed by:
executed 54 times by 1 test: return *this;Executed by:
| 54 | ||||||||||||||||||||||||||||||
| 1740 | } | - | ||||||||||||||||||||||||||||||
| 1741 | - | |||||||||||||||||||||||||||||||
| 1742 | - | |||||||||||||||||||||||||||||||
| 1743 | - | |||||||||||||||||||||||||||||||
| 1744 | QXmlStreamNamespaceDeclaration::~QXmlStreamNamespaceDeclaration() | - | ||||||||||||||||||||||||||||||
| 1745 | { | - | ||||||||||||||||||||||||||||||
| 1746 | } | - | ||||||||||||||||||||||||||||||
| 1747 | QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration() | - | ||||||||||||||||||||||||||||||
| 1748 | { | - | ||||||||||||||||||||||||||||||
| 1749 | } | - | ||||||||||||||||||||||||||||||
| 1750 | - | |||||||||||||||||||||||||||||||
| 1751 | - | |||||||||||||||||||||||||||||||
| 1752 | - | |||||||||||||||||||||||||||||||
| 1753 | - | |||||||||||||||||||||||||||||||
| 1754 | QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration(const QXmlStreamEntityDeclaration &other) | - | ||||||||||||||||||||||||||||||
| 1755 | { | - | ||||||||||||||||||||||||||||||
| 1756 | *this = other; | - | ||||||||||||||||||||||||||||||
| 1757 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||
| 1758 | - | |||||||||||||||||||||||||||||||
| 1759 | - | |||||||||||||||||||||||||||||||
| 1760 | - | |||||||||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||||||||
| 1762 | QXmlStreamEntityDeclaration& QXmlStreamEntityDeclaration::operator=(const QXmlStreamEntityDeclaration &other) | - | ||||||||||||||||||||||||||||||
| 1763 | { | - | ||||||||||||||||||||||||||||||
| 1764 | m_name = other.m_name; | - | ||||||||||||||||||||||||||||||
| 1765 | m_notationName = other.m_notationName; | - | ||||||||||||||||||||||||||||||
| 1766 | m_systemId = other.m_systemId; | - | ||||||||||||||||||||||||||||||
| 1767 | m_publicId = other.m_publicId; | - | ||||||||||||||||||||||||||||||
| 1768 | m_value = other.m_value; | - | ||||||||||||||||||||||||||||||
| 1769 | return executed 10 times by 1 test: *this;return *this;Executed by:
executed 10 times by 1 test: return *this;Executed by:
| 10 | ||||||||||||||||||||||||||||||
| 1770 | } | - | ||||||||||||||||||||||||||||||
| 1771 | - | |||||||||||||||||||||||||||||||
| 1772 | - | |||||||||||||||||||||||||||||||
| 1773 | - | |||||||||||||||||||||||||||||||
| 1774 | - | |||||||||||||||||||||||||||||||
| 1775 | QXmlStreamEntityDeclaration::~QXmlStreamEntityDeclaration() | - | ||||||||||||||||||||||||||||||
| 1776 | { | - | ||||||||||||||||||||||||||||||
| 1777 | } | - | ||||||||||||||||||||||||||||||
| 1778 | QStringRef QXmlStreamAttributes::value(const QString &namespaceUri, const QString &name) const | - | ||||||||||||||||||||||||||||||
| 1779 | { | - | ||||||||||||||||||||||||||||||
| 1780 | for (int i = 0; i < size()
| 6-28 | ||||||||||||||||||||||||||||||
| 1781 | const QXmlStreamAttribute &attribute = at(i); | - | ||||||||||||||||||||||||||||||
| 1782 | if (attribute.name() == name
| 2-21 | ||||||||||||||||||||||||||||||
| 1783 | return executed 5 times by 1 test: attribute.value();return attribute.value();Executed by:
executed 5 times by 1 test: return attribute.value();Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 1784 | } executed 23 times by 1 test: end of blockExecuted by:
| 23 | ||||||||||||||||||||||||||||||
| 1785 | return executed 6 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 6 times by 1 test: return QStringRef();Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 1786 | } | - | ||||||||||||||||||||||||||||||
| 1787 | - | |||||||||||||||||||||||||||||||
| 1788 | - | |||||||||||||||||||||||||||||||
| 1789 | - | |||||||||||||||||||||||||||||||
| 1790 | - | |||||||||||||||||||||||||||||||
| 1791 | - | |||||||||||||||||||||||||||||||
| 1792 | - | |||||||||||||||||||||||||||||||
| 1793 | QStringRef QXmlStreamAttributes::value(const QString &namespaceUri, QLatin1String name) const | - | ||||||||||||||||||||||||||||||
| 1794 | { | - | ||||||||||||||||||||||||||||||
| 1795 | for (int i = 0; i < size()
| 0 | ||||||||||||||||||||||||||||||
| 1796 | const QXmlStreamAttribute &attribute = at(i); | - | ||||||||||||||||||||||||||||||
| 1797 | if (attribute.name() == name
| 0 | ||||||||||||||||||||||||||||||
| 1798 | return never executed: attribute.value();return attribute.value();never executed: return attribute.value(); | 0 | ||||||||||||||||||||||||||||||
| 1799 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1800 | return never executed: QStringRef();return QStringRef();never executed: return QStringRef(); | 0 | ||||||||||||||||||||||||||||||
| 1801 | } | - | ||||||||||||||||||||||||||||||
| 1802 | - | |||||||||||||||||||||||||||||||
| 1803 | - | |||||||||||||||||||||||||||||||
| 1804 | - | |||||||||||||||||||||||||||||||
| 1805 | - | |||||||||||||||||||||||||||||||
| 1806 | - | |||||||||||||||||||||||||||||||
| 1807 | - | |||||||||||||||||||||||||||||||
| 1808 | QStringRef QXmlStreamAttributes::value(QLatin1String namespaceUri, QLatin1String name) const | - | ||||||||||||||||||||||||||||||
| 1809 | { | - | ||||||||||||||||||||||||||||||
| 1810 | for (int i = 0; i < size()
| 0 | ||||||||||||||||||||||||||||||
| 1811 | const QXmlStreamAttribute &attribute = at(i); | - | ||||||||||||||||||||||||||||||
| 1812 | if (attribute.name() == name
| 0 | ||||||||||||||||||||||||||||||
| 1813 | return never executed: attribute.value();return attribute.value();never executed: return attribute.value(); | 0 | ||||||||||||||||||||||||||||||
| 1814 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1815 | return never executed: QStringRef();return QStringRef();never executed: return QStringRef(); | 0 | ||||||||||||||||||||||||||||||
| 1816 | } | - | ||||||||||||||||||||||||||||||
| 1817 | QStringRef QXmlStreamAttributes::value(const QString &qualifiedName) const | - | ||||||||||||||||||||||||||||||
| 1818 | { | - | ||||||||||||||||||||||||||||||
| 1819 | for (int i = 0; i < size()
| 3-19 | ||||||||||||||||||||||||||||||
| 1820 | const QXmlStreamAttribute &attribute = at(i); | - | ||||||||||||||||||||||||||||||
| 1821 | if (attribute.qualifiedName() == qualifiedName
| 5-14 | ||||||||||||||||||||||||||||||
| 1822 | return executed 5 times by 1 test: attribute.value();return attribute.value();Executed by:
executed 5 times by 1 test: return attribute.value();Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 1823 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||
| 1824 | return executed 3 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 3 times by 1 test: return QStringRef();Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 1825 | } | - | ||||||||||||||||||||||||||||||
| 1826 | QStringRef QXmlStreamAttributes::value(QLatin1String qualifiedName) const | - | ||||||||||||||||||||||||||||||
| 1827 | { | - | ||||||||||||||||||||||||||||||
| 1828 | for (int i = 0; i < size()
| 16832-224211 | ||||||||||||||||||||||||||||||
| 1829 | const QXmlStreamAttribute &attribute = at(i); | - | ||||||||||||||||||||||||||||||
| 1830 | if (attribute.qualifiedName() == qualifiedName
| 51027-173184 | ||||||||||||||||||||||||||||||
| 1831 | return executed 173184 times by 14 tests: attribute.value();return attribute.value();Executed by:
executed 173184 times by 14 tests: return attribute.value();Executed by:
| 173184 | ||||||||||||||||||||||||||||||
| 1832 | } executed 51027 times by 14 tests: end of blockExecuted by:
| 51027 | ||||||||||||||||||||||||||||||
| 1833 | return executed 16832 times by 14 tests: QStringRef();return QStringRef();Executed by:
executed 16832 times by 14 tests: return QStringRef();Executed by:
| 16832 | ||||||||||||||||||||||||||||||
| 1834 | } | - | ||||||||||||||||||||||||||||||
| 1835 | - | |||||||||||||||||||||||||||||||
| 1836 | - | |||||||||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||||||||
| 1838 | - | |||||||||||||||||||||||||||||||
| 1839 | - | |||||||||||||||||||||||||||||||
| 1840 | void QXmlStreamAttributes::append(const QString &namespaceUri, const QString &name, const QString &value) | - | ||||||||||||||||||||||||||||||
| 1841 | { | - | ||||||||||||||||||||||||||||||
| 1842 | append(QXmlStreamAttribute(namespaceUri, name, value)); | - | ||||||||||||||||||||||||||||||
| 1843 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1844 | - | |||||||||||||||||||||||||||||||
| 1845 | - | |||||||||||||||||||||||||||||||
| 1846 | - | |||||||||||||||||||||||||||||||
| 1847 | - | |||||||||||||||||||||||||||||||
| 1848 | - | |||||||||||||||||||||||||||||||
| 1849 | void QXmlStreamAttributes::append(const QString &qualifiedName, const QString &value) | - | ||||||||||||||||||||||||||||||
| 1850 | { | - | ||||||||||||||||||||||||||||||
| 1851 | append(QXmlStreamAttribute(qualifiedName, value)); | - | ||||||||||||||||||||||||||||||
| 1852 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1853 | bool QXmlStreamReader::isWhitespace() const | - | ||||||||||||||||||||||||||||||
| 1854 | { | - | ||||||||||||||||||||||||||||||
| 1855 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1856 | return executed 1903 times by 1 test: d->type == QXmlStreamReader::Charactersreturn d->type == QXmlStreamReader::Characters && d->isWhitespace;Executed by:
executed 1903 times by 1 test: return d->type == QXmlStreamReader::Characters && d->isWhitespace;Executed by:
| 221-1903 | ||||||||||||||||||||||||||||||
| 1857 | } | - | ||||||||||||||||||||||||||||||
| 1858 | - | |||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||||||||
| 1863 | - | |||||||||||||||||||||||||||||||
| 1864 | bool QXmlStreamReader::isCDATA() const | - | ||||||||||||||||||||||||||||||
| 1865 | { | - | ||||||||||||||||||||||||||||||
| 1866 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1867 | return executed 1903 times by 1 test: d->type == QXmlStreamReader::Charactersreturn d->type == QXmlStreamReader::Characters && d->isCDATA;Executed by:
executed 1903 times by 1 test: return d->type == QXmlStreamReader::Characters && d->isCDATA;Executed by:
| 10-1903 | ||||||||||||||||||||||||||||||
| 1868 | } | - | ||||||||||||||||||||||||||||||
| 1869 | bool QXmlStreamReader::isStandaloneDocument() const | - | ||||||||||||||||||||||||||||||
| 1870 | { | - | ||||||||||||||||||||||||||||||
| 1871 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1872 | return executed 77 times by 1 test: d->standalone;return d->standalone;Executed by:
executed 77 times by 1 test: return d->standalone;Executed by:
| 77 | ||||||||||||||||||||||||||||||
| 1873 | } | - | ||||||||||||||||||||||||||||||
| 1874 | QStringRef QXmlStreamReader::documentVersion() const | - | ||||||||||||||||||||||||||||||
| 1875 | { | - | ||||||||||||||||||||||||||||||
| 1876 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1877 | if (d->type == QXmlStreamReader::StartDocument
| 133-1826 | ||||||||||||||||||||||||||||||
| 1878 | return executed 133 times by 1 test: d->documentVersion;return d->documentVersion;Executed by:
executed 133 times by 1 test: return d->documentVersion;Executed by:
| 133 | ||||||||||||||||||||||||||||||
| 1879 | return executed 1826 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 1826 times by 1 test: return QStringRef();Executed by:
| 1826 | ||||||||||||||||||||||||||||||
| 1880 | } | - | ||||||||||||||||||||||||||||||
| 1881 | QStringRef QXmlStreamReader::documentEncoding() const | - | ||||||||||||||||||||||||||||||
| 1882 | { | - | ||||||||||||||||||||||||||||||
| 1883 | const QXmlStreamReaderPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 1884 | if (d->type == QXmlStreamReader::StartDocument
| 83-1826 | ||||||||||||||||||||||||||||||
| 1885 | return executed 83 times by 1 test: d->documentEncoding;return d->documentEncoding;Executed by:
executed 83 times by 1 test: return d->documentEncoding;Executed by:
| 83 | ||||||||||||||||||||||||||||||
| 1886 | return executed 1826 times by 1 test: QStringRef();return QStringRef();Executed by:
executed 1826 times by 1 test: return QStringRef();Executed by:
| 1826 | ||||||||||||||||||||||||||||||
| 1887 | } | - | ||||||||||||||||||||||||||||||
| 1888 | class QXmlStreamWriterPrivate : public QXmlStreamPrivateTagStack { | - | ||||||||||||||||||||||||||||||
| 1889 | QXmlStreamWriter *q_ptr; | - | ||||||||||||||||||||||||||||||
| 1890 | inline QXmlStreamWriter* q_func() { return static_cast<QXmlStreamWriter *>(q_ptr); } inline const QXmlStreamWriter* q_func() const { return static_cast<const QXmlStreamWriter *>(q_ptr); } friend class QXmlStreamWriter; | - | ||||||||||||||||||||||||||||||
| 1891 | public: | - | ||||||||||||||||||||||||||||||
| 1892 | QXmlStreamWriterPrivate(QXmlStreamWriter *q); | - | ||||||||||||||||||||||||||||||
| 1893 | ~QXmlStreamWriterPrivate() { | - | ||||||||||||||||||||||||||||||
| 1894 | if (deleteDevice
| 34-710 | ||||||||||||||||||||||||||||||
| 1895 | delete device; executed 710 times by 1 test: delete device;Executed by:
| 710 | ||||||||||||||||||||||||||||||
| 1896 | - | |||||||||||||||||||||||||||||||
| 1897 | delete encoder; | - | ||||||||||||||||||||||||||||||
| 1898 | - | |||||||||||||||||||||||||||||||
| 1899 | } executed 744 times by 3 tests: end of blockExecuted by:
| 744 | ||||||||||||||||||||||||||||||
| 1900 | - | |||||||||||||||||||||||||||||||
| 1901 | void write(const QStringRef &); | - | ||||||||||||||||||||||||||||||
| 1902 | void write(const QString &); | - | ||||||||||||||||||||||||||||||
| 1903 | void writeEscaped(const QString &, bool escapeWhitespace = false); | - | ||||||||||||||||||||||||||||||
| 1904 | void write(const char *s, int len); | - | ||||||||||||||||||||||||||||||
| 1905 | template <int N> void write(const char (&s)[N]) { write(s, N - 1); } executed 9934 times by 3 tests: end of blockExecuted by:
| 9934 | ||||||||||||||||||||||||||||||
| 1906 | bool finishStartElement(bool contents = true); | - | ||||||||||||||||||||||||||||||
| 1907 | void writeStartElement(const QString &namespaceUri, const QString &name); | - | ||||||||||||||||||||||||||||||
| 1908 | QIODevice *device; | - | ||||||||||||||||||||||||||||||
| 1909 | QString *stringDevice; | - | ||||||||||||||||||||||||||||||
| 1910 | uint deleteDevice :1; | - | ||||||||||||||||||||||||||||||
| 1911 | uint inStartElement :1; | - | ||||||||||||||||||||||||||||||
| 1912 | uint inEmptyElement :1; | - | ||||||||||||||||||||||||||||||
| 1913 | uint lastWasStartElement :1; | - | ||||||||||||||||||||||||||||||
| 1914 | uint wroteSomething :1; | - | ||||||||||||||||||||||||||||||
| 1915 | uint hasError :1; | - | ||||||||||||||||||||||||||||||
| 1916 | uint autoFormatting :1; | - | ||||||||||||||||||||||||||||||
| 1917 | uint isCodecASCIICompatible :1; | - | ||||||||||||||||||||||||||||||
| 1918 | QByteArray autoFormattingIndent; | - | ||||||||||||||||||||||||||||||
| 1919 | NamespaceDeclaration emptyNamespace; | - | ||||||||||||||||||||||||||||||
| 1920 | int lastNamespaceDeclaration; | - | ||||||||||||||||||||||||||||||
| 1921 | - | |||||||||||||||||||||||||||||||
| 1922 | - | |||||||||||||||||||||||||||||||
| 1923 | QTextCodec *codec; | - | ||||||||||||||||||||||||||||||
| 1924 | QTextEncoder *encoder; | - | ||||||||||||||||||||||||||||||
| 1925 | - | |||||||||||||||||||||||||||||||
| 1926 | void checkIfASCIICompatibleCodec(); | - | ||||||||||||||||||||||||||||||
| 1927 | - | |||||||||||||||||||||||||||||||
| 1928 | NamespaceDeclaration &findNamespace(const QString &namespaceUri, bool writeDeclaration = false, bool noDefault = false); | - | ||||||||||||||||||||||||||||||
| 1929 | void writeNamespaceDeclaration(const NamespaceDeclaration &namespaceDeclaration); | - | ||||||||||||||||||||||||||||||
| 1930 | - | |||||||||||||||||||||||||||||||
| 1931 | int namespacePrefixCount; | - | ||||||||||||||||||||||||||||||
| 1932 | - | |||||||||||||||||||||||||||||||
| 1933 | void indent(int level); | - | ||||||||||||||||||||||||||||||
| 1934 | }; | - | ||||||||||||||||||||||||||||||
| 1935 | - | |||||||||||||||||||||||||||||||
| 1936 | - | |||||||||||||||||||||||||||||||
| 1937 | QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q) | - | ||||||||||||||||||||||||||||||
| 1938 | :autoFormattingIndent(4, ' ') | - | ||||||||||||||||||||||||||||||
| 1939 | { | - | ||||||||||||||||||||||||||||||
| 1940 | q_ptr = q; | - | ||||||||||||||||||||||||||||||
| 1941 | device = 0; | - | ||||||||||||||||||||||||||||||
| 1942 | stringDevice = 0; | - | ||||||||||||||||||||||||||||||
| 1943 | deleteDevice = false; | - | ||||||||||||||||||||||||||||||
| 1944 | - | |||||||||||||||||||||||||||||||
| 1945 | codec = QTextCodec::codecForMib(106); | - | ||||||||||||||||||||||||||||||
| 1946 | encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); | - | ||||||||||||||||||||||||||||||
| 1947 | - | |||||||||||||||||||||||||||||||
| 1948 | checkIfASCIICompatibleCodec(); | - | ||||||||||||||||||||||||||||||
| 1949 | inStartElement = inEmptyElement = false; | - | ||||||||||||||||||||||||||||||
| 1950 | wroteSomething = false; | - | ||||||||||||||||||||||||||||||
| 1951 | hasError = false; | - | ||||||||||||||||||||||||||||||
| 1952 | lastWasStartElement = false; | - | ||||||||||||||||||||||||||||||
| 1953 | lastNamespaceDeclaration = 1; | - | ||||||||||||||||||||||||||||||
| 1954 | autoFormatting = false; | - | ||||||||||||||||||||||||||||||
| 1955 | namespacePrefixCount = 0; | - | ||||||||||||||||||||||||||||||
| 1956 | } executed 744 times by 3 tests: end of blockExecuted by:
| 744 | ||||||||||||||||||||||||||||||
| 1957 | - | |||||||||||||||||||||||||||||||
| 1958 | void QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec() | - | ||||||||||||||||||||||||||||||
| 1959 | { | - | ||||||||||||||||||||||||||||||
| 1960 | - | |||||||||||||||||||||||||||||||
| 1961 | ((!(encoder)) ? qt_assert("encoder",__FILE__,3025) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||||||||
| 1963 | QChar letterA = QLatin1Char('a'); | - | ||||||||||||||||||||||||||||||
| 1964 | const QByteArray bytesA = encoder->fromUnicode(&letterA, 1); | - | ||||||||||||||||||||||||||||||
| 1965 | const bool isCodecASCIICompatibleA = (
| 1-757 | ||||||||||||||||||||||||||||||
| 1966 | QChar letterLess = QLatin1Char('<'); | - | ||||||||||||||||||||||||||||||
| 1967 | const QByteArray bytesLess = encoder->fromUnicode(&letterLess, 1); | - | ||||||||||||||||||||||||||||||
| 1968 | const bool isCodecASCIICompatibleLess = (
| 1-757 | ||||||||||||||||||||||||||||||
| 1969 | isCodecASCIICompatible = isCodecASCIICompatibleA
| 0-756 | ||||||||||||||||||||||||||||||
| 1970 | - | |||||||||||||||||||||||||||||||
| 1971 | - | |||||||||||||||||||||||||||||||
| 1972 | - | |||||||||||||||||||||||||||||||
| 1973 | } executed 758 times by 3 tests: end of blockExecuted by:
| 758 | ||||||||||||||||||||||||||||||
| 1974 | - | |||||||||||||||||||||||||||||||
| 1975 | void QXmlStreamWriterPrivate::write(const QStringRef &s) | - | ||||||||||||||||||||||||||||||
| 1976 | { | - | ||||||||||||||||||||||||||||||
| 1977 | if (device
| 8-3151 | ||||||||||||||||||||||||||||||
| 1978 | if (hasError
| 4-3147 | ||||||||||||||||||||||||||||||
| 1979 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 1980 | - | |||||||||||||||||||||||||||||||
| 1981 | - | |||||||||||||||||||||||||||||||
| 1982 | - | |||||||||||||||||||||||||||||||
| 1983 | QByteArray bytes = encoder->fromUnicode(s.constData(), s.size()); | - | ||||||||||||||||||||||||||||||
| 1984 | - | |||||||||||||||||||||||||||||||
| 1985 | if (device->write(bytes) != bytes.size()
| 1-3146 | ||||||||||||||||||||||||||||||
| 1986 | hasError = true; executed 1 time by 1 test: hasError = true;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 1987 | } executed 3147 times by 3 tests: end of blockExecuted by:
| 3147 | ||||||||||||||||||||||||||||||
| 1988 | else if (stringDevice
| 0-8 | ||||||||||||||||||||||||||||||
| 1989 | s.appendTo(stringDevice); executed 8 times by 1 test: s.appendTo(stringDevice);Executed by:
| 8 | ||||||||||||||||||||||||||||||
| 1990 | else | - | ||||||||||||||||||||||||||||||
| 1991 | QMessageLogger(__FILE__, 3055, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: No device"); never executed: QMessageLogger(__FILE__, 3055, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: No device"); | 0 | ||||||||||||||||||||||||||||||
| 1992 | } | - | ||||||||||||||||||||||||||||||
| 1993 | - | |||||||||||||||||||||||||||||||
| 1994 | void QXmlStreamWriterPrivate::write(const QString &s) | - | ||||||||||||||||||||||||||||||
| 1995 | { | - | ||||||||||||||||||||||||||||||
| 1996 | if (device
| 72-5148 | ||||||||||||||||||||||||||||||
| 1997 | if (hasError
| 1-5147 | ||||||||||||||||||||||||||||||
| 1998 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 1999 | - | |||||||||||||||||||||||||||||||
| 2000 | - | |||||||||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||||||||
| 2002 | QByteArray bytes = encoder->fromUnicode(s); | - | ||||||||||||||||||||||||||||||
| 2003 | - | |||||||||||||||||||||||||||||||
| 2004 | if (device->write(bytes) != bytes.size()
| 1-5146 | ||||||||||||||||||||||||||||||
| 2005 | hasError = true; executed 1 time by 1 test: hasError = true;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2006 | } executed 5147 times by 3 tests: end of blockExecuted by:
| 5147 | ||||||||||||||||||||||||||||||
| 2007 | else if (stringDevice
| 0-72 | ||||||||||||||||||||||||||||||
| 2008 | stringDevice->append(s); executed 72 times by 1 test: stringDevice->append(s);Executed by:
| 72 | ||||||||||||||||||||||||||||||
| 2009 | else | - | ||||||||||||||||||||||||||||||
| 2010 | QMessageLogger(__FILE__, 3074, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: No device"); never executed: QMessageLogger(__FILE__, 3074, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: No device"); | 0 | ||||||||||||||||||||||||||||||
| 2011 | } | - | ||||||||||||||||||||||||||||||
| 2012 | - | |||||||||||||||||||||||||||||||
| 2013 | void QXmlStreamWriterPrivate::writeEscaped(const QString &s, bool escapeWhitespace) | - | ||||||||||||||||||||||||||||||
| 2014 | { | - | ||||||||||||||||||||||||||||||
| 2015 | QString escaped; | - | ||||||||||||||||||||||||||||||
| 2016 | escaped.reserve(s.size()); | - | ||||||||||||||||||||||||||||||
| 2017 | for ( int i = 0; i < s.size()
| 3437-20852 | ||||||||||||||||||||||||||||||
| 2018 | QChar c = s.at(i); | - | ||||||||||||||||||||||||||||||
| 2019 | if (c.unicode() == '<'
| 50-20802 | ||||||||||||||||||||||||||||||
| 2020 | escaped.append(QLatin1String("<")); executed 50 times by 1 test: escaped.append(QLatin1String("<"));Executed by:
| 50 | ||||||||||||||||||||||||||||||
| 2021 | else if (c.unicode() == '>'
| 52-20750 | ||||||||||||||||||||||||||||||
| 2022 | escaped.append(QLatin1String(">")); executed 52 times by 1 test: escaped.append(QLatin1String(">"));Executed by:
| 52 | ||||||||||||||||||||||||||||||
| 2023 | else if (c.unicode() == '&'
| 29-20721 | ||||||||||||||||||||||||||||||
| 2024 | escaped.append(QLatin1String("&")); executed 29 times by 1 test: escaped.append(QLatin1String("&"));Executed by:
| 29 | ||||||||||||||||||||||||||||||
| 2025 | else if (c.unicode() == '\"'
| 21-20700 | ||||||||||||||||||||||||||||||
| 2026 | escaped.append(QLatin1String(""")); executed 21 times by 1 test: escaped.append(QLatin1String("""));Executed by:
| 21 | ||||||||||||||||||||||||||||||
| 2027 | else if (escapeWhitespace
| 173-16644 | ||||||||||||||||||||||||||||||
| 2028 | if (c.unicode() == '\n'
| 2-171 | ||||||||||||||||||||||||||||||
| 2029 | escaped.append(QLatin1String(" ")); executed 2 times by 1 test: escaped.append(QLatin1String(" "));Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2030 | else if (c.unicode() == '\r'
| 2-169 | ||||||||||||||||||||||||||||||
| 2031 | escaped.append(QLatin1String(" ")); executed 2 times by 1 test: escaped.append(QLatin1String(" "));Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2032 | else if (c.unicode() == '\t'
| 3-166 | ||||||||||||||||||||||||||||||
| 2033 | escaped.append(QLatin1String("	")); executed 3 times by 1 test: escaped.append(QLatin1String("	"));Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 2034 | else | - | ||||||||||||||||||||||||||||||
| 2035 | escaped += c; executed 166 times by 1 test: escaped += c;Executed by:
| 166 | ||||||||||||||||||||||||||||||
| 2036 | } else { | - | ||||||||||||||||||||||||||||||
| 2037 | escaped += QChar(c); | - | ||||||||||||||||||||||||||||||
| 2038 | } executed 20527 times by 3 tests: end of blockExecuted by:
| 20527 | ||||||||||||||||||||||||||||||
| 2039 | } | - | ||||||||||||||||||||||||||||||
| 2040 | write(escaped); | - | ||||||||||||||||||||||||||||||
| 2041 | } executed 3437 times by 3 tests: end of blockExecuted by:
| 3437 | ||||||||||||||||||||||||||||||
| 2042 | - | |||||||||||||||||||||||||||||||
| 2043 | - | |||||||||||||||||||||||||||||||
| 2044 | void QXmlStreamWriterPrivate::write(const char *s, int len) | - | ||||||||||||||||||||||||||||||
| 2045 | { | - | ||||||||||||||||||||||||||||||
| 2046 | if (device
| 64-10239 | ||||||||||||||||||||||||||||||
| 2047 | if (hasError
| 14-10225 | ||||||||||||||||||||||||||||||
| 2048 | return; executed 14 times by 1 test: return;Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 2049 | if (isCodecASCIICompatible
| 14-10211 | ||||||||||||||||||||||||||||||
| 2050 | if (device->write(s, len) != len
| 2-10209 | ||||||||||||||||||||||||||||||
| 2051 | hasError = true; executed 2 times by 1 test: hasError = true;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2052 | return; executed 10211 times by 3 tests: return;Executed by:
| 10211 | ||||||||||||||||||||||||||||||
| 2053 | } | - | ||||||||||||||||||||||||||||||
| 2054 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||
| 2055 | - | |||||||||||||||||||||||||||||||
| 2056 | write(QString::fromLatin1(s, len)); | - | ||||||||||||||||||||||||||||||
| 2057 | } executed 78 times by 1 test: end of blockExecuted by:
| 78 | ||||||||||||||||||||||||||||||
| 2058 | - | |||||||||||||||||||||||||||||||
| 2059 | void QXmlStreamWriterPrivate::writeNamespaceDeclaration(const NamespaceDeclaration &namespaceDeclaration) { | - | ||||||||||||||||||||||||||||||
| 2060 | if (namespaceDeclaration.prefix.isEmpty()
| 0-102 | ||||||||||||||||||||||||||||||
| 2061 | write(" xmlns=\""); | - | ||||||||||||||||||||||||||||||
| 2062 | write(namespaceDeclaration.namespaceUri); | - | ||||||||||||||||||||||||||||||
| 2063 | write("\""); | - | ||||||||||||||||||||||||||||||
| 2064 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
| 2065 | write(" xmlns:"); | - | ||||||||||||||||||||||||||||||
| 2066 | write(namespaceDeclaration.prefix); | - | ||||||||||||||||||||||||||||||
| 2067 | write("=\""); | - | ||||||||||||||||||||||||||||||
| 2068 | write(namespaceDeclaration.namespaceUri); | - | ||||||||||||||||||||||||||||||
| 2069 | write("\""); | - | ||||||||||||||||||||||||||||||
| 2070 | } executed 102 times by 3 tests: end of blockExecuted by:
| 102 | ||||||||||||||||||||||||||||||
| 2071 | } | - | ||||||||||||||||||||||||||||||
| 2072 | - | |||||||||||||||||||||||||||||||
| 2073 | bool QXmlStreamWriterPrivate::finishStartElement(bool contents) | - | ||||||||||||||||||||||||||||||
| 2074 | { | - | ||||||||||||||||||||||||||||||
| 2075 | bool hadSomethingWritten = wroteSomething; | - | ||||||||||||||||||||||||||||||
| 2076 | wroteSomething = contents; | - | ||||||||||||||||||||||||||||||
| 2077 | if (!inStartElement
| 1276-5103 | ||||||||||||||||||||||||||||||
| 2078 | return executed 5103 times by 3 tests: hadSomethingWritten;return hadSomethingWritten;Executed by:
executed 5103 times by 3 tests: return hadSomethingWritten;Executed by:
| 5103 | ||||||||||||||||||||||||||||||
| 2079 | - | |||||||||||||||||||||||||||||||
| 2080 | if (inEmptyElement
| 39-1237 | ||||||||||||||||||||||||||||||
| 2081 | write("/>"); | - | ||||||||||||||||||||||||||||||
| 2082 | QXmlStreamWriterPrivate::Tag &tag = tagStack_pop(); | - | ||||||||||||||||||||||||||||||
| 2083 | lastNamespaceDeclaration = tag.namespaceDeclarationsSize; | - | ||||||||||||||||||||||||||||||
| 2084 | lastWasStartElement = false; | - | ||||||||||||||||||||||||||||||
| 2085 | } executed 39 times by 3 tests: else {end of blockExecuted by:
| 39 | ||||||||||||||||||||||||||||||
| 2086 | write(">"); | - | ||||||||||||||||||||||||||||||
| 2087 | } executed 1237 times by 3 tests: end of blockExecuted by:
| 1237 | ||||||||||||||||||||||||||||||
| 2088 | inStartElement = inEmptyElement = false; | - | ||||||||||||||||||||||||||||||
| 2089 | lastNamespaceDeclaration = namespaceDeclarations.size(); | - | ||||||||||||||||||||||||||||||
| 2090 | return executed 1276 times by 3 tests: hadSomethingWritten;return hadSomethingWritten;Executed by:
executed 1276 times by 3 tests: return hadSomethingWritten;Executed by:
| 1276 | ||||||||||||||||||||||||||||||
| 2091 | } | - | ||||||||||||||||||||||||||||||
| 2092 | - | |||||||||||||||||||||||||||||||
| 2093 | QXmlStreamPrivateTagStack::NamespaceDeclaration &QXmlStreamWriterPrivate::findNamespace(const QString &namespaceUri, bool writeDeclaration, bool noDefault) | - | ||||||||||||||||||||||||||||||
| 2094 | { | - | ||||||||||||||||||||||||||||||
| 2095 | for (int j = namespaceDeclarations.size() - 1; j >= 0
| 1162-2565 | ||||||||||||||||||||||||||||||
| 2096 | NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations[j]; | - | ||||||||||||||||||||||||||||||
| 2097 | if (namespaceDeclaration.namespaceUri == namespaceUri
| 302-2263 | ||||||||||||||||||||||||||||||
| 2098 | if (!noDefault
| 0-168 | ||||||||||||||||||||||||||||||
| 2099 | return executed 302 times by 3 tests: namespaceDeclaration;return namespaceDeclaration;Executed by:
executed 302 times by 3 tests: return namespaceDeclaration;Executed by:
| 302 | ||||||||||||||||||||||||||||||
| 2100 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2101 | } executed 2263 times by 3 tests: end of blockExecuted by:
| 2263 | ||||||||||||||||||||||||||||||
| 2102 | if (namespaceUri.isEmpty()
| 19-1143 | ||||||||||||||||||||||||||||||
| 2103 | return executed 1143 times by 1 test: emptyNamespace;return emptyNamespace;Executed by:
executed 1143 times by 1 test: return emptyNamespace;Executed by:
| 1143 | ||||||||||||||||||||||||||||||
| 2104 | NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 2105 | if (namespaceUri.isEmpty()
| 0-19 | ||||||||||||||||||||||||||||||
| 2106 | namespaceDeclaration.prefix.clear(); | - | ||||||||||||||||||||||||||||||
| 2107 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
| 2108 | QString s; | - | ||||||||||||||||||||||||||||||
| 2109 | int n = ++namespacePrefixCount; | - | ||||||||||||||||||||||||||||||
| 2110 | for(;;) { | - | ||||||||||||||||||||||||||||||
| 2111 | s = QLatin1Char('n') + QString::number(n++); | - | ||||||||||||||||||||||||||||||
| 2112 | int j = namespaceDeclarations.size() - 2; | - | ||||||||||||||||||||||||||||||
| 2113 | while (j >= 0
| 0-22 | ||||||||||||||||||||||||||||||
| 2114 | -- executed 22 times by 1 test: j;--j;Executed by:
executed 22 times by 1 test: --j;Executed by:
| 22 | ||||||||||||||||||||||||||||||
| 2115 | if (j < 0
| 0-19 | ||||||||||||||||||||||||||||||
| 2116 | break; executed 19 times by 1 test: break;Executed by:
| 19 | ||||||||||||||||||||||||||||||
| 2117 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2118 | namespaceDeclaration.prefix = addToStringStorage(s); | - | ||||||||||||||||||||||||||||||
| 2119 | } executed 19 times by 1 test: end of blockExecuted by:
| 19 | ||||||||||||||||||||||||||||||
| 2120 | namespaceDeclaration.namespaceUri = addToStringStorage(namespaceUri); | - | ||||||||||||||||||||||||||||||
| 2121 | if (writeDeclaration
| 4-15 | ||||||||||||||||||||||||||||||
| 2122 | writeNamespaceDeclaration(namespaceDeclaration); executed 4 times by 1 test: writeNamespaceDeclaration(namespaceDeclaration);Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 2123 | return executed 19 times by 1 test: namespaceDeclaration;return namespaceDeclaration;Executed by:
executed 19 times by 1 test: return namespaceDeclaration;Executed by:
| 19 | ||||||||||||||||||||||||||||||
| 2124 | } | - | ||||||||||||||||||||||||||||||
| 2125 | - | |||||||||||||||||||||||||||||||
| 2126 | - | |||||||||||||||||||||||||||||||
| 2127 | - | |||||||||||||||||||||||||||||||
| 2128 | void QXmlStreamWriterPrivate::indent(int level) | - | ||||||||||||||||||||||||||||||
| 2129 | { | - | ||||||||||||||||||||||||||||||
| 2130 | write("\n"); | - | ||||||||||||||||||||||||||||||
| 2131 | for (int i = level; i > 0
| 218-332 | ||||||||||||||||||||||||||||||
| 2132 | write(autoFormattingIndent.constData(), autoFormattingIndent.length()); executed 332 times by 3 tests: write(autoFormattingIndent.constData(), autoFormattingIndent.length());Executed by:
| 332 | ||||||||||||||||||||||||||||||
| 2133 | } executed 218 times by 3 tests: end of blockExecuted by:
| 218 | ||||||||||||||||||||||||||||||
| 2134 | - | |||||||||||||||||||||||||||||||
| 2135 | - | |||||||||||||||||||||||||||||||
| 2136 | - | |||||||||||||||||||||||||||||||
| 2137 | - | |||||||||||||||||||||||||||||||
| 2138 | - | |||||||||||||||||||||||||||||||
| 2139 | - | |||||||||||||||||||||||||||||||
| 2140 | - | |||||||||||||||||||||||||||||||
| 2141 | QXmlStreamWriter::QXmlStreamWriter() | - | ||||||||||||||||||||||||||||||
| 2142 | : d_ptr(new QXmlStreamWriterPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 2143 | { | - | ||||||||||||||||||||||||||||||
| 2144 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||||||||
| 2146 | - | |||||||||||||||||||||||||||||||
| 2147 | - | |||||||||||||||||||||||||||||||
| 2148 | - | |||||||||||||||||||||||||||||||
| 2149 | QXmlStreamWriter::QXmlStreamWriter(QIODevice *device) | - | ||||||||||||||||||||||||||||||
| 2150 | : d_ptr(new QXmlStreamWriterPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 2151 | { | - | ||||||||||||||||||||||||||||||
| 2152 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2153 | d->device = device; | - | ||||||||||||||||||||||||||||||
| 2154 | } executed 32 times by 3 tests: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||||||||
| 2155 | - | |||||||||||||||||||||||||||||||
| 2156 | - | |||||||||||||||||||||||||||||||
| 2157 | - | |||||||||||||||||||||||||||||||
| 2158 | - | |||||||||||||||||||||||||||||||
| 2159 | - | |||||||||||||||||||||||||||||||
| 2160 | QXmlStreamWriter::QXmlStreamWriter(QByteArray *array) | - | ||||||||||||||||||||||||||||||
| 2161 | : d_ptr(new QXmlStreamWriterPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 2162 | { | - | ||||||||||||||||||||||||||||||
| 2163 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2164 | d->device = new QBuffer(array); | - | ||||||||||||||||||||||||||||||
| 2165 | d->device->open(QIODevice::WriteOnly); | - | ||||||||||||||||||||||||||||||
| 2166 | d->deleteDevice = true; | - | ||||||||||||||||||||||||||||||
| 2167 | } executed 710 times by 1 test: end of blockExecuted by:
| 710 | ||||||||||||||||||||||||||||||
| 2168 | - | |||||||||||||||||||||||||||||||
| 2169 | - | |||||||||||||||||||||||||||||||
| 2170 | - | |||||||||||||||||||||||||||||||
| 2171 | - | |||||||||||||||||||||||||||||||
| 2172 | QXmlStreamWriter::QXmlStreamWriter(QString *string) | - | ||||||||||||||||||||||||||||||
| 2173 | : d_ptr(new QXmlStreamWriterPrivate(this)) | - | ||||||||||||||||||||||||||||||
| 2174 | { | - | ||||||||||||||||||||||||||||||
| 2175 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2176 | d->stringDevice = string; | - | ||||||||||||||||||||||||||||||
| 2177 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 2178 | - | |||||||||||||||||||||||||||||||
| 2179 | - | |||||||||||||||||||||||||||||||
| 2180 | - | |||||||||||||||||||||||||||||||
| 2181 | - | |||||||||||||||||||||||||||||||
| 2182 | QXmlStreamWriter::~QXmlStreamWriter() | - | ||||||||||||||||||||||||||||||
| 2183 | { | - | ||||||||||||||||||||||||||||||
| 2184 | } | - | ||||||||||||||||||||||||||||||
| 2185 | void QXmlStreamWriter::setDevice(QIODevice *device) | - | ||||||||||||||||||||||||||||||
| 2186 | { | - | ||||||||||||||||||||||||||||||
| 2187 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2188 | if (device == d->device
| 0 | ||||||||||||||||||||||||||||||
| 2189 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
| 2190 | d->stringDevice = 0; | - | ||||||||||||||||||||||||||||||
| 2191 | if (d->deleteDevice
| 0 | ||||||||||||||||||||||||||||||
| 2192 | delete d->device; | - | ||||||||||||||||||||||||||||||
| 2193 | d->deleteDevice = false; | - | ||||||||||||||||||||||||||||||
| 2194 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2195 | d->device = device; | - | ||||||||||||||||||||||||||||||
| 2196 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2197 | - | |||||||||||||||||||||||||||||||
| 2198 | - | |||||||||||||||||||||||||||||||
| 2199 | - | |||||||||||||||||||||||||||||||
| 2200 | - | |||||||||||||||||||||||||||||||
| 2201 | - | |||||||||||||||||||||||||||||||
| 2202 | - | |||||||||||||||||||||||||||||||
| 2203 | - | |||||||||||||||||||||||||||||||
| 2204 | QIODevice *QXmlStreamWriter::device() const | - | ||||||||||||||||||||||||||||||
| 2205 | { | - | ||||||||||||||||||||||||||||||
| 2206 | const QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2207 | return never executed: d->device;return d->device;never executed: return d->device; | 0 | ||||||||||||||||||||||||||||||
| 2208 | } | - | ||||||||||||||||||||||||||||||
| 2209 | void QXmlStreamWriter::setCodec(QTextCodec *codec) | - | ||||||||||||||||||||||||||||||
| 2210 | { | - | ||||||||||||||||||||||||||||||
| 2211 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2212 | if (codec
| 0-14 | ||||||||||||||||||||||||||||||
| 2213 | d->codec = codec; | - | ||||||||||||||||||||||||||||||
| 2214 | delete d->encoder; | - | ||||||||||||||||||||||||||||||
| 2215 | d->encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); | - | ||||||||||||||||||||||||||||||
| 2216 | d->checkIfASCIICompatibleCodec(); | - | ||||||||||||||||||||||||||||||
| 2217 | } executed 14 times by 3 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||
| 2218 | } executed 14 times by 3 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||
| 2219 | void QXmlStreamWriter::setCodec(const char *codecName) | - | ||||||||||||||||||||||||||||||
| 2220 | { | - | ||||||||||||||||||||||||||||||
| 2221 | setCodec(QTextCodec::codecForName(codecName)); | - | ||||||||||||||||||||||||||||||
| 2222 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 2223 | - | |||||||||||||||||||||||||||||||
| 2224 | - | |||||||||||||||||||||||||||||||
| 2225 | - | |||||||||||||||||||||||||||||||
| 2226 | - | |||||||||||||||||||||||||||||||
| 2227 | - | |||||||||||||||||||||||||||||||
| 2228 | - | |||||||||||||||||||||||||||||||
| 2229 | QTextCodec *QXmlStreamWriter::codec() const | - | ||||||||||||||||||||||||||||||
| 2230 | { | - | ||||||||||||||||||||||||||||||
| 2231 | const QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2232 | return never executed: d->codec;return d->codec;never executed: return d->codec; | 0 | ||||||||||||||||||||||||||||||
| 2233 | } | - | ||||||||||||||||||||||||||||||
| 2234 | void QXmlStreamWriter::setAutoFormatting(bool enable) | - | ||||||||||||||||||||||||||||||
| 2235 | { | - | ||||||||||||||||||||||||||||||
| 2236 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2237 | d->autoFormatting = enable; | - | ||||||||||||||||||||||||||||||
| 2238 | } executed 28 times by 3 tests: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||||||||
| 2239 | - | |||||||||||||||||||||||||||||||
| 2240 | - | |||||||||||||||||||||||||||||||
| 2241 | - | |||||||||||||||||||||||||||||||
| 2242 | - | |||||||||||||||||||||||||||||||
| 2243 | - | |||||||||||||||||||||||||||||||
| 2244 | - | |||||||||||||||||||||||||||||||
| 2245 | bool QXmlStreamWriter::autoFormatting() const | - | ||||||||||||||||||||||||||||||
| 2246 | { | - | ||||||||||||||||||||||||||||||
| 2247 | const QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2248 | return never executed: d->autoFormatting;return d->autoFormatting;never executed: return d->autoFormatting; | 0 | ||||||||||||||||||||||||||||||
| 2249 | } | - | ||||||||||||||||||||||||||||||
| 2250 | void QXmlStreamWriter::setAutoFormattingIndent(int spacesOrTabs) | - | ||||||||||||||||||||||||||||||
| 2251 | { | - | ||||||||||||||||||||||||||||||
| 2252 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2253 | d->autoFormattingIndent = QByteArray(qAbs(spacesOrTabs), spacesOrTabs >= 0 ? ' ' : '\t'); | - | ||||||||||||||||||||||||||||||
| 2254 | } executed 21 times by 3 tests: end of blockExecuted by:
| 21 | ||||||||||||||||||||||||||||||
| 2255 | - | |||||||||||||||||||||||||||||||
| 2256 | int QXmlStreamWriter::autoFormattingIndent() const | - | ||||||||||||||||||||||||||||||
| 2257 | { | - | ||||||||||||||||||||||||||||||
| 2258 | const QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2259 | return executed 1 time by 1 test: d->autoFormattingIndent.count(' ') - d->autoFormattingIndent.count('\t');return d->autoFormattingIndent.count(' ') - d->autoFormattingIndent.count('\t');Executed by:
executed 1 time by 1 test: return d->autoFormattingIndent.count(' ') - d->autoFormattingIndent.count('\t');Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2260 | } | - | ||||||||||||||||||||||||||||||
| 2261 | - | |||||||||||||||||||||||||||||||
| 2262 | - | |||||||||||||||||||||||||||||||
| 2263 | - | |||||||||||||||||||||||||||||||
| 2264 | - | |||||||||||||||||||||||||||||||
| 2265 | - | |||||||||||||||||||||||||||||||
| 2266 | - | |||||||||||||||||||||||||||||||
| 2267 | - | |||||||||||||||||||||||||||||||
| 2268 | bool QXmlStreamWriter::hasError() const | - | ||||||||||||||||||||||||||||||
| 2269 | { | - | ||||||||||||||||||||||||||||||
| 2270 | const QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2271 | return executed 6 times by 1 test: d->hasError;return d->hasError;Executed by:
executed 6 times by 1 test: return d->hasError;Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 2272 | } | - | ||||||||||||||||||||||||||||||
| 2273 | void QXmlStreamWriter::writeAttribute(const QString &qualifiedName, const QString &value) | - | ||||||||||||||||||||||||||||||
| 2274 | { | - | ||||||||||||||||||||||||||||||
| 2275 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2276 | ((!(d->inStartElement)) ? qt_assert("d->inStartElement",__FILE__,3421) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2277 | ((!(qualifiedName.count(QLatin1Char(':')) <= 1)) ? qt_assert("qualifiedName.count(QLatin1Char(':')) <= 1",__FILE__,3422) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2278 | d->write(" "); | - | ||||||||||||||||||||||||||||||
| 2279 | d->write(qualifiedName); | - | ||||||||||||||||||||||||||||||
| 2280 | d->write("=\""); | - | ||||||||||||||||||||||||||||||
| 2281 | d->writeEscaped(value, true); | - | ||||||||||||||||||||||||||||||
| 2282 | d->write("\""); | - | ||||||||||||||||||||||||||||||
| 2283 | } executed 440 times by 1 test: end of blockExecuted by:
| 440 | ||||||||||||||||||||||||||||||
| 2284 | void QXmlStreamWriter::writeAttribute(const QString &namespaceUri, const QString &name, const QString &value) | - | ||||||||||||||||||||||||||||||
| 2285 | { | - | ||||||||||||||||||||||||||||||
| 2286 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2287 | ((!(d->inStartElement)) ? qt_assert("d->inStartElement",__FILE__,3441) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2288 | ((!(!name.contains(QLatin1Char(':')))) ? qt_assert("!name.contains(QLatin1Char(':'))",__FILE__,3442) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2289 | QXmlStreamWriterPrivate::NamespaceDeclaration &namespaceDeclaration = d->findNamespace(namespaceUri, true, true); | - | ||||||||||||||||||||||||||||||
| 2290 | d->write(" "); | - | ||||||||||||||||||||||||||||||
| 2291 | if (!namespaceDeclaration.prefix.isEmpty()
| 0-172 | ||||||||||||||||||||||||||||||
| 2292 | d->write(namespaceDeclaration.prefix); | - | ||||||||||||||||||||||||||||||
| 2293 | d->write(":"); | - | ||||||||||||||||||||||||||||||
| 2294 | } executed 172 times by 3 tests: end of blockExecuted by:
| 172 | ||||||||||||||||||||||||||||||
| 2295 | d->write(name); | - | ||||||||||||||||||||||||||||||
| 2296 | d->write("=\""); | - | ||||||||||||||||||||||||||||||
| 2297 | d->writeEscaped(value, true); | - | ||||||||||||||||||||||||||||||
| 2298 | d->write("\""); | - | ||||||||||||||||||||||||||||||
| 2299 | } executed 172 times by 3 tests: end of blockExecuted by:
| 172 | ||||||||||||||||||||||||||||||
| 2300 | void QXmlStreamWriter::writeAttribute(const QXmlStreamAttribute& attribute) | - | ||||||||||||||||||||||||||||||
| 2301 | { | - | ||||||||||||||||||||||||||||||
| 2302 | if (attribute.namespaceUri().isEmpty()
| 34-433 | ||||||||||||||||||||||||||||||
| 2303 | writeAttribute(attribute.qualifiedName().toString(), executed 433 times by 1 test: writeAttribute(attribute.qualifiedName().toString(), attribute.value().toString());Executed by:
| 433 | ||||||||||||||||||||||||||||||
| 2304 | attribute.value().toString()); executed 433 times by 1 test: writeAttribute(attribute.qualifiedName().toString(), attribute.value().toString());Executed by:
| 433 | ||||||||||||||||||||||||||||||
| 2305 | else | - | ||||||||||||||||||||||||||||||
| 2306 | writeAttribute(attribute.namespaceUri().toString(), executed 34 times by 1 test: writeAttribute(attribute.namespaceUri().toString(), attribute.name().toString(), attribute.value().toString());Executed by:
| 34 | ||||||||||||||||||||||||||||||
| 2307 | attribute.name().toString(), executed 34 times by 1 test: writeAttribute(attribute.namespaceUri().toString(), attribute.name().toString(), attribute.value().toString());Executed by:
| 34 | ||||||||||||||||||||||||||||||
| 2308 | attribute.value().toString()); executed 34 times by 1 test: writeAttribute(attribute.namespaceUri().toString(), attribute.name().toString(), attribute.value().toString());Executed by:
| 34 | ||||||||||||||||||||||||||||||
| 2309 | } | - | ||||||||||||||||||||||||||||||
| 2310 | void QXmlStreamWriter::writeAttributes(const QXmlStreamAttributes& attributes) | - | ||||||||||||||||||||||||||||||
| 2311 | { | - | ||||||||||||||||||||||||||||||
| 2312 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2313 | ((!(d->inStartElement)) ? qt_assert("d->inStartElement",__FILE__,3487) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2314 | (void)d;; | - | ||||||||||||||||||||||||||||||
| 2315 | for (int i = 0; i < attributes.size()
| 0-4 | ||||||||||||||||||||||||||||||
| 2316 | writeAttribute(attributes.at(i)); never executed: writeAttribute(attributes.at(i)); | 0 | ||||||||||||||||||||||||||||||
| 2317 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||
| 2318 | void QXmlStreamWriter::writeCDATA(const QString &text) | - | ||||||||||||||||||||||||||||||
| 2319 | { | - | ||||||||||||||||||||||||||||||
| 2320 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2321 | d->finishStartElement(); | - | ||||||||||||||||||||||||||||||
| 2322 | QString copy(text); | - | ||||||||||||||||||||||||||||||
| 2323 | copy.replace(QLatin1String("]]>"), QLatin1String("]]]]><![CDATA[>")); | - | ||||||||||||||||||||||||||||||
| 2324 | d->write("<![CDATA["); | - | ||||||||||||||||||||||||||||||
| 2325 | d->write(copy); | - | ||||||||||||||||||||||||||||||
| 2326 | d->write("]]>"); | - | ||||||||||||||||||||||||||||||
| 2327 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2328 | void QXmlStreamWriter::writeCharacters(const QString &text) | - | ||||||||||||||||||||||||||||||
| 2329 | { | - | ||||||||||||||||||||||||||||||
| 2330 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2331 | d->finishStartElement(); | - | ||||||||||||||||||||||||||||||
| 2332 | d->writeEscaped(text); | - | ||||||||||||||||||||||||||||||
| 2333 | } executed 2825 times by 3 tests: end of blockExecuted by:
| 2825 | ||||||||||||||||||||||||||||||
| 2334 | - | |||||||||||||||||||||||||||||||
| 2335 | - | |||||||||||||||||||||||||||||||
| 2336 | - | |||||||||||||||||||||||||||||||
| 2337 | - | |||||||||||||||||||||||||||||||
| 2338 | - | |||||||||||||||||||||||||||||||
| 2339 | - | |||||||||||||||||||||||||||||||
| 2340 | void QXmlStreamWriter::writeComment(const QString &text) | - | ||||||||||||||||||||||||||||||
| 2341 | { | - | ||||||||||||||||||||||||||||||
| 2342 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2343 | ((!(!text.contains(QLatin1String("--")) && !text.endsWith(QLatin1Char('-')))) ? qt_assert("!text.contains(QLatin1String(\"--\")) && !text.endsWith(QLatin1Char('-'))",__FILE__,3535) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2344 | if (!d->finishStartElement(false)
| 0-7 | ||||||||||||||||||||||||||||||
| 2345 | d->indent(d->tagStack.size()); executed 7 times by 1 test: d->indent(d->tagStack.size());Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 2346 | d->write("<!--"); | - | ||||||||||||||||||||||||||||||
| 2347 | d->write(text); | - | ||||||||||||||||||||||||||||||
| 2348 | d->write("-->"); | - | ||||||||||||||||||||||||||||||
| 2349 | d->inStartElement = d->lastWasStartElement = false; | - | ||||||||||||||||||||||||||||||
| 2350 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||||||||
| 2351 | - | |||||||||||||||||||||||||||||||
| 2352 | - | |||||||||||||||||||||||||||||||
| 2353 | - | |||||||||||||||||||||||||||||||
| 2354 | - | |||||||||||||||||||||||||||||||
| 2355 | - | |||||||||||||||||||||||||||||||
| 2356 | void QXmlStreamWriter::writeDTD(const QString &dtd) | - | ||||||||||||||||||||||||||||||
| 2357 | { | - | ||||||||||||||||||||||||||||||
| 2358 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2359 | d->finishStartElement(); | - | ||||||||||||||||||||||||||||||
| 2360 | if (d->autoFormatting
| 0-46 | ||||||||||||||||||||||||||||||
| 2361 | d->write("\n"); never executed: d->write("\n"); | 0 | ||||||||||||||||||||||||||||||
| 2362 | d->write(dtd); | - | ||||||||||||||||||||||||||||||
| 2363 | if (d->autoFormatting
| 0-46 | ||||||||||||||||||||||||||||||
| 2364 | d->write("\n"); never executed: d->write("\n"); | 0 | ||||||||||||||||||||||||||||||
| 2365 | } executed 46 times by 1 test: end of blockExecuted by:
| 46 | ||||||||||||||||||||||||||||||
| 2366 | - | |||||||||||||||||||||||||||||||
| 2367 | - | |||||||||||||||||||||||||||||||
| 2368 | - | |||||||||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||||||||
| 2370 | - | |||||||||||||||||||||||||||||||
| 2371 | - | |||||||||||||||||||||||||||||||
| 2372 | - | |||||||||||||||||||||||||||||||
| 2373 | void QXmlStreamWriter::writeEmptyElement(const QString &qualifiedName) | - | ||||||||||||||||||||||||||||||
| 2374 | { | - | ||||||||||||||||||||||||||||||
| 2375 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2376 | ((!(qualifiedName.count(QLatin1Char(':')) <= 1)) ? qt_assert("qualifiedName.count(QLatin1Char(':')) <= 1",__FILE__,3568) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2377 | d->writeStartElement(QString(), qualifiedName); | - | ||||||||||||||||||||||||||||||
| 2378 | d->inEmptyElement = true; | - | ||||||||||||||||||||||||||||||
| 2379 | } executed 5 times by 1 test: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||||||||
| 2380 | void QXmlStreamWriter::writeEmptyElement(const QString &namespaceUri, const QString &name) | - | ||||||||||||||||||||||||||||||
| 2381 | { | - | ||||||||||||||||||||||||||||||
| 2382 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2383 | ((!(!name.contains(QLatin1Char(':')))) ? qt_assert("!name.contains(QLatin1Char(':'))",__FILE__,3584) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2384 | d->writeStartElement(namespaceUri, name); | - | ||||||||||||||||||||||||||||||
| 2385 | d->inEmptyElement = true; | - | ||||||||||||||||||||||||||||||
| 2386 | } executed 34 times by 2 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||||||||
| 2387 | void QXmlStreamWriter::writeTextElement(const QString &qualifiedName, const QString &text) | - | ||||||||||||||||||||||||||||||
| 2388 | { | - | ||||||||||||||||||||||||||||||
| 2389 | writeStartElement(qualifiedName); | - | ||||||||||||||||||||||||||||||
| 2390 | writeCharacters(text); | - | ||||||||||||||||||||||||||||||
| 2391 | writeEndElement(); | - | ||||||||||||||||||||||||||||||
| 2392 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 2393 | void QXmlStreamWriter::writeTextElement(const QString &namespaceUri, const QString &name, const QString &text) | - | ||||||||||||||||||||||||||||||
| 2394 | { | - | ||||||||||||||||||||||||||||||
| 2395 | writeStartElement(namespaceUri, name); | - | ||||||||||||||||||||||||||||||
| 2396 | writeCharacters(text); | - | ||||||||||||||||||||||||||||||
| 2397 | writeEndElement(); | - | ||||||||||||||||||||||||||||||
| 2398 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2399 | - | |||||||||||||||||||||||||||||||
| 2400 | - | |||||||||||||||||||||||||||||||
| 2401 | - | |||||||||||||||||||||||||||||||
| 2402 | - | |||||||||||||||||||||||||||||||
| 2403 | - | |||||||||||||||||||||||||||||||
| 2404 | - | |||||||||||||||||||||||||||||||
| 2405 | - | |||||||||||||||||||||||||||||||
| 2406 | void QXmlStreamWriter::writeEndDocument() | - | ||||||||||||||||||||||||||||||
| 2407 | { | - | ||||||||||||||||||||||||||||||
| 2408 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2409 | while (d->tagStack.size()
| 14-33 | ||||||||||||||||||||||||||||||
| 2410 | writeEndElement(); executed 14 times by 3 tests: writeEndElement();Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 2411 | d->write("\n"); | - | ||||||||||||||||||||||||||||||
| 2412 | } executed 33 times by 3 tests: end of blockExecuted by:
| 33 | ||||||||||||||||||||||||||||||
| 2413 | - | |||||||||||||||||||||||||||||||
| 2414 | - | |||||||||||||||||||||||||||||||
| 2415 | - | |||||||||||||||||||||||||||||||
| 2416 | - | |||||||||||||||||||||||||||||||
| 2417 | - | |||||||||||||||||||||||||||||||
| 2418 | - | |||||||||||||||||||||||||||||||
| 2419 | void QXmlStreamWriter::writeEndElement() | - | ||||||||||||||||||||||||||||||
| 2420 | { | - | ||||||||||||||||||||||||||||||
| 2421 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2422 | if (d->tagStack.isEmpty()
| 1-1255 | ||||||||||||||||||||||||||||||
| 2423 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2424 | - | |||||||||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||||||||
| 2426 | if (d->inStartElement
| 14-1213 | ||||||||||||||||||||||||||||||
| 2427 | d->write("/>"); | - | ||||||||||||||||||||||||||||||
| 2428 | d->lastWasStartElement = d->inStartElement = false; | - | ||||||||||||||||||||||||||||||
| 2429 | QXmlStreamWriterPrivate::Tag &tag = d->tagStack_pop(); | - | ||||||||||||||||||||||||||||||
| 2430 | d->lastNamespaceDeclaration = tag.namespaceDeclarationsSize; | - | ||||||||||||||||||||||||||||||
| 2431 | return; executed 14 times by 3 tests: return;Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 2432 | } | - | ||||||||||||||||||||||||||||||
| 2433 | - | |||||||||||||||||||||||||||||||
| 2434 | if (!d->finishStartElement(false)
| 7-1096 | ||||||||||||||||||||||||||||||
| 2435 | d->indent(d->tagStack.size()-1); executed 77 times by 3 tests: d->indent(d->tagStack.size()-1);Executed by:
| 77 | ||||||||||||||||||||||||||||||
| 2436 | if (d->tagStack.isEmpty()
| 4-1237 | ||||||||||||||||||||||||||||||
| 2437 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 2438 | d->lastWasStartElement = false; | - | ||||||||||||||||||||||||||||||
| 2439 | QXmlStreamWriterPrivate::Tag &tag = d->tagStack_pop(); | - | ||||||||||||||||||||||||||||||
| 2440 | d->lastNamespaceDeclaration = tag.namespaceDeclarationsSize; | - | ||||||||||||||||||||||||||||||
| 2441 | d->write("</"); | - | ||||||||||||||||||||||||||||||
| 2442 | if (!tag.namespaceDeclaration.prefix.isEmpty()
| 105-1132 | ||||||||||||||||||||||||||||||
| 2443 | d->write(tag.namespaceDeclaration.prefix); | - | ||||||||||||||||||||||||||||||
| 2444 | d->write(":"); | - | ||||||||||||||||||||||||||||||
| 2445 | } executed 105 times by 3 tests: end of blockExecuted by:
| 105 | ||||||||||||||||||||||||||||||
| 2446 | d->write(tag.name); | - | ||||||||||||||||||||||||||||||
| 2447 | d->write(">"); | - | ||||||||||||||||||||||||||||||
| 2448 | } executed 1237 times by 3 tests: end of blockExecuted by:
| 1237 | ||||||||||||||||||||||||||||||
| 2449 | - | |||||||||||||||||||||||||||||||
| 2450 | - | |||||||||||||||||||||||||||||||
| 2451 | - | |||||||||||||||||||||||||||||||
| 2452 | - | |||||||||||||||||||||||||||||||
| 2453 | - | |||||||||||||||||||||||||||||||
| 2454 | - | |||||||||||||||||||||||||||||||
| 2455 | void QXmlStreamWriter::writeEntityReference(const QString &name) | - | ||||||||||||||||||||||||||||||
| 2456 | { | - | ||||||||||||||||||||||||||||||
| 2457 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2458 | d->finishStartElement(); | - | ||||||||||||||||||||||||||||||
| 2459 | d->write("&"); | - | ||||||||||||||||||||||||||||||
| 2460 | d->write(name); | - | ||||||||||||||||||||||||||||||
| 2461 | d->write(";"); | - | ||||||||||||||||||||||||||||||
| 2462 | } executed 857 times by 1 test: end of blockExecuted by:
| 857 | ||||||||||||||||||||||||||||||
| 2463 | void QXmlStreamWriter::writeNamespace(const QString &namespaceUri, const QString &prefix) | - | ||||||||||||||||||||||||||||||
| 2464 | { | - | ||||||||||||||||||||||||||||||
| 2465 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2466 | ((!(!namespaceUri.isEmpty())) ? qt_assert("!namespaceUri.isEmpty()",__FILE__,3705) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2467 | ((!(prefix != QLatin1String("xmlns"))) ? qt_assert("prefix != QLatin1String(\"xmlns\")",__FILE__,3706) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2468 | if (prefix.isEmpty()
| 0-83 | ||||||||||||||||||||||||||||||
| 2469 | d->findNamespace(namespaceUri, d->inStartElement); | - | ||||||||||||||||||||||||||||||
| 2470 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
| 2471 | ((!(!((prefix == QLatin1String("xml")) ^ (namespaceUri == QLatin1String("http://www.w3.org/XML/1998/namespace"))))) ? qt_assert("!((prefix == QLatin1String(\"xml\")) ^ (namespaceUri == QLatin1String(\"http://www.w3.org/XML/1998/namespace\")))",__FILE__,3710) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2472 | ((!(namespaceUri != QLatin1String("http://www.w3.org/2000/xmlns/"))) ? qt_assert("namespaceUri != QLatin1String(\"http://www.w3.org/2000/xmlns/\")",__FILE__,3711) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2473 | QXmlStreamWriterPrivate::NamespaceDeclaration &namespaceDeclaration = d->namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 2474 | namespaceDeclaration.prefix = d->addToStringStorage(prefix); | - | ||||||||||||||||||||||||||||||
| 2475 | namespaceDeclaration.namespaceUri = d->addToStringStorage(namespaceUri); | - | ||||||||||||||||||||||||||||||
| 2476 | if (d->inStartElement
| 2-81 | ||||||||||||||||||||||||||||||
| 2477 | d->writeNamespaceDeclaration(namespaceDeclaration); executed 2 times by 1 test: d->writeNamespaceDeclaration(namespaceDeclaration);Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2478 | } executed 83 times by 3 tests: end of blockExecuted by:
| 83 | ||||||||||||||||||||||||||||||
| 2479 | } | - | ||||||||||||||||||||||||||||||
| 2480 | void QXmlStreamWriter::writeDefaultNamespace(const QString &namespaceUri) | - | ||||||||||||||||||||||||||||||
| 2481 | { | - | ||||||||||||||||||||||||||||||
| 2482 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2483 | ((!(namespaceUri != QLatin1String("http://www.w3.org/XML/1998/namespace"))) ? qt_assert("namespaceUri != QLatin1String(\"http://www.w3.org/XML/1998/namespace\")",__FILE__,3734) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2484 | ((!(namespaceUri != QLatin1String("http://www.w3.org/2000/xmlns/"))) ? qt_assert("namespaceUri != QLatin1String(\"http://www.w3.org/2000/xmlns/\")",__FILE__,3735) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2485 | QXmlStreamWriterPrivate::NamespaceDeclaration &namespaceDeclaration = d->namespaceDeclarations.push(); | - | ||||||||||||||||||||||||||||||
| 2486 | namespaceDeclaration.prefix.clear(); | - | ||||||||||||||||||||||||||||||
| 2487 | namespaceDeclaration.namespaceUri = d->addToStringStorage(namespaceUri); | - | ||||||||||||||||||||||||||||||
| 2488 | if (d->inStartElement
| 0 | ||||||||||||||||||||||||||||||
| 2489 | d->writeNamespaceDeclaration(namespaceDeclaration); never executed: d->writeNamespaceDeclaration(namespaceDeclaration); | 0 | ||||||||||||||||||||||||||||||
| 2490 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2491 | - | |||||||||||||||||||||||||||||||
| 2492 | - | |||||||||||||||||||||||||||||||
| 2493 | - | |||||||||||||||||||||||||||||||
| 2494 | - | |||||||||||||||||||||||||||||||
| 2495 | - | |||||||||||||||||||||||||||||||
| 2496 | - | |||||||||||||||||||||||||||||||
| 2497 | void QXmlStreamWriter::writeProcessingInstruction(const QString &target, const QString &data) | - | ||||||||||||||||||||||||||||||
| 2498 | { | - | ||||||||||||||||||||||||||||||
| 2499 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2500 | ((!(!data.contains(QLatin1String("?>")))) ? qt_assert("!data.contains(QLatin1String(\"?>\"))",__FILE__,3751) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2501 | if (!d->finishStartElement(false)
| 1-61 | ||||||||||||||||||||||||||||||
| 2502 | d->indent(d->tagStack.size()); executed 1 time by 1 test: d->indent(d->tagStack.size());Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2503 | d->write("<?"); | - | ||||||||||||||||||||||||||||||
| 2504 | d->write(target); | - | ||||||||||||||||||||||||||||||
| 2505 | if (!data.isNull()
| 0-72 | ||||||||||||||||||||||||||||||
| 2506 | d->write(" "); | - | ||||||||||||||||||||||||||||||
| 2507 | d->write(data); | - | ||||||||||||||||||||||||||||||
| 2508 | } executed 72 times by 1 test: end of blockExecuted by:
| 72 | ||||||||||||||||||||||||||||||
| 2509 | d->write("?>"); | - | ||||||||||||||||||||||||||||||
| 2510 | } executed 72 times by 1 test: end of blockExecuted by:
| 72 | ||||||||||||||||||||||||||||||
| 2511 | void QXmlStreamWriter::writeStartDocument() | - | ||||||||||||||||||||||||||||||
| 2512 | { | - | ||||||||||||||||||||||||||||||
| 2513 | writeStartDocument(QLatin1String("1.0")); | - | ||||||||||||||||||||||||||||||
| 2514 | } executed 34 times by 3 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||||||||||||||
| 2515 | - | |||||||||||||||||||||||||||||||
| 2516 | - | |||||||||||||||||||||||||||||||
| 2517 | - | |||||||||||||||||||||||||||||||
| 2518 | - | |||||||||||||||||||||||||||||||
| 2519 | - | |||||||||||||||||||||||||||||||
| 2520 | - | |||||||||||||||||||||||||||||||
| 2521 | - | |||||||||||||||||||||||||||||||
| 2522 | void QXmlStreamWriter::writeStartDocument(const QString &version) | - | ||||||||||||||||||||||||||||||
| 2523 | { | - | ||||||||||||||||||||||||||||||
| 2524 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2525 | d->finishStartElement(false); | - | ||||||||||||||||||||||||||||||
| 2526 | d->write("<?xml version=\""); | - | ||||||||||||||||||||||||||||||
| 2527 | d->write(version); | - | ||||||||||||||||||||||||||||||
| 2528 | if (d->device
| 2-35 | ||||||||||||||||||||||||||||||
| 2529 | d->write("\" encoding=\""); | - | ||||||||||||||||||||||||||||||
| 2530 | - | |||||||||||||||||||||||||||||||
| 2531 | - | |||||||||||||||||||||||||||||||
| 2532 | - | |||||||||||||||||||||||||||||||
| 2533 | d->write(d->codec->name().constData(), d->codec->name().length()); | - | ||||||||||||||||||||||||||||||
| 2534 | - | |||||||||||||||||||||||||||||||
| 2535 | } executed 35 times by 3 tests: end of blockExecuted by:
| 35 | ||||||||||||||||||||||||||||||
| 2536 | d->write("\"?>"); | - | ||||||||||||||||||||||||||||||
| 2537 | } executed 37 times by 3 tests: end of blockExecuted by:
| 37 | ||||||||||||||||||||||||||||||
| 2538 | - | |||||||||||||||||||||||||||||||
| 2539 | - | |||||||||||||||||||||||||||||||
| 2540 | - | |||||||||||||||||||||||||||||||
| 2541 | - | |||||||||||||||||||||||||||||||
| 2542 | - | |||||||||||||||||||||||||||||||
| 2543 | - | |||||||||||||||||||||||||||||||
| 2544 | - | |||||||||||||||||||||||||||||||
| 2545 | void QXmlStreamWriter::writeStartDocument(const QString &version, bool standalone) | - | ||||||||||||||||||||||||||||||
| 2546 | { | - | ||||||||||||||||||||||||||||||
| 2547 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2548 | d->finishStartElement(false); | - | ||||||||||||||||||||||||||||||
| 2549 | d->write("<?xml version=\""); | - | ||||||||||||||||||||||||||||||
| 2550 | d->write(version); | - | ||||||||||||||||||||||||||||||
| 2551 | if (d->device
| 0-2 | ||||||||||||||||||||||||||||||
| 2552 | d->write("\" encoding=\""); | - | ||||||||||||||||||||||||||||||
| 2553 | - | |||||||||||||||||||||||||||||||
| 2554 | - | |||||||||||||||||||||||||||||||
| 2555 | - | |||||||||||||||||||||||||||||||
| 2556 | d->write(d->codec->name().constData(), d->codec->name().length()); | - | ||||||||||||||||||||||||||||||
| 2557 | - | |||||||||||||||||||||||||||||||
| 2558 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 2559 | if (standalone
| 1 | ||||||||||||||||||||||||||||||
| 2560 | d->write("\" standalone=\"yes\"?>"); executed 1 time by 1 test: d->write("\" standalone=\"yes\"?>");Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2561 | else | - | ||||||||||||||||||||||||||||||
| 2562 | d->write("\" standalone=\"no\"?>"); executed 1 time by 1 test: d->write("\" standalone=\"no\"?>");Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2563 | } | - | ||||||||||||||||||||||||||||||
| 2564 | void QXmlStreamWriter::writeStartElement(const QString &qualifiedName) | - | ||||||||||||||||||||||||||||||
| 2565 | { | - | ||||||||||||||||||||||||||||||
| 2566 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2567 | ((!(qualifiedName.count(QLatin1Char(':')) <= 1)) ? qt_assert("qualifiedName.count(QLatin1Char(':')) <= 1",__FILE__,3838) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2568 | d->writeStartElement(QString(), qualifiedName); | - | ||||||||||||||||||||||||||||||
| 2569 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||
| 2570 | void QXmlStreamWriter::writeStartElement(const QString &namespaceUri, const QString &name) | - | ||||||||||||||||||||||||||||||
| 2571 | { | - | ||||||||||||||||||||||||||||||
| 2572 | QXmlStreamWriterPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2573 | ((!(!name.contains(QLatin1Char(':')))) ? qt_assert("!name.contains(QLatin1Char(':'))",__FILE__,3854) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2574 | d->writeStartElement(namespaceUri, name); | - | ||||||||||||||||||||||||||||||
| 2575 | } executed 1243 times by 3 tests: end of blockExecuted by:
| 1243 | ||||||||||||||||||||||||||||||
| 2576 | - | |||||||||||||||||||||||||||||||
| 2577 | void QXmlStreamWriterPrivate::writeStartElement(const QString &namespaceUri, const QString &name) | - | ||||||||||||||||||||||||||||||
| 2578 | { | - | ||||||||||||||||||||||||||||||
| 2579 | if (!finishStartElement(false)
| 133-845 | ||||||||||||||||||||||||||||||
| 2580 | indent(tagStack.size()); executed 133 times by 3 tests: indent(tagStack.size());Executed by:
| 133 | ||||||||||||||||||||||||||||||
| 2581 | - | |||||||||||||||||||||||||||||||
| 2582 | Tag &tag = tagStack_push(); | - | ||||||||||||||||||||||||||||||
| 2583 | tag.name = addToStringStorage(name); | - | ||||||||||||||||||||||||||||||
| 2584 | tag.namespaceDeclaration = findNamespace(namespaceUri); | - | ||||||||||||||||||||||||||||||
| 2585 | write("<"); | - | ||||||||||||||||||||||||||||||
| 2586 | if (!tag.namespaceDeclaration.prefix.isEmpty()
| 149-1143 | ||||||||||||||||||||||||||||||
| 2587 | write(tag.namespaceDeclaration.prefix); | - | ||||||||||||||||||||||||||||||
| 2588 | write(":"); | - | ||||||||||||||||||||||||||||||
| 2589 | } executed 149 times by 3 tests: end of blockExecuted by:
| 149 | ||||||||||||||||||||||||||||||
| 2590 | write(tag.name); | - | ||||||||||||||||||||||||||||||
| 2591 | inStartElement = lastWasStartElement = true; | - | ||||||||||||||||||||||||||||||
| 2592 | - | |||||||||||||||||||||||||||||||
| 2593 | for (int i = lastNamespaceDeclaration; i < namespaceDeclarations.size()
| 96-1292 | ||||||||||||||||||||||||||||||
| 2594 | writeNamespaceDeclaration(namespaceDeclarations[i]); executed 96 times by 3 tests: writeNamespaceDeclaration(namespaceDeclarations[i]);Executed by:
| 96 | ||||||||||||||||||||||||||||||
| 2595 | tag.namespaceDeclarationsSize = lastNamespaceDeclaration; | - | ||||||||||||||||||||||||||||||
| 2596 | } executed 1292 times by 3 tests: end of blockExecuted by:
| 1292 | ||||||||||||||||||||||||||||||
| 2597 | void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader) | - | ||||||||||||||||||||||||||||||
| 2598 | { | - | ||||||||||||||||||||||||||||||
| 2599 | switch (reader.tokenType()) { | - | ||||||||||||||||||||||||||||||
| 2600 | case never executed: QXmlStreamReader::NoToken:case QXmlStreamReader::NoToken:never executed: case QXmlStreamReader::NoToken: | 0 | ||||||||||||||||||||||||||||||
| 2601 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 2602 | case executed 2 times by 1 test: QXmlStreamReader::StartDocument:case QXmlStreamReader::StartDocument:Executed by:
executed 2 times by 1 test: case QXmlStreamReader::StartDocument:Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2603 | writeStartDocument(); | - | ||||||||||||||||||||||||||||||
| 2604 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2605 | case executed 2 times by 1 test: QXmlStreamReader::EndDocument:case QXmlStreamReader::EndDocument:Executed by:
executed 2 times by 1 test: case QXmlStreamReader::EndDocument:Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2606 | writeEndDocument(); | - | ||||||||||||||||||||||||||||||
| 2607 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 2608 | case executed 4 times by 1 test: QXmlStreamReader::StartElement:case QXmlStreamReader::StartElement:Executed by:
executed 4 times by 1 test: {case QXmlStreamReader::StartElement:Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 2609 | QXmlStreamNamespaceDeclarations namespaceDeclarations = reader.namespaceDeclarations(); | - | ||||||||||||||||||||||||||||||
| 2610 | for (int i = 0; i < namespaceDeclarations.size()
| 0-4 | ||||||||||||||||||||||||||||||
| 2611 | const QXmlStreamNamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.at(i); | - | ||||||||||||||||||||||||||||||
| 2612 | writeNamespace(namespaceDeclaration.namespaceUri().toString(), | - | ||||||||||||||||||||||||||||||
| 2613 | namespaceDeclaration.prefix().toString()); | - | ||||||||||||||||||||||||||||||
| 2614 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 2615 | writeStartElement(reader.namespaceUri().toString(), reader.name().toString()); | - | ||||||||||||||||||||||||||||||
| 2616 | writeAttributes(reader.attributes()); | - | ||||||||||||||||||||||||||||||
| 2617 | } break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||||||||
| 2618 | case executed 1144 times by 1 test: QXmlStreamReader::EndElement:case QXmlStreamReader::EndElement:Executed by:
executed 1144 times by 1 test: case QXmlStreamReader::EndElement:Executed by:
| 1144 | ||||||||||||||||||||||||||||||
| 2619 | writeEndElement(); | - | ||||||||||||||||||||||||||||||
| 2620 | break; executed 1144 times by 1 test: break;Executed by:
| 1144 | ||||||||||||||||||||||||||||||
| 2621 | case never executed: QXmlStreamReader::Characters:case QXmlStreamReader::Characters:never executed: case QXmlStreamReader::Characters: | 0 | ||||||||||||||||||||||||||||||
| 2622 | if (reader.isCDATA()
| 0 | ||||||||||||||||||||||||||||||
| 2623 | writeCDATA(reader.text().toString()); never executed: writeCDATA(reader.text().toString()); | 0 | ||||||||||||||||||||||||||||||
| 2624 | else | - | ||||||||||||||||||||||||||||||
| 2625 | writeCharacters(reader.text().toString()); never executed: writeCharacters(reader.text().toString()); | 0 | ||||||||||||||||||||||||||||||
| 2626 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 2627 | case executed 6 times by 1 test: QXmlStreamReader::Comment:case QXmlStreamReader::Comment:Executed by:
executed 6 times by 1 test: case QXmlStreamReader::Comment:Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 2628 | writeComment(reader.text().toString()); | - | ||||||||||||||||||||||||||||||
| 2629 | break; executed 6 times by 1 test: break;Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 2630 | case never executed: QXmlStreamReader::DTD:case QXmlStreamReader::DTD:never executed: case QXmlStreamReader::DTD: | 0 | ||||||||||||||||||||||||||||||
| 2631 | writeDTD(reader.text().toString()); | - | ||||||||||||||||||||||||||||||
| 2632 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 2633 | case executed 1 time by 1 test: QXmlStreamReader::EntityReference:case QXmlStreamReader::EntityReference:Executed by:
executed 1 time by 1 test: case QXmlStreamReader::EntityReference:Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2634 | writeEntityReference(reader.name().toString()); | - | ||||||||||||||||||||||||||||||
| 2635 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2636 | case executed 48 times by 1 test: QXmlStreamReader::ProcessingInstruction:case QXmlStreamReader::ProcessingInstruction:Executed by:
executed 48 times by 1 test: case QXmlStreamReader::ProcessingInstruction:Executed by:
| 48 | ||||||||||||||||||||||||||||||
| 2637 | writeProcessingInstruction(reader.processingInstructionTarget().toString(), | - | ||||||||||||||||||||||||||||||
| 2638 | reader.processingInstructionData().toString()); | - | ||||||||||||||||||||||||||||||
| 2639 | break; executed 48 times by 1 test: break;Executed by:
| 48 | ||||||||||||||||||||||||||||||
| 2640 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||
| 2641 | ((!(reader.tokenType() != QXmlStreamReader::Invalid)) ? qt_assert("reader.tokenType() != QXmlStreamReader::Invalid",__FILE__,3931) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 2642 | QMessageLogger(__FILE__, 3932, __PRETTY_FUNCTION__).warning("QXmlStreamWriter: writeCurrentToken() with invalid state."); | - | ||||||||||||||||||||||||||||||
| 2643 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 2644 | } | - | ||||||||||||||||||||||||||||||
| 2645 | } | - | ||||||||||||||||||||||||||||||
| 2646 | - | |||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |