| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | | - |
| 16 | | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | | - |
| 29 | | - |
| 30 | | - |
| 31 | | - |
| 32 | | - |
| 33 | | - |
| 34 | #include "qjson_p.h" | - |
| 35 | #include <qalgorithms.h> | - |
| 36 | | - |
| 37 | QT_BEGIN_NAMESPACE | - |
| 38 | | - |
| 39 | namespace QJsonPrivate | - |
| 40 | { | - |
| 41 | | - |
| 42 | #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN | - |
| 43 | #define Q_TO_LITTLE_ENDIAN(x) (x) | - |
| 44 | #else | - |
| 45 | #define Q_TO_LITTLE_ENDIAN(x) ( ((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | ((x & 0xff000000) >> 24) ) | - |
| 46 | #endif | - |
| 47 | | - |
| 48 | static const Base emptyArray = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } }; | - |
| 49 | static const Base emptyObject = { { Q_TO_LITTLE_ENDIAN(sizeof(Base)) }, { 0 }, { 0 } }; | - |
| 50 | | - |
| 51 | | - |
| 52 | void Data::compact() | - |
| 53 | { | - |
| 54 | Q_ASSERT(sizeof(Value) == sizeof(offset)); | - |
| 55 | | - |
| 56 | if (!compactionCounter)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 57 | return; never executed: return; | 0 |
| 58 | | - |
| 59 | Base *base = header->root(); | - |
| 60 | int reserve = 0; | - |
| 61 | if (base->is_object) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 62 | Object *o = static_cast<Object *>(base); | - |
| 63 | for (int i = 0; i < (int)o->length; ++i)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 64 | reserve += o->entryAt(i)->usedStorage(o); never executed: reserve += o->entryAt(i)->usedStorage(o); | 0 |
| 65 | } else { never executed: end of block | 0 |
| 66 | Array *a = static_cast<Array *>(base); | - |
| 67 | for (int i = 0; i < (int)a->length; ++i)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 68 | reserve += (*a)[i].usedStorage(a); never executed: reserve += (*a)[i].usedStorage(a); | 0 |
| 69 | } never executed: end of block | 0 |
| 70 | | - |
| 71 | int size = sizeof(Base) + reserve + base->length*sizeof(offset); | - |
| 72 | int alloc = sizeof(Header) + size; | - |
| 73 | Header *h = (Header *) malloc(alloc); | - |
| 74 | h->tag = QJsonDocument::BinaryFormatTag; | - |
| 75 | h->version = 1; | - |
| 76 | Base *b = h->root(); | - |
| 77 | b->size = size; | - |
| 78 | b->is_object = header->root()->is_object; | - |
| 79 | b->length = base->length; | - |
| 80 | b->tableOffset = reserve + sizeof(Array); | - |
| 81 | | - |
| 82 | int offset = sizeof(Base); | - |
| 83 | if (b->is_object) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 84 | Object *o = static_cast<Object *>(base); | - |
| 85 | Object *no = static_cast<Object *>(b); | - |
| 86 | | - |
| 87 | for (int i = 0; i < (int)o->length; ++i) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 88 | no->table()[i] = offset; | - |
| 89 | | - |
| 90 | const Entry *e = o->entryAt(i); | - |
| 91 | Entry *ne = no->entryAt(i); | - |
| 92 | int s = e->size(); | - |
| 93 | memcpy(ne, e, s); | - |
| 94 | offset += s; | - |
| 95 | int dataSize = e->value.usedStorage(o); | - |
| 96 | if (dataSize) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 97 | memcpy((char *)no + offset, e->value.data(o), dataSize); | - |
| 98 | ne->value.value = offset; | - |
| 99 | offset += dataSize; | - |
| 100 | } never executed: end of block | 0 |
| 101 | } never executed: end of block | 0 |
| 102 | } else { never executed: end of block | 0 |
| 103 | Array *a = static_cast<Array *>(base); | - |
| 104 | Array *na = static_cast<Array *>(b); | - |
| 105 | | - |
| 106 | for (int i = 0; i < (int)a->length; ++i) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 107 | const Value &v = (*a)[i]; | - |
| 108 | Value &nv = (*na)[i]; | - |
| 109 | nv = v; | - |
| 110 | int dataSize = v.usedStorage(a); | - |
| 111 | if (dataSize) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 112 | memcpy((char *)na + offset, v.data(a), dataSize); | - |
| 113 | nv.value = offset; | - |
| 114 | offset += dataSize; | - |
| 115 | } never executed: end of block | 0 |
| 116 | } never executed: end of block | 0 |
| 117 | } never executed: end of block | 0 |
| 118 | Q_ASSERT(offset == (int)b->tableOffset); | - |
| 119 | | - |
| 120 | free(header); | - |
| 121 | header = h; | - |
| 122 | this->alloc = alloc; | - |
| 123 | compactionCounter = 0; | - |
| 124 | } never executed: end of block | 0 |
| 125 | | - |
| 126 | bool Data::valid() const | - |
| 127 | { | - |
| 128 | if (header->tag != QJsonDocument::BinaryFormatTag || header->version != 1u)| TRUE | never evaluated | | FALSE | evaluated 679 times by 110 testsEvaluated 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
- ...
|
| TRUE | never evaluated | | FALSE | evaluated 679 times by 110 testsEvaluated 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-679 |
| 129 | return false; never executed: return false; | 0 |
| 130 | | - |
| 131 | bool res = false; | - |
| 132 | Base *root = header->root(); | - |
| 133 | int maxSize = alloc - sizeof(Header); | - |
| 134 | if (root->is_object)| TRUE | evaluated 679 times by 110 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-679 |
| 135 | res = static_cast<Object *>(root)->isValid(maxSize);executed 679 times by 110 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
- ...
| 679 |
| 136 | else | - |
| 137 | res = static_cast<Array *>(root)->isValid(maxSize); never executed: res = static_cast<Array *>(root)->isValid(maxSize); | 0 |
| 138 | | - |
| 139 | return res;executed 679 times by 110 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
- ...
| 679 |
| 140 | } | - |
| 141 | | - |
| 142 | | - |
| 143 | int Base::reserveSpace(uint dataSize, int posInTable, uint numItems, bool replace) | - |
| 144 | { | - |
| 145 | Q_ASSERT(posInTable >= 0 && posInTable <= (int)length); | - |
| 146 | if (size + dataSize >= Value::MaxSize) {| TRUE | never evaluated | | FALSE | evaluated 16 times by 1 test |
| 0-16 |
| 147 | qWarning("QJson: Document too large to store in data structure %d %d %d", (uint)size, dataSize, Value::MaxSize); | - |
| 148 | return 0; never executed: return 0; | 0 |
| 149 | } | - |
| 150 | | - |
| 151 | offset off = tableOffset; | - |
| 152 | | - |
| 153 | if (replace) {| TRUE | never evaluated | | FALSE | evaluated 16 times by 1 test |
| 0-16 |
| 154 | memmove((char *)(table()) + dataSize, table(), length*sizeof(offset)); | - |
| 155 | } else { never executed: end of block | 0 |
| 156 | memmove((char *)(table() + posInTable + numItems) + dataSize, table() + posInTable, (length - posInTable)*sizeof(offset)); | - |
| 157 | memmove((char *)(table()) + dataSize, table(), posInTable*sizeof(offset)); | - |
| 158 | }executed 16 times by 1 test: end of block | 16 |
| 159 | tableOffset += dataSize; | - |
| 160 | for (int i = 0; i < (int)numItems; ++i)| TRUE | evaluated 16 times by 1 test | | FALSE | evaluated 16 times by 1 test |
| 16 |
| 161 | table()[posInTable + i] = off;executed 16 times by 1 test: table()[posInTable + i] = off; | 16 |
| 162 | size += dataSize; | - |
| 163 | if (!replace) {| TRUE | evaluated 16 times by 1 test | | FALSE | never evaluated |
| 0-16 |
| 164 | length += numItems; | - |
| 165 | size += numItems * sizeof(offset); | - |
| 166 | }executed 16 times by 1 test: end of block | 16 |
| 167 | return off;executed 16 times by 1 test: return off; | 16 |
| 168 | } | - |
| 169 | | - |
| 170 | void Base::removeItems(int pos, int numItems) | - |
| 171 | { | - |
| 172 | Q_ASSERT(pos >= 0 && pos <= (int)length); | - |
| 173 | if (pos + numItems < (int)length)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 174 | 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 |
| 175 | length -= numItems; | - |
| 176 | } never executed: end of block | 0 |
| 177 | | - |
| 178 | int Object::indexOf(const QString &key, bool *exists) | - |
| 179 | { | - |
| 180 | int min = 0; | - |
| 181 | int n = length; | - |
| 182 | while (n > 0) {| TRUE | evaluated 217481 times by 117 testsEvaluated 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
- ...
| | FALSE | evaluated 87497 times by 117 testsEvaluated 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
- ...
|
| 87497-217481 |
| 183 | int half = n >> 1; | - |
| 184 | int middle = min + half; | - |
| 185 | if (*entryAt(middle) >= key) {| TRUE | evaluated 171071 times by 116 testsEvaluated 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
- ...
| | FALSE | evaluated 46410 times by 117 testsEvaluated 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
- ...
|
| 46410-171071 |
| 186 | n = half; | - |
| 187 | } else {executed 171071 times by 116 tests: end of blockExecuted 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
- ...
| 171071 |
| 188 | min = middle + 1; | - |
| 189 | n -= half + 1; | - |
| 190 | }executed 46410 times by 117 tests: end of blockExecuted 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
- ...
| 46410 |
| 191 | } | - |
| 192 | if (min < (int)length && *entryAt(min) == key) {| TRUE | evaluated 87430 times by 116 testsEvaluated 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
- ...
| | FALSE | evaluated 67 times by 3 testsEvaluated by:- tst_QFactoryLoader
- tst_QMetaType
- tst_QOpenGlConfig
|
| TRUE | evaluated 87180 times by 116 testsEvaluated 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
- ...
| | FALSE | evaluated 250 times by 2 testsEvaluated by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
|
| 67-87430 |
| 193 | *exists = true; | - |
| 194 | return min;executed 87180 times by 116 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
- ...
| 87180 |
| 195 | } | - |
| 196 | *exists = false; | - |
| 197 | return min;executed 317 times by 4 tests: return min;Executed by:- tst_QFactoryLoader
- tst_QMetaType
- tst_QNetworkCookieJar
- tst_QOpenGlConfig
| 317 |
| 198 | } | - |
| 199 | | - |
| 200 | bool Object::isValid(int maxSize) const | - |
| 201 | { | - |
| 202 | if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)| TRUE | never evaluated | | FALSE | evaluated 1358 times by 110 testsEvaluated 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
- ...
|
| TRUE | never evaluated | | FALSE | evaluated 1358 times by 110 testsEvaluated 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-1358 |
| 203 | return false; never executed: return false; | 0 |
| 204 | | - |
| 205 | QString lastKey; | - |
| 206 | for (uint i = 0; i < length; ++i) {| TRUE | evaluated 4291 times by 110 testsEvaluated 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
- ...
| | FALSE | evaluated 1358 times by 110 testsEvaluated 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
- ...
|
| 1358-4291 |
| 207 | offset entryOffset = table()[i]; | - |
| 208 | if (entryOffset + sizeof(Entry) >= tableOffset)| TRUE | never evaluated | | FALSE | evaluated 4291 times by 110 testsEvaluated 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-4291 |
| 209 | return false; never executed: return false; | 0 |
| 210 | Entry *e = entryAt(i); | - |
| 211 | if (!e->isValid(tableOffset - table()[i]))| TRUE | never evaluated | | FALSE | evaluated 4291 times by 110 testsEvaluated 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-4291 |
| 212 | return false; never executed: return false; | 0 |
| 213 | QString key = e->key(); | - |
| 214 | if (key < lastKey)| TRUE | never evaluated | | FALSE | evaluated 4291 times by 110 testsEvaluated 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-4291 |
| 215 | return false; never executed: return false; | 0 |
| 216 | if (!e->value.isValid(this))| TRUE | never evaluated | | FALSE | evaluated 4291 times by 110 testsEvaluated 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-4291 |
| 217 | return false; never executed: return false; | 0 |
| 218 | lastKey = key; | - |
| 219 | }executed 4291 times by 110 tests: end of blockExecuted 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
- ...
| 4291 |
| 220 | return true;executed 1358 times by 110 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
- ...
| 1358 |
| 221 | } | - |
| 222 | | - |
| 223 | | - |
| 224 | | - |
| 225 | bool Array::isValid(int maxSize) const | - |
| 226 | { | - |
| 227 | if (size > (uint)maxSize || tableOffset + length*sizeof(offset) > size)| TRUE | never evaluated | | FALSE | evaluated 896 times by 107 testsEvaluated 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
- ...
|
| TRUE | never evaluated | | FALSE | evaluated 896 times by 107 testsEvaluated 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-896 |
| 228 | return false; never executed: return false; | 0 |
| 229 | | - |
| 230 | for (uint i = 0; i < length; ++i) {| TRUE | evaluated 1187 times by 107 testsEvaluated 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
- ...
| | FALSE | evaluated 896 times by 107 testsEvaluated 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
- ...
|
| 896-1187 |
| 231 | if (!at(i).isValid(this))| TRUE | never evaluated | | FALSE | evaluated 1187 times by 107 testsEvaluated 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-1187 |
| 232 | return false; never executed: return false; | 0 |
| 233 | }executed 1187 times by 107 tests: end of blockExecuted 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
- ...
| 1187 |
| 234 | return true;executed 896 times by 107 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
- ...
| 896 |
| 235 | } | - |
| 236 | | - |
| 237 | | - |
| 238 | bool Entry::operator ==(const QString &key) const | - |
| 239 | { | - |
| 240 | if (value.latinKey)| TRUE | evaluated 87430 times by 116 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-87430 |
| 241 | return (shallowLatin1Key() == key);executed 87430 times by 116 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
- ...
| 87430 |
| 242 | else | - |
| 243 | return (shallowKey() == key); never executed: return (shallowKey() == key); | 0 |
| 244 | } | - |
| 245 | | - |
| 246 | bool Entry::operator ==(const Entry &other) const | - |
| 247 | { | - |
| 248 | if (value.latinKey) {| TRUE | evaluated 711 times by 3 testsEvaluated by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
- tst_qmakelib
| | FALSE | never evaluated |
| 0-711 |
| 249 | if (other.value.latinKey)| TRUE | evaluated 711 times by 3 testsEvaluated by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
- tst_qmakelib
| | FALSE | never evaluated |
| 0-711 |
| 250 | return shallowLatin1Key() == other.shallowLatin1Key();executed 711 times by 3 tests: return shallowLatin1Key() == other.shallowLatin1Key();Executed by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
- tst_qmakelib
| 711 |
| 251 | return shallowLatin1Key() == other.shallowKey(); never executed: return shallowLatin1Key() == other.shallowKey(); | 0 |
| 252 | } else if (other.value.latinKey) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 253 | return shallowKey() == other.shallowLatin1Key(); never executed: return shallowKey() == other.shallowLatin1Key(); | 0 |
| 254 | } | - |
| 255 | return shallowKey() == other.shallowKey(); never executed: return shallowKey() == other.shallowKey(); | 0 |
| 256 | } | - |
| 257 | | - |
| 258 | bool Entry::operator >=(const Entry &other) const | - |
| 259 | { | - |
| 260 | if (value.latinKey) {| TRUE | evaluated 1397 times by 3 testsEvaluated by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
- tst_qmakelib
| | FALSE | never evaluated |
| 0-1397 |
| 261 | if (other.value.latinKey)| TRUE | evaluated 1397 times by 3 testsEvaluated by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
- tst_qmakelib
| | FALSE | never evaluated |
| 0-1397 |
| 262 | return shallowLatin1Key() >= other.shallowLatin1Key();executed 1397 times by 3 tests: return shallowLatin1Key() >= other.shallowLatin1Key();Executed by:- tst_QNetworkCookieJar
- tst_QOpenGlConfig
- tst_qmakelib
| 1397 |
| 263 | return shallowLatin1Key() >= other.shallowKey(); never executed: return shallowLatin1Key() >= other.shallowKey(); | 0 |
| 264 | } else if (other.value.latinKey) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 265 | return shallowKey() >= other.shallowLatin1Key(); never executed: return shallowKey() >= other.shallowLatin1Key(); | 0 |
| 266 | } | - |
| 267 | return shallowKey() >= other.shallowKey(); never executed: return shallowKey() >= other.shallowKey(); | 0 |
| 268 | } | - |
| 269 | | - |
| 270 | | - |
| 271 | int Value::usedStorage(const Base *b) const | - |
| 272 | { | - |
| 273 | int s = 0; | - |
| 274 | switch (type) { | - |
| 275 | case QJsonValue::Double: never executed: case QJsonValue::Double: | 0 |
| 276 | if (latinOrIntValue)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 277 | break; never executed: break; | 0 |
| 278 | s = sizeof(double); | - |
| 279 | break; never executed: break; | 0 |
| 280 | case QJsonValue::String: { never executed: case QJsonValue::String: | 0 |
| 281 | char *d = data(b); | - |
| 282 | if (latinOrIntValue)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 283 | s = sizeof(ushort) + qFromLittleEndian(*(ushort *)d); never executed: s = sizeof(ushort) + qFromLittleEndian(*(ushort *)d); | 0 |
| 284 | else | - |
| 285 | s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d); never executed: s = sizeof(int) + sizeof(ushort) * qFromLittleEndian(*(int *)d); | 0 |
| 286 | break; never executed: break; | 0 |
| 287 | } | - |
| 288 | case QJsonValue::Array: never executed: case QJsonValue::Array: | 0 |
| 289 | case QJsonValue::Object: never executed: case QJsonValue::Object: | 0 |
| 290 | s = base(b)->size; | - |
| 291 | break; never executed: break; | 0 |
| 292 | case QJsonValue::Null: never executed: case QJsonValue::Null: | 0 |
| 293 | case QJsonValue::Bool: never executed: case QJsonValue::Bool: | 0 |
| 294 | default: never executed: default: | 0 |
| 295 | break; never executed: break; | 0 |
| 296 | } | - |
| 297 | return alignedSize(s); never executed: return alignedSize(s); | 0 |
| 298 | } | - |
| 299 | | - |
| 300 | inline bool isValidValueOffset(uint offset, uint tableOffset) | - |
| 301 | { | - |
| 302 | return offset >= sizeof(Base)executed 4120 times by 110 tests: return offset >= sizeof(Base) && offset + sizeof(uint) <= tableOffset;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
- ...
| TRUE | evaluated 4120 times by 110 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-4120 |
| 303 | && offset + sizeof(uint) <= tableOffset;executed 4120 times by 110 tests: return offset >= sizeof(Base) && offset + sizeof(uint) <= tableOffset;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
- ...
| TRUE | evaluated 4120 times by 110 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-4120 |
| 304 | } | - |
| 305 | | - |
| 306 | bool Value::isValid(const Base *b) const | - |
| 307 | { | - |
| 308 | switch (type) { | - |
| 309 | case QJsonValue::Null: never executed: case QJsonValue::Null: | 0 |
| 310 | case QJsonValue::Bool:executed 679 times by 110 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
- ...
| 679 |
| 311 | return true;executed 679 times by 110 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
- ...
| 679 |
| 312 | case QJsonValue::Double:executed 679 times by 110 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
- ...
| 679 |
| 313 | return latinOrIntValue || isValidValueOffset(value, b->tableOffset);executed 679 times by 110 tests: return latinOrIntValue || isValidValueOffset(value, b->tableOffset);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
- ...
| TRUE | never evaluated | | FALSE | never evaluated |
| 0-679 |
| 314 | case QJsonValue::String:executed 2545 times by 110 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
- ...
| 2545 |
| 315 | if (!isValidValueOffset(value, b->tableOffset))| TRUE | never evaluated | | FALSE | evaluated 2545 times by 110 testsEvaluated 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-2545 |
| 316 | return false; never executed: return false; | 0 |
| 317 | if (latinOrIntValue)| TRUE | evaluated 2545 times by 110 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-2545 |
| 318 | return asLatin1String(b).isValid(b->tableOffset - value);executed 2545 times by 110 tests: return asLatin1String(b).isValid(b->tableOffset - value);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
- ...
| 2545 |
| 319 | return asString(b).isValid(b->tableOffset - value); never executed: return asString(b).isValid(b->tableOffset - value); | 0 |
| 320 | case QJsonValue::Array:executed 896 times by 107 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
- ...
| 896 |
| 321 | return isValidValueOffset(value, b->tableOffset)executed 896 times by 107 tests: return isValidValueOffset(value, b->tableOffset) && static_cast<Array *>(base(b))->isValid(b->tableOffset - value);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
- ...
| TRUE | evaluated 896 times by 107 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-896 |
| 322 | && static_cast<Array *>(base(b))->isValid(b->tableOffset - value);executed 896 times by 107 tests: return isValidValueOffset(value, b->tableOffset) && static_cast<Array *>(base(b))->isValid(b->tableOffset - value);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
- ...
| TRUE | evaluated 896 times by 107 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-896 |
| 323 | case QJsonValue::Object:executed 679 times by 110 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
- ...
| 679 |
| 324 | return isValidValueOffset(value, b->tableOffset)executed 679 times by 110 tests: return isValidValueOffset(value, b->tableOffset) && static_cast<Object *>(base(b))->isValid(b->tableOffset - value);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
- ...
| TRUE | evaluated 679 times by 110 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-679 |
| 325 | && static_cast<Object *>(base(b))->isValid(b->tableOffset - value);executed 679 times by 110 tests: return isValidValueOffset(value, b->tableOffset) && static_cast<Object *>(base(b))->isValid(b->tableOffset - value);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
- ...
| TRUE | evaluated 679 times by 110 testsEvaluated 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
- ...
| | FALSE | never evaluated |
| 0-679 |
| 326 | default: never executed: default: | 0 |
| 327 | return false; never executed: return false; | 0 |
| 328 | } | - |
| 329 | } | - |
| 330 | | - |
| 331 | | - |
| 332 | | - |
| 333 | | - |
| 334 | int Value::requiredStorage(QJsonValue &v, bool *compressed) | - |
| 335 | { | - |
| 336 | *compressed = false; | - |
| 337 | switch (v.t) { | - |
| 338 | case QJsonValue::Double:executed 4 times by 1 test: case QJsonValue::Double: | 4 |
| 339 | if (QJsonPrivate::compressedNumber(v.dbl) != INT_MAX) {| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-4 |
| 340 | *compressed = true; | - |
| 341 | return 0;executed 4 times by 1 test: return 0; | 4 |
| 342 | } | - |
| 343 | return sizeof(double); never executed: return sizeof(double); | 0 |
| 344 | case QJsonValue::String: {executed 4 times by 1 test: case QJsonValue::String: | 4 |
| 345 | QString s = v.toString(); | - |
| 346 | *compressed = QJsonPrivate::useCompressed(s); | - |
| 347 | return QJsonPrivate::qStringSize(s, *compressed);executed 4 times by 1 test: return QJsonPrivate::qStringSize(s, *compressed); | 4 |
| 348 | } | - |
| 349 | case QJsonValue::Array: never executed: case QJsonValue::Array: | 0 |
| 350 | case QJsonValue::Object: never executed: case QJsonValue::Object: | 0 |
| 351 | if (v.d && v.d->compactionCounter) {| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 352 | v.detach(); | - |
| 353 | v.d->compact(); | - |
| 354 | v.base = static_cast<QJsonPrivate::Base *>(v.d->header->root()); | - |
| 355 | } never executed: end of block | 0 |
| 356 | return v.base ? v.base->size : sizeof(QJsonPrivate::Base); never executed: return v.base ? v.base->size : sizeof(QJsonPrivate::Base); | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 357 | case QJsonValue::Undefined: never executed: case QJsonValue::Undefined: | 0 |
| 358 | case QJsonValue::Null:executed 4 times by 1 test: case QJsonValue::Null: | 4 |
| 359 | case QJsonValue::Bool:executed 4 times by 1 test: case QJsonValue::Bool: | 4 |
| 360 | break;executed 8 times by 1 test: break; | 8 |
| 361 | } | - |
| 362 | return 0;executed 8 times by 1 test: return 0; | 8 |
| 363 | } | - |
| 364 | | - |
| 365 | | - |
| 366 | | - |
| 367 | | - |
| 368 | uint Value::valueToStore(const QJsonValue &v, uint offset) | - |
| 369 | { | - |
| 370 | switch (v.t) { | - |
| 371 | case QJsonValue::Undefined: never executed: case QJsonValue::Undefined: | 0 |
| 372 | case QJsonValue::Null:executed 4 times by 1 test: case QJsonValue::Null: | 4 |
| 373 | break;executed 4 times by 1 test: break; | 4 |
| 374 | case QJsonValue::Bool:executed 4 times by 1 test: case QJsonValue::Bool: | 4 |
| 375 | return v.b;executed 4 times by 1 test: return v.b; | 4 |
| 376 | case QJsonValue::Double: {executed 4 times by 1 test: case QJsonValue::Double: | 4 |
| 377 | int c = QJsonPrivate::compressedNumber(v.dbl); | - |
| 378 | if (c != INT_MAX)| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-4 |
| 379 | return c;executed 4 times by 1 test: return c; | 4 |
| 380 | } | - |
| 381 | | - |
| 382 | case QJsonValue::String: code before this statement never executed: case QJsonValue::String: executed 4 times by 1 test: case QJsonValue::String: | 0-4 |
| 383 | case QJsonValue::Array: never executed: case QJsonValue::Array: | 0 |
| 384 | case QJsonValue::Object: never executed: case QJsonValue::Object: | 0 |
| 385 | return offset;executed 4 times by 1 test: return offset; | 4 |
| 386 | } | - |
| 387 | return 0;executed 4 times by 1 test: return 0; | 4 |
| 388 | } | - |
| 389 | | - |
| 390 | | - |
| 391 | | - |
| 392 | | - |
| 393 | void Value::copyData(const QJsonValue &v, char *dest, bool compressed) | - |
| 394 | { | - |
| 395 | switch (v.t) { | - |
| 396 | case QJsonValue::Double: never executed: case QJsonValue::Double: | 0 |
| 397 | if (!compressed) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 398 | qToLittleEndian(v.ui, (uchar *)dest); | - |
| 399 | } never executed: end of block | 0 |
| 400 | break; never executed: break; | 0 |
| 401 | case QJsonValue::String: {executed 4 times by 1 test: case QJsonValue::String: | 4 |
| 402 | QString str = v.toString(); | - |
| 403 | QJsonPrivate::copyString(dest, str, compressed); | - |
| 404 | break;executed 4 times by 1 test: break; | 4 |
| 405 | } | - |
| 406 | case QJsonValue::Array: never executed: case QJsonValue::Array: | 0 |
| 407 | case QJsonValue::Object: { never executed: case QJsonValue::Object: | 0 |
| 408 | const QJsonPrivate::Base *b = v.base; | - |
| 409 | if (!b)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 410 | b = (v.t == QJsonValue::Array ? &emptyArray : &emptyObject); never executed: b = (v.t == QJsonValue::Array ? &emptyArray : &emptyObject); | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 411 | memcpy(dest, b, b->size); | - |
| 412 | break; never executed: break; | 0 |
| 413 | } | - |
| 414 | default: never executed: default: | 0 |
| 415 | break; never executed: break; | 0 |
| 416 | } | - |
| 417 | } | - |
| 418 | | - |
| 419 | } | - |
| 420 | | - |
| 421 | QT_END_NAMESPACE | - |
| | |