OpenCoverage

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)
!compactionCounterDescription
TRUEnever evaluated
FALSEnever evaluated
0
63 return;
never executed: return;
0
64-
65 Base *base = header->root();-
66 int reserve = 0;-
67 if (base->is_object) {
base->is_objectDescription
TRUEnever evaluated
FALSEnever evaluated
0
68 Object *o = static_cast<Object *>(base);-
69 for (int i = 0; i < (int)o->length; ++i)
i < (int)o->lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
70 reserve += o->entryAt(i)->usedStorage(o);
never executed: reserve += o->entryAt(i)->usedStorage(o);
0
71 } else {
never executed: end of block
0
72 Array *a = static_cast<Array *>(base);-
73 for (int i = 0; i < (int)a->length; ++i)
i < (int)a->lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
74 reserve += (*a)[i].usedStorage(a);
never executed: reserve += (*a)[i].usedStorage(a);
0
75 }
never executed: end of block
0
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) {
b->is_objectDescription
TRUEnever evaluated
FALSEnever evaluated
0
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) {
i < (int)o->lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
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) {
dataSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
103 memcpy((char *)no + offset, e->value.data(o), dataSize);-
104 ne->value.value = offset;-
105 offset += dataSize;-
106 }
never executed: end of block
0
107 }
never executed: end of block
0
108 } else {
never executed: end of block
0
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) {
i < (int)a->lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
113 const Value &v = (*a)[i];-
114 Value &nv = (*na)[i];-
115 nv = v;-
116 int dataSize = v.usedStorage(a);-
117 if (dataSize) {
dataSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
118 memcpy((char *)na + offset, v.data(a), dataSize);-
119 nv.value = offset;-
120 offset += dataSize;-
121 }
never executed: end of block
0
122 }
never executed: end of block
0
123 }
never executed: end of block
0
124 Q_ASSERT(offset == (int)b->tableOffset);-
125-
126 free(header);-
127 header = h;-
128 this->alloc = alloc;-
129 compactionCounter = 0;-
130}
never executed: end of block
0
131-
132bool Data::valid() const-
133{-
134 if (header->tag != QJsonDocument::BinaryFormatTag || header->version != 1u)
header->tag !=...inaryFormatTagDescription
TRUEnever evaluated
FALSEevaluated 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
  • ...
header->version != 1uDescription
TRUEnever evaluated
FALSEevaluated 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
  • ...
0-704
135 return false;
never executed: return false;
0
136-
137 bool res = false;-
138 Base *root = header->root();-
139 int maxSize = alloc - sizeof(Header);-
140 if (root->is_object)
root->is_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
  • ...
FALSEnever evaluated
0-704
141 res = static_cast<Object *>(root)->isValid(maxSize);
executed 704 times by 111 tests: res = static_cast<Object *>(root)->isValid(maxSize);
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
142 else-
143 res = static_cast<Array *>(root)->isValid(maxSize);
never executed: res = static_cast<Array *>(root)->isValid(maxSize);
0
144-
145 return res;
executed 704 times by 111 tests: return res;
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
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) {
size + dataSiz...Value::MaxSizeDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMetaType
0-16
153 qWarning("QJson: Document too large to store in data structure %d %d %d", (uint)size, dataSize, Value::MaxSize);-
154 return 0;
never executed: return 0;
0
155 }-
156-
157 offset off = tableOffset;-
158 // move table to new position-
159 if (replace) {
replaceDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMetaType
0-16
160 memmove((char *)(table()) + dataSize, table(), length*sizeof(offset));-
161 } else {
never executed: end of block
0
162 memmove((char *)(table() + posInTable + numItems) + dataSize, table() + posInTable, (length - posInTable)*sizeof(offset));-
163 memmove((char *)(table()) + dataSize, table(), posInTable*sizeof(offset));-
164 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_QMetaType
16
165 tableOffset += dataSize;-
166 for (int i = 0; i < (int)numItems; ++i)
i < (int)numItemsDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMetaType
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMetaType
16
167 table()[posInTable + i] = off;
executed 16 times by 1 test: table()[posInTable + i] = off;
Executed by:
  • tst_QMetaType
16
168 size += dataSize;-
169 if (!replace) {
!replaceDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QMetaType
FALSEnever evaluated
0-16
170 length += numItems;-
171 size += numItems * sizeof(offset);-
172 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_QMetaType
16
173 return off;
executed 16 times by 1 test: return off;
Executed by:
  • tst_QMetaType
16
174}-
175-
176void Base::removeItems(int pos, int numItems)-
177{-
178 Q_ASSERT(pos >= 0 && pos <= (int)length);-
179 if (pos + numItems < (int)length)
pos + numItems < (int)lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
180 memmove(table() + pos, table() + pos + numItems, (length - pos - numItems)*sizeof(offset));
never executed: memmove(table() + pos, table() + pos + numItems, (length - pos - numItems)*sizeof(offset));
0
181 length -= numItems;-
182}
never executed: end of block
0
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)
size > (uint)maxSizeDescription
TRUEnever evaluated
FALSEevaluated 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
  • ...
tableOffset + ...offset) > sizeDescription
TRUEnever evaluated
FALSEevaluated 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
  • ...
0-1408
231 return false;
never executed: return false;
0
232-
233 QString lastKey;-
234 for (uint i = 0; i < length; ++i) {
i < lengthDescription
TRUEevaluated 4444 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 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
  • ...
1408-4444
235 offset entryOffset = table()[i];-
236 if (entryOffset + sizeof(Entry) >= tableOffset)
entryOffset + ...>= tableOffsetDescription
TRUEnever evaluated
FALSEevaluated 4444 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-4444
237 return false;
never executed: return false;
0
238 Entry *e = entryAt(i);-
239 if (!e->isValid(tableOffset - table()[i]))
!e->isValid(ta... - table()[i])Description
TRUEnever evaluated
FALSEevaluated 4444 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-4444
240 return false;
never executed: return false;
0
241 QString key = e->key();-
242 if (key < lastKey)
key < lastKeyDescription
TRUEnever evaluated
FALSEevaluated 4444 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-4444
243 return false;
never executed: return false;
0
244 if (!e->value.isValid(this))
!e->value.isValid(this)Description
TRUEnever evaluated
FALSEevaluated 4444 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-4444
245 return false;
never executed: return false;
0
246 lastKey = key;-
247 }
executed 4444 times by 111 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
  • ...
4444
248 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
249}-
250-
251-
252-
253bool Array::isValid(int maxSize) const-
254{-
255 if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)
size > (uint)maxSizeDescription
TRUEnever evaluated
FALSEevaluated 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
  • ...
tableOffset + ...offset) > sizeDescription
TRUEnever evaluated
FALSEevaluated 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
  • ...
0-924
256 return false;
never executed: return false;
0
257-
258 for (uint i = 0; i < length; ++i) {
i < lengthDescription
TRUEevaluated 1223 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 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
  • ...
924-1223
259 if (!at(i).isValid(this))
!at(i).isValid(this)Description
TRUEnever evaluated
FALSEevaluated 1223 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
  • ...
0-1223
260 return false;
never executed: return false;
0
261 }
executed 1223 times by 108 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_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
1223
262 return true;
executed 924 times by 108 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_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
924
263}-
264-
265-
266bool Entry::operator ==(const QString &key) const-
267{-
268 if (value.latinKey)
value.latinKeyDescription
TRUEevaluated 1180 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEnever evaluated
0-1180
269 return (shallowLatin1Key() == key);
executed 1180 times by 1 test: return (shallowLatin1Key() == key);
Executed by:
  • tst_QNetworkCookieJar
1180
270 else-
271 return (shallowKey() == key);
never executed: return (shallowKey() == key);
0
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) {
value.latinKeyDescription
TRUEevaluated 711 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
0-711
285 if (other.value.latinKey)
other.value.latinKeyDescription
TRUEevaluated 711 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
0-711
286 return shallowLatin1Key() == other.shallowLatin1Key();
executed 711 times by 3 tests: return shallowLatin1Key() == other.shallowLatin1Key();
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
711
287 return shallowLatin1Key() == other.shallowKey();
never executed: return shallowLatin1Key() == other.shallowKey();
0
288 } else if (other.value.latinKey) {
other.value.latinKeyDescription
TRUEnever evaluated
FALSEnever evaluated
0
289 return shallowKey() == other.shallowLatin1Key();
never executed: return shallowKey() == other.shallowLatin1Key();
0
290 }-
291 return shallowKey() == other.shallowKey();
never executed: return shallowKey() == other.shallowKey();
0
292}-
293-
294bool Entry::operator >=(const Entry &other) const-
295{-
296 if (value.latinKey) {
value.latinKeyDescription
TRUEevaluated 1397 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
0-1397
297 if (other.value.latinKey)
other.value.latinKeyDescription
TRUEevaluated 1397 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
0-1397
298 return shallowLatin1Key() >= other.shallowLatin1Key();
executed 1397 times by 3 tests: return shallowLatin1Key() >= other.shallowLatin1Key();
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1397
299 return shallowLatin1Key() >= other.shallowKey();
never executed: return shallowLatin1Key() >= other.shallowKey();
0
300 } else if (other.value.latinKey) {
other.value.latinKeyDescription
TRUEnever evaluated
FALSEnever evaluated
0
301 return shallowKey() >= other.shallowLatin1Key();
never executed: return shallowKey() >= other.shallowLatin1Key();
0
302 }-
303 return shallowKey() >= other.shallowKey();
never executed: return shallowKey() >= other.shallowKey();
0
304}-
305-
306-
307int Value::usedStorage(const Base *b) const-
308{-
309 int s = 0;-
310 switch (type) {-
311 case QJsonValue::Double:
never executed: case QJsonValue::Double:
0
312 if (latinOrIntValue)
latinOrIntValueDescription
TRUEnever evaluated
FALSEnever evaluated
0
313 break;
never executed: break;
0
314 s = sizeof(double);-
315 break;
never executed: break;
0
316 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
  • ...
2631
317 char *d = data(b);-
318 if (latinOrIntValue)
latinOrIntValueDescription
TRUEevaluated 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
  • ...
FALSEnever evaluated
0-2631
319 s = sizeof(ushort) + qFromLittleEndian(*(ushort *)d);
executed 2631 times by 111 tests: s = sizeof(ushort) + qFromLittleEndian(*(ushort *)d);
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
320 else-
321 s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);
never executed: s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d);
0
322 break;
executed 2631 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
  • ...
2631
323 }-
324 case QJsonValue::Array:
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
325 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
326 s = base(b)->size;-
327 break;
executed 1628 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
  • ...
1628
328 case QJsonValue::Null:
never executed: case QJsonValue::Null:
0
329 case QJsonValue::Bool:
never executed: case QJsonValue::Bool:
0
330 default:
never executed: default:
0
331 break;
never executed: break;
0
332 }-
333 return alignedSize(s);
executed 4259 times by 111 tests: return alignedSize(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
  • ...
4259
334}-
335-
336bool Value::isValid(const Base *b) const-
337{-
338 int offset = 0;-
339 switch (type) {-
340 case QJsonValue::Double:
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::String:
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 case QJsonValue::Array:
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 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;-
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::Null:
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:
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 (!offset)
!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 + 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 int s = usedStorage(b);-
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
  • ...
0-4259
362 return true;
never executed: return true;
0
363 if (s < 0 || s > (int)b->tableOffset - 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 false;
never executed: return false;
0
365 if (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
  • ...
924-3335
366 return static_cast<Array *>(base(b))->isValid(s);
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 if (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
368 return static_cast<Object *>(base(b))->isValid(s);
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 return true;
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
370}-
371-
372/*!-
373 \internal-
374 */-
375int Value::requiredStorage(QJsonValue &v, bool *compressed)-
376{-
377 *compressed = false;-
378 switch (v.t) {-
379 case QJsonValue::Double:
executed 4 times by 1 test: case QJsonValue::Double:
Executed by:
  • tst_QMetaType
4
380 if (QJsonPrivate::compressedNumber(v.dbl) != INT_MAX) {
QJsonPrivate::... != 2147483647Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMetaType
FALSEnever evaluated
0-4
381 *compressed = true;-
382 return 0;
executed 4 times by 1 test: return 0;
Executed by:
  • tst_QMetaType
4
383 }-
384 return sizeof(double);
never executed: return sizeof(double);
0
385 case QJsonValue::String: {
executed 4 times by 1 test: case QJsonValue::String:
Executed by:
  • tst_QMetaType
4
386 QString s = v.toString();-
387 *compressed = QJsonPrivate::useCompressed(s);-
388 return QJsonPrivate::qStringSize(s, *compressed);
executed 4 times by 1 test: return QJsonPrivate::qStringSize(s, *compressed);
Executed by:
  • tst_QMetaType
4
389 }-
390 case QJsonValue::Array:
never executed: case QJsonValue::Array:
0
391 case QJsonValue::Object:
never executed: case QJsonValue::Object:
0
392 if (v.d && v.d->compactionCounter) {
v.dDescription
TRUEnever evaluated
FALSEnever evaluated
v.d->compactionCounterDescription
TRUEnever evaluated
FALSEnever evaluated
0
393 v.detach();-
394 v.d->compact();-
395 v.base = static_cast<QJsonPrivate::Base *>(v.d->header->root());-
396 }
never executed: end of block
0
397 return v.base ? v.base->size : sizeof(QJsonPrivate::Base);
never executed: return v.base ? v.base->size : sizeof(QJsonPrivate::Base);
0
398 case QJsonValue::Undefined:
never executed: case QJsonValue::Undefined:
0
399 case QJsonValue::Null:
executed 4 times by 1 test: case QJsonValue::Null:
Executed by:
  • tst_QMetaType
4
400 case QJsonValue::Bool:
executed 4 times by 1 test: case QJsonValue::Bool:
Executed by:
  • tst_QMetaType
4
401 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_QMetaType
8
402 }-
403 return 0;
executed 8 times by 1 test: return 0;
Executed by:
  • tst_QMetaType
8
404}-
405-
406/*!-
407 \internal-
408 */-
409uint Value::valueToStore(const QJsonValue &v, uint offset)-
410{-
411 switch (v.t) {-
412 case QJsonValue::Undefined:
never executed: case QJsonValue::Undefined:
0
413 case QJsonValue::Null:
executed 4 times by 1 test: case QJsonValue::Null:
Executed by:
  • tst_QMetaType
4
414 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_QMetaType
4
415 case QJsonValue::Bool:
executed 4 times by 1 test: case QJsonValue::Bool:
Executed by:
  • tst_QMetaType
4
416 return v.b;
executed 4 times by 1 test: return v.b;
Executed by:
  • tst_QMetaType
4
417 case QJsonValue::Double: {
executed 4 times by 1 test: case QJsonValue::Double:
Executed by:
  • tst_QMetaType
4
418 int c = QJsonPrivate::compressedNumber(v.dbl);-
419 if (c != INT_MAX)
c != 2147483647Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QMetaType
FALSEnever evaluated
0-4
420 return c;
executed 4 times by 1 test: return c;
Executed by:
  • tst_QMetaType
4
421 }-
422 // fall through-
423 case QJsonValue::String:
code before this statement never executed: case QJsonValue::String:
executed 4 times by 1 test: case QJsonValue::String:
Executed by:
  • tst_QMetaType
0-4
424 case QJsonValue::Array:
never executed: case QJsonValue::Array:
0
425 case QJsonValue::Object:
never executed: case QJsonValue::Object:
0
426 return offset;
executed 4 times by 1 test: return offset;
Executed by:
  • tst_QMetaType
4
427 }-
428 return 0;
executed 4 times by 1 test: return 0;
Executed by:
  • tst_QMetaType
4
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, 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