qnetworkaccessmanager.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/access/qnetworkaccessmanager.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12namespace { namespace Q_QGS_fileBackend { typedef QNetworkAccessFileBackendFactory Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 10 times by 10 tests
Evaluated by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 10 times by 10 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
}
executed 10 times by 10 tests: end of block
Executed by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 91 times by 10 tests: return &holder.value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
&holder.value;
executed 91 times by 10 tests: return &holder.value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
} } } static QGlobalStatic<QNetworkAccessFileBackendFactory, Q_QGS_fileBackend::innerFunction, Q_QGS_fileBackend::guard> fileBackend;
0-91
13-
14namespace { namespace Q_QGS_ftpBackend { typedef QNetworkAccessFtpBackendFactory Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 10 times by 10 tests
Evaluated by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 10 times by 10 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
}
executed 10 times by 10 tests: end of block
Executed by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 91 times by 10 tests: return &holder.value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
&holder.value;
executed 91 times by 10 tests: return &holder.value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
} } } static QGlobalStatic<QNetworkAccessFtpBackendFactory, Q_QGS_ftpBackend::innerFunction, Q_QGS_ftpBackend::guard> ftpBackend;
0-91
15-
16-
17-
18namespace { namespace Q_QGS_debugpipeBackend { typedef QNetworkAccessDebugPipeBackendFactory Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 10 times by 10 tests
Evaluated by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 10 times by 10 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
}
executed 10 times by 10 tests: end of block
Executed by:
  • tst_qabstractnetworkcache - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfigurationmanagerqappless - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 91 times by 10 tests: return &holder.value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
&holder.value;
executed 91 times by 10 tests: return &holder.value;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
} } } static QGlobalStatic<QNetworkAccessDebugPipeBackendFactory, Q_QGS_debugpipeBackend::innerFunction, Q_QGS_debugpipeBackend::guard> debugpipeBackend;
0-91
19static void ensureInitialized()-
20{-
21-
22 (void) ftpBackend();-
23-
24-
25-
26 (void) debugpipeBackend();-
27-
28-
29-
30 (void) fileBackend();-
31}
executed 91 times by 10 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
91
32QNetworkAccessManager::QNetworkAccessManager(QObject *parent)-
33 : QObject(*new QNetworkAccessManagerPrivate, parent)-
34{-
35 ensureInitialized();-
36-
37 qRegisterMetaType<QNetworkReply::NetworkError>();-
38-
39 qRegisterMetaType<QNetworkProxy>();-
40-
41-
42 qRegisterMetaType<QList<QSslError> >();-
43 qRegisterMetaType<QSslConfiguration>();-
44 qRegisterMetaType<QSslPreSharedKeyAuthenticator *>();-
45-
46 qRegisterMetaType<QList<QPair<QByteArray,QByteArray> > >();-
47-
48 qRegisterMetaType<QHttpNetworkRequest>();-
49-
50 qRegisterMetaType<QNetworkReply::NetworkError>();-
51 qRegisterMetaType<QSharedPointer<char> >();-
52-
53-
54 QNetworkAccessManagerPrivate * const d = d_func();-
55-
56-
57-
58-
59 connect(&d->networkConfigurationManager, qFlagLocation("2""onlineStateChanged(bool)" "\0" __FILE__ ":" "477"),-
60 qFlagLocation("1""_q_onlineStateChanged(bool)" "\0" __FILE__ ":" "478"));-
61 connect(&d->networkConfigurationManager, qFlagLocation("2""configurationChanged(const QNetworkConfiguration &)" "\0" __FILE__ ":" "479"),-
62 qFlagLocation("1""_q_configurationChanged(const QNetworkConfiguration &)" "\0" __FILE__ ":" "480"));-
63-
64-
65}
executed 91 times by 10 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
91
66QNetworkAccessManager::~QNetworkAccessManager()-
67{-
68-
69 delete d_func()->proxyFactory;-
70-
71-
72-
73-
74-
75-
76 qDeleteAll(findChildren<QNetworkReply *>());-
77-
78-
79-
80}
executed 92 times by 11 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_spdy - unknown status
92
81QNetworkProxy QNetworkAccessManager::proxy() const-
82{-
83 return
never executed: return d_func()->proxy;
d_func()->proxy;
never executed: return d_func()->proxy;
0
84}-
85void QNetworkAccessManager::setProxy(const QNetworkProxy &proxy)-
86{-
87 QNetworkAccessManagerPrivate * const d = d_func();-
88 delete d->proxyFactory;-
89 d->proxy = proxy;-
90 d->proxyFactory = 0;-
91}
executed 788 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
788
92QNetworkProxyFactory *QNetworkAccessManager::proxyFactory() const-
93{-
94 return
never executed: return d_func()->proxyFactory;
d_func()->proxyFactory;
never executed: return d_func()->proxyFactory;
0
95}-
96void QNetworkAccessManager::setProxyFactory(QNetworkProxyFactory *factory)-
97{-
98 QNetworkAccessManagerPrivate * const d = d_func();-
99 delete d->proxyFactory;-
100 d->proxyFactory = factory;-
101 d->proxy = QNetworkProxy();-
102}
executed 20 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
20
103QAbstractNetworkCache *QNetworkAccessManager::cache() const-
104{-
105 const QNetworkAccessManagerPrivate * const d = d_func();-
106 return
never executed: return d->networkCache;
d->networkCache;
never executed: return d->networkCache;
0
107}-
108void QNetworkAccessManager::setCache(QAbstractNetworkCache *cache)-
109{-
110 QNetworkAccessManagerPrivate * const d = d_func();-
111 if (d->networkCache != cache
d->networkCache != cacheDescription
TRUEevaluated 94 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 614 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
94-614
112 delete d->networkCache;-
113 d->networkCache = cache;-
114 if (d->networkCache
d->networkCacheDescription
TRUEevaluated 69 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
)
25-69
115 d->networkCache->setParent(this);
executed 69 times by 3 tests: d->networkCache->setParent(this);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
69
116 }
executed 94 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
94
117}
executed 708 times by 3 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
708
118QNetworkCookieJar *QNetworkAccessManager::cookieJar() const-
119{-
120 const QNetworkAccessManagerPrivate * const d = d_func();-
121 if (!d->cookieJar
!d->cookieJarDescription
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-13
122 d->createCookieJar();
never executed: d->createCookieJar();
0
123 return
executed 13 times by 1 test: return d->cookieJar;
Executed by:
  • tst_QNetworkReply
d->cookieJar;
executed 13 times by 1 test: return d->cookieJar;
Executed by:
  • tst_QNetworkReply
13
124}-
125void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)-
126{-
127 QNetworkAccessManagerPrivate * const d = d_func();-
128 d->cookieJarCreated = true;-
129 if (d->cookieJar != cookieJar
d->cookieJar != cookieJarDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
130 if (d->cookieJar
d->cookieJarDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->cookieJar->parent() == this
d->cookieJar->parent() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
131 delete d->cookieJar;
never executed: delete d->cookieJar;
0
132 d->cookieJar = cookieJar;-
133 if (thread() == cookieJar->thread()
thread() == co...eJar->thread()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
134 d->cookieJar->setParent(this);
never executed: d->cookieJar->setParent(this);
0
135 }
never executed: end of block
0
136}
never executed: end of block
0
137-
138-
139-
140-
141-
142-
143-
144QNetworkReply *QNetworkAccessManager::head(const QNetworkRequest &request)-
145{-
146 return
executed 27 times by 1 test: return d_func()->postProcess(createRequest(QNetworkAccessManager::HeadOperation, request));
Executed by:
  • tst_QNetworkReply
d_func()->postProcess(createRequest(QNetworkAccessManager::HeadOperation, request));
executed 27 times by 1 test: return d_func()->postProcess(createRequest(QNetworkAccessManager::HeadOperation, request));
Executed by:
  • tst_QNetworkReply
27
147}-
148QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request)-
149{-
150 return
executed 776 times by 9 tests: return d_func()->postProcess(createRequest(QNetworkAccessManager::GetOperation, request));
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_Spdy
d_func()->postProcess(createRequest(QNetworkAccessManager::GetOperation, request));
executed 776 times by 9 tests: return d_func()->postProcess(createRequest(QNetworkAccessManager::GetOperation, request));
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_Spdy
776
151}-
152QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, QIODevice *data)-
153{-
154 return
executed 157 times by 3 tests: return d_func()->postProcess(createRequest(QNetworkAccessManager::PostOperation, request, data));
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
d_func()->postProcess(createRequest(QNetworkAccessManager::PostOperation, request, data));
executed 157 times by 3 tests: return d_func()->postProcess(createRequest(QNetworkAccessManager::PostOperation, request, data));
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
157
155}-
156-
157-
158-
159-
160-
161-
162-
163QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, const QByteArray &data)-
164{-
165 QBuffer *buffer = new QBuffer;-
166 buffer->setData(data);-
167 buffer->open(QIODevice::ReadOnly);-
168-
169 QNetworkReply *reply = post(request, buffer);-
170 buffer->setParent(reply);-
171 return
executed 54 times by 3 tests: return reply;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
reply;
executed 54 times by 3 tests: return reply;
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
54
172}-
173QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, QHttpMultiPart *multiPart)-
174{-
175 QNetworkRequest newRequest = d_func()->prepareMultipart(request, multiPart);-
176 QIODevice *device = multiPart->d_func()->device;-
177 QNetworkReply *reply = post(newRequest, device);-
178 return
executed 24 times by 2 tests: return reply;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
reply;
executed 24 times by 2 tests: return reply;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
24
179}-
180QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, QHttpMultiPart *multiPart)-
181{-
182 QNetworkRequest newRequest = d_func()->prepareMultipart(request, multiPart);-
183 QIODevice *device = multiPart->d_func()->device;-
184 QNetworkReply *reply = put(newRequest, device);-
185 return
never executed: return reply;
reply;
never executed: return reply;
0
186}-
187QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, QIODevice *data)-
188{-
189 return
executed 95 times by 2 tests: return d_func()->postProcess(createRequest(QNetworkAccessManager::PutOperation, request, data));
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
d_func()->postProcess(createRequest(QNetworkAccessManager::PutOperation, request, data));
executed 95 times by 2 tests: return d_func()->postProcess(createRequest(QNetworkAccessManager::PutOperation, request, data));
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
95
190}-
191-
192-
193-
194-
195-
196-
197-
198QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, const QByteArray &data)-
199{-
200 QBuffer *buffer = new QBuffer;-
201 buffer->setData(data);-
202 buffer->open(QIODevice::ReadOnly);-
203-
204 QNetworkReply *reply = put(request, buffer);-
205 buffer->setParent(reply);-
206 return
executed 55 times by 2 tests: return reply;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
reply;
executed 55 times by 2 tests: return reply;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
55
207}-
208QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &request)-
209{-
210 return
executed 7 times by 1 test: return d_func()->postProcess(createRequest(QNetworkAccessManager::DeleteOperation, request));
Executed by:
  • tst_QNetworkReply
d_func()->postProcess(createRequest(QNetworkAccessManager::DeleteOperation, request));
executed 7 times by 1 test: return d_func()->postProcess(createRequest(QNetworkAccessManager::DeleteOperation, request));
Executed by:
  • tst_QNetworkReply
7
211}-
212void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config)-
213{-
214 QNetworkAccessManagerPrivate * const d = d_func();-
215 d->networkConfiguration = config;-
216 d->customNetworkConfiguration = true;-
217 d->createSession(config);-
218}
executed 26 times by 3 tests: end of block
Executed by:
  • tst_QNetworkAccessManager
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
26
219QNetworkConfiguration QNetworkAccessManager::configuration() const-
220{-
221 const QNetworkAccessManagerPrivate * const d = d_func();-
222-
223 QSharedPointer<QNetworkSession> session(d->getNetworkSession());-
224 if (session
sessionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
225 return
never executed: return session->configuration();
session->configuration();
never executed: return session->configuration();
0
226 } else {-
227 QNetworkConfigurationManager manager;-
228 return
never executed: return manager.defaultConfiguration();
manager.defaultConfiguration();
never executed: return manager.defaultConfiguration();
0
229 }-
230}-
231QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const-
232{-
233 const QNetworkAccessManagerPrivate * const d = d_func();-
234-
235 QSharedPointer<QNetworkSession> networkSession(d->getNetworkSession());-
236 QNetworkConfigurationManager manager;-
237 if (networkSession
networkSessionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
238 return
never executed: return manager.configurationFromIdentifier( networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString());
manager.configurationFromIdentifier(
never executed: return manager.configurationFromIdentifier( networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString());
0
239 networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString());
never executed: return manager.configurationFromIdentifier( networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString());
0
240 } else {-
241 return
never executed: return manager.defaultConfiguration();
manager.defaultConfiguration();
never executed: return manager.defaultConfiguration();
0
242 }-
243}-
244void QNetworkAccessManager::setNetworkAccessible(QNetworkAccessManager::NetworkAccessibility accessible)-
245{-
246 QNetworkAccessManagerPrivate * const d = d_func();-
247-
248 d->defaultAccessControl = accessible == NotAccessible
accessible == NotAccessibleDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
? false : true;
1-2
249-
250 if (d->networkAccessible != accessible
d->networkAcce... != accessibleDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
FALSEnever evaluated
) {
0-3
251 NetworkAccessibility previous = networkAccessible();-
252 d->networkAccessible = accessible;-
253 NetworkAccessibility current = networkAccessible();-
254 if (previous != current
previous != currentDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
FALSEnever evaluated
)
0-3
255 networkAccessibleChanged(current);
executed 3 times by 1 test: networkAccessibleChanged(current);
Executed by:
  • tst_QNetworkAccessManager
3
256 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QNetworkAccessManager
3
257}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QNetworkAccessManager
3
258-
259-
260-
261-
262-
263-
264QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccessible() const-
265{-
266 const QNetworkAccessManagerPrivate * const d = d_func();-
267-
268 if (d->networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined)
d->networkConf...on::Undefined)Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
)
0-12
269 return
never executed: return UnknownAccessibility;
UnknownAccessibility;
never executed: return UnknownAccessibility;
0
270-
271 if (d->networkSessionRequired
d->networkSessionRequiredDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
) {
0-12
272 QSharedPointer<QNetworkSession> networkSession(d->getNetworkSession());-
273 if (networkSession
networkSessionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
274-
275 if (d->online
d->onlineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
276 return
never executed: return d->networkAccessible;
d->networkAccessible;
never executed: return d->networkAccessible;
0
277 else-
278 return
never executed: return NotAccessible;
NotAccessible;
never executed: return NotAccessible;
0
279 } else {-
280 if (d->defaultAccessControl
d->defaultAccessControlDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
281 if (d->online
d->onlineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
282 return
never executed: return d->networkAccessible;
d->networkAccessible;
never executed: return d->networkAccessible;
0
283 else-
284 return
never executed: return NotAccessible;
NotAccessible;
never executed: return NotAccessible;
0
285 }-
286 return
never executed: return (d->networkAccessible);
(d->networkAccessible);
never executed: return (d->networkAccessible);
0
287 }-
288 } else {-
289 if (d->online
d->onlineDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkAccessManager
FALSEnever evaluated
)
0-12
290 return
executed 12 times by 1 test: return d->networkAccessible;
Executed by:
  • tst_QNetworkAccessManager
d->networkAccessible;
executed 12 times by 1 test: return d->networkAccessible;
Executed by:
  • tst_QNetworkAccessManager
12
291 else-
292 return
never executed: return NotAccessible;
NotAccessible;
never executed: return NotAccessible;
0
293 }-
294}-
295-
296-
297-
298-
299-
300-
301-
302const QWeakPointer<const QNetworkSession> QNetworkAccessManagerPrivate::getNetworkSession(const QNetworkAccessManager *q)-
303{-
304 return
executed 30 times by 1 test: return q->d_func()->networkSessionWeakRef;
Executed by:
  • tst_QNetworkReply
q->d_func()->networkSessionWeakRef;
executed 30 times by 1 test: return q->d_func()->networkSessionWeakRef;
Executed by:
  • tst_QNetworkReply
30
305}-
306-
307QSharedPointer<QNetworkSession> QNetworkAccessManagerPrivate::getNetworkSession() const-
308{-
309 if (networkSessionStrongRef
networkSessionStrongRefDescription
TRUEevaluated 4125 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 28 times by 2 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
)
28-4125
310 return
executed 4125 times by 8 tests: return networkSessionStrongRef;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
networkSessionStrongRef;
executed 4125 times by 8 tests: return networkSessionStrongRef;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
4125
311 return
executed 28 times by 2 tests: return networkSessionWeakRef.toStrongRef();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
networkSessionWeakRef.toStrongRef();
executed 28 times by 2 tests: return networkSessionWeakRef.toStrongRef();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
28
312}-
313void QNetworkAccessManager::connectToHostEncrypted(const QString &hostName, quint16 port,-
314 const QSslConfiguration &sslConfiguration)-
315{-
316 QUrl url;-
317 url.setHost(hostName);-
318 url.setPort(port);-
319 url.setScheme(QLatin1String("preconnect-https"));-
320 QNetworkRequest request(url);-
321 if (sslConfiguration != QSslConfiguration::defaultConfiguration()
sslConfigurati...onfiguration()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
322 request.setSslConfiguration(sslConfiguration);
never executed: request.setSslConfiguration(sslConfiguration);
0
323-
324-
325-
326 if (sslConfiguration.allowedNextProtocols().contains(
sslConfigurati...otocolSpdy3_0)Description
TRUEnever evaluated
FALSEnever evaluated
0
327 QSslConfiguration::NextProtocolSpdy3_0)
sslConfigurati...otocolSpdy3_0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
328 request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true);
never executed: request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true);
0
329-
330 get(request);-
331}
never executed: end of block
0
332void QNetworkAccessManager::connectToHost(const QString &hostName, quint16 port)-
333{-
334 QUrl url;-
335 url.setHost(hostName);-
336 url.setPort(port);-
337 url.setScheme(QLatin1String("preconnect-http"));-
338 QNetworkRequest request(url);-
339 get(request);-
340}
never executed: end of block
0
341QNetworkReply *QNetworkAccessManager::sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data)-
342{-
343 QNetworkRequest newRequest(request);-
344 newRequest.setAttribute(QNetworkRequest::CustomVerbAttribute, verb);-
345 return
executed 7 times by 1 test: return d_func()->postProcess(createRequest(QNetworkAccessManager::CustomOperation, newRequest, data));
Executed by:
  • tst_QNetworkReply
d_func()->postProcess(createRequest(QNetworkAccessManager::CustomOperation, newRequest, data));
executed 7 times by 1 test: return d_func()->postProcess(createRequest(QNetworkAccessManager::CustomOperation, newRequest, data));
Executed by:
  • tst_QNetworkReply
7
346}-
347QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Operation op,-
348 const QNetworkRequest &req,-
349 QIODevice *outgoingData)-
350{-
351 QNetworkAccessManagerPrivate * const d = d_func();-
352-
353 bool isLocalFile = req.url().isLocalFile();-
354 QString scheme = req.url().scheme();-
355-
356-
357-
358 if (op == QNetworkAccessManager::GetOperation
op == QNetwork...::GetOperationDescription
TRUEevaluated 776 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_Spdy
FALSEevaluated 293 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
293-776
359 || op == QNetworkAccessManager::HeadOperation
op == QNetwork...:HeadOperationDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 266 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
27-266
360 if (isLocalFile
isLocalFileDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlStream
FALSEevaluated 775 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
28-775
361-
362-
363-
364 || scheme == QLatin1String("qrc")
scheme == QLatin1String("qrc")Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 773 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
2-773
365 return
executed 30 times by 2 tests: return new QNetworkReplyFileImpl(this, req, op);
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
new QNetworkReplyFileImpl(this, req, op);
executed 30 times by 2 tests: return new QNetworkReplyFileImpl(this, req, op);
Executed by:
  • tst_QNetworkReply
  • tst_QXmlStream
30
366 }-
367-
368 if (scheme == QLatin1String("data")
scheme == QLat...String("data")Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 743 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
)
30-743
369 return
executed 30 times by 1 test: return new QNetworkReplyDataImpl(this, req, op);
Executed by:
  • tst_QNetworkReply
new QNetworkReplyDataImpl(this, req, op);
executed 30 times by 1 test: return new QNetworkReplyDataImpl(this, req, op);
Executed by:
  • tst_QNetworkReply
30
370-
371-
372 QNetworkRequest::CacheLoadControl mode =-
373 static_cast<QNetworkRequest::CacheLoadControl>(-
374 req.attribute(QNetworkRequest::CacheLoadControlAttribute,-
375 QNetworkRequest::PreferNetwork).toInt());-
376 if (mode == QNetworkRequest::AlwaysCache
mode == QNetwo...t::AlwaysCacheDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
  • tst_QNetworkReply
FALSEevaluated 729 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
) {
14-729
377-
378 QNetworkReplyImpl *reply = new QNetworkReplyImpl(this);-
379 QNetworkReplyImplPrivate *priv = reply->d_func();-
380 priv->manager = this;-
381 priv->backend = new QNetworkAccessCacheBackend();-
382 priv->backend->manager = this->d_func();-
383 priv->backend->setParent(reply);-
384 priv->backend->reply = priv;-
385 priv->setup(op, req, outgoingData);-
386 return
executed 14 times by 3 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
  • tst_QNetworkReply
reply;
executed 14 times by 3 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
  • tst_QNetworkReply
14
387 }-
388 }
executed 729 times by 7 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
729
389-
390-
391-
392-
393 if (d->networkAccessible == NotAccessible
d->networkAcce... NotAccessibleDescription
TRUEnever evaluated
FALSEevaluated 995 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& !isLocalFile
!isLocalFileDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-995
394 return
never executed: return new QDisabledNetworkReply(this, req, op);
new QDisabledNetworkReply(this, req, op);
never executed: return new QDisabledNetworkReply(this, req, op);
0
395 }-
396-
397 if (!d->networkSessionStrongRef
!d->networkSessionStrongRefDescription
TRUEevaluated 196 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 799 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
&& (d->initializeSession
d->initializeSessionDescription
TRUEevaluated 85 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 111 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
|| !d->networkConfiguration.identifier().isEmpty()
!d->networkCon...er().isEmpty()Description
TRUEevaluated 111 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)) {
0-799
398 QNetworkConfigurationManager manager;-
399 if (!d->networkConfiguration.identifier().isEmpty()
!d->networkCon...er().isEmpty()Description
TRUEevaluated 196 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
) {
0-196
400 if ((d->networkConfiguration.state() & QNetworkConfiguration::Defined)-
401 && d->networkConfiguration != manager.defaultConfiguration()
d->networkConf...onfiguration()Description
TRUEnever evaluated
FALSEevaluated 196 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
)
0-196
402 d->createSession(manager.defaultConfiguration());
never executed: d->createSession(manager.defaultConfiguration());
0
403 else-
404 d->createSession(d->networkConfiguration);
executed 196 times by 7 tests: d->createSession(d->networkConfiguration);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
196
405-
406 } else {-
407 if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired
manager.capabi...essionRequiredDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
408 d->createSession(manager.defaultConfiguration());
never executed: d->createSession(manager.defaultConfiguration());
0
409 else-
410 d->initializeSession = false;
never executed: d->initializeSession = false;
0
411 }-
412 }-
413-
414-
415 QNetworkRequest request = req;-
416 if (!request.header(QNetworkRequest::ContentLengthHeader).isValid()
!request.heade...der).isValid()Description
TRUEevaluated 992 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
&&
3-992
417 outgoingData
outgoingDataDescription
TRUEevaluated 252 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 740 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
&& !outgoingData->isSequential()
!outgoingData->isSequential()Description
TRUEevaluated 159 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 93 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
93-740
418-
419-
420 request.setHeader(QNetworkRequest::ContentLengthHeader, outgoingData->size());-
421 }
executed 159 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
159
422-
423 if (static_cast<
static_cast<QN...est::AutomaticDescription
TRUEevaluated 995 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
QNetworkRequest::LoadControl>
static_cast<QN...est::AutomaticDescription
TRUEevaluated 995 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
0-995
424 (request.attribute(QNetworkRequest::CookieLoadControlAttribute,
static_cast<QN...est::AutomaticDescription
TRUEevaluated 995 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
0-995
425 QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Automatic
static_cast<QN...est::AutomaticDescription
TRUEevaluated 995 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
) {
0-995
426 if (d->cookieJar
d->cookieJarDescription
TRUEevaluated 650 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 345 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
345-650
427 QList<QNetworkCookie> cookies = d->cookieJar->cookiesForUrl(request.url());-
428 if (!cookies.isEmpty()
!cookies.isEmpty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 642 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
8-642
429 request.setHeader(QNetworkRequest::CookieHeader, QVariant::fromValue(cookies));
executed 8 times by 1 test: request.setHeader(QNetworkRequest::CookieHeader, QVariant::fromValue(cookies));
Executed by:
  • tst_QNetworkReply
8
430 }
executed 650 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
650
431 }
executed 995 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
995
432-
433-
434-
435 if (scheme == QLatin1String("http")
scheme == QLat...String("http")Description
TRUEevaluated 655 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 340 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
|| scheme == QLatin1String("preconnect-http")
scheme == QLat...connect-http")Description
TRUEnever evaluated
FALSEevaluated 340 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
0-655
436-
437 || scheme == QLatin1String("https")
scheme == QLat...tring("https")Description
TRUEevaluated 232 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QNetworkReply
|| scheme == QLatin1String("preconnect-https")
scheme == QLat...onnect-https")Description
TRUEnever evaluated
FALSEevaluated 108 times by 1 test
Evaluated by:
  • tst_QNetworkReply
0-232
438-
439 ) {-
440 QNetworkReplyHttpImpl *reply = new QNetworkReplyHttpImpl(this, request, op, outgoingData);-
441-
442 connect(this, qFlagLocation("2""networkSessionConnected()" "\0" __FILE__ ":" "1215"),-
443 reply, qFlagLocation("1""_q_networkSessionConnected()" "\0" __FILE__ ":" "1216"));-
444-
445 return
executed 887 times by 8 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
reply;
executed 887 times by 8 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
887
446 }-
447-
448-
449-
450 QNetworkReplyImpl *reply = new QNetworkReplyImpl(this);-
451-
452 if (!isLocalFile
!isLocalFileDescription
TRUEevaluated 69 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 39 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
39-69
453 connect(this, qFlagLocation("2""networkSessionConnected()" "\0" __FILE__ ":" "1226"),-
454 reply, qFlagLocation("1""_q_networkSessionConnected()" "\0" __FILE__ ":" "1227"));-
455 }
executed 69 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
69
456-
457 QNetworkReplyImplPrivate *priv = reply->d_func();-
458 priv->manager = this;-
459-
460-
461-
462-
463-
464-
465 priv->backend = d->findBackend(op, request);-
466-
467 if (priv->backend
priv->backendDescription
TRUEevaluated 104 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
4-104
468 priv->backend->setParent(reply);-
469 priv->backend->reply = priv;-
470 }
executed 104 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
104
471-
472-
473 reply->setSslConfiguration(request.sslConfiguration());-
474-
475-
476-
477 priv->setup(op, request, outgoingData);-
478-
479 return
executed 108 times by 1 test: return reply;
Executed by:
  • tst_QNetworkReply
reply;
executed 108 times by 1 test: return reply;
Executed by:
  • tst_QNetworkReply
108
480}-
481QStringList QNetworkAccessManager::supportedSchemes() const-
482{-
483 QStringList schemes;-
484 QNetworkAccessManager *self = const_cast<QNetworkAccessManager *>(this);-
485 QMetaObject::invokeMethod(self, "supportedSchemesImplementation", Qt::DirectConnection,-
486 QReturnArgument<QStringList >("QStringList", schemes));-
487 schemes.removeDuplicates();-
488 return
never executed: return schemes;
schemes;
never executed: return schemes;
0
489}-
490QStringList QNetworkAccessManager::supportedSchemesImplementation() const-
491{-
492 const QNetworkAccessManagerPrivate * const d = d_func();-
493-
494 QStringList schemes = d->backendSupportedSchemes();-
495-
496-
497 schemes << ([]() -> QString { enum { Size = sizeof(u"" "http")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "http" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
498-
499 if (QSslSocket::supportsSsl()
QSslSocket::supportsSsl()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
500 schemes << ([]() -> QString { enum { Size = sizeof(u"" "https")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "https" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
never executed: schemes << ([]() -> QString { enum { Size = sizeof(u"" "https")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "https" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());
0
501-
502-
503 schemes << ([]() -> QString { enum { Size = sizeof(u"" "data")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "data" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
504 return
never executed: return schemes;
schemes;
never executed: return schemes;
0
505}-
506void QNetworkAccessManager::clearAccessCache()-
507{-
508 QNetworkAccessManagerPrivate::clearCache(this);-
509}
executed 644 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
644
510-
511void QNetworkAccessManagerPrivate::_q_replyFinished()-
512{-
513 QNetworkAccessManager * const q = q_func();-
514-
515 QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());-
516 if (reply
replyDescription
TRUEevaluated 931 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_Spdy
FALSEnever evaluated
)
0-931
517 q->finished(reply);
executed 931 times by 9 tests: q->finished(reply);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_Spdy
931
518-
519-
520-
521-
522-
523 activeReplyCount--;-
524 if (networkSessionStrongRef
networkSessionStrongRefDescription
TRUEevaluated 920 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager
  • tst_QXmlStream
&& activeReplyCount == 0
activeReplyCount == 0Description
TRUEevaluated 195 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 725 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
)
11-920
525 networkSessionStrongRef.clear();
executed 195 times by 7 tests: networkSessionStrongRef.clear();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_Spdy
195
526-
527}
executed 931 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlStream
  • tst_Spdy
931
528-
529void QNetworkAccessManagerPrivate::_q_replyEncrypted()-
530{-
531-
532 QNetworkAccessManager * const q = q_func();-
533 QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());-
534 if (reply
replyDescription
TRUEevaluated 75 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-75
535 q->encrypted(reply);
executed 75 times by 2 tests: q->encrypted(reply);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
75
536-
537}
executed 75 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
75
538-
539void QNetworkAccessManagerPrivate::_q_replySslErrors(const QList<QSslError> &errors)-
540{-
541-
542 QNetworkAccessManager * const q = q_func();-
543 QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());-
544 if (reply
replyDescription
TRUEevaluated 48 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-48
545 q->sslErrors(reply, errors);
executed 48 times by 2 tests: q->sslErrors(reply, errors);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
48
546-
547-
548-
549}
executed 48 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
48
550-
551void QNetworkAccessManagerPrivate::_q_replyPreSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator)-
552{-
553-
554 QNetworkAccessManager * const q = q_func();-
555 QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());-
556 if (reply
replyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
557 q->preSharedKeyAuthenticationRequired(reply, authenticator);
never executed: q->preSharedKeyAuthenticationRequired(reply, authenticator);
0
558-
559-
560-
561}
never executed: end of block
0
562-
563QNetworkReply *QNetworkAccessManagerPrivate::postProcess(QNetworkReply *reply)-
564{-
565 QNetworkAccessManager * const q = q_func();-
566 QNetworkReplyPrivate::setManager(reply, q);-
567 q->connect(reply, qFlagLocation("2""finished()" "\0" __FILE__ ":" "1376"), qFlagLocation("1""_q_replyFinished()" "\0" __FILE__ ":" "1376"));-
568-
569-
570-
571 q->connect(reply, qFlagLocation("2""encrypted()" "\0" __FILE__ ":" "1380"), qFlagLocation("1""_q_replyEncrypted()" "\0" __FILE__ ":" "1380"));-
572 q->connect(reply, qFlagLocation("2""sslErrors(QList<QSslError>)" "\0" __FILE__ ":" "1381"), qFlagLocation("1""_q_replySslErrors(QList<QSslError>)" "\0" __FILE__ ":" "1381"));-
573 q->connect(reply, qFlagLocation("2""preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)" "\0" __FILE__ ":" "1382"), qFlagLocation("1""_q_replyPreSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator*)" "\0" __FILE__ ":" "1382"));-
574-
575-
576 activeReplyCount++;-
577-
578-
579 return
executed 1069 times by 10 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
reply;
executed 1069 times by 10 tests: return reply;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
1069
580}-
581-
582void QNetworkAccessManagerPrivate::createCookieJar() const-
583{-
584 if (!cookieJarCreated
!cookieJarCreatedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
585-
586 QNetworkAccessManagerPrivate *that = const_cast<QNetworkAccessManagerPrivate *>(this);-
587 that->cookieJar = new QNetworkCookieJar(that->q_func());-
588 that->cookieJarCreated = true;-
589 }
never executed: end of block
0
590}
never executed: end of block
0
591-
592void QNetworkAccessManagerPrivate::authenticationRequired(QAuthenticator *authenticator,-
593 QNetworkReply *reply,-
594 bool synchronous,-
595 QUrl &url,-
596 QUrl *urlForLastAuthentication,-
597 bool allowAuthenticationReuse)-
598{-
599 QNetworkAccessManager * const q = q_func();-
600-
601-
602-
603-
604 if (allowAuthenticationReuse
allowAuthenticationReuseDescription
TRUEevaluated 126 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
&& (urlForLastAuthentication->isEmpty()
urlForLastAuth...ion->isEmpty()Description
TRUEevaluated 88 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QNetworkReply
1-126
605 || url != *urlForLastAuthentication
url != *urlFor...AuthenticationDescription
TRUEnever evaluated
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)) {
0-38
606-
607 if (!url.userName().isEmpty()
!url.userName().isEmpty()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 76 times by 1 test
Evaluated by:
  • tst_QNetworkReply
12-76
608 && !url.password().isEmpty()
!url.password().isEmpty()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-12
609 authenticator->setUser(url.userName(QUrl::FullyDecoded));-
610 authenticator->setPassword(url.password(QUrl::FullyDecoded));-
611 *urlForLastAuthentication = url;-
612 authenticationManager->cacheCredentials(url, authenticator);-
613 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
12
614 }-
615-
616 QNetworkAuthenticationCredential cred = authenticationManager->fetchCachedCredentials(url, authenticator);-
617 if (!cred.isNull()
!cred.isNull()Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
20-56
618 authenticator->setUser(cred.user);-
619 authenticator->setPassword(cred.password);-
620 *urlForLastAuthentication = url;-
621 return;
executed 20 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
20
622 }-
623 }
executed 56 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
56
624-
625-
626-
627 if (synchronous
synchronousDescription
TRUEnever evaluated
FALSEevaluated 95 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-95
628 return;
never executed: return;
0
629-
630 *urlForLastAuthentication = url;-
631 q->authenticationRequired(reply, authenticator);-
632 if (allowAuthenticationReuse
allowAuthenticationReuseDescription
TRUEevaluated 94 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
)
1-94
633 authenticationManager->cacheCredentials(url, authenticator);
executed 94 times by 1 test: authenticationManager->cacheCredentials(url, authenticator);
Executed by:
  • tst_QNetworkReply
94
634}
executed 95 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
95
635-
636-
637void QNetworkAccessManagerPrivate::proxyAuthenticationRequired(const QUrl &url,-
638 const QNetworkProxy &proxy,-
639 bool synchronous,-
640 QAuthenticator *authenticator,-
641 QNetworkProxy *lastProxyAuthentication)-
642{-
643 QNetworkAccessManager * const q = q_func();-
644 QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(*authenticator);-
645 if (proxy != *lastProxyAuthentication
proxy != *last...AuthenticationDescription
TRUEevaluated 66 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& (!priv
!privDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
|| !priv->hasFailed
!priv->hasFailedDescription
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)) {
2-66
646 QNetworkAuthenticationCredential cred = authenticationManager->fetchCachedProxyCredentials(proxy);-
647 if (!cred.isNull()
!cred.isNull()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 56 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
8-56
648 authenticator->setUser(cred.user);-
649 authenticator->setPassword(cred.password);-
650 return;
executed 8 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
8
651 }-
652 }
executed 56 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
56
653 (void)url;;-
654-
655-
656-
657-
658 if (synchronous
synchronousDescription
TRUEnever evaluated
FALSEevaluated 60 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-60
659 return;
never executed: return;
0
660-
661 *lastProxyAuthentication = proxy;-
662 q->proxyAuthenticationRequired(proxy, authenticator);-
663 authenticationManager->cacheProxyCredentials(proxy, authenticator);-
664}
executed 60 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
60
665-
666QList<QNetworkProxy> QNetworkAccessManagerPrivate::queryProxy(const QNetworkProxyQuery &query)-
667{-
668 QList<QNetworkProxy> proxies;-
669 if (proxyFactory
proxyFactoryDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 986 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
20-986
670 proxies = proxyFactory->queryProxy(query);-
671 if (proxies.isEmpty()
proxies.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-20
672 QMessageLogger(__FILE__, 1499, __PRETTY_FUNCTION__).warning("QNetworkAccessManager: factory %p has returned an empty result set",-
673 proxyFactory);-
674 proxies << QNetworkProxy::NoProxy;-
675 }
never executed: end of block
0
676 }
executed 20 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
else if (proxy.type() == QNetworkProxy::DefaultProxy
proxy.type() =...::DefaultProxyDescription
TRUEevaluated 832 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 154 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
20-832
677-
678 return
executed 832 times by 8 tests: return QNetworkProxyFactory::proxyForQuery(query);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QNetworkProxyFactory::proxyForQuery(query);
executed 832 times by 8 tests: return QNetworkProxyFactory::proxyForQuery(query);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
832
679 } else {-
680 proxies << proxy;-
681 }
executed 154 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
154
682-
683 return
executed 174 times by 2 tests: return proxies;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
proxies;
executed 174 times by 2 tests: return proxies;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
174
684}-
685-
686-
687void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager)-
688{-
689 manager->d_func()->objectCache.clear();-
690 manager->d_func()->authenticationManager->clearCache();-
691-
692 if (manager->d_func()->httpThread
manager->d_func()->httpThreadDescription
TRUEevaluated 394 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 252 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
252-394
693 manager->d_func()->httpThread->quit();-
694 manager->d_func()->httpThread->wait(5000);-
695 if (manager->d_func()->httpThread->isFinished()
manager->d_fun...->isFinished()Description
TRUEevaluated 394 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-394
696 delete manager->d_func()->httpThread;
executed 394 times by 2 tests: delete manager->d_func()->httpThread;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
394
697 else-
698 QObject::connect(manager->d_func()->httpThread, qFlagLocation("2""finished()" "\0" __FILE__ ":" "1525"), manager->d_func()->httpThread, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "1525"));
never executed: QObject::connect(manager->d_func()->httpThread, qFlagLocation("2""finished()" "\0" __FILE__ ":" "1525"), manager->d_func()->httpThread, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "1525"));
0
699 manager->d_func()->httpThread = 0;-
700 }
executed 394 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
394
701}
executed 646 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
646
702-
703QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()-
704{-
705 if (httpThread
httpThreadDescription
TRUEevaluated 76 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_spdy - unknown status
FALSEevaluated 16 times by 4 tests
Evaluated by:
  • tst_QNetworkAccessManager
  • tst_QNetworkConfigurationManager
  • tst_QNetworkReply
  • tst_QXmlStream
) {
16-76
706 httpThread->quit();-
707 httpThread->wait(5000);-
708 if (httpThread->isFinished()
httpThread->isFinished()Description
TRUEevaluated 76 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_spdy - unknown status
FALSEnever evaluated
)
0-76
709 delete httpThread;
executed 76 times by 8 tests: delete httpThread;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_spdy - unknown status
76
710 else-
711 QObject::connect(httpThread, qFlagLocation("2""finished()" "\0" __FILE__ ":" "1538"), httpThread, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "1538"));
never executed: QObject::connect(httpThread, qFlagLocation("2""finished()" "\0" __FILE__ ":" "1538"), httpThread, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "1538"));
0
712 httpThread = 0;-
713 }
executed 76 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 - unknown status
76
714}
executed 92 times by 11 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_spdy - unknown status
92
715-
716-
717void QNetworkAccessManagerPrivate::createSession(const QNetworkConfiguration &config)-
718{-
719 QNetworkAccessManager * const q = q_func();-
720-
721 initializeSession = false;-
722-
723-
724 networkSessionStrongRef = networkSessionWeakRef.toStrongRef();-
725-
726 QSharedPointer<QNetworkSession> newSession;-
727 if (config.isValid()
config.isValid()Description
TRUEevaluated 222 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
)
0-222
728 newSession = QSharedNetworkSessionManager::getSession(config);
executed 222 times by 9 tests: newSession = QSharedNetworkSessionManager::getSession(config);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
222
729-
730 if (networkSessionStrongRef
networkSessionStrongRefDescription
TRUEevaluated 123 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
99-123
731-
732 if (networkSessionStrongRef == newSession
networkSession... == newSessionDescription
TRUEevaluated 123 times by 3 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-123
733 return;
executed 123 times by 3 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkReply
  • tst_Spdy
123
734-
735 QObject::disconnect(networkSessionStrongRef.data(), qFlagLocation("2""opened()" "\0" __FILE__ ":" "1562"), q, qFlagLocation("2""networkSessionConnected()" "\0" __FILE__ ":" "1562"));-
736 QObject::disconnect(networkSessionStrongRef.data(), qFlagLocation("2""closed()" "\0" __FILE__ ":" "1563"), q, qFlagLocation("1""_q_networkSessionClosed()" "\0" __FILE__ ":" "1563"));-
737 QObject::disconnect(networkSessionStrongRef.data(), qFlagLocation("2""stateChanged(QNetworkSession::State)" "\0" __FILE__ ":" "1564"),-
738 q, qFlagLocation("1""_q_networkSessionStateChanged(QNetworkSession::State)" "\0" __FILE__ ":" "1565"));-
739 QObject::disconnect(networkSessionStrongRef.data(), qFlagLocation("2""error(QNetworkSession::SessionError)" "\0" __FILE__ ":" "1566"),-
740 q, qFlagLocation("1""_q_networkSessionFailed(QNetworkSession::SessionError)" "\0" __FILE__ ":" "1567"));-
741 }
never executed: end of block
0
742-
743-
744 networkSessionStrongRef = newSession;-
745 networkSessionWeakRef = networkSessionStrongRef.toWeakRef();-
746-
747 if (!networkSessionStrongRef
!networkSessionStrongRefDescription
TRUEnever evaluated
FALSEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
0-99
748-
749 if (networkAccessible == QNetworkAccessManager::NotAccessible
networkAccessi...:NotAccessibleDescription
TRUEnever evaluated
FALSEnever evaluated
|| !online
!onlineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
750 q->networkAccessibleChanged(QNetworkAccessManager::NotAccessible);
never executed: q->networkAccessibleChanged(QNetworkAccessManager::NotAccessible);
0
751 else-
752 q->networkAccessibleChanged(QNetworkAccessManager::UnknownAccessibility);
never executed: q->networkAccessibleChanged(QNetworkAccessManager::UnknownAccessibility);
0
753-
754 return;
never executed: return;
0
755 }-
756-
757-
758 QObject::connect(networkSessionStrongRef.data(), qFlagLocation("2""opened()" "\0" __FILE__ ":" "1585"), q, qFlagLocation("2""networkSessionConnected()" "\0" __FILE__ ":" "1585"), Qt::QueuedConnection);-
759-
760 QObject::connect(networkSessionStrongRef.data(), qFlagLocation("2""closed()" "\0" __FILE__ ":" "1587"), q, qFlagLocation("1""_q_networkSessionClosed()" "\0" __FILE__ ":" "1587"), Qt::QueuedConnection);-
761 QObject::connect(networkSessionStrongRef.data(), qFlagLocation("2""stateChanged(QNetworkSession::State)" "\0" __FILE__ ":" "1588"),-
762 q, qFlagLocation("1""_q_networkSessionStateChanged(QNetworkSession::State)" "\0" __FILE__ ":" "1589"), Qt::QueuedConnection);-
763 QObject::connect(networkSessionStrongRef.data(), qFlagLocation("2""error(QNetworkSession::SessionError)" "\0" __FILE__ ":" "1590"),-
764 q, qFlagLocation("1""_q_networkSessionFailed(QNetworkSession::SessionError)" "\0" __FILE__ ":" "1591"));-
765-
766 _q_networkSessionStateChanged(networkSessionStrongRef->state());-
767}
executed 99 times by 9 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_Spdy
99
768-
769void QNetworkAccessManagerPrivate::_q_networkSessionClosed()-
770{-
771 QNetworkAccessManager * const q = q_func();-
772 QSharedPointer<QNetworkSession> networkSession(getNetworkSession());-
773 if (networkSession
networkSessionDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
) {
0-4
774 networkConfiguration = networkSession->configuration();-
775-
776-
777 QObject::disconnect(networkSession.data(), qFlagLocation("2""opened()" "\0" __FILE__ ":" "1604"), q, qFlagLocation("2""networkSessionConnected()" "\0" __FILE__ ":" "1604"));-
778 QObject::disconnect(networkSession.data(), qFlagLocation("2""closed()" "\0" __FILE__ ":" "1605"), q, qFlagLocation("1""_q_networkSessionClosed()" "\0" __FILE__ ":" "1605"));-
779 QObject::disconnect(networkSession.data(), qFlagLocation("2""stateChanged(QNetworkSession::State)" "\0" __FILE__ ":" "1606"),-
780 q, qFlagLocation("1""_q_networkSessionStateChanged(QNetworkSession::State)" "\0" __FILE__ ":" "1607"));-
781 QObject::disconnect(networkSession.data(), qFlagLocation("2""error(QNetworkSession::SessionError)" "\0" __FILE__ ":" "1608"),-
782 q, qFlagLocation("1""_q_networkSessionFailed(QNetworkSession::SessionError)" "\0" __FILE__ ":" "1609"));-
783-
784 networkSessionStrongRef.clear();-
785 networkSessionWeakRef.clear();-
786 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
4
787}
executed 4 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
4
788-
789void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession::State state)-
790{-
791 QNetworkAccessManager * const q = q_func();-
792 bool reallyOnline = false;-
793-
794-
795 if (state == QNetworkSession::Connected
state == QNetw...ion::ConnectedDescription
TRUEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
&& lastSessionState != QNetworkSession::Roaming
lastSessionSta...ssion::RoamingDescription
TRUEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
)
0-99
796 q->networkSessionConnected();
executed 99 times by 9 tests: q->networkSessionConnected();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
99
797 lastSessionState = state;-
798-
799 if (online
onlineDescription
TRUEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
&& state == QNetworkSession::Disconnected
state == QNetw...::DisconnectedDescription
TRUEnever evaluated
FALSEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
0-99
800 const auto cfgs = networkConfigurationManager.allConfigurations();-
801 for (const QNetworkConfiguration &cfg : cfgs) {-
802 if (cfg.state().testFlag(QNetworkConfiguration::Active)
cfg.state().te...ation::Active)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
803 reallyOnline = true;-
804 }
never executed: end of block
0
805 }
never executed: end of block
0
806 }
never executed: end of block
else if (state == QNetworkSession::Connected
state == QNetw...ion::ConnectedDescription
TRUEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
|| state == QNetworkSession::Roaming
state == QNetw...ssion::RoamingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-99
807 reallyOnline = true;-
808 }
executed 99 times by 9 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_Spdy
99
809-
810 if (!reallyOnline
!reallyOnlineDescription
TRUEnever evaluated
FALSEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
0-99
811 if (state != QNetworkSession::Connected
state != QNetw...ion::ConnectedDescription
TRUEnever evaluated
FALSEnever evaluated
&& state != QNetworkSession::Roaming
state != QNetw...ssion::RoamingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
812 if (networkAccessible != QNetworkAccessManager::NotAccessible
networkAccessi...:NotAccessibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
813 networkAccessible = QNetworkAccessManager::NotAccessible;-
814 q->networkAccessibleChanged(networkAccessible);-
815 }
never executed: end of block
0
816 }
never executed: end of block
0
817 }
never executed: end of block
else {
0
818 if (defaultAccessControl
defaultAccessControlDescription
TRUEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
)
0-99
819 if (networkAccessible != QNetworkAccessManager::Accessible
networkAccessi...er::AccessibleDescription
TRUEnever evaluated
FALSEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
0-99
820 networkAccessible = QNetworkAccessManager::Accessible;-
821 q->networkAccessibleChanged(networkAccessible);-
822 }
never executed: end of block
0
823 }
executed 99 times by 9 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_Spdy
99
824 online = reallyOnline;-
825 if (online
onlineDescription
TRUEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
&& (state != QNetworkSession::Connected
state != QNetw...ion::ConnectedDescription
TRUEnever evaluated
FALSEevaluated 99 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
&& state != QNetworkSession::Roaming
state != QNetw...ssion::RoamingDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0-99
826 _q_networkSessionClosed();-
827 createSession(q->configuration());-
828 }
never executed: end of block
0
829}
executed 99 times by 9 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_Spdy
99
830-
831void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)-
832{-
833 QNetworkAccessManager * const q = q_func();-
834-
835-
836-
837 if (customNetworkConfiguration
customNetworkConfigurationDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
838 online = (networkConfiguration.state() & QNetworkConfiguration::Active);-
839 }
never executed: end of block
else {
0
840 if (online != isOnline
online != isOnlineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
841 _q_networkSessionClosed();-
842 createSession(q->configuration());-
843 online = isOnline;-
844 }
never executed: end of block
0
845 }
never executed: end of block
0
846 if (online
onlineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
847 if (defaultAccessControl
defaultAccessControlDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
848 if (networkAccessible != QNetworkAccessManager::Accessible
networkAccessi...er::AccessibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
849 networkAccessible = QNetworkAccessManager::Accessible;-
850 q->networkAccessibleChanged(networkAccessible);-
851 }
never executed: end of block
0
852 }
never executed: end of block
0
853 }
never executed: end of block
else {
0
854 if (networkAccessible != QNetworkAccessManager::NotAccessible
networkAccessi...:NotAccessibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
855 networkAccessible = QNetworkAccessManager::NotAccessible;-
856 q->networkAccessibleChanged(networkAccessible);-
857 }
never executed: end of block
0
858 }
never executed: end of block
0
859}-
860-
861void QNetworkAccessManagerPrivate::_q_configurationChanged(const QNetworkConfiguration &configuration)-
862{-
863 const QString id = configuration.identifier();-
864 if (configuration.state().testFlag(QNetworkConfiguration::Active)
configuration....ation::Active)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
865 if (!onlineConfigurations.contains(id)
!onlineConfigu...s.contains(id)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
866-
867 QSharedPointer<QNetworkSession> session(getNetworkSession());-
868 if (session
sessionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
869 if (online
onlineDescription
TRUEnever evaluated
FALSEnever evaluated
&& session->configuration().identifier()
session->confi...).identifier()Description
TRUEnever evaluated
FALSEnever evaluated
0
870 != networkConfigurationManager.defaultConfiguration().identifier()
session->confi...).identifier()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
871-
872 onlineConfigurations.insert(id);-
873-
874-
875 _q_networkSessionClosed();-
876 createSession(networkConfigurationManager.defaultConfiguration());-
877 }
never executed: end of block
0
878 }
never executed: end of block
0
879 }
never executed: end of block
0
880-
881 }
never executed: end of block
else if (onlineConfigurations.contains(id)
onlineConfigur...s.contains(id)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
882-
883 onlineConfigurations.remove(id);-
884 if (!onlineConfigurations.isEmpty()
!onlineConfigu...ions.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
885 _q_networkSessionClosed();-
886 createSession(configuration);-
887 }
never executed: end of block
0
888 }
never executed: end of block
0
889}
never executed: end of block
0
890-
891-
892void QNetworkAccessManagerPrivate::_q_networkSessionFailed(QNetworkSession::SessionError)-
893{-
894 const auto cfgs = networkConfigurationManager.allConfigurations();-
895 for (const QNetworkConfiguration &cfg : cfgs) {-
896 if (cfg.state().testFlag(QNetworkConfiguration::Active)
cfg.state().te...ation::Active)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
897 online = true;-
898 _q_networkSessionClosed();-
899 createSession(networkConfigurationManager.defaultConfiguration());-
900 return;
never executed: return;
0
901 }-
902 }
never executed: end of block
0
903}
never executed: end of block
0
904-
905-
906-
907QNetworkRequest QNetworkAccessManagerPrivate::prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart)-
908{-
909-
910 QNetworkRequest newRequest(request);-
911-
912-
913 if (!request.header(QNetworkRequest::ContentTypeHeader).isValid()
!request.heade...der).isValid()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
2-22
914 QByteArray contentType;-
915 contentType.reserve(34 + multiPart->d_func()->boundary.count());-
916 contentType += "multipart/";-
917 switch (multiPart->d_func()->contentType) {-
918 case
executed 2 times by 1 test: case QHttpMultiPart::RelatedType:
Executed by:
  • tst_QNetworkReply
QHttpMultiPart::RelatedType:
executed 2 times by 1 test: case QHttpMultiPart::RelatedType:
Executed by:
  • tst_QNetworkReply
2
919 contentType += "related";-
920 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
2
921 case
executed 13 times by 2 tests: case QHttpMultiPart::FormDataType:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QHttpMultiPart::FormDataType:
executed 13 times by 2 tests: case QHttpMultiPart::FormDataType:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
13
922 contentType += "form-data";-
923 break;
executed 13 times by 2 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
13
924 case
executed 4 times by 1 test: case QHttpMultiPart::AlternativeType:
Executed by:
  • tst_QNetworkReply
QHttpMultiPart::AlternativeType:
executed 4 times by 1 test: case QHttpMultiPart::AlternativeType:
Executed by:
  • tst_QNetworkReply
4
925 contentType += "alternative";-
926 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
4
927 default
executed 3 times by 1 test: default:
Executed by:
  • tst_QNetworkReply
:
executed 3 times by 1 test: default:
Executed by:
  • tst_QNetworkReply
3
928 contentType += "mixed";-
929 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
3
930 }-
931-
932 contentType += "; boundary=\"" + multiPart->d_func()->boundary + '"';-
933 newRequest.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(contentType));-
934 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
22
935-
936-
937-
938 QByteArray mimeHeader("MIME-Version");-
939 if (!request.hasRawHeader(mimeHeader)
!request.hasRa...er(mimeHeader)Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
)
0-24
940 newRequest.setRawHeader(mimeHeader, QByteArray("1.0"));
executed 24 times by 2 tests: newRequest.setRawHeader(mimeHeader, QByteArray("1.0"));
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
24
941-
942 QIODevice *device = multiPart->d_func()->device;-
943 if (!device->isReadable()
!device->isReadable()Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-24
944 if (!device->isOpen()
!device->isOpen()Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEnever evaluated
) {
0-24
945 if (!device->open(QIODevice::ReadOnly)
!device->open(...ice::ReadOnly)Description
TRUEnever evaluated
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
0-24
946 QMessageLogger(__FILE__, 1773, __PRETTY_FUNCTION__).warning("could not open device for reading");
never executed: QMessageLogger(__FILE__, 1773, __PRETTY_FUNCTION__).warning("could not open device for reading");
0
947 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
else {
24
948 QMessageLogger(__FILE__, 1775, __PRETTY_FUNCTION__).warning("device is not readable");-
949 }
never executed: end of block
0
950 }-
951-
952 return
executed 24 times by 2 tests: return newRequest;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
newRequest;
executed 24 times by 2 tests: return newRequest;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
24
953}-
954-
955-
956-
Switch to Source codePreprocessed file

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