qjsonparser.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/json/qjsonparser.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2static const int nestingLimit = 1024;-
3-
4-
5QString QJsonParseError::errorString() const-
6{-
7 const char *sz = "";-
8 switch (error) {-
9 case
never executed: case NoError:
NoError:
never executed: case NoError:
0
10 sz = "no error occurred";-
11 break;
never executed: break;
0
12 case
never executed: case UnterminatedObject:
UnterminatedObject:
never executed: case UnterminatedObject:
0
13 sz = "unterminated object";-
14 break;
never executed: break;
0
15 case
never executed: case MissingNameSeparator:
MissingNameSeparator:
never executed: case MissingNameSeparator:
0
16 sz = "missing name separator";-
17 break;
never executed: break;
0
18 case
never executed: case UnterminatedArray:
UnterminatedArray:
never executed: case UnterminatedArray:
0
19 sz = "unterminated array";-
20 break;
never executed: break;
0
21 case
never executed: case MissingValueSeparator:
MissingValueSeparator:
never executed: case MissingValueSeparator:
0
22 sz = "missing value separator";-
23 break;
never executed: break;
0
24 case
never executed: case IllegalValue:
IllegalValue:
never executed: case IllegalValue:
0
25 sz = "illegal value";-
26 break;
never executed: break;
0
27 case
never executed: case TerminationByNumber:
TerminationByNumber:
never executed: case TerminationByNumber:
0
28 sz = "invalid termination by number";-
29 break;
never executed: break;
0
30 case
never executed: case IllegalNumber:
IllegalNumber:
never executed: case IllegalNumber:
0
31 sz = "illegal number";-
32 break;
never executed: break;
0
33 case
never executed: case IllegalEscapeSequence:
IllegalEscapeSequence:
never executed: case IllegalEscapeSequence:
0
34 sz = "invalid escape sequence";-
35 break;
never executed: break;
0
36 case
never executed: case IllegalUTF8String:
IllegalUTF8String:
never executed: case IllegalUTF8String:
0
37 sz = "invalid UTF8 string";-
38 break;
never executed: break;
0
39 case
never executed: case UnterminatedString:
UnterminatedString:
never executed: case UnterminatedString:
0
40 sz = "unterminated string";-
41 break;
never executed: break;
0
42 case
never executed: case MissingObject:
MissingObject:
never executed: case MissingObject:
0
43 sz = "object is missing after a comma";-
44 break;
never executed: break;
0
45 case
never executed: case DeepNesting:
DeepNesting:
never executed: case DeepNesting:
0
46 sz = "too deeply nested document";-
47 break;
never executed: break;
0
48 case
never executed: case DocumentTooLarge:
DocumentTooLarge:
never executed: case DocumentTooLarge:
0
49 sz = "too large document";-
50 break;
never executed: break;
0
51 case
never executed: case GarbageAtEnd:
GarbageAtEnd:
never executed: case GarbageAtEnd:
0
52 sz = "garbage at the end of the document";-
53 break;
never executed: break;
0
54 }-
55-
56 return
never executed: return QCoreApplication::translate("QJsonParseError", sz);
QCoreApplication::translate("QJsonParseError", sz);
never executed: return QCoreApplication::translate("QJsonParseError", sz);
0
57-
58-
59-
60}-
61-
62using namespace QJsonPrivate;-
63-
64Parser::Parser(const char *json, int length)-
65 : head(json), json(json), data(0), dataLength(0), current(0), nestingLevel(0), lastError(QJsonParseError::NoError)-
66{-
67 end = json + length;-
68}
executed 10 times by 4 tests: end of block
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
10
69enum {-
70 Space = 0x20,-
71 Tab = 0x09,-
72 LineFeed = 0x0a,-
73 Return = 0x0d,-
74 BeginArray = 0x5b,-
75 BeginObject = 0x7b,-
76 EndArray = 0x5d,-
77 EndObject = 0x7d,-
78 NameSeparator = 0x3a,-
79 ValueSeparator = 0x2c,-
80 Quote = 0x22-
81};-
82-
83void Parser::eatBOM()-
84{-
85-
86 uchar utf8bom[3] = { 0xef, 0xbb, 0xbf };-
87 if (end - json > 3
end - json > 3Description
TRUEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&&
0-10
88 (
(uchar)json[0] == utf8bom[0]Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
uchar)json[0] == utf8bom[0]
(uchar)json[0] == utf8bom[0]Description
TRUEnever evaluated
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
&&
0-10
89 (
(uchar)json[1] == utf8bom[1]Description
TRUEnever evaluated
FALSEnever evaluated
uchar)json[1] == utf8bom[1]
(uchar)json[1] == utf8bom[1]Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
90 (
(uchar)json[2] == utf8bom[2]Description
TRUEnever evaluated
FALSEnever evaluated
uchar)json[2] == utf8bom[2]
(uchar)json[2] == utf8bom[2]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
91 json += 3;
never executed: json += 3;
0
92}
executed 10 times by 4 tests: end of block
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
10
93-
94bool Parser::eatSpace()-
95{-
96 while (json < end
json < endDescription
TRUEevaluated 30245 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
14-30245
97 if (*
*json > SpaceDescription
TRUEevaluated 9523 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 20722 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
json > Space
*json > SpaceDescription
TRUEevaluated 9523 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 20722 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
9523-20722
98 break;
executed 9523 times by 4 tests: break;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
9523
99 if (*
*json != SpaceDescription
TRUEevaluated 2643 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
FALSEevaluated 18079 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
json != Space
*json != SpaceDescription
TRUEevaluated 2643 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
FALSEevaluated 18079 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
&&
2643-18079
100 *
*json != TabDescription
TRUEevaluated 2643 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
FALSEnever evaluated
json != Tab
*json != TabDescription
TRUEevaluated 2643 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
FALSEnever evaluated
&&
0-2643
101 *
*json != LineFeedDescription
TRUEnever evaluated
FALSEevaluated 2643 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
json != LineFeed
*json != LineFeedDescription
TRUEnever evaluated
FALSEevaluated 2643 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
&&
0-2643
102 *
*json != ReturnDescription
TRUEnever evaluated
FALSEnever evaluated
json != Return
*json != ReturnDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
103 break;
never executed: break;
0
104 ++json;-
105 }
executed 20722 times by 4 tests: end of block
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
20722
106 return
executed 9537 times by 4 tests: return (json < end);
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
(json < end);
executed 9537 times by 4 tests: return (json < end);
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
9537
107}-
108-
109char Parser::nextToken()-
110{-
111 if (!eatSpace()
!eatSpace()Description
TRUEnever evaluated
FALSEevaluated 5213 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-5213
112 return
never executed: return 0;
0;
never executed: return 0;
0
113 char token = *json++;-
114 switch (token) {-
115 case
executed 1 time by 1 test: case BeginArray:
Executed by:
  • tst_QNetworkCookieJar
BeginArray:
executed 1 time by 1 test: case BeginArray:
Executed by:
  • tst_QNetworkCookieJar
1
116 case
executed 8 times by 3 tests: case BeginObject:
Executed by:
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_qmakelib
BeginObject:
executed 8 times by 3 tests: case BeginObject:
Executed by:
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_qmakelib
8
117 case
executed 1439 times by 3 tests: case NameSeparator:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
NameSeparator:
executed 1439 times by 3 tests: case NameSeparator:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1439
118 case
executed 1278 times by 3 tests: case ValueSeparator:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
ValueSeparator:
executed 1278 times by 3 tests: case ValueSeparator:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1278
119 case
executed 546 times by 3 tests: case EndArray:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
EndArray:
executed 546 times by 3 tests: case EndArray:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
546
120 case
executed 499 times by 3 tests: case EndObject:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
EndObject:
executed 499 times by 3 tests: case EndObject:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
499
121 eatSpace();-
122 case
executed 1439 times by 3 tests: case Quote:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
Quote:
executed 1439 times by 3 tests: case Quote:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
code before this statement executed 3771 times by 4 tests: case Quote:
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1439-3771
123 break;
executed 5210 times by 4 tests: break;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
5210
124 default
executed 3 times by 2 tests: default:
Executed by:
  • tst_QMetaType
  • tst_qmakelib
:
executed 3 times by 2 tests: default:
Executed by:
  • tst_QMetaType
  • tst_qmakelib
3
125 token = 0;-
126 break;
executed 3 times by 2 tests: break;
Executed by:
  • tst_QMetaType
  • tst_qmakelib
3
127 }-
128 return
executed 5213 times by 4 tests: return token;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
token;
executed 5213 times by 4 tests: return token;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
5213
129}-
130-
131-
132-
133-
134QJsonDocument Parser::parse(QJsonParseError *error)-
135{-
136-
137-
138-
139-
140-
141 dataLength = qMax(end - json, (ptrdiff_t) 256);-
142 data = (char *)malloc(dataLength);-
143-
144-
145 QJsonPrivate::Header *h = (QJsonPrivate::Header *)data;-
146 h->tag = QJsonDocument::BinaryFormatTag;-
147 h->version = 1u;-
148-
149 current = sizeof(QJsonPrivate::Header);-
150-
151 eatBOM();-
152 char token = nextToken();-
153-
154 if (1) ;
executed 10 times by 4 tests: ;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 319, __PRETTY_FUNCTION__).debug() << hex << (uint)token;
dead code: QMessageLogger(__FILE__, 319, __PRETTY_FUNCTION__).debug() << hex << (uint)token;
-
155 if (token == BeginArray
token == BeginArrayDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 9 times by 3 tests
Evaluated by:
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
1-9
156 if (!parseArray()
!parseArray()Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-1
157 goto
never executed: goto error;
error;
never executed: goto error;
0
158 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
else if (token == BeginObject
token == BeginObjectDescription
TRUEevaluated 8 times by 3 tests
Evaluated by:
  • tst_QMetaType
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
) {
1-8
159 if (!parseObject()
!parseObject()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMetaType
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
)
2-6
160 goto
executed 2 times by 1 test: goto error;
Executed by:
  • tst_QMetaType
error;
executed 2 times by 1 test: goto error;
Executed by:
  • tst_QMetaType
2
161 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
else {
6
162 lastError = QJsonParseError::IllegalValue;-
163 goto
executed 1 time by 1 test: goto error;
Executed by:
  • tst_qmakelib
error;
executed 1 time by 1 test: goto error;
Executed by:
  • tst_qmakelib
1
164 }-
165-
166 eatSpace();-
167 if (json < end
json < endDescription
TRUEnever evaluated
FALSEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-7
168 lastError = QJsonParseError::GarbageAtEnd;-
169 goto
never executed: goto error;
error;
never executed: goto error;
0
170 }-
171-
172 do {} while (0);-
173 {-
174 if (error
errorDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QOpenGlConfig
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_qmakelib
) {
2-5
175 error->offset = 0;-
176 error->error = QJsonParseError::NoError;-
177 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QOpenGlConfig
5
178 QJsonPrivate::Data *d = new QJsonPrivate::Data(data, current);-
179 return
executed 7 times by 3 tests: return QJsonDocument(d);
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
QJsonDocument(d);
executed 7 times by 3 tests: return QJsonDocument(d);
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
7
180 }-
181-
182error:-
183-
184-
185-
186 if (error
errorDescription
TRUEnever evaluated
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QMetaType
  • tst_qmakelib
) {
0-3
187 error->offset = json - head;-
188 error->error = lastError;-
189 }
never executed: end of block
0
190 free(data);-
191 return
executed 3 times by 2 tests: return QJsonDocument();
Executed by:
  • tst_QMetaType
  • tst_qmakelib
QJsonDocument();
executed 3 times by 2 tests: return QJsonDocument();
Executed by:
  • tst_QMetaType
  • tst_qmakelib
3
192}-
193-
194-
195void Parser::ParsedObject::insert(uint offset) {-
196 const QJsonPrivate::Entry *newEntry = reinterpret_cast<const QJsonPrivate::Entry *>(parser->data + objectPosition + offset);-
197 int min = 0;-
198 int n = offsets.size();-
199 while (n > 0
n > 0Description
TRUEevaluated 1397 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
1397-1439
200 int half = n >> 1;-
201 int middle = min + half;-
202 if (*
*entryAt(middle) >= *newEntryDescription
TRUEevaluated 723 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 674 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
entryAt(middle) >= *newEntry
*entryAt(middle) >= *newEntryDescription
TRUEevaluated 723 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 674 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
674-723
203 n = half;-
204 }
executed 723 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else {
723
205 min = middle + 1;-
206 n -= half + 1;-
207 }
executed 674 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
674
208 }-
209 if (min < offsets.size()
min < offsets.size()Description
TRUEevaluated 711 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 728 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
&& *
*entryAt(min) == *newEntryDescription
TRUEnever evaluated
FALSEevaluated 711 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
entryAt(min) == *newEntry
*entryAt(min) == *newEntryDescription
TRUEnever evaluated
FALSEevaluated 711 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-728
210 offsets[min] = offset;-
211 }
never executed: end of block
else {
0
212 offsets.insert(min, offset);-
213 }
executed 1439 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1439
214}-
215-
216-
217-
218-
219-
220-
221bool Parser::parseObject()-
222{-
223 if (++
++nestingLevel > nestingLimitDescription
TRUEnever evaluated
FALSEevaluated 501 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
nestingLevel > nestingLimit
++nestingLevel > nestingLimitDescription
TRUEnever evaluated
FALSEevaluated 501 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-501
224 lastError = QJsonParseError::DeepNesting;-
225 return
never executed: return false;
false;
never executed: return false;
0
226 }-
227-
228 int objectOffset = reserveSpace(sizeof(QJsonPrivate::Object));-
229 if (objectOffset < 0
objectOffset < 0Description
TRUEnever evaluated
FALSEevaluated 501 times by 4 tests
Evaluated by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-501
230 return
never executed: return false;
false;
never executed: return false;
0
231 if (1) ;
executed 501 times by 4 tests: ;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 396, __PRETTY_FUNCTION__).debug() << "parseObject pos=" << objectOffset << current << json;
dead code: QMessageLogger(__FILE__, 396, __PRETTY_FUNCTION__).debug() << "parseObject pos=" << objectOffset << current << json;
-
232-
233 ParsedObject parsedObject(this, objectOffset);-
234-
235 char token = nextToken();-
236 while (token == Quote
token == QuoteDescription
TRUEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMetaType
) {
2-1439
237 int off = current - objectOffset;-
238 if (!parseMember(objectOffset)
!parseMember(objectOffset)Description
TRUEnever evaluated
FALSEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-1439
239 return
never executed: return false;
false;
never executed: return false;
0
240 parsedObject.insert(off);-
241 token = nextToken();-
242 if (token != ValueSeparator
token != ValueSeparatorDescription
TRUEevaluated 499 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 940 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
499-940
243 break;
executed 499 times by 3 tests: break;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
499
244 token = nextToken();-
245 if (token == EndObject
token == EndObjectDescription
TRUEnever evaluated
FALSEevaluated 940 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-940
246 lastError = QJsonParseError::MissingObject;-
247 return
never executed: return false;
false;
never executed: return false;
0
248 }-
249 }
executed 940 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
940
250-
251 if (1) ;
executed 501 times by 4 tests: ;
Executed by:
  • tst_QMetaType
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 416, __PRETTY_FUNCTION__).debug() << "end token=" << token;
dead code: QMessageLogger(__FILE__, 416, __PRETTY_FUNCTION__).debug() << "end token=" << token;
-
252 if (token != EndObject
token != EndObjectDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QMetaType
FALSEevaluated 499 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
2-499
253 lastError = QJsonParseError::UnterminatedObject;-
254 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_QMetaType
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QMetaType
2
255 }-
256-
257 if (1) ;
executed 499 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 422, __PRETTY_FUNCTION__).debug() << "numEntries" << parsedObject.offsets.size();
dead code: QMessageLogger(__FILE__, 422, __PRETTY_FUNCTION__).debug() << "numEntries" << parsedObject.offsets.size();
-
258 int table = objectOffset;-
259-
260 if (parsedObject.offsets.size()
parsedObject.offsets.size()Description
TRUEevaluated 499 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
) {
0-499
261 int tableSize = parsedObject.offsets.size()*sizeof(uint);-
262 table = reserveSpace(tableSize);-
263 if (table < 0
table < 0Description
TRUEnever evaluated
FALSEevaluated 499 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-499
264 return
never executed: return false;
false;
never executed: return false;
0
265-
266-
267 memcpy(data + table, parsedObject.offsets.constData(), tableSize);-
268-
269-
270-
271-
272-
273-
274 }
executed 499 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
499
275-
276 QJsonPrivate::Object *o = (QJsonPrivate::Object *)(data + objectOffset);-
277 o->tableOffset = table - objectOffset;-
278 o->size = current - objectOffset;-
279 o->is_object = true;-
280 o->length = parsedObject.offsets.size();-
281-
282 if (1) ;
executed 499 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 447, __PRETTY_FUNCTION__).debug() << "current=" << current;
dead code: QMessageLogger(__FILE__, 447, __PRETTY_FUNCTION__).debug() << "current=" << current;
-
283 do {} while (0);-
284-
285 --nestingLevel;-
286 return
executed 499 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 499 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
499
287}-
288-
289-
290-
291-
292bool Parser::parseMember(int baseOffset)-
293{-
294 int entryOffset = reserveSpace(sizeof(QJsonPrivate::Entry));-
295 if (entryOffset < 0
entryOffset < 0Description
TRUEnever evaluated
FALSEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-1439
296 return
never executed: return false;
false;
never executed: return false;
0
297 if (1) ;
executed 1439 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 462, __PRETTY_FUNCTION__).debug() << "parseMember pos=" << entryOffset;
dead code: QMessageLogger(__FILE__, 462, __PRETTY_FUNCTION__).debug() << "parseMember pos=" << entryOffset;
-
298-
299 bool latin1;-
300 if (!parseString(&latin1)
!parseString(&latin1)Description
TRUEnever evaluated
FALSEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-1439
301 return
never executed: return false;
false;
never executed: return false;
0
302 char token = nextToken();-
303 if (token != NameSeparator
token != NameSeparatorDescription
TRUEnever evaluated
FALSEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-1439
304 lastError = QJsonParseError::MissingNameSeparator;-
305 return
never executed: return false;
false;
never executed: return false;
0
306 }-
307 QJsonPrivate::Value val;-
308 if (!parseValue(&val, baseOffset)
!parseValue(&val, baseOffset)Description
TRUEnever evaluated
FALSEevaluated 1439 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-1439
309 return
never executed: return false;
false;
never executed: return false;
0
310-
311-
312 QJsonPrivate::Entry *e = (QJsonPrivate::Entry *)(data + entryOffset);-
313 e->value = val;-
314 e->value.latinKey = latin1;-
315-
316 do {} while (0);-
317 return
executed 1439 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 1439 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1439
318}-
319-
320namespace {-
321 struct ValueArray {-
322 static const int prealloc = 128;-
323 ValueArray() : data(stackValues), alloc(prealloc), size(0) {}
executed 546 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
546
324 ~ValueArray() { if (data != stackValues
data != stackValuesDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 545 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) free(data);
executed 1 time by 1 test: free(data);
Executed by:
  • tst_QNetworkCookieJar
}
executed 546 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1-546
325-
326 inline bool grow() {-
327 alloc *= 2;-
328 if (data == stackValues
data == stackValuesDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEnever evaluated
) {
0-1
329 QJsonPrivate::Value *newValues = static_cast<QJsonPrivate::Value *>(malloc(alloc*sizeof(QJsonPrivate::Value)));-
330 if (!newValues
!newValuesDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-1
331 return
never executed: return false;
false;
never executed: return false;
0
332 memcpy(newValues, data, size*sizeof(QJsonPrivate::Value));-
333 data = newValues;-
334 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
else {
1
335 void *newValues = realloc(data, alloc * sizeof(QJsonPrivate::Value));-
336 if (!newValues
!newValuesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
337 return
never executed: return false;
false;
never executed: return false;
0
338 data = static_cast<QJsonPrivate::Value *>(newValues);-
339 }
never executed: end of block
0
340 return
executed 1 time by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
1
341 }-
342 bool append(const QJsonPrivate::Value &v) {-
343 if (alloc == size
alloc == sizeDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 796 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
&& !grow()
!grow()Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-796
344 return
never executed: return false;
false;
never executed: return false;
0
345 data[size] = v;-
346 ++size;-
347 return
executed 797 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 797 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
797
348 }-
349-
350 QJsonPrivate::Value stackValues[prealloc];-
351 QJsonPrivate::Value *data;-
352 int alloc;-
353 int size;-
354 };-
355}-
356-
357-
358-
359-
360bool Parser::parseArray()-
361{-
362 if (1) ;
executed 546 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 527, __PRETTY_FUNCTION__).debug() << "parseArray";
dead code: QMessageLogger(__FILE__, 527, __PRETTY_FUNCTION__).debug() << "parseArray";
-
363-
364 if (++
++nestingLevel > nestingLimitDescription
TRUEnever evaluated
FALSEevaluated 546 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
nestingLevel > nestingLimit
++nestingLevel > nestingLimitDescription
TRUEnever evaluated
FALSEevaluated 546 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-546
365 lastError = QJsonParseError::DeepNesting;-
366 return
never executed: return false;
false;
never executed: return false;
0
367 }-
368-
369 int arrayOffset = reserveSpace(sizeof(QJsonPrivate::Array));-
370 if (arrayOffset < 0
arrayOffset < 0Description
TRUEnever evaluated
FALSEevaluated 546 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-546
371 return
never executed: return false;
false;
never executed: return false;
0
372-
373 ValueArray values;-
374-
375 if (!eatSpace()
!eatSpace()Description
TRUEnever evaluated
FALSEevaluated 546 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-546
376 lastError = QJsonParseError::UnterminatedArray;-
377 return
never executed: return false;
false;
never executed: return false;
0
378 }-
379 if (*
*json == EndArrayDescription
TRUEevaluated 87 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 459 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
json == EndArray
*json == EndArrayDescription
TRUEevaluated 87 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 459 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
87-459
380 nextToken();-
381 }
executed 87 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
else {
87
382 while (1) {-
383 QJsonPrivate::Value val;-
384 if (!parseValue(&val, arrayOffset)
!parseValue(&val, arrayOffset)Description
TRUEnever evaluated
FALSEevaluated 797 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-797
385 return
never executed: return false;
false;
never executed: return false;
0
386 if (!values.append(val)
!values.append(val)Description
TRUEnever evaluated
FALSEevaluated 797 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-797
387 lastError = QJsonParseError::DocumentTooLarge;-
388 return
never executed: return false;
false;
never executed: return false;
0
389 }-
390 char token = nextToken();-
391 if (token == EndArray
token == EndArrayDescription
TRUEevaluated 459 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 338 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
338-459
392 break;
executed 459 times by 3 tests: break;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
459
393 else if (token != ValueSeparator
token != ValueSeparatorDescription
TRUEnever evaluated
FALSEevaluated 338 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-338
394 if (!eatSpace()
!eatSpace()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
395 lastError = QJsonParseError::UnterminatedArray;
never executed: lastError = QJsonParseError::UnterminatedArray;
0
396 else-
397 lastError = QJsonParseError::MissingValueSeparator;
never executed: lastError = QJsonParseError::MissingValueSeparator;
0
398 return
never executed: return false;
false;
never executed: return false;
0
399 }-
400 }
executed 338 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
338
401 }
executed 459 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
459
402-
403 if (1) ;
executed 546 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 568, __PRETTY_FUNCTION__).debug() << "size =" << values.size;
dead code: QMessageLogger(__FILE__, 568, __PRETTY_FUNCTION__).debug() << "size =" << values.size;
-
404 int table = arrayOffset;-
405-
406 if (values.size
values.sizeDescription
TRUEevaluated 459 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 87 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
87-459
407 int tableSize = values.size*sizeof(QJsonPrivate::Value);-
408 table = reserveSpace(tableSize);-
409 if (table < 0
table < 0Description
TRUEnever evaluated
FALSEevaluated 459 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-459
410 return
never executed: return false;
false;
never executed: return false;
0
411 memcpy(data + table, values.data, tableSize);-
412 }
executed 459 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
459
413-
414 QJsonPrivate::Array *a = (QJsonPrivate::Array *)(data + arrayOffset);-
415 a->tableOffset = table - arrayOffset;-
416 a->size = current - arrayOffset;-
417 a->is_object = false;-
418 a->length = values.size;-
419-
420 if (1) ;
executed 546 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 585, __PRETTY_FUNCTION__).debug() << "current=" << current;
dead code: QMessageLogger(__FILE__, 585, __PRETTY_FUNCTION__).debug() << "current=" << current;
-
421 do {} while (0);-
422-
423 --nestingLevel;-
424 return
executed 546 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 546 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
546
425}-
426-
427-
428-
429-
430-
431-
432bool Parser::parseValue(QJsonPrivate::Value *val, int baseOffset)-
433{-
434 if (1) ;
executed 2236 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 599, __PRETTY_FUNCTION__).debug() << "parse Value" << json;
dead code: QMessageLogger(__FILE__, 599, __PRETTY_FUNCTION__).debug() << "parse Value" << json;
-
435 val->_dummy = 0;-
436-
437 switch (*json++) {-
438 case
executed 1 time by 1 test: case 'n':
Executed by:
  • tst_qmakelib
'n':
executed 1 time by 1 test: case 'n':
Executed by:
  • tst_qmakelib
1
439 if (end - json < 4
end - json < 4Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
) {
0-1
440 lastError = QJsonParseError::IllegalValue;-
441 return
never executed: return false;
false;
never executed: return false;
0
442 }-
443 if (*
*json++ == 'u'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'u'
*json++ == 'u'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
444 *
*json++ == 'l'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'l'
*json++ == 'l'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
445 *
*json++ == 'l'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'l'
*json++ == 'l'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
) {
0-1
446 val->type = QJsonValue::Null;-
447 if (1) ;
executed 1 time by 1 test: ;
Executed by:
  • tst_qmakelib
else QMessageLogger(__FILE__, 612, __PRETTY_FUNCTION__).debug() << "value: null";
dead code: QMessageLogger(__FILE__, 612, __PRETTY_FUNCTION__).debug() << "value: null";
-
448 do {} while (0);-
449 return
executed 1 time by 1 test: return true;
Executed by:
  • tst_qmakelib
true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_qmakelib
1
450 }-
451 lastError = QJsonParseError::IllegalValue;-
452 return
never executed: return false;
false;
never executed: return false;
0
453 case
executed 1 time by 1 test: case 't':
Executed by:
  • tst_qmakelib
't':
executed 1 time by 1 test: case 't':
Executed by:
  • tst_qmakelib
1
454 if (end - json < 4
end - json < 4Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
) {
0-1
455 lastError = QJsonParseError::IllegalValue;-
456 return
never executed: return false;
false;
never executed: return false;
0
457 }-
458 if (*
*json++ == 'r'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'r'
*json++ == 'r'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
459 *
*json++ == 'u'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'u'
*json++ == 'u'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
460 *
*json++ == 'e'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'e'
*json++ == 'e'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
) {
0-1
461 val->type = QJsonValue::Bool;-
462 val->value = true;-
463 if (1) ;
executed 1 time by 1 test: ;
Executed by:
  • tst_qmakelib
else QMessageLogger(__FILE__, 628, __PRETTY_FUNCTION__).debug() << "value: true";
dead code: QMessageLogger(__FILE__, 628, __PRETTY_FUNCTION__).debug() << "value: true";
-
464 do {} while (0);-
465 return
executed 1 time by 1 test: return true;
Executed by:
  • tst_qmakelib
true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_qmakelib
1
466 }-
467 lastError = QJsonParseError::IllegalValue;-
468 return
never executed: return false;
false;
never executed: return false;
0
469 case
executed 1 time by 1 test: case 'f':
Executed by:
  • tst_qmakelib
'f':
executed 1 time by 1 test: case 'f':
Executed by:
  • tst_qmakelib
1
470 if (end - json < 5
end - json < 5Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
) {
0-1
471 lastError = QJsonParseError::IllegalValue;-
472 return
never executed: return false;
false;
never executed: return false;
0
473 }-
474 if (*
*json++ == 'a'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'a'
*json++ == 'a'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
475 *
*json++ == 'l'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'l'
*json++ == 'l'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
476 *
*json++ == 's'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 's'
*json++ == 's'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
&&
0-1
477 *
*json++ == 'e'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
json++ == 'e'
*json++ == 'e'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmakelib
FALSEnever evaluated
) {
0-1
478 val->type = QJsonValue::Bool;-
479 val->value = false;-
480 if (1) ;
executed 1 time by 1 test: ;
Executed by:
  • tst_qmakelib
else QMessageLogger(__FILE__, 645, __PRETTY_FUNCTION__).debug() << "value: false";
dead code: QMessageLogger(__FILE__, 645, __PRETTY_FUNCTION__).debug() << "value: false";
-
481 do {} while (0);-
482 return
executed 1 time by 1 test: return true;
Executed by:
  • tst_qmakelib
true;
executed 1 time by 1 test: return true;
Executed by:
  • tst_qmakelib
1
483 }-
484 lastError = QJsonParseError::IllegalValue;-
485 return
never executed: return false;
false;
never executed: return false;
0
486 case
executed 1144 times by 3 tests: case Quote:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
Quote:
executed 1144 times by 3 tests: case Quote:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
{
1144
487 val->type = QJsonValue::String;-
488 if (current - baseOffset >= Value::MaxSize
current - base...Value::MaxSizeDescription
TRUEnever evaluated
FALSEevaluated 1144 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-1144
489 lastError = QJsonParseError::DocumentTooLarge;-
490 return
never executed: return false;
false;
never executed: return false;
0
491 }-
492 val->value = current - baseOffset;-
493 bool latin1;-
494 if (!parseString(&latin1)
!parseString(&latin1)Description
TRUEnever evaluated
FALSEevaluated 1144 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-1144
495 return
never executed: return false;
false;
never executed: return false;
0
496 val->latinOrIntValue = latin1;-
497 if (1) ;
executed 1144 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 662, __PRETTY_FUNCTION__).debug() << "value: string";
dead code: QMessageLogger(__FILE__, 662, __PRETTY_FUNCTION__).debug() << "value: string";
-
498 do {} while (0);-
499 return
executed 1144 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 1144 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
1144
500 }-
501 case
executed 545 times by 3 tests: case BeginArray:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
BeginArray:
executed 545 times by 3 tests: case BeginArray:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
545
502 val->type = QJsonValue::Array;-
503 if (current - baseOffset >= Value::MaxSize
current - base...Value::MaxSizeDescription
TRUEnever evaluated
FALSEevaluated 545 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-545
504 lastError = QJsonParseError::DocumentTooLarge;-
505 return
never executed: return false;
false;
never executed: return false;
0
506 }-
507 val->value = current - baseOffset;-
508 if (!parseArray()
!parseArray()Description
TRUEnever evaluated
FALSEevaluated 545 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-545
509 return
never executed: return false;
false;
never executed: return false;
0
510 if (1) ;
executed 545 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 675, __PRETTY_FUNCTION__).debug() << "value: array";
dead code: QMessageLogger(__FILE__, 675, __PRETTY_FUNCTION__).debug() << "value: array";
-
511 do {} while (0);-
512 return
executed 545 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 545 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
545
513 case
executed 493 times by 3 tests: case BeginObject:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
BeginObject:
executed 493 times by 3 tests: case BeginObject:
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
493
514 val->type = QJsonValue::Object;-
515 if (current - baseOffset >= Value::MaxSize
current - base...Value::MaxSizeDescription
TRUEnever evaluated
FALSEevaluated 493 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-493
516 lastError = QJsonParseError::DocumentTooLarge;-
517 return
never executed: return false;
false;
never executed: return false;
0
518 }-
519 val->value = current - baseOffset;-
520 if (!parseObject()
!parseObject()Description
TRUEnever evaluated
FALSEevaluated 493 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-493
521 return
never executed: return false;
false;
never executed: return false;
0
522 if (1) ;
executed 493 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 687, __PRETTY_FUNCTION__).debug() << "value: object";
dead code: QMessageLogger(__FILE__, 687, __PRETTY_FUNCTION__).debug() << "value: object";
-
523 do {} while (0);-
524 return
executed 493 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 493 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
493
525 case
never executed: case EndArray:
EndArray:
never executed: case EndArray:
0
526 lastError = QJsonParseError::MissingObject;-
527 return
never executed: return false;
false;
never executed: return false;
0
528 default
executed 51 times by 2 tests: default:
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
:
executed 51 times by 2 tests: default:
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
51
529 --json;-
530 if (!parseNumber(val, baseOffset)
!parseNumber(val, baseOffset)Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-51
531 return
never executed: return false;
false;
never executed: return false;
0
532 if (1) ;
executed 51 times by 2 tests: ;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 697, __PRETTY_FUNCTION__).debug() << "value: number";
dead code: QMessageLogger(__FILE__, 697, __PRETTY_FUNCTION__).debug() << "value: number";
-
533 do {} while (0);-
534 }
executed 51 times by 2 tests: end of block
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
51
535-
536 return
executed 51 times by 2 tests: return true;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 51 times by 2 tests: return true;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
51
537}-
538bool Parser::parseNumber(QJsonPrivate::Value *val, int baseOffset)-
539{-
540 if (1) ;
executed 51 times by 2 tests: ;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 724, __PRETTY_FUNCTION__).debug() << "parseNumber" << json;
dead code: QMessageLogger(__FILE__, 724, __PRETTY_FUNCTION__).debug() << "parseNumber" << json;
-
541 val->type = QJsonValue::Double;-
542-
543 const char *start = json;-
544 bool isInt = true;-
545-
546-
547 if (json < end
json < endDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& *
*json == '-'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json == '-'
*json == '-'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-51
548 ++
never executed: ++json;
json;
never executed: ++json;
0
549-
550-
551 if (json < end
json < endDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& *
*json == '0'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json == '0'
*json == '0'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-51
552 ++json;-
553 }
never executed: end of block
else {
0
554 while (json < end
json < endDescription
TRUEevaluated 114 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& *
*json >= '0'Description
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json >= '0'
*json >= '0'Description
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
&& *
*json <= '9'Description
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
json <= '9'
*json <= '9'Description
TRUEevaluated 63 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
)
0-114
555 ++
executed 63 times by 2 tests: ++json;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json;
executed 63 times by 2 tests: ++json;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
63
556 }
executed 51 times by 2 tests: end of block
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
51
557-
558-
559 if (json < end
json < endDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& *
*json == '.'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json == '.'
*json == '.'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-51
560 isInt = false;-
561 ++json;-
562 while (json < end
json < endDescription
TRUEnever evaluated
FALSEnever evaluated
&& *
*json >= '0'Description
TRUEnever evaluated
FALSEnever evaluated
json >= '0'
*json >= '0'Description
TRUEnever evaluated
FALSEnever evaluated
&& *
*json <= '9'Description
TRUEnever evaluated
FALSEnever evaluated
json <= '9'
*json <= '9'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
563 ++
never executed: ++json;
json;
never executed: ++json;
0
564 }
never executed: end of block
0
565-
566-
567 if (json < end
json < endDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& (*
*json == 'e'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json == 'e'
*json == 'e'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
|| *
*json == 'E'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
json == 'E'
*json == 'E'Description
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
)) {
0-51
568 isInt = false;-
569 ++json;-
570 if (json < end
json < endDescription
TRUEnever evaluated
FALSEnever evaluated
&& (*
*json == '-'Description
TRUEnever evaluated
FALSEnever evaluated
json == '-'
*json == '-'Description
TRUEnever evaluated
FALSEnever evaluated
|| *
*json == '+'Description
TRUEnever evaluated
FALSEnever evaluated
json == '+'
*json == '+'Description
TRUEnever evaluated
FALSEnever evaluated
))
0
571 ++
never executed: ++json;
json;
never executed: ++json;
0
572 while (json < end
json < endDescription
TRUEnever evaluated
FALSEnever evaluated
&& *
*json >= '0'Description
TRUEnever evaluated
FALSEnever evaluated
json >= '0'
*json >= '0'Description
TRUEnever evaluated
FALSEnever evaluated
&& *
*json <= '9'Description
TRUEnever evaluated
FALSEnever evaluated
json <= '9'
*json <= '9'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
573 ++
never executed: ++json;
json;
never executed: ++json;
0
574 }
never executed: end of block
0
575-
576 if (json >= end
json >= endDescription
TRUEnever evaluated
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-51
577 lastError = QJsonParseError::TerminationByNumber;-
578 return
never executed: return false;
false;
never executed: return false;
0
579 }-
580-
581 QByteArray number(start, json - start);-
582 if (1) ;
executed 51 times by 2 tests: ;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 766, __PRETTY_FUNCTION__).debug() << "numberstring" << number;
dead code: QMessageLogger(__FILE__, 766, __PRETTY_FUNCTION__).debug() << "numberstring" << number;
-
583-
584 if (isInt
isIntDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
) {
0-51
585 bool ok;-
586 int n = number.toInt(&ok);-
587 if (ok
okDescription
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& n < (1<<25)
n < (1<<25)Description
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
&& n > -(1<<25)
n > -(1<<25)Description
TRUEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
) {
0-51
588 val->int_value = n;-
589 val->latinOrIntValue = true;-
590 do {} while (0);-
591 return
executed 51 times by 2 tests: return true;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 51 times by 2 tests: return true;
Executed by:
  • tst_QOpenGlConfig
  • tst_qmakelib
51
592 }-
593 }
never executed: end of block
0
594-
595 bool ok;-
596 union {-
597 quint64 ui;-
598 double d;-
599 };-
600 d = number.toDouble(&ok);-
601-
602 if (!ok
!okDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
603 lastError = QJsonParseError::IllegalNumber;-
604 return
never executed: return false;
false;
never executed: return false;
0
605 }-
606-
607 int pos = reserveSpace(sizeof(double));-
608 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
609 return
never executed: return false;
false;
never executed: return false;
0
610 qToLittleEndian(ui, data + pos);-
611 if (current - baseOffset >= Value::MaxSize
current - base...Value::MaxSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
612 lastError = QJsonParseError::DocumentTooLarge;-
613 return
never executed: return false;
false;
never executed: return false;
0
614 }-
615 val->value = pos - baseOffset;-
616 val->latinOrIntValue = false;-
617-
618 do {} while (0);-
619 return
never executed: return true;
true;
never executed: return true;
0
620}-
621static inline bool addHexDigit(char digit, uint *result)-
622{-
623 *result <<= 4;-
624 if (digit >= '0'
digit >= '0'Description
TRUEevaluated 412 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEnever evaluated
&& digit <= '9'
digit <= '9'Description
TRUEevaluated 300 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-412
625 *
executed 300 times by 1 test: *result |= (digit - '0');
Executed by:
  • tst_QNetworkCookieJar
result |= (digit - '0');
executed 300 times by 1 test: *result |= (digit - '0');
Executed by:
  • tst_QNetworkCookieJar
300
626 else if (digit >= 'a'
digit >= 'a'Description
TRUEnever evaluated
FALSEevaluated 112 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
&& digit <= 'f'
digit <= 'f'Description
TRUEnever evaluated
FALSEnever evaluated
)
0-112
627 *
never executed: *result |= (digit - 'a') + 10;
result |= (digit - 'a') + 10;
never executed: *result |= (digit - 'a') + 10;
0
628 else if (digit >= 'A'
digit >= 'A'Description
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEnever evaluated
&& digit <= 'F'
digit <= 'F'Description
TRUEevaluated 112 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEnever evaluated
)
0-112
629 *
executed 112 times by 1 test: *result |= (digit - 'A') + 10;
Executed by:
  • tst_QNetworkCookieJar
result |= (digit - 'A') + 10;
executed 112 times by 1 test: *result |= (digit - 'A') + 10;
Executed by:
  • tst_QNetworkCookieJar
112
630 else-
631 return
never executed: return false;
false;
never executed: return false;
0
632 return
executed 412 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
true;
executed 412 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
412
633}-
634-
635static inline bool scanEscapeSequence(const char *&json, const char *end, uint *ch)-
636{-
637 ++json;-
638 if (json >= end
json >= endDescription
TRUEnever evaluated
FALSEevaluated 206 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-206
639 return
never executed: return false;
false;
never executed: return false;
0
640-
641 if (1) ;
executed 206 times by 1 test: ;
Executed by:
  • tst_QNetworkCookieJar
else QMessageLogger(__FILE__, 848, __PRETTY_FUNCTION__).debug() << "scan escape" << (char)*json;
dead code: QMessageLogger(__FILE__, 848, __PRETTY_FUNCTION__).debug() << "scan escape" << (char)*json;
-
642 uint escaped = *json++;-
643 switch (escaped) {-
644 case
executed 98 times by 1 test: case '"':
Executed by:
  • tst_QNetworkCookieJar
'"':
executed 98 times by 1 test: case '"':
Executed by:
  • tst_QNetworkCookieJar
98
645 *ch = '"'; break;
executed 98 times by 1 test: break;
Executed by:
  • tst_QNetworkCookieJar
98
646 case
executed 4 times by 1 test: case '\\':
Executed by:
  • tst_QNetworkCookieJar
'\\':
executed 4 times by 1 test: case '\\':
Executed by:
  • tst_QNetworkCookieJar
4
647 *ch = '\\'; break;
executed 4 times by 1 test: break;
Executed by:
  • tst_QNetworkCookieJar
4
648 case
never executed: case '/':
'/':
never executed: case '/':
0
649 *ch = '/'; break;
never executed: break;
0
650 case
never executed: case 'b':
'b':
never executed: case 'b':
0
651 *ch = 0x8; break;
never executed: break;
0
652 case
never executed: case 'f':
'f':
never executed: case 'f':
0
653 *ch = 0xc; break;
never executed: break;
0
654 case
never executed: case 'n':
'n':
never executed: case 'n':
0
655 *ch = 0xa; break;
never executed: break;
0
656 case
executed 1 time by 1 test: case 'r':
Executed by:
  • tst_QNetworkCookieJar
'r':
executed 1 time by 1 test: case 'r':
Executed by:
  • tst_QNetworkCookieJar
1
657 *ch = 0xd; break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkCookieJar
1
658 case
never executed: case 't':
't':
never executed: case 't':
0
659 *ch = 0x9; break;
never executed: break;
0
660 case
executed 103 times by 1 test: case 'u':
Executed by:
  • tst_QNetworkCookieJar
'u':
executed 103 times by 1 test: case 'u':
Executed by:
  • tst_QNetworkCookieJar
{
103
661 *ch = 0;-
662 if (json > end - 4
json > end - 4Description
TRUEnever evaluated
FALSEevaluated 103 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-103
663 return
never executed: return false;
false;
never executed: return false;
0
664 for (int i = 0; i < 4
i < 4Description
TRUEevaluated 412 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 103 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
; ++i) {
103-412
665 if (!addHexDigit(*json, ch)
!addHexDigit(*json, ch)Description
TRUEnever evaluated
FALSEevaluated 412 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-412
666 return
never executed: return false;
false;
never executed: return false;
0
667 ++json;-
668 }
executed 412 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
412
669 return
executed 103 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
true;
executed 103 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
103
670 }-
671 default
never executed: default:
:
never executed: default:
0
672-
673-
674 *ch = escaped;-
675 return
never executed: return true;
true;
never executed: return true;
0
676 }-
677 return
executed 103 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
true;
executed 103 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
103
678}-
679-
680static inline bool scanUtf8Char(const char *&json, const char *end, uint *result)-
681{-
682 const uchar *&src = reinterpret_cast<const uchar *&>(json);-
683 const uchar *uend = reinterpret_cast<const uchar *>(end);-
684 uchar b = *src++;-
685 int res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, result, src, uend);-
686 if (res < 0
res < 0Description
TRUEnever evaluated
FALSEevaluated 35995 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-35995
687-
688 --json;-
689 return
never executed: return false;
false;
never executed: return false;
0
690 }-
691-
692 return
executed 35995 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 35995 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
35995
693}-
694-
695bool Parser::parseString(bool *latin1)-
696{-
697 *latin1 = true;-
698-
699 const char *start = json;-
700 int outStart = current;-
701-
702-
703-
704 int stringPos = reserveSpace(2);-
705 if (stringPos < 0
stringPos < 0Description
TRUEnever evaluated
FALSEevaluated 2583 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-2583
706 return
never executed: return false;
false;
never executed: return false;
0
707-
708 if (1) ;
executed 2583 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 915, __PRETTY_FUNCTION__).debug() << "parse string stringPos=" << stringPos << json;
dead code: QMessageLogger(__FILE__, 915, __PRETTY_FUNCTION__).debug() << "parse string stringPos=" << stringPos << json;
-
709 while (json < end
json < endDescription
TRUEevaluated 38666 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEnever evaluated
) {
0-38666
710 uint ch = 0;-
711 if (*
*json == '"'Description
TRUEevaluated 2573 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 36093 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
json == '"'
*json == '"'Description
TRUEevaluated 2573 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 36093 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
2573-36093
712 break;
executed 2573 times by 3 tests: break;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
2573
713 else if (*
*json == '\\'Description
TRUEevaluated 110 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 35983 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
json == '\\'
*json == '\\'Description
TRUEevaluated 110 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 35983 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
110-35983
714 if (!scanEscapeSequence(json, end, &ch)
!scanEscapeSeq...son, end, &ch)Description
TRUEnever evaluated
FALSEevaluated 110 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
0-110
715 lastError = QJsonParseError::IllegalEscapeSequence;-
716 return
never executed: return false;
false;
never executed: return false;
0
717 }-
718 }
executed 110 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
else {
110
719 if (!scanUtf8Char(json, end, &ch)
!scanUtf8Char(json, end, &ch)Description
TRUEnever evaluated
FALSEevaluated 35983 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-35983
720 lastError = QJsonParseError::IllegalUTF8String;-
721 return
never executed: return false;
false;
never executed: return false;
0
722 }-
723 }
executed 35983 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
35983
724-
725 if (ch > 0xff
ch > 0xffDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 36083 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
|| json - start >= 0x8000
json - start >= 0x8000Description
TRUEnever evaluated
FALSEevaluated 36083 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-36083
726 *latin1 = false;-
727 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_QNetworkCookieJar
10
728 }-
729 int pos = reserveSpace(1);-
730 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEevaluated 36083 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-36083
731 return
never executed: return false;
false;
never executed: return false;
0
732 if (1) ;
executed 36083 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 939, __PRETTY_FUNCTION__).debug() << " " << ch << (char)ch;
dead code: QMessageLogger(__FILE__, 939, __PRETTY_FUNCTION__).debug() << " " << ch << (char)ch;
-
733 data[pos] = (uchar)ch;-
734 }
executed 36083 times by 3 tests: end of block
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
36083
735 ++json;-
736 if (1) ;
executed 2583 times by 3 tests: ;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
else QMessageLogger(__FILE__, 943, __PRETTY_FUNCTION__).debug() << "end of string";
dead code: QMessageLogger(__FILE__, 943, __PRETTY_FUNCTION__).debug() << "end of string";
-
737 if (json >= end
json >= endDescription
TRUEnever evaluated
FALSEevaluated 2583 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
) {
0-2583
738 lastError = QJsonParseError::UnterminatedString;-
739 return
never executed: return false;
false;
never executed: return false;
0
740 }-
741-
742-
743 if (*
*latin1Description
TRUEevaluated 2573 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
latin1
*latin1Description
TRUEevaluated 2573 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
10-2573
744-
745 *(QJsonPrivate::qle_ushort *)(data + stringPos) = ushort(current - outStart - sizeof(ushort));-
746 int pos = reserveSpace((4 - current) & 3);-
747 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEevaluated 2573 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
0-2573
748 return
never executed: return false;
false;
never executed: return false;
0
749 while (pos & 3
pos & 3Description
TRUEevaluated 4433 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
FALSEevaluated 2573 times by 3 tests
Evaluated by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
)
2573-4433
750 data[pos++] = 0;
executed 4433 times by 3 tests: data[pos++] = 0;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
4433
751 do {} while (0);-
752 return
executed 2573 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
true;
executed 2573 times by 3 tests: return true;
Executed by:
  • tst_QNetworkCookieJar
  • tst_QOpenGlConfig
  • tst_qmakelib
2573
753 }-
754-
755 *latin1 = false;-
756 if (1) ;
executed 10 times by 1 test: ;
Executed by:
  • tst_QNetworkCookieJar
else QMessageLogger(__FILE__, 963, __PRETTY_FUNCTION__).debug() << "not latin";
dead code: QMessageLogger(__FILE__, 963, __PRETTY_FUNCTION__).debug() << "not latin";
-
757-
758 json = start;-
759 current = outStart + sizeof(int);-
760-
761 while (json < end
json < endDescription
TRUEevaluated 118 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEnever evaluated
) {
0-118
762 uint ch = 0;-
763 if (*
*json == '"'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
json == '"'
*json == '"'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
10-108
764 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_QNetworkCookieJar
10
765 else if (*
*json == '\\'Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
json == '\\'
*json == '\\'Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
12-96
766 if (!scanEscapeSequence(json, end, &ch)
!scanEscapeSeq...son, end, &ch)Description
TRUEnever evaluated
FALSEevaluated 96 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
0-96
767 lastError = QJsonParseError::IllegalEscapeSequence;-
768 return
never executed: return false;
false;
never executed: return false;
0
769 }-
770 }
executed 96 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
else {
96
771 if (!scanUtf8Char(json, end, &ch)
!scanUtf8Char(json, end, &ch)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
0-12
772 lastError = QJsonParseError::IllegalUTF8String;-
773 return
never executed: return false;
false;
never executed: return false;
0
774 }-
775 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
12
776 if (QChar::requiresSurrogates(ch)
QChar::requiresSurrogates(ch)Description
TRUEnever evaluated
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
0-108
777 int pos = reserveSpace(4);-
778 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
779 return
never executed: return false;
false;
never executed: return false;
0
780 *(QJsonPrivate::qle_ushort *)(data + pos) = QChar::highSurrogate(ch);-
781 *(QJsonPrivate::qle_ushort *)(data + pos + 2) = QChar::lowSurrogate(ch);-
782 }
never executed: end of block
else {
0
783 int pos = reserveSpace(2);-
784 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-108
785 return
never executed: return false;
false;
never executed: return false;
0
786 *(QJsonPrivate::qle_ushort *)(data + pos) = (ushort)ch;-
787 }
executed 108 times by 1 test: end of block
Executed by:
  • tst_QNetworkCookieJar
108
788 }-
789 ++json;-
790-
791 if (json >= end
json >= endDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
) {
0-10
792 lastError = QJsonParseError::UnterminatedString;-
793 return
never executed: return false;
false;
never executed: return false;
0
794 }-
795-
796-
797 *(QJsonPrivate::qle_int *)(data + stringPos) = (current - outStart - sizeof(int))/2;-
798 int pos = reserveSpace((4 - current) & 3);-
799 if (pos < 0
pos < 0Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
0-10
800 return
never executed: return false;
false;
never executed: return false;
0
801 while (pos & 3
pos & 3Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QNetworkCookieJar
)
10-12
802 data[pos++] = 0;
executed 12 times by 1 test: data[pos++] = 0;
Executed by:
  • tst_QNetworkCookieJar
12
803 do {} while (0);-
804 return
executed 10 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
true;
executed 10 times by 1 test: return true;
Executed by:
  • tst_QNetworkCookieJar
10
805}-
806-
807-
Switch to Source codePreprocessed file

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