qjson.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/json/qjson.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qjson_p.h"-
41#include <qalgorithms.h>-
42-
43QT_BEGIN_NAMESPACE-
44-
45namespace QJsonPrivate-
46{-
47-
48#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN-
49#define Q_TO_LITTLE_ENDIAN(x) (x)-
50#else-
51#define Q_TO_LITTLE_ENDIAN(x) ( ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | ((x & 0xff000000) >> 24) )-
52#endif-
53-
54static const Base emptyArray = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } };-
55static const Base emptyObject = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } };-
56-
57-
58void Data::compact()-
59{-
60 Q_ASSERT(sizeof(Value) == sizeof(offset));-
61-
62 if (!compactionCounter)-
63 return;-
64-
65 Base *base = header->root();-
66 int reserve = 0;-
67 if (base->is_object) {-
68 Object *o = static_cast<Object *>(base);-
69 for (int i = 0; i < (int)o->length; ++i)-
70 reserve += o->entryAt(i)->usedStorage(o);-
71 } else {-
72 Array *a = static_cast<Array *>(base);-
73 for (int i = 0; i < (int)a->length; ++i)-
74 reserve += (*a)[i].usedStorage(a);-
75 }-
76-
77 int size = sizeof(Base) + reserve + base->length*sizeof(offset);-
78 int alloc = sizeof(Header) + size;-
79 Header *h = (Header *) malloc(alloc);-
80 h->tag = QJsonDocument::BinaryFormatTag;-
81 h->version = 1;-
82 Base *b = h->root();-
83 b->size = size;-
84 b->is_object = header->root()->is_object;-
85 b->length = base->length;-
86 b->tableOffset = reserve + sizeof(Array);-
87-
88 int offset = sizeof(Base);-
89 if (b->is_object) {-
90 Object *o = static_cast<Object *>(base);-
91 Object *no = static_cast<Object *>(b);-
92-
93 for (int i = 0; i < (int)o->length; ++i) {-
94 no->table()[i] = offset;-
95-
96 const Entry *e = o->entryAt(i);-
97 Entry *ne = no->entryAt(i);-
98 int s = e->size();-
99 memcpy(ne, e, s);-
100 offset += s;-
101 int dataSize = e->value.usedStorage(o);-
102 if (dataSize) {-
103 memcpy((char *)no + offset, e->value.data(o), dataSize);-
104 ne->value.value = offset;-
105 offset += dataSize;-
106 }-
107 }-
108 } else {-
109 Array *a = static_cast<Array *>(base);-
110 Array *na = static_cast<Array *>(b);-
111-
112 for (int i = 0; i < (int)a->length; ++i) {-
113 const Value &v = (*a)[i];-
114 Value &nv = (*na)[i];-
115 nv = v;-
116 int dataSize = v.usedStorage(a);-
117 if (dataSize) {-
118 memcpy((char *)na + offset, v.data(a), dataSize);-
119 nv.value = offset;-
120 offset += dataSize;-
121 }-
122 }-
123 }-
124 Q_ASSERT(offset == (int)b->tableOffset);-
125-
126 free(header);-
127 header = h;-
128 this->alloc = alloc;-
129 compactionCounter = 0;-
130}-
131-
132bool Data::valid() const-
133{-
134 if (header->tag != QJsonDocument::BinaryFormatTag || header->version != 1u)-
135 return false;-
136-
137 bool res = false;-
138 Base *root = header->root();-
139 int maxSize = alloc - sizeof(Header);-
140 if (root->is_object)-
141 res = static_cast<Object *>(root)->isValid(maxSize);-
142 else-
143 res = static_cast<Array *>(root)->isValid(maxSize);-
144-
145 return res;-
146}-
147-
148-
149int Base::reserveSpace(uint dataSize, int posInTable, uint numItems, bool replace)-
150{-
151 Q_ASSERT(posInTable >= 0 && posInTable <= (int)length);-
152 if (size + dataSize >= Value::MaxSize) {-
153 qWarning("QJson: Document too large to store in data structure %d %d %d", (uint)size, dataSize, Value::MaxSize);-
154 return 0;-
155 }-
156-
157 offset off = tableOffset;-
158 // move table to new position-
159 if (replace) {-
160 memmove((char *)(table()) + dataSize, table(), length*sizeof(offset));-
161 } else {-
162 memmove((char *)(table() + posInTable + numItems) + dataSize, table() + posInTable, (length - posInTable)*sizeof(offset));-
163 memmove((char *)(table()) + dataSize, table(), posInTable*sizeof(offset));-
164 }-
165 tableOffset += dataSize;-
166 for (int i = 0; i < (int)numItems; ++i)-
167 table()[posInTable + i] = off;-
168 size += dataSize;-
169 if (!replace) {-
170 length += numItems;-
171 size += numItems * sizeof(offset);-
172 }-
173 return off;-
174}-
175-
176void Base::removeItems(int pos, int numItems)-
177{-
178 Q_ASSERT(pos >= 0 && pos <= (int)length);-
179 if (pos + numItems < (int)length)-
180 memmove(table() + pos, table() + pos + numItems, (length - pos - numItems)*sizeof(offset));-
181 length -= numItems;-
182}-
183-
184int Object::indexOf(const QString &key, bool *exists) const-
185{-
186 int min = 0;-
187 int n = length;-
188 while (n > 0) {
n > 0Description
TRUEevaluated 2494 times by 2 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
FALSEevaluated 1188 times by 2 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
1188-2494
189 int half = n >> 1;-
190 int middle = min + half;-
191 if (*entryAt(middle) >= key) {
*entryAt(middle) >= keyDescription
TRUEevaluated 1676 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 818 times by 2 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
818-1676
192 n = half;-
193 } else {
executed 1676 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
1676
194 min = middle + 1;-
195 n -= half + 1;-
196 }
executed 818 times by 2 tests: end of block
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
818
197 }-
198 if (min < (int)length && *entryAt(min) == key) {
min < (int)lengthDescription
TRUEevaluated 1180 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QMetaType
*entryAt(min) == keyDescription
TRUEevaluated 1025 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 155 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
8-1180
199 *exists = true;-
200 return min;
executed 1025 times by 1 test: return min;
Executed by:
  • tst_QNetworkCookieJar
1025
201 }-
202 *exists = false;-
203 return min;
executed 163 times by 2 tests: return min;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
163
204}-
205-
206int Object::indexOf(QLatin1String key, bool *exists) const-
207{-
208 int min = 0;-
209 int n = length;-
210 while (n > 0) {
n > 0Description
TRUEevaluated 215416 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 86439 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
86439-215416
211 int half = n >> 1;-
212 int middle = min + half;-
213 if (*entryAt(middle) >= key) {
*entryAt(middle) >= keyDescription
TRUEevaluated 169679 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 45737 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
45737-169679
214 n = half;-
215 } else {
executed 169679 times by 115 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
169679
216 min = middle + 1;-
217 n -= half + 1;-
218 }
executed 45737 times by 115 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
45737
219 }-
220 if (min < (int)length && *entryAt(min) == key) {
min < (int)lengthDescription
TRUEevaluated 86380 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 59 times by 2 tests
Evaluated by:
  • tst_QFactoryLoader
  • tst_QOpenGlConfig
*entryAt(min) == keyDescription
TRUEevaluated 86285 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 95 times by 1 test
Evaluated by:
  • tst_QOpenGlConfig
59-86380
221 *exists = true;-
222 return min;
executed 86285 times by 115 tests: return min;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
86285
223 }-
224 *exists = false;-
225 return min;
executed 154 times by 2 tests: return min;
Executed by:
  • tst_QFactoryLoader
  • tst_QOpenGlConfig
154
226}-
227-
228bool Object::isValid(int maxSize) const-
229{-
230 if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)-
231 return false;-
232-
233 QString lastKey;-
234 for (uint i = 0; i < length; ++i) {-
235 offset entryOffset = table()[i];-
236 if (entryOffset + sizeof(Entry) >= tableOffset)-
237 return false;-
238 Entry *e = entryAt(i);-
239 if (!e->isValid(tableOffset - table()[i]))-
240 return false;-
241 QString key = e->key();-
242 if (key < lastKey)-
243 return false;-
244 if (!e->value.isValid(this))-
245 return false;-
246 lastKey = key;-
247 }-
248 return true;-
249}-
250-
251-
252-
253bool Array::isValid(int maxSize) const-
254{-
255 if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)-
256 return false;-
257-
258 for (uint i = 0; i < length; ++i) {-
259 if (!at(i).isValid(this))-
260 return false;-
261 }-
262 return true;-
263}-
264-
265-
266bool Entry::operator ==(const QString &key) const-
267{-
268 if (value.latinKey)-
269 return (shallowLatin1Key() == key);-
270 else-
271 return (shallowKey() == key);-
272}-
273-
274bool Entry::operator==(QLatin1String key) const-
275{-
276 if (value.latinKey)
value.latinKeyDescription
TRUEevaluated 86380 times by 115 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEnever evaluated
0-86380
277 return shallowLatin1Key() == key;
executed 86380 times by 115 tests: return shallowLatin1Key() == key;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
86380
278 else-
279 return shallowKey() == key;
never executed: return shallowKey() == key;
0
280}-
281-
282bool Entry::operator ==(const Entry &other) const-
283{-
284 if (value.latinKey) {-
285 if (other.value.latinKey)-
286 return shallowLatin1Key() == other.shallowLatin1Key();-
287 return shallowLatin1Key() == other.shallowKey();-
288 } else if (other.value.latinKey) {-
289 return shallowKey() == other.shallowLatin1Key();-
290 }-
291 return shallowKey() == other.shallowKey();-
292}-
293-
294bool Entry::operator >=(const Entry &other) const-
295{-
296 if (value.latinKey) {-
297 if (other.value.latinKey)-
298 return shallowLatin1Key() >= other.shallowLatin1Key();-
299 return shallowLatin1Key() >= other.shallowKey();-
300 } else if (other.value.latinKey) {-
301 return shallowKey() >= other.shallowLatin1Key();-
302 }-
303 return shallowKey() >= other.shallowKey();-
304}-
305-
306-
307int Value::usedStorage(const Base *b) const-
308{-
309 int s = 0;-
310 switch (type) {-
311 case QJsonValue::Double:-
312 if (latinOrIntValue)-
313 break;-
314 s = sizeof(double);-
315 break;-
316 case QJsonValue::String: {-
317 char *d = data(b);-
318 if (latinOrIntValue)-
319 s = sizeof(ushort) + qFromLittleEndian(*(ushort *)d);-
320 else-
321 s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);-
322 break;-
323 }-
324 case QJsonValue::Array:-
325 case QJsonValue::Object:-
326 s = base(b)->size;-
327 break;-
328 case QJsonValue::Null:-
329 case QJsonValue::Bool:-
330 default:-
331 break;-
332 }-
333 return alignedSize(s);-
}
inline bool isValidValueOffset(uint offset, uint tableOffset)
{
return offset >= sizeof(Base)
&& offset + sizeof(uint) <= tableOffset;}
335-
336bool Value::isValid(const Base *b) const-
337{-
338 int offset = 0;-
339 switch (type) {-
340 case QJsonValue::NullDouble:
executed 704 times by 111 tests: case QJsonValue::Double:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704
341 if (latinOrIntValue)
latinOrIntValueDescription
TRUEevaluated 704 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEnever evaluated
0-704
342 break;
executed 704 times by 111 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704
343 // fall through-
344 case QJsonValue::BoolString:
code before this statement never executed: case QJsonValue::String:
executed 2631 times by 111 tests: case QJsonValue::String:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-2631
345 return true;case QJsonValue::DoubleArray:
executed 924 times by 108 tests: case QJsonValue::Array:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
924
346 return latinOrIntValue || isValidValueOffset(case QJsonValue::Object:
executed 704 times by 111 tests: case QJsonValue::Object:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704
347 offset = value, b->tableOffset);;-
348 break;
executed 4259 times by 111 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
4259
349 case QJsonValue::StringNull:
never executed: case QJsonValue::Null:
0
350 case QJsonValue::Bool:
executed 704 times by 111 tests: case QJsonValue::Bool:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704
351 default
never executed: default:
:
never executed: default:
0
352 break;
executed 704 times by 111 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704
353 }-
354-
355 if (!isValidValueOffsetoffset)
!offsetDescription
TRUEevaluated 1408 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
1408-4259
356 return true;
executed 1408 times by 111 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
1408
357 if
offset + sizeo...b->tableOffsetDescription
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
(value,offset + sizeof(uint) > b->tableOffset)))
offset + sizeo...b->tableOffsetDescription
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-4259
358 return false;
never executed: return false;
0
359-
360 ifint s = usedStorage(latinOrIntValueb);-
361 if (!s
!sDescription
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
)
!sDescription
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-4259
362 return asLatin1Stringtrue;
never executed: return true;
0
363 if
s < 0Description
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
s > (int)b->ta...ffset - offsetDescription
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
(b).isValids < 0 || s > (int)b->tableOffset - value);offset)
s < 0Description
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
s > (int)b->ta...ffset - offsetDescription
TRUEnever evaluated
FALSEevaluated 4259 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
0-4259
364 return asString(b).isValidfalse;
never executed: return false;
0
365 if
type == QJsonValue::ArrayDescription
TRUEevaluated 924 times by 108 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 3335 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
(b->tableOffset - value);
type == QJsonValue::ArrayDescription
TRUEevaluated 924 times by 108 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 3335 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
924-3335
case
type == QJsonValue::ArrayDescription
TRUEevaluated 924 times by 108 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 3335 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
type == QJsonValue::Array:
type == QJsonValue::ArrayDescription
TRUEevaluated 924 times by 108 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 3335 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
return isValidValueOffset(value, b->tableOffset
type == QJsonValue::ArrayDescription
TRUEevaluated 924 times by 108 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 3335 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
)
type == QJsonValue::ArrayDescription
TRUEevaluated 924 times by 108 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 3335 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
366 &&return static_cast<Array *>(base(b))->isValid(b->tableOffset - values);
executed 924 times by 108 tests: return static_cast<Array *>(base(b))->isValid(s);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
924
367 caseif (type == QJsonValue::Object:
type == QJsonValue::ObjectDescription
TRUEevaluated 704 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 2631 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704-2631
return isValidValueOffset(value, b->tableOffset
type == QJsonValue::ObjectDescription
TRUEevaluated 704 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 2631 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
)
type == QJsonValue::ObjectDescription
TRUEevaluated 704 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 2631 times by 111 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
368 &&return static_cast<Object *>(base(b))->isValid(b->tableOffset - values);
executed 704 times by 111 tests: return static_cast<Object *>(base(b))->isValid(s);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
704
369 default:return falsetrue;
executed 2631 times by 111 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
2631
}}
371-
372/*!-
373 \internal-
374 */-
375int Value::requiredStorage(QJsonValue &v, bool *compressed)-
376{-
377 *compressed = false;-
378 switch (v.t) {-
379 case QJsonValue::Double:-
380 if (QJsonPrivate::compressedNumber(v.dbl) != INT_MAX) {-
381 *compressed = true;-
382 return 0;-
383 }-
384 return sizeof(double);-
385 case QJsonValue::String: {-
386 QString s = v.toString();-
387 *compressed = QJsonPrivate::useCompressed(s);-
388 return QJsonPrivate::qStringSize(s, *compressed);-
389 }-
390 case QJsonValue::Array:-
391 case QJsonValue::Object:-
392 if (v.d && v.d->compactionCounter) {-
393 v.detach();-
394 v.d->compact();-
395 v.base = static_cast<QJsonPrivate::Base *>(v.d->header->root());-
396 }-
397 return v.base ? v.base->size : sizeof(QJsonPrivate::Base);-
398 case QJsonValue::Undefined:-
399 case QJsonValue::Null:-
400 case QJsonValue::Bool:-
401 break;-
402 }-
403 return 0;-
404}-
405-
406/*!-
407 \internal-
408 */-
409uint Value::valueToStore(const QJsonValue &v, uint offset)-
410{-
411 switch (v.t) {-
412 case QJsonValue::Undefined:-
413 case QJsonValue::Null:-
414 break;-
415 case QJsonValue::Bool:-
416 return v.b;-
417 case QJsonValue::Double: {-
418 int c = QJsonPrivate::compressedNumber(v.dbl);-
419 if (c != INT_MAX)-
420 return c;-
421 }-
422 // fall through-
423 case QJsonValue::String:-
424 case QJsonValue::Array:-
425 case QJsonValue::Object:-
426 return offset;-
427 }-
428 return 0;-
429}-
430-
431/*!-
432 \internal-
433 */-
434void Value::copyData(const QJsonValue &v, char *dest, bool compressed)-
435{-
436 switch (v.t) {-
437 case QJsonValue::Double:
never executed: case QJsonValue::Double:
0
438 if (!compressed) {
!compressedDescription
TRUEnever evaluated
FALSEnever evaluated
0
439 qToLittleEndian(v.ui, (uchar *)dest);-
440 }
never executed: end of block
0
441 break;
never executed: break;
0
442 case QJsonValue::String: {
executed 4 times by 1 test: case QJsonValue::String:
Executed by:
  • tst_QMetaType
4
443 QString str = v.toString();-
444 QJsonPrivate::copyString(dest, str, compressed);-
445 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_QMetaType
4
446 }-
447 case QJsonValue::Array:
never executed: case QJsonValue::Array:
0
448 case QJsonValue::Object: {
never executed: case QJsonValue::Object:
0
449 const QJsonPrivate::Base *b = v.base;-
450 if (!b)
!bDescription
TRUEnever evaluated
FALSEnever evaluated
0
451 b = (v.t == QJsonValue::Array ? &emptyArray : &emptyObject);
never executed: b = (v.t == QJsonValue::Array ? &emptyArray : &emptyObject);
v.t == QJsonValue::ArrayDescription
TRUEnever evaluated
FALSEnever evaluated
0
452 memcpy(dest, b, b->size);-
453 break;
never executed: break;
0
454 }-
455 default:
never executed: default:
0
456 break;
never executed: break;
0
457 }-
458}-
459-
460} // namespace QJsonPrivate-
461-
462QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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