qnetworkrequest.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qnetworkrequest.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate-
3{-
4public:-
5 static const int maxRedirectCount = 50;-
6 inline QNetworkRequestPrivate()-
7 : priority(QNetworkRequest::NormalPriority)-
8-
9 , sslConfiguration(0)-
10-
11 , maxRedirectsAllowed(maxRedirectCount)-
12 { qRegisterMetaType<QNetworkRequest>(); }
executed 3129 times by 11 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
3129
13 ~QNetworkRequestPrivate()-
14 {-
15-
16 delete sslConfiguration;-
17-
18 }
executed 3384 times by 12 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
  • tst_spdy - unknown status
3384
19-
20-
21 QNetworkRequestPrivate(const QNetworkRequestPrivate &other)-
22 : QSharedData(other), QNetworkHeadersPrivate(other)-
23 {-
24 url = other.url;-
25 priority = other.priority;-
26 maxRedirectsAllowed = other.maxRedirectsAllowed;-
27-
28 sslConfiguration = 0;-
29 if (other.sslConfiguration
other.sslConfigurationDescription
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
FALSEevaluated 154 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
102-154
30 sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
executed 102 times by 2 tests: sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
102
31-
32 }
executed 256 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
256
33-
34 inline bool operator==(const QNetworkRequestPrivate &other) const-
35 {-
36 return
never executed: return url == other.url && priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes && maxRedirectsAllowed == other.maxRedirectsAllowed;
url == other.url &&
never executed: return url == other.url && priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes && maxRedirectsAllowed == other.maxRedirectsAllowed;
0
37 priority == other.priority &&
never executed: return url == other.url && priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes && maxRedirectsAllowed == other.maxRedirectsAllowed;
0
38 rawHeaders == other.rawHeaders &&
never executed: return url == other.url && priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes && maxRedirectsAllowed == other.maxRedirectsAllowed;
0
39 attributes == other.attributes &&
never executed: return url == other.url && priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes && maxRedirectsAllowed == other.maxRedirectsAllowed;
0
40 maxRedirectsAllowed == other.maxRedirectsAllowed;
never executed: return url == other.url && priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes && maxRedirectsAllowed == other.maxRedirectsAllowed;
0
41-
42 }-
43-
44 QUrl url;-
45 QNetworkRequest::Priority priority;-
46-
47 mutable QSslConfiguration *sslConfiguration;-
48-
49 int maxRedirectsAllowed;-
50};-
51-
52-
53-
54-
55-
56-
57-
58QNetworkRequest::QNetworkRequest(const QUrl &url)-
59 : d(new QNetworkRequestPrivate)-
60{-
61 d->url = url;-
62}
executed 3129 times by 11 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
3129
63-
64-
65-
66-
67QNetworkRequest::QNetworkRequest(const QNetworkRequest &other)-
68 : d(other.d)-
69{-
70}
executed 1181 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1181
71-
72-
73-
74-
75QNetworkRequest::~QNetworkRequest()-
76{-
77-
78 d = 0;-
79}
executed 4307 times by 12 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
  • tst_spdy - unknown status
4307
80-
81-
82-
83-
84-
85-
86-
87bool QNetworkRequest::operator==(const QNetworkRequest &other) const-
88{-
89 return
executed 1 time by 1 test: return d == other.d || *d == *other.d;
Executed by:
  • tst_QNetworkReply
d == other.d || *d == *other.d;
executed 1 time by 1 test: return d == other.d || *d == *other.d;
Executed by:
  • tst_QNetworkReply
1
90}-
91QNetworkRequest &QNetworkRequest::operator=(const QNetworkRequest &other)-
92{-
93 d = other.d;-
94 return
executed 1956 times by 10 tests: return *this;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
*this;
executed 1956 times by 10 tests: return *this;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
1956
95}-
96QUrl QNetworkRequest::url() const-
97{-
98 return
executed 6076 times by 11 tests: return d->url;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
d->url;
executed 6076 times by 11 tests: return d->url;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
6076
99}-
100-
101-
102-
103-
104-
105-
106void QNetworkRequest::setUrl(const QUrl &url)-
107{-
108 d->url = url;-
109}
executed 29 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
29
110QVariant QNetworkRequest::header(KnownHeaders header) const-
111{-
112 return
executed 1084 times by 9 tests: return d->cookedHeaders.value(header);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
d->cookedHeaders.value(header);
executed 1084 times by 9 tests: return d->cookedHeaders.value(header);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
1084
113}-
114void QNetworkRequest::setHeader(KnownHeaders header, const QVariant &value)-
115{-
116 d->setCookedHeader(header, value);-
117}
executed 212 times by 4 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
212
118-
119-
120-
121-
122-
123-
124-
125bool QNetworkRequest::hasRawHeader(const QByteArray &headerName) const-
126{-
127 return
executed 768 times by 8 tests: return d->findRawHeader(headerName) != d->rawHeaders.constEnd();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
d->findRawHeader(headerName) != d->rawHeaders.constEnd();
executed 768 times by 8 tests: return d->findRawHeader(headerName) != d->rawHeaders.constEnd();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
768
128}-
129QByteArray QNetworkRequest::rawHeader(const QByteArray &headerName) const-
130{-
131 QNetworkHeadersPrivate::RawHeadersList::ConstIterator it =-
132 d->findRawHeader(headerName);-
133 if (it != d->rawHeaders.constEnd()
it != d->rawHeaders.constEnd()Description
TRUEevaluated 376 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
)
4-376
134 return
executed 376 times by 4 tests: return it->second;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
it->second;
executed 376 times by 4 tests: return it->second;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
376
135 return
executed 4 times by 1 test: return QByteArray();
Executed by:
  • tst_qnetworkrequest - unknown status
QByteArray();
executed 4 times by 1 test: return QByteArray();
Executed by:
  • tst_qnetworkrequest - unknown status
4
136}-
137-
138-
139-
140-
141-
142-
143-
144QList<QByteArray> QNetworkRequest::rawHeaderList() const-
145{-
146 return
executed 886 times by 9 tests: return d->rawHeadersKeys();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
d->rawHeadersKeys();
executed 886 times by 9 tests: return d->rawHeadersKeys();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
886
147}-
148void QNetworkRequest::setRawHeader(const QByteArray &headerName, const QByteArray &headerValue)-
149{-
150 d->setRawHeader(headerName, headerValue);-
151}
executed 198 times by 4 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
198
152QVariant QNetworkRequest::attribute(Attribute code, const QVariant &defaultValue) const-
153{-
154 return
executed 10121 times by 9 tests: return d->attributes.value(code, defaultValue);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->attributes.value(code, defaultValue);
executed 10121 times by 9 tests: return d->attributes.value(code, defaultValue);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
10121
155}-
156void QNetworkRequest::setAttribute(Attribute code, const QVariant &value)-
157{-
158 if (value.isValid()
value.isValid()Description
TRUEevaluated 334 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-334
159 d->attributes.insert(code, value);
executed 334 times by 5 tests: d->attributes.insert(code, value);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
334
160 else-
161 d->attributes.remove(code);
never executed: d->attributes.remove(code);
0
162}-
163QSslConfiguration QNetworkRequest::sslConfiguration() const-
164{-
165 if (!d->sslConfiguration
!d->sslConfigurationDescription
TRUEevaluated 814 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 411 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
)
411-814
166 d->sslConfiguration = new QSslConfiguration(QSslConfiguration::defaultConfiguration());
executed 814 times by 8 tests: d->sslConfiguration = new QSslConfiguration(QSslConfiguration::defaultConfiguration());
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
814
167 return
executed 1225 times by 8 tests: return *d->sslConfiguration;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
*d->sslConfiguration;
executed 1225 times by 8 tests: return *d->sslConfiguration;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1225
168}-
169void QNetworkRequest::setSslConfiguration(const QSslConfiguration &config)-
170{-
171 if (!d->sslConfiguration
!d->sslConfigurationDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-46
172 d->sslConfiguration = new QSslConfiguration(config);
executed 46 times by 1 test: d->sslConfiguration = new QSslConfiguration(config);
Executed by:
  • tst_QNetworkReply
46
173 else-
174 *
executed 1 time by 1 test: *d->sslConfiguration = config;
Executed by:
  • tst_QNetworkReply
d->sslConfiguration = config;
executed 1 time by 1 test: *d->sslConfiguration = config;
Executed by:
  • tst_QNetworkReply
1
175}-
176void QNetworkRequest::setOriginatingObject(QObject *object)-
177{-
178 d->originatingObject = object;-
179}
executed 1 time by 1 test: end of block
Executed by:
  • tst_qnetworkrequest - unknown status
1
180QObject *QNetworkRequest::originatingObject() const-
181{-
182 return
executed 3 times by 1 test: return d->originatingObject.data();
Executed by:
  • tst_qnetworkrequest - unknown status
d->originatingObject.data();
executed 3 times by 1 test: return d->originatingObject.data();
Executed by:
  • tst_qnetworkrequest - unknown status
3
183}-
184QNetworkRequest::Priority QNetworkRequest::priority() const-
185{-
186 return
executed 887 times by 8 tests: return d->priority;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->priority;
executed 887 times by 8 tests: return d->priority;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
887
187}-
188void QNetworkRequest::setPriority(Priority priority)-
189{-
190 d->priority = priority;-
191}
never executed: end of block
0
192int QNetworkRequest::maximumRedirectsAllowed() const-
193{-
194 return
executed 891 times by 8 tests: return d->maxRedirectsAllowed;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d->maxRedirectsAllowed;
executed 891 times by 8 tests: return d->maxRedirectsAllowed;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
891
195}-
196void QNetworkRequest::setMaximumRedirectsAllowed(int maxRedirectsAllowed)-
197{-
198 d->maxRedirectsAllowed = maxRedirectsAllowed;-
199}
executed 7 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
7
200-
201static QByteArray headerName(QNetworkRequest::KnownHeaders header)-
202{-
203 switch (header) {-
204 case
executed 94 times by 4 tests: case QNetworkRequest::ContentTypeHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentTypeHeader:
executed 94 times by 4 tests: case QNetworkRequest::ContentTypeHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
94
205 return
executed 94 times by 4 tests: return "Content-Type";
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
"Content-Type";
executed 94 times by 4 tests: return "Content-Type";
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
94
206-
207 case
executed 252 times by 5 tests: case QNetworkRequest::ContentLengthHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentLengthHeader:
executed 252 times by 5 tests: case QNetworkRequest::ContentLengthHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
252
208 return
executed 252 times by 5 tests: return "Content-Length";
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
"Content-Length";
executed 252 times by 5 tests: return "Content-Length";
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
252
209-
210 case
executed 3 times by 1 test: case QNetworkRequest::LocationHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LocationHeader:
executed 3 times by 1 test: case QNetworkRequest::LocationHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
3
211 return
executed 3 times by 1 test: return "Location";
Executed by:
  • tst_qnetworkrequest - unknown status
"Location";
executed 3 times by 1 test: return "Location";
Executed by:
  • tst_qnetworkrequest - unknown status
3
212-
213 case
executed 59 times by 3 tests: case QNetworkRequest::LastModifiedHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LastModifiedHeader:
executed 59 times by 3 tests: case QNetworkRequest::LastModifiedHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
59
214 return
executed 59 times by 3 tests: return "Last-Modified";
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
"Last-Modified";
executed 59 times by 3 tests: return "Last-Modified";
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
59
215-
216 case
executed 11 times by 2 tests: case QNetworkRequest::CookieHeader:
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QNetworkRequest::CookieHeader:
executed 11 times by 2 tests: case QNetworkRequest::CookieHeader:
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
11
217 return
executed 11 times by 2 tests: return "Cookie";
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
"Cookie";
executed 11 times by 2 tests: return "Cookie";
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
11
218-
219 case
executed 3 times by 1 test: case QNetworkRequest::SetCookieHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
QNetworkRequest::SetCookieHeader:
executed 3 times by 1 test: case QNetworkRequest::SetCookieHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
3
220 return
executed 3 times by 1 test: return "Set-Cookie";
Executed by:
  • tst_qnetworkrequest - unknown status
"Set-Cookie";
executed 3 times by 1 test: return "Set-Cookie";
Executed by:
  • tst_qnetworkrequest - unknown status
3
221-
222 case
executed 36 times by 2 tests: case QNetworkRequest::ContentDispositionHeader:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QNetworkRequest::ContentDispositionHeader:
executed 36 times by 2 tests: case QNetworkRequest::ContentDispositionHeader:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
36
223 return
executed 36 times by 2 tests: return "Content-Disposition";
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
"Content-Disposition";
executed 36 times by 2 tests: return "Content-Disposition";
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
36
224-
225 case
executed 1 time by 1 test: case QNetworkRequest::UserAgentHeader:
Executed by:
  • tst_QNetworkReply
QNetworkRequest::UserAgentHeader:
executed 1 time by 1 test: case QNetworkRequest::UserAgentHeader:
Executed by:
  • tst_QNetworkReply
1
226 return
executed 1 time by 1 test: return "User-Agent";
Executed by:
  • tst_QNetworkReply
"User-Agent";
executed 1 time by 1 test: return "User-Agent";
Executed by:
  • tst_QNetworkReply
1
227-
228 case
never executed: case QNetworkRequest::ServerHeader:
QNetworkRequest::ServerHeader:
never executed: case QNetworkRequest::ServerHeader:
0
229 return
never executed: return "Server";
"Server";
never executed: return "Server";
0
230-
231-
232-
233 }-
234-
235 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
236}-
237-
238static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVariant &value)-
239{-
240 switch (header) {-
241 case
executed 93 times by 4 tests: case QNetworkRequest::ContentTypeHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentTypeHeader:
executed 93 times by 4 tests: case QNetworkRequest::ContentTypeHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
93
242 case
executed 251 times by 5 tests: case QNetworkRequest::ContentLengthHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentLengthHeader:
executed 251 times by 5 tests: case QNetworkRequest::ContentLengthHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
251
243 case
executed 36 times by 2 tests: case QNetworkRequest::ContentDispositionHeader:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QNetworkRequest::ContentDispositionHeader:
executed 36 times by 2 tests: case QNetworkRequest::ContentDispositionHeader:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
36
244 case
executed 1 time by 1 test: case QNetworkRequest::UserAgentHeader:
Executed by:
  • tst_QNetworkReply
QNetworkRequest::UserAgentHeader:
executed 1 time by 1 test: case QNetworkRequest::UserAgentHeader:
Executed by:
  • tst_QNetworkReply
1
245 case
never executed: case QNetworkRequest::ServerHeader:
QNetworkRequest::ServerHeader:
never executed: case QNetworkRequest::ServerHeader:
0
246 return
executed 381 times by 5 tests: return value.toByteArray();
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
value.toByteArray();
executed 381 times by 5 tests: return value.toByteArray();
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
381
247-
248 case
executed 3 times by 1 test: case QNetworkRequest::LocationHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LocationHeader:
executed 3 times by 1 test: case QNetworkRequest::LocationHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
3
249 switch (value.userType()) {-
250 case
executed 1 time by 1 test: case QMetaType::QUrl:
Executed by:
  • tst_qnetworkrequest - unknown status
QMetaType::QUrl:
executed 1 time by 1 test: case QMetaType::QUrl:
Executed by:
  • tst_qnetworkrequest - unknown status
1
251 return
executed 1 time by 1 test: return value.toUrl().toEncoded();
Executed by:
  • tst_qnetworkrequest - unknown status
value.toUrl().toEncoded();
executed 1 time by 1 test: return value.toUrl().toEncoded();
Executed by:
  • tst_qnetworkrequest - unknown status
1
252-
253 default
executed 2 times by 1 test: default:
Executed by:
  • tst_qnetworkrequest - unknown status
:
executed 2 times by 1 test: default:
Executed by:
  • tst_qnetworkrequest - unknown status
2
254 return
executed 2 times by 1 test: return value.toByteArray();
Executed by:
  • tst_qnetworkrequest - unknown status
value.toByteArray();
executed 2 times by 1 test: return value.toByteArray();
Executed by:
  • tst_qnetworkrequest - unknown status
2
255 }-
256-
257 case
executed 57 times by 3 tests: case QNetworkRequest::LastModifiedHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LastModifiedHeader:
executed 57 times by 3 tests: case QNetworkRequest::LastModifiedHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
57
258 switch (value.userType()) {-
259 case
executed 1 time by 1 test: case QMetaType::QDate:
Executed by:
  • tst_qnetworkrequest - unknown status
QMetaType::QDate:
executed 1 time by 1 test: case QMetaType::QDate:
Executed by:
  • tst_qnetworkrequest - unknown status
1
260 case
executed 56 times by 3 tests: case QMetaType::QDateTime:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
QMetaType::QDateTime:
executed 56 times by 3 tests: case QMetaType::QDateTime:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
56
261-
262 return
executed 57 times by 3 tests: return QNetworkHeadersPrivate::toHttpDate(value.toDateTime());
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
QNetworkHeadersPrivate::toHttpDate(value.toDateTime());
executed 57 times by 3 tests: return QNetworkHeadersPrivate::toHttpDate(value.toDateTime());
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
57
263-
264 default
never executed: default:
:
never executed: default:
0
265 return
never executed: return value.toByteArray();
value.toByteArray();
never executed: return value.toByteArray();
0
266 }-
267-
268 case
executed 11 times by 2 tests: case QNetworkRequest::CookieHeader:
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QNetworkRequest::CookieHeader:
executed 11 times by 2 tests: case QNetworkRequest::CookieHeader:
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
{
11
269 QList<QNetworkCookie> cookies = qvariant_cast<QList<QNetworkCookie> >(value);-
270 if (cookies.isEmpty()
cookies.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
&& value.userType() == qMetaTypeId<QNetworkCookie>()
value.userType...tworkCookie>()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-11
271 cookies << qvariant_cast<QNetworkCookie>(value);
never executed: cookies << qvariant_cast<QNetworkCookie>(value);
0
272-
273 QByteArray result;-
274 bool first = true;-
275 for (const QNetworkCookie &cookie : qAsConst(cookies)) {-
276 if (!first
!firstDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
)
3-11
277 result += "; ";
executed 3 times by 2 tests: result += "; ";
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
3
278 first = false;-
279 result += cookie.toRawForm(QNetworkCookie::NameAndValueOnly);-
280 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
14
281 return
executed 11 times by 2 tests: return result;
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
result;
executed 11 times by 2 tests: return result;
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
11
282 }-
283-
284 case
executed 3 times by 1 test: case QNetworkRequest::SetCookieHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
QNetworkRequest::SetCookieHeader:
executed 3 times by 1 test: case QNetworkRequest::SetCookieHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
{
3
285 QList<QNetworkCookie> cookies = qvariant_cast<QList<QNetworkCookie> >(value);-
286 if (cookies.isEmpty()
cookies.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
&& value.userType() == qMetaTypeId<QNetworkCookie>()
value.userType...tworkCookie>()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-3
287 cookies << qvariant_cast<QNetworkCookie>(value);
never executed: cookies << qvariant_cast<QNetworkCookie>(value);
0
288-
289 QByteArray result;-
290 bool first = true;-
291 for (const QNetworkCookie &cookie : qAsConst(cookies)) {-
292 if (!first
!firstDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
)
1-3
293 result += ", ";
executed 1 time by 1 test: result += ", ";
Executed by:
  • tst_qnetworkrequest - unknown status
1
294 first = false;-
295 result += cookie.toRawForm(QNetworkCookie::Full);-
296 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qnetworkrequest - unknown status
4
297 return
executed 3 times by 1 test: return result;
Executed by:
  • tst_qnetworkrequest - unknown status
result;
executed 3 times by 1 test: return result;
Executed by:
  • tst_qnetworkrequest - unknown status
3
298 }-
299 }-
300-
301 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
302}-
303-
304static int parseHeaderName(const QByteArray &headerName)-
305{-
306 if (headerName.isEmpty()
headerName.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 5862 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
0-5862
307 return
never executed: return -1;
-1;
never executed: return -1;
0
308-
309 switch (tolower(headerName.at(0))) {-
310 case
executed 2183 times by 7 tests: case 'c':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
'c':
executed 2183 times by 7 tests: case 'c':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
2183
311 if (qstricmp(headerName.constData(), "content-type") == 0
qstricmp(heade...nt-type") == 0Description
TRUEevaluated 917 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 1266 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
917-1266
312 return
executed 917 times by 6 tests: return QNetworkRequest::ContentTypeHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentTypeHeader;
executed 917 times by 6 tests: return QNetworkRequest::ContentTypeHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
917
313 else if (qstricmp(headerName.constData(), "content-length") == 0
qstricmp(heade...-length") == 0Description
TRUEevaluated 590 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 676 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
590-676
314 return
executed 590 times by 7 tests: return QNetworkRequest::ContentLengthHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentLengthHeader;
executed 590 times by 7 tests: return QNetworkRequest::ContentLengthHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
590
315 else if (qstricmp(headerName.constData(), "cookie") == 0
qstricmp(heade..."cookie") == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
FALSEevaluated 674 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
2-674
316 return
executed 2 times by 1 test: return QNetworkRequest::CookieHeader;
Executed by:
  • tst_qnetworkrequest - unknown status
QNetworkRequest::CookieHeader;
executed 2 times by 1 test: return QNetworkRequest::CookieHeader;
Executed by:
  • tst_qnetworkrequest - unknown status
2
317 break;
executed 674 times by 6 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
674
318-
319 case
executed 360 times by 6 tests: case 'l':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
'l':
executed 360 times by 6 tests: case 'l':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
360
320 if (qstricmp(headerName.constData(), "location") == 0
qstricmp(heade...ocation") == 0Description
TRUEevaluated 47 times by 3 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 313 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
47-313
321 return
executed 47 times by 3 tests: return QNetworkRequest::LocationHeader;
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LocationHeader;
executed 47 times by 3 tests: return QNetworkRequest::LocationHeader;
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
47
322 else if (qstricmp(headerName.constData(), "last-modified") == 0
qstricmp(heade...odified") == 0Description
TRUEevaluated 313 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEnever evaluated
)
0-313
323 return
executed 313 times by 5 tests: return QNetworkRequest::LastModifiedHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LastModifiedHeader;
executed 313 times by 5 tests: return QNetworkRequest::LastModifiedHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
313
324 break;
never executed: break;
0
325-
326 case
executed 851 times by 7 tests: case 's':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
's':
executed 851 times by 7 tests: case 's':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
851
327 if (qstricmp(headerName.constData(), "set-cookie") == 0
qstricmp(heade...-cookie") == 0Description
TRUEevaluated 19 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 832 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
19-832
328 return
executed 19 times by 3 tests: return QNetworkRequest::SetCookieHeader;
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QNetworkRequest::SetCookieHeader;
executed 19 times by 3 tests: return QNetworkRequest::SetCookieHeader;
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
19
329 else if (qstricmp(headerName.constData(), "server") == 0
qstricmp(heade..."server") == 0Description
TRUEevaluated 831 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-831
330 return
executed 831 times by 5 tests: return QNetworkRequest::ServerHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
QNetworkRequest::ServerHeader;
executed 831 times by 5 tests: return QNetworkRequest::ServerHeader;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
831
331 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QNetworkReply
1
332-
333 case
executed 9 times by 2 tests: case 'u':
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
'u':
executed 9 times by 2 tests: case 'u':
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
9
334 if (qstricmp(headerName.constData(), "user-agent") == 0
qstricmp(heade...r-agent") == 0Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
FALSEnever evaluated
)
0-9
335 return
executed 9 times by 2 tests: return QNetworkRequest::UserAgentHeader;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
QNetworkRequest::UserAgentHeader;
executed 9 times by 2 tests: return QNetworkRequest::UserAgentHeader;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
9
336 break;
never executed: break;
0
337 }-
338-
339 return
executed 3134 times by 8 tests: return -1;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
-1;
executed 3134 times by 8 tests: return -1;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
3134
340}-
341-
342static QVariant parseHttpDate(const QByteArray &raw)-
343{-
344 QDateTime dt = QNetworkHeadersPrivate::fromHttpDate(raw);-
345 if (dt.isValid()
dt.isValid()Description
TRUEevaluated 313 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEnever evaluated
)
0-313
346 return
executed 313 times by 5 tests: return dt;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
dt;
executed 313 times by 5 tests: return dt;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
313
347 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
348}-
349-
350static QVariant parseCookieHeader(const QByteArray &raw)-
351{-
352 QList<QNetworkCookie> result;-
353 const QList<QByteArray> cookieList = raw.split(';');-
354 for (const QByteArray &cookie : cookieList) {-
355 QList<QNetworkCookie> parsed = QNetworkCookie::parseCookies(cookie.trimmed());-
356 if (parsed.count() != 1
parsed.count() != 1Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
)
0-3
357 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
358-
359 result += parsed;-
360 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qnetworkrequest - unknown status
3
361-
362 return
executed 2 times by 1 test: return QVariant::fromValue(result);
Executed by:
  • tst_qnetworkrequest - unknown status
QVariant::fromValue(result);
executed 2 times by 1 test: return QVariant::fromValue(result);
Executed by:
  • tst_qnetworkrequest - unknown status
2
363}-
364-
365static QVariant parseHeaderValue(QNetworkRequest::KnownHeaders header, const QByteArray &value)-
366{-
367-
368 switch (header) {-
369 case
executed 9 times by 2 tests: case QNetworkRequest::UserAgentHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
QNetworkRequest::UserAgentHeader:
executed 9 times by 2 tests: case QNetworkRequest::UserAgentHeader:
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
9
370 case
executed 831 times by 5 tests: case QNetworkRequest::ServerHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
QNetworkRequest::ServerHeader:
executed 831 times by 5 tests: case QNetworkRequest::ServerHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
831
371 case
executed 917 times by 6 tests: case QNetworkRequest::ContentTypeHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentTypeHeader:
executed 917 times by 6 tests: case QNetworkRequest::ContentTypeHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
917
372-
373 return
executed 1757 times by 7 tests: return QString::fromLatin1(value);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QString::fromLatin1(value);
executed 1757 times by 7 tests: return QString::fromLatin1(value);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
1757
374-
375 case
executed 589 times by 7 tests: case QNetworkRequest::ContentLengthHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::ContentLengthHeader:
executed 589 times by 7 tests: case QNetworkRequest::ContentLengthHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
{
589
376 bool ok;-
377 qint64 result = value.trimmed().toLongLong(&ok);-
378 if (ok
okDescription
TRUEevaluated 587 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
)
2-587
379 return
executed 587 times by 7 tests: return result;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
result;
executed 587 times by 7 tests: return result;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
587
380 return
executed 2 times by 1 test: return QVariant();
Executed by:
  • tst_qnetworkrequest - unknown status
QVariant();
executed 2 times by 1 test: return QVariant();
Executed by:
  • tst_qnetworkrequest - unknown status
2
381 }-
382-
383 case
executed 47 times by 3 tests: case QNetworkRequest::LocationHeader:
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LocationHeader:
executed 47 times by 3 tests: case QNetworkRequest::LocationHeader:
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
{
47
384 QUrl result = QUrl::fromEncoded(value, QUrl::StrictMode);-
385 if (result.isValid()
result.isValid()Description
TRUEevaluated 45 times by 3 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
&& !result.scheme().isEmpty()
!result.scheme().isEmpty()Description
TRUEevaluated 44 times by 3 tests
Evaluated by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
)
1-45
386 return
executed 44 times by 3 tests: return result;
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
result;
executed 44 times by 3 tests: return result;
Executed by:
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
44
387 return
executed 3 times by 1 test: return QVariant();
Executed by:
  • tst_qnetworkrequest - unknown status
QVariant();
executed 3 times by 1 test: return QVariant();
Executed by:
  • tst_qnetworkrequest - unknown status
3
388 }-
389-
390 case
executed 313 times by 5 tests: case QNetworkRequest::LastModifiedHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
QNetworkRequest::LastModifiedHeader:
executed 313 times by 5 tests: case QNetworkRequest::LastModifiedHeader:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
313
391 return
executed 313 times by 5 tests: return parseHttpDate(value);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
parseHttpDate(value);
executed 313 times by 5 tests: return parseHttpDate(value);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
313
392-
393 case
executed 2 times by 1 test: case QNetworkRequest::CookieHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
QNetworkRequest::CookieHeader:
executed 2 times by 1 test: case QNetworkRequest::CookieHeader:
Executed by:
  • tst_qnetworkrequest - unknown status
2
394 return
executed 2 times by 1 test: return parseCookieHeader(value);
Executed by:
  • tst_qnetworkrequest - unknown status
parseCookieHeader(value);
executed 2 times by 1 test: return parseCookieHeader(value);
Executed by:
  • tst_qnetworkrequest - unknown status
2
395-
396 case
executed 19 times by 3 tests: case QNetworkRequest::SetCookieHeader:
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QNetworkRequest::SetCookieHeader:
executed 19 times by 3 tests: case QNetworkRequest::SetCookieHeader:
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
19
397 return
executed 19 times by 3 tests: return QVariant::fromValue(QNetworkCookie::parseCookies(value));
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
QVariant::fromValue(QNetworkCookie::parseCookies(value));
executed 19 times by 3 tests: return QVariant::fromValue(QNetworkCookie::parseCookies(value));
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
19
398-
399 default
never executed: default:
:
never executed: default:
0
400 ((!(0)) ? qt_assert("0",__FILE__,907) : qt_noop());-
401 }
never executed: end of block
0
402 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
403}-
404-
405QNetworkHeadersPrivate::RawHeadersList::ConstIterator-
406QNetworkHeadersPrivate::findRawHeader(const QByteArray &key) const-
407{-
408 RawHeadersList::ConstIterator it = rawHeaders.constBegin();-
409 RawHeadersList::ConstIterator end = rawHeaders.constEnd();-
410 for ( ; it != end
it != endDescription
TRUEevaluated 20068 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 6784 times by 13 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkrequest - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
; ++it)
6784-20068
411 if (qstricmp(it->first.constData(), key.constData()) == 0
qstricmp(it->f...stData()) == 0Description
TRUEevaluated 1002 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 19066 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
1002-19066
412 return
executed 1002 times by 7 tests: return it;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
it;
executed 1002 times by 7 tests: return it;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
1002
413-
414 return
executed 6784 times by 13 tests: return end;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkrequest - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
end;
executed 6784 times by 13 tests: return end;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkrequest - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
6784
415}-
416-
417QNetworkHeadersPrivate::RawHeadersList QNetworkHeadersPrivate::allRawHeaders() const-
418{-
419 return
executed 26 times by 2 tests: return rawHeaders;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
rawHeaders;
executed 26 times by 2 tests: return rawHeaders;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
26
420}-
421-
422QList<QByteArray> QNetworkHeadersPrivate::rawHeadersKeys() const-
423{-
424 QList<QByteArray> result;-
425 result.reserve(rawHeaders.size());-
426 RawHeadersList::ConstIterator it = rawHeaders.constBegin(),-
427 end = rawHeaders.constEnd();-
428 for ( ; it != end
it != endDescription
TRUEevaluated 1079 times by 6 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 1533 times by 14 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkrequest - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
; ++it)
1079-1533
429 result << it->first;
executed 1079 times by 6 tests: result << it->first;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
1079
430-
431 return
executed 1533 times by 14 tests: return result;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkrequest - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
result;
executed 1533 times by 14 tests: return result;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkrequest - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1533
432}-
433-
434void QNetworkHeadersPrivate::setRawHeader(const QByteArray &key, const QByteArray &value)-
435{-
436 if (key.isEmpty()
key.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
FALSEevaluated 5698 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
2-5698
437-
438 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qnetworkrequest - unknown status
2
439-
440 setRawHeaderInternal(key, value);-
441 parseAndSetHeader(key, value);-
442}
executed 5698 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
5698
443void QNetworkHeadersPrivate::setAllRawHeaders(const RawHeadersList &list)-
444{-
445 cookedHeaders.clear();-
446 rawHeaders = list;-
447-
448 RawHeadersList::ConstIterator it = rawHeaders.constBegin();-
449 RawHeadersList::ConstIterator end = rawHeaders.constEnd();-
450 for ( ; it != end
it != endDescription
TRUEevaluated 164 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 107 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
; ++it)
107-164
451 parseAndSetHeader(it->first, it->second);
executed 164 times by 3 tests: parseAndSetHeader(it->first, it->second);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
164
452}
executed 107 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
107
453-
454void QNetworkHeadersPrivate::setCookedHeader(QNetworkRequest::KnownHeaders header,-
455 const QVariant &value)-
456{-
457 QByteArray name = headerName(header);-
458 if (name.isEmpty()
name.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 459 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
0-459
459-
460 QMessageLogger(__FILE__, 976, __PRETTY_FUNCTION__).warning("QNetworkRequest::setHeader: invalid header value KnownHeader(%d) received", header);-
461 return;
never executed: return;
0
462 }-
463-
464 if (value.isNull()
value.isNull()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 455 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
4-455
465 setRawHeaderInternal(name, QByteArray());-
466 cookedHeaders.remove(header);-
467 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
else {
4
468 QByteArray rawValue = headerValue(header, value);-
469 if (rawValue.isEmpty()
rawValue.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 455 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
0-455
470 QMessageLogger(__FILE__, 986, __PRETTY_FUNCTION__).warning("QNetworkRequest::setHeader: QVariant of type %s cannot be used with header %s",-
471 value.typeName(), name.constData());-
472 return;
never executed: return;
0
473 }-
474-
475 setRawHeaderInternal(name, rawValue);-
476 cookedHeaders.insert(header, value);-
477 }
executed 455 times by 5 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
455
478}-
479-
480void QNetworkHeadersPrivate::setRawHeaderInternal(const QByteArray &key, const QByteArray &value)-
481{-
482 auto firstEqualsKey = [&key](const RawHeaderPair &header) {-
483 return
executed 17730 times by 9 tests: return qstricmp(header.first.constData(), key.constData()) == 0;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
qstricmp(header.first.constData(), key.constData()) == 0;
executed 17730 times by 9 tests: return qstricmp(header.first.constData(), key.constData()) == 0;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
17730
484 };-
485 rawHeaders.erase(std::remove_if(rawHeaders.begin(), rawHeaders.end(),-
486 firstEqualsKey),-
487 rawHeaders.end());-
488-
489 if (value.isNull()
value.isNull()Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
FALSEevaluated 6148 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
)
9-6148
490 return;
executed 9 times by 2 tests: return;
Executed by:
  • tst_QNetworkReply
  • tst_qnetworkrequest - unknown status
9
491-
492 RawHeaderPair pair;-
493 pair.first = key;-
494 pair.second = value;-
495 rawHeaders.append(pair);-
496}
executed 6148 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
6148
497-
498void QNetworkHeadersPrivate::parseAndSetHeader(const QByteArray &key, const QByteArray &value)-
499{-
500-
501 const int parsedKeyAsInt = parseHeaderName(key);-
502 if (parsedKeyAsInt != -1
parsedKeyAsInt != -1Description
TRUEevaluated 2728 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 3134 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
2728-3134
503 const QNetworkRequest::KnownHeaders parsedKey-
504 = static_cast<QNetworkRequest::KnownHeaders>(parsedKeyAsInt);-
505 if (value.isNull()
value.isNull()Description
TRUEnever evaluated
FALSEevaluated 2728 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
0-2728
506 cookedHeaders.remove(parsedKey);-
507 }
never executed: end of block
else if (parsedKey == QNetworkRequest::ContentLengthHeader
parsedKey == Q...ntLengthHeaderDescription
TRUEevaluated 590 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 2138 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
0-2138
508 && cookedHeaders.contains(QNetworkRequest::ContentLengthHeader)
cookedHeaders....tLengthHeader)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 589 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
1-589
509-
510-
511 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else {
1
512 cookedHeaders.insert(parsedKey, parseHeaderValue(parsedKey, value));-
513 }
executed 2727 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
2727
514-
515 }-
516}
executed 5862 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
5862
517-
518-
519-
520-
521static int name_to_month(const char* month_str)-
522{-
523 switch (month_str[0]) {-
524 case
executed 20 times by 1 test: case 'J':
Executed by:
  • tst_QAbstractNetworkCache
'J':
executed 20 times by 1 test: case 'J':
Executed by:
  • tst_QAbstractNetworkCache
20
525 switch (month_str[1]) {-
526 case
executed 20 times by 1 test: case 'a':
Executed by:
  • tst_QAbstractNetworkCache
'a':
executed 20 times by 1 test: case 'a':
Executed by:
  • tst_QAbstractNetworkCache
20
527 return
executed 20 times by 1 test: return 1;
Executed by:
  • tst_QAbstractNetworkCache
1;
executed 20 times by 1 test: return 1;
Executed by:
  • tst_QAbstractNetworkCache
20
528 case
never executed: case 'u':
'u':
never executed: case 'u':
0
529 switch (month_str[2] ) {-
530 case
never executed: case 'n':
'n':
never executed: case 'n':
0
531 return
never executed: return 6;
6;
never executed: return 6;
0
532 case
never executed: case 'l':
'l':
never executed: case 'l':
0
533 return
never executed: return 7;
7;
never executed: return 7;
0
534 }-
535 }
never executed: end of block
0
536 break;
never executed: break;
0
537 case
never executed: case 'F':
'F':
never executed: case 'F':
0
538 return
never executed: return 2;
2;
never executed: return 2;
0
539 case
executed 78 times by 2 tests: case 'M':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
'M':
executed 78 times by 2 tests: case 'M':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
78
540 switch (month_str[2] ) {-
541 case
executed 1 time by 1 test: case 'r':
Executed by:
  • tst_QNetworkReply
'r':
executed 1 time by 1 test: case 'r':
Executed by:
  • tst_QNetworkReply
1
542 return
executed 1 time by 1 test: return 3;
Executed by:
  • tst_QNetworkReply
3;
executed 1 time by 1 test: return 3;
Executed by:
  • tst_QNetworkReply
1
543 case
executed 77 times by 2 tests: case 'y':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
'y':
executed 77 times by 2 tests: case 'y':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
77
544 return
executed 77 times by 2 tests: return 5;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
5;
executed 77 times by 2 tests: return 5;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
77
545 }-
546 break;
never executed: break;
0
547 case
never executed: case 'A':
'A':
never executed: case 'A':
0
548 switch (month_str[1]) {-
549 case
never executed: case 'p':
'p':
never executed: case 'p':
0
550 return
never executed: return 4;
4;
never executed: return 4;
0
551 case
never executed: case 'u':
'u':
never executed: case 'u':
0
552 return
never executed: return 8;
8;
never executed: return 8;
0
553 }-
554 break;
never executed: break;
0
555 case
executed 225 times by 4 tests: case 'O':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
'O':
executed 225 times by 4 tests: case 'O':
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
225
556 return
executed 225 times by 4 tests: return 10;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
10;
executed 225 times by 4 tests: return 10;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
225
557 case
never executed: case 'S':
'S':
never executed: case 'S':
0
558 return
never executed: return 9;
9;
never executed: return 9;
0
559 case
executed 42 times by 3 tests: case 'N':
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
'N':
executed 42 times by 3 tests: case 'N':
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
42
560 return
executed 42 times by 3 tests: return 11;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
11;
executed 42 times by 3 tests: return 11;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
42
561 case
never executed: case 'D':
'D':
never executed: case 'D':
0
562 return
never executed: return 12;
12;
never executed: return 12;
0
563 }-
564-
565 return
never executed: return 0;
0;
never executed: return 0;
0
566}-
567-
568QDateTime QNetworkHeadersPrivate::fromHttpDate(const QByteArray &value)-
569{-
570-
571-
572-
573-
574-
575-
576 int pos = value.indexOf(',');-
577 QDateTime dt;-
578-
579 if (pos == -1
pos == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
FALSEevaluated 366 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
) {
1-366
580-
581 dt = QDateTime::fromString(QString::fromLatin1(value), Qt::TextDate);-
582 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qnetworkrequest - unknown status
else {
1
583-
584-
585 if (pos == 3
pos == 3Description
TRUEevaluated 365 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkrequest - unknown status
) {
1-365
586 char month_name[4];-
587 int day, year, hour, minute, second;-
588-
589-
590-
591-
592-
593-
594 if (sscanf(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, &year, &hour, &minute, &second) == 6
sscanf(value.c... &second) == 6Description
TRUEevaluated 365 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEnever evaluated
)
0-365
595-
596 dt = QDateTime(QDate(year, name_to_month(month_name), day), QTime(hour, minute, second));
executed 365 times by 5 tests: dt = QDateTime(QDate(year, name_to_month(month_name), day), QTime(hour, minute, second));
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
365
597 }
executed 365 times by 5 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
else {
365
598 QLocale c = QLocale::c();-
599-
600 QString sansWeekday = QString::fromLatin1(value.constData() + pos + 2);-
601-
602 dt = c.toDateTime(sansWeekday, QLatin1String("dd-MMM-yy hh:mm:ss 'GMT'"));-
603 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qnetworkrequest - unknown status
1
604 }-
605-
606-
607 if (dt.isValid()
dt.isValid()Description
TRUEevaluated 367 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
FALSEnever evaluated
)
0-367
608 dt.setTimeSpec(Qt::UTC);
executed 367 times by 5 tests: dt.setTimeSpec(Qt::UTC);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
367
609 return
executed 367 times by 5 tests: return dt;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
dt;
executed 367 times by 5 tests: return dt;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qnetworkrequest - unknown status
367
610}-
611-
612QByteArray QNetworkHeadersPrivate::toHttpDate(const QDateTime &dt)-
613{-
614 return
executed 79 times by 4 tests: return QLocale::c().toString(dt, QLatin1String("ddd, dd MMM yyyy hh:mm:ss 'GMT'")) .toLatin1();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
QLocale::c().toString(dt, QLatin1String("ddd, dd MMM yyyy hh:mm:ss 'GMT'"))
executed 79 times by 4 tests: return QLocale::c().toString(dt, QLatin1String("ddd, dd MMM yyyy hh:mm:ss 'GMT'")) .toLatin1();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
79
615 .toLatin1();
executed 79 times by 4 tests: return QLocale::c().toString(dt, QLatin1String("ddd, dd MMM yyyy hh:mm:ss 'GMT'")) .toLatin1();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_qnetworkrequest - unknown status
79
616}-
617-
618-
Switch to Source codePreprocessed file

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