| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/json/qjsondocument.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | QJsonDocument::QJsonDocument() | - | ||||||||||||
| 4 | : d(0) | - | ||||||||||||
| 5 | { | - | ||||||||||||
| 6 | } executed 331 times by 5 tests: end of blockExecuted by:
| 331 | ||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | QJsonDocument::QJsonDocument(const QJsonObject &object) | - | ||||||||||||
| 12 | : d(0) | - | ||||||||||||
| 13 | { | - | ||||||||||||
| 14 | setObject(object); | - | ||||||||||||
| 15 | } never executed: end of block | 0 | ||||||||||||
| 16 | - | |||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | QJsonDocument::QJsonDocument(const QJsonArray &array) | - | ||||||||||||
| 21 | : d(0) | - | ||||||||||||
| 22 | { | - | ||||||||||||
| 23 | setArray(array); | - | ||||||||||||
| 24 | } never executed: end of block | 0 | ||||||||||||
| 25 | - | |||||||||||||
| 26 | - | |||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | QJsonDocument::QJsonDocument(QJsonPrivate::Data *data) | - | ||||||||||||
| 30 | : d(data) | - | ||||||||||||
| 31 | { | - | ||||||||||||
| 32 | ((!(d)) ? qt_assert("d",__FILE__,114) : qt_noop()); | - | ||||||||||||
| 33 | d->ref.ref(); | - | ||||||||||||
| 34 | } executed 711 times by 114 tests: end of blockExecuted by:
| 711 | ||||||||||||
| 35 | - | |||||||||||||
| 36 | - | |||||||||||||
| 37 | - | |||||||||||||
| 38 | - | |||||||||||||
| 39 | - | |||||||||||||
| 40 | - | |||||||||||||
| 41 | QJsonDocument::~QJsonDocument() | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 | if (d
| 7-712 | ||||||||||||
| 44 | delete d; executed 7 times by 3 tests: delete d;Executed by:
| 7 | ||||||||||||
| 45 | } executed 1207 times by 117 tests: end of blockExecuted by:
| 1207 | ||||||||||||
| 46 | - | |||||||||||||
| 47 | - | |||||||||||||
| 48 | - | |||||||||||||
| 49 | - | |||||||||||||
| 50 | QJsonDocument::QJsonDocument(const QJsonDocument &other) | - | ||||||||||||
| 51 | { | - | ||||||||||||
| 52 | d = other.d; | - | ||||||||||||
| 53 | if (d
| 0-165 | ||||||||||||
| 54 | d->ref.ref(); never executed: d->ref.ref(); | 0 | ||||||||||||
| 55 | } executed 165 times by 3 tests: end of blockExecuted by:
| 165 | ||||||||||||
| 56 | - | |||||||||||||
| 57 | - | |||||||||||||
| 58 | - | |||||||||||||
| 59 | - | |||||||||||||
| 60 | - | |||||||||||||
| 61 | QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other) | - | ||||||||||||
| 62 | { | - | ||||||||||||
| 63 | if (d != other.d
| 1 | ||||||||||||
| 64 | if (d
| 0-1 | ||||||||||||
| 65 | delete d; never executed: delete d; | 0 | ||||||||||||
| 66 | d = other.d; | - | ||||||||||||
| 67 | if (d
| 0-1 | ||||||||||||
| 68 | d->ref.ref(); executed 1 time by 1 test: d->ref.ref();Executed by:
| 1 | ||||||||||||
| 69 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 70 | - | |||||||||||||
| 71 | return executed 2 times by 2 tests: *this;return *this;Executed by:
executed 2 times by 2 tests: return *this;Executed by:
| 2 | ||||||||||||
| 72 | } | - | ||||||||||||
| 73 | QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) | - | ||||||||||||
| 74 | { | - | ||||||||||||
| 75 | if (quintptr(data) & 3
| 0 | ||||||||||||
| 76 | QMessageLogger(__FILE__, 187, __PRETTY_FUNCTION__).warning("QJsonDocument::fromRawData: data has to have 4 byte alignment"); | - | ||||||||||||
| 77 | return never executed: QJsonDocument();return QJsonDocument();never executed: return QJsonDocument(); | 0 | ||||||||||||
| 78 | } | - | ||||||||||||
| 79 | - | |||||||||||||
| 80 | QJsonPrivate::Data *d = new QJsonPrivate::Data((char *)data, size); | - | ||||||||||||
| 81 | d->ownsData = false; | - | ||||||||||||
| 82 | - | |||||||||||||
| 83 | if (validation != BypassValidation
| 0 | ||||||||||||
| 84 | delete d; | - | ||||||||||||
| 85 | return never executed: QJsonDocument();return QJsonDocument();never executed: return QJsonDocument(); | 0 | ||||||||||||
| 86 | } | - | ||||||||||||
| 87 | - | |||||||||||||
| 88 | return never executed: QJsonDocument(d);return QJsonDocument(d);never executed: return QJsonDocument(d); | 0 | ||||||||||||
| 89 | } | - | ||||||||||||
| 90 | const char *QJsonDocument::rawData(int *size) const | - | ||||||||||||
| 91 | { | - | ||||||||||||
| 92 | if (!d
| 0 | ||||||||||||
| 93 | *size = 0; | - | ||||||||||||
| 94 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 95 | } | - | ||||||||||||
| 96 | *size = d->alloc; | - | ||||||||||||
| 97 | return never executed: d->rawData;return d->rawData;never executed: return d->rawData; | 0 | ||||||||||||
| 98 | } | - | ||||||||||||
| 99 | QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | if (data.size() < (int)(sizeof(QJsonPrivate::Header) + sizeof(QJsonPrivate::Base))
| 0-704 | ||||||||||||
| 102 | return never executed: QJsonDocument();return QJsonDocument();never executed: return QJsonDocument(); | 0 | ||||||||||||
| 103 | - | |||||||||||||
| 104 | QJsonPrivate::Header h; | - | ||||||||||||
| 105 | memcpy(&h, data.constData(), sizeof(QJsonPrivate::Header)); | - | ||||||||||||
| 106 | QJsonPrivate::Base root; | - | ||||||||||||
| 107 | memcpy(&root, data.constData() + sizeof(QJsonPrivate::Header), sizeof(QJsonPrivate::Base)); | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | if (h.tag != QJsonDocument::BinaryFormatTag
| 0-704 | ||||||||||||
| 111 | sizeof(QJsonPrivate::Header) + root.size > (uint)data.size()
| 0-704 | ||||||||||||
| 112 | return never executed: QJsonDocument();return QJsonDocument();never executed: return QJsonDocument(); | 0 | ||||||||||||
| 113 | - | |||||||||||||
| 114 | const uint size = sizeof(QJsonPrivate::Header) + root.size; | - | ||||||||||||
| 115 | char *raw = (char *)malloc(size); | - | ||||||||||||
| 116 | if (!raw
| 0-704 | ||||||||||||
| 117 | return never executed: QJsonDocument();return QJsonDocument();never executed: return QJsonDocument(); | 0 | ||||||||||||
| 118 | - | |||||||||||||
| 119 | memcpy(raw, data.constData(), size); | - | ||||||||||||
| 120 | QJsonPrivate::Data *d = new QJsonPrivate::Data(raw, size); | - | ||||||||||||
| 121 | - | |||||||||||||
| 122 | if (validation != BypassValidation
| 0-704 | ||||||||||||
| 123 | delete d; | - | ||||||||||||
| 124 | return never executed: QJsonDocument();return QJsonDocument();never executed: return QJsonDocument(); | 0 | ||||||||||||
| 125 | } | - | ||||||||||||
| 126 | - | |||||||||||||
| 127 | return executed 704 times by 111 tests: QJsonDocument(d);return QJsonDocument(d);Executed by:
executed 704 times by 111 tests: return QJsonDocument(d);Executed by:
| 704 | ||||||||||||
| 128 | } | - | ||||||||||||
| 129 | QJsonDocument QJsonDocument::fromVariant(const QVariant &variant) | - | ||||||||||||
| 130 | { | - | ||||||||||||
| 131 | QJsonDocument doc; | - | ||||||||||||
| 132 | if (variant.type() == QVariant::Map
| 0 | ||||||||||||
| 133 | doc.setObject(QJsonObject::fromVariantMap(variant.toMap())); | - | ||||||||||||
| 134 | } never executed: else if (variant.type() == QVariant::Listend of block
| 0 | ||||||||||||
| 135 | doc.setArray(QJsonArray::fromVariantList(variant.toList())); | - | ||||||||||||
| 136 | } never executed: else if (variant.type() == QVariant::StringListend of block
| 0 | ||||||||||||
| 137 | doc.setArray(QJsonArray::fromStringList(variant.toStringList())); | - | ||||||||||||
| 138 | } never executed: end of block | 0 | ||||||||||||
| 139 | return never executed: doc;return doc;never executed: return doc; | 0 | ||||||||||||
| 140 | } | - | ||||||||||||
| 141 | QVariant QJsonDocument::toVariant() const | - | ||||||||||||
| 142 | { | - | ||||||||||||
| 143 | if (!d
| 0 | ||||||||||||
| 144 | return never executed: QVariant();return QVariant();never executed: return QVariant(); | 0 | ||||||||||||
| 145 | - | |||||||||||||
| 146 | if (d->header->root()->isArray()
| 0 | ||||||||||||
| 147 | return never executed: QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root())).toVariantList();return QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root())).toVariantList();never executed: return QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root())).toVariantList(); | 0 | ||||||||||||
| 148 | else | - | ||||||||||||
| 149 | return never executed: QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root())).toVariantMap();return QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root())).toVariantMap();never executed: return QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root())).toVariantMap(); | 0 | ||||||||||||
| 150 | } | - | ||||||||||||
| 151 | - | |||||||||||||
| 152 | - | |||||||||||||
| 153 | - | |||||||||||||
| 154 | - | |||||||||||||
| 155 | - | |||||||||||||
| 156 | - | |||||||||||||
| 157 | - | |||||||||||||
| 158 | QByteArray QJsonDocument::toJson() const | - | ||||||||||||
| 159 | { | - | ||||||||||||
| 160 | return never executed: toJson(Indented);return toJson(Indented);never executed: return toJson(Indented); | 0 | ||||||||||||
| 161 | } | - | ||||||||||||
| 162 | QByteArray QJsonDocument::toJson(JsonFormat format) const | - | ||||||||||||
| 163 | { | - | ||||||||||||
| 164 | if (!d
| 0 | ||||||||||||
| 165 | return never executed: QByteArray();return QByteArray();never executed: return QByteArray(); | 0 | ||||||||||||
| 166 | - | |||||||||||||
| 167 | QByteArray json; | - | ||||||||||||
| 168 | - | |||||||||||||
| 169 | if (d->header->root()->isArray()
| 0 | ||||||||||||
| 170 | QJsonPrivate::Writer::arrayToJson(static_cast<QJsonPrivate::Array *>(d->header->root()), json, 0, (format == Compact)); never executed: QJsonPrivate::Writer::arrayToJson(static_cast<QJsonPrivate::Array *>(d->header->root()), json, 0, (format == Compact)); | 0 | ||||||||||||
| 171 | else | - | ||||||||||||
| 172 | QJsonPrivate::Writer::objectToJson(static_cast<QJsonPrivate::Object *>(d->header->root()), json, 0, (format == Compact)); never executed: QJsonPrivate::Writer::objectToJson(static_cast<QJsonPrivate::Object *>(d->header->root()), json, 0, (format == Compact)); | 0 | ||||||||||||
| 173 | - | |||||||||||||
| 174 | return never executed: json;return json;never executed: return json; | 0 | ||||||||||||
| 175 | } | - | ||||||||||||
| 176 | QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error) | - | ||||||||||||
| 177 | { | - | ||||||||||||
| 178 | QJsonPrivate::Parser parser(json.constData(), json.length()); | - | ||||||||||||
| 179 | return executed 10 times by 4 tests: parser.parse(error);return parser.parse(error);Executed by:
executed 10 times by 4 tests: return parser.parse(error);Executed by:
| 10 | ||||||||||||
| 180 | } | - | ||||||||||||
| 181 | - | |||||||||||||
| 182 | - | |||||||||||||
| 183 | - | |||||||||||||
| 184 | - | |||||||||||||
| 185 | bool QJsonDocument::isEmpty() const | - | ||||||||||||
| 186 | { | - | ||||||||||||
| 187 | if (!d
| 0 | ||||||||||||
| 188 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||
| 189 | - | |||||||||||||
| 190 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 191 | } | - | ||||||||||||
| 192 | QByteArray QJsonDocument::toBinaryData() const | - | ||||||||||||
| 193 | { | - | ||||||||||||
| 194 | if (!d
| 0 | ||||||||||||
| 195 | return never executed: QByteArray();return QByteArray();never executed: return QByteArray(); | 0 | ||||||||||||
| 196 | - | |||||||||||||
| 197 | return never executed: QByteArray(d->rawData, d->header->root()->size + sizeof(QJsonPrivate::Header));return QByteArray(d->rawData, d->header->root()->size + sizeof(QJsonPrivate::Header));never executed: return QByteArray(d->rawData, d->header->root()->size + sizeof(QJsonPrivate::Header)); | 0 | ||||||||||||
| 198 | } | - | ||||||||||||
| 199 | - | |||||||||||||
| 200 | - | |||||||||||||
| 201 | - | |||||||||||||
| 202 | - | |||||||||||||
| 203 | - | |||||||||||||
| 204 | - | |||||||||||||
| 205 | bool QJsonDocument::isArray() const | - | ||||||||||||
| 206 | { | - | ||||||||||||
| 207 | if (!d
| 0-2 | ||||||||||||
| 208 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 209 | - | |||||||||||||
| 210 | QJsonPrivate::Header *h = (QJsonPrivate::Header *)d->rawData; | - | ||||||||||||
| 211 | return executed 2 times by 2 tests: h->root()->isArray();return h->root()->isArray();Executed by:
executed 2 times by 2 tests: return h->root()->isArray();Executed by:
| 2 | ||||||||||||
| 212 | } | - | ||||||||||||
| 213 | - | |||||||||||||
| 214 | - | |||||||||||||
| 215 | - | |||||||||||||
| 216 | - | |||||||||||||
| 217 | - | |||||||||||||
| 218 | - | |||||||||||||
| 219 | bool QJsonDocument::isObject() const | - | ||||||||||||
| 220 | { | - | ||||||||||||
| 221 | if (!d
| 0-1 | ||||||||||||
| 222 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 223 | - | |||||||||||||
| 224 | QJsonPrivate::Header *h = (QJsonPrivate::Header *)d->rawData; | - | ||||||||||||
| 225 | return executed 1 time by 1 test: h->root()->isObject();return h->root()->isObject();Executed by:
executed 1 time by 1 test: return h->root()->isObject();Executed by:
| 1 | ||||||||||||
| 226 | } | - | ||||||||||||
| 227 | QJsonObject QJsonDocument::object() const | - | ||||||||||||
| 228 | { | - | ||||||||||||
| 229 | if (d
| 0-710 | ||||||||||||
| 230 | QJsonPrivate::Base *b = d->header->root(); | - | ||||||||||||
| 231 | if (b->isObject()
| 0-710 | ||||||||||||
| 232 | return executed 710 times by 113 tests: QJsonObject(d, static_cast<QJsonPrivate::Object *>(b));return QJsonObject(d, static_cast<QJsonPrivate::Object *>(b));Executed by:
executed 710 times by 113 tests: return QJsonObject(d, static_cast<QJsonPrivate::Object *>(b));Executed by:
| 710 | ||||||||||||
| 233 | } never executed: end of block | 0 | ||||||||||||
| 234 | return never executed: QJsonObject();return QJsonObject();never executed: return QJsonObject(); | 0 | ||||||||||||
| 235 | } | - | ||||||||||||
| 236 | QJsonArray QJsonDocument::array() const | - | ||||||||||||
| 237 | { | - | ||||||||||||
| 238 | if (d
| 0-1 | ||||||||||||
| 239 | QJsonPrivate::Base *b = d->header->root(); | - | ||||||||||||
| 240 | if (b->isArray()
| 0-1 | ||||||||||||
| 241 | return executed 1 time by 1 test: QJsonArray(d, static_cast<QJsonPrivate::Array *>(b));return QJsonArray(d, static_cast<QJsonPrivate::Array *>(b));Executed by:
executed 1 time by 1 test: return QJsonArray(d, static_cast<QJsonPrivate::Array *>(b));Executed by:
| 1 | ||||||||||||
| 242 | } never executed: end of block | 0 | ||||||||||||
| 243 | return never executed: QJsonArray();return QJsonArray();never executed: return QJsonArray(); | 0 | ||||||||||||
| 244 | } | - | ||||||||||||
| 245 | - | |||||||||||||
| 246 | - | |||||||||||||
| 247 | - | |||||||||||||
| 248 | - | |||||||||||||
| 249 | - | |||||||||||||
| 250 | - | |||||||||||||
| 251 | void QJsonDocument::setObject(const QJsonObject &object) | - | ||||||||||||
| 252 | { | - | ||||||||||||
| 253 | if (d
| 0 | ||||||||||||
| 254 | delete d; never executed: delete d; | 0 | ||||||||||||
| 255 | - | |||||||||||||
| 256 | d = object.d; | - | ||||||||||||
| 257 | - | |||||||||||||
| 258 | if (!d
| 0 | ||||||||||||
| 259 | d = new QJsonPrivate::Data(0, QJsonValue::Object); | - | ||||||||||||
| 260 | } never executed: else if (d->compactionCounterend of block
| 0 | ||||||||||||
| 261 | QJsonObject o(object); | - | ||||||||||||
| 262 | if (d->compactionCounter
| 0 | ||||||||||||
| 263 | o.compact(); never executed: o.compact(); | 0 | ||||||||||||
| 264 | else | - | ||||||||||||
| 265 | o.detach2(); never executed: o.detach2(); | 0 | ||||||||||||
| 266 | d = o.d; | - | ||||||||||||
| 267 | d->ref.ref(); | - | ||||||||||||
| 268 | return; never executed: return; | 0 | ||||||||||||
| 269 | } | - | ||||||||||||
| 270 | d->ref.ref(); | - | ||||||||||||
| 271 | } never executed: end of block | 0 | ||||||||||||
| 272 | - | |||||||||||||
| 273 | - | |||||||||||||
| 274 | - | |||||||||||||
| 275 | - | |||||||||||||
| 276 | - | |||||||||||||
| 277 | - | |||||||||||||
| 278 | void QJsonDocument::setArray(const QJsonArray &array) | - | ||||||||||||
| 279 | { | - | ||||||||||||
| 280 | if (d
| 0 | ||||||||||||
| 281 | delete d; never executed: delete d; | 0 | ||||||||||||
| 282 | - | |||||||||||||
| 283 | d = array.d; | - | ||||||||||||
| 284 | - | |||||||||||||
| 285 | if (!d
| 0 | ||||||||||||
| 286 | d = new QJsonPrivate::Data(0, QJsonValue::Array); | - | ||||||||||||
| 287 | } never executed: else if (d->compactionCounterend of block
| 0 | ||||||||||||
| 288 | QJsonArray a(array); | - | ||||||||||||
| 289 | if (d->compactionCounter
| 0 | ||||||||||||
| 290 | a.compact(); never executed: a.compact(); | 0 | ||||||||||||
| 291 | else | - | ||||||||||||
| 292 | a.detach2(); never executed: a.detach2(); | 0 | ||||||||||||
| 293 | d = a.d; | - | ||||||||||||
| 294 | d->ref.ref(); | - | ||||||||||||
| 295 | return; never executed: return; | 0 | ||||||||||||
| 296 | } | - | ||||||||||||
| 297 | d->ref.ref(); | - | ||||||||||||
| 298 | } never executed: end of block | 0 | ||||||||||||
| 299 | - | |||||||||||||
| 300 | - | |||||||||||||
| 301 | - | |||||||||||||
| 302 | - | |||||||||||||
| 303 | bool QJsonDocument::operator==(const QJsonDocument &other) const | - | ||||||||||||
| 304 | { | - | ||||||||||||
| 305 | if (d == other.d
| 0-8 | ||||||||||||
| 306 | return executed 8 times by 1 test: true;return true;Executed by:
executed 8 times by 1 test: return true;Executed by:
| 8 | ||||||||||||
| 307 | - | |||||||||||||
| 308 | if (!d
| 0 | ||||||||||||
| 309 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 310 | - | |||||||||||||
| 311 | if (d->header->root()->isArray() != other.d->header->root()->isArray()
| 0 | ||||||||||||
| 312 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 313 | - | |||||||||||||
| 314 | if (d->header->root()->isObject()
| 0 | ||||||||||||
| 315 | return never executed: QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root()))return QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root())) == QJsonObject(other.d, static_cast<QJsonPrivate::Object *>(other.d->header->root()));never executed: return QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root())) == QJsonObject(other.d, static_cast<QJsonPrivate::Object *>(other.d->header->root())); | 0 | ||||||||||||
| 316 | == QJsonObject(other.d, static_cast<QJsonPrivate::Object *>(other.d->header->root())); never executed: return QJsonObject(d, static_cast<QJsonPrivate::Object *>(d->header->root())) == QJsonObject(other.d, static_cast<QJsonPrivate::Object *>(other.d->header->root())); | 0 | ||||||||||||
| 317 | else | - | ||||||||||||
| 318 | return never executed: QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root()))return QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root())) == QJsonArray(other.d, static_cast<QJsonPrivate::Array *>(other.d->header->root()));never executed: return QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root())) == QJsonArray(other.d, static_cast<QJsonPrivate::Array *>(other.d->header->root())); | 0 | ||||||||||||
| 319 | == QJsonArray(other.d, static_cast<QJsonPrivate::Array *>(other.d->header->root())); never executed: return QJsonArray(d, static_cast<QJsonPrivate::Array *>(d->header->root())) == QJsonArray(other.d, static_cast<QJsonPrivate::Array *>(other.d->header->root())); | 0 | ||||||||||||
| 320 | } | - | ||||||||||||
| 321 | bool QJsonDocument::isNull() const | - | ||||||||||||
| 322 | { | - | ||||||||||||
| 323 | return executed 686 times by 114 tests: (d == 0);return (d == 0);Executed by:
executed 686 times by 114 tests: return (d == 0);Executed by:
| 686 | ||||||||||||
| 324 | } | - | ||||||||||||
| 325 | - | |||||||||||||
| 326 | - | |||||||||||||
| 327 | QDebug operator<<(QDebug dbg, const QJsonDocument &o) | - | ||||||||||||
| 328 | { | - | ||||||||||||
| 329 | QDebugStateSaver saver(dbg); | - | ||||||||||||
| 330 | if (!o.d
| 0-1 | ||||||||||||
| 331 | dbg << "QJsonDocument()"; | - | ||||||||||||
| 332 | return executed 1 time by 1 test: dbg;return dbg;Executed by:
executed 1 time by 1 test: return dbg;Executed by:
| 1 | ||||||||||||
| 333 | } | - | ||||||||||||
| 334 | QByteArray json; | - | ||||||||||||
| 335 | if (o.d->header->root()->isArray()
| 0 | ||||||||||||
| 336 | QJsonPrivate::Writer::arrayToJson(static_cast<QJsonPrivate::Array *>(o.d->header->root()), json, 0, true); never executed: QJsonPrivate::Writer::arrayToJson(static_cast<QJsonPrivate::Array *>(o.d->header->root()), json, 0, true); | 0 | ||||||||||||
| 337 | else | - | ||||||||||||
| 338 | QJsonPrivate::Writer::objectToJson(static_cast<QJsonPrivate::Object *>(o.d->header->root()), json, 0, true); never executed: QJsonPrivate::Writer::objectToJson(static_cast<QJsonPrivate::Object *>(o.d->header->root()), json, 0, true); | 0 | ||||||||||||
| 339 | dbg.nospace() << "QJsonDocument(" | - | ||||||||||||
| 340 | << json.constData() | - | ||||||||||||
| 341 | << ')'; | - | ||||||||||||
| 342 | return never executed: dbg;return dbg;never executed: return dbg; | 0 | ||||||||||||
| 343 | } | - | ||||||||||||
| 344 | - | |||||||||||||
| 345 | - | |||||||||||||
| 346 | - | |||||||||||||
| Switch to Source code | Preprocessed file |