qabstractsocket.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/socket/qabstractsocket.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Copyright (C) 2016 Intel Corporation.-
5** Contact: https://www.qt.io/licensing/-
6**-
7** This file is part of the QtNetwork module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41//#define QABSTRACTSOCKET_DEBUG-
42-
43/*!-
44 \class QAbstractSocket-
45-
46 \brief The QAbstractSocket class provides the base functionality-
47 common to all socket types.-
48-
49 \reentrant-
50 \ingroup network-
51 \inmodule QtNetwork-
52-
53 QAbstractSocket is the base class for QTcpSocket and QUdpSocket-
54 and contains all common functionality of these two classes. If-
55 you need a socket, you have two options:-
56-
57 \list-
58 \li Instantiate QTcpSocket or QUdpSocket.-
59 \li Create a native socket descriptor, instantiate-
60 QAbstractSocket, and call setSocketDescriptor() to wrap the-
61 native socket.-
62 \endlist-
63-
64 TCP (Transmission Control Protocol) is a reliable,-
65 stream-oriented, connection-oriented transport protocol. UDP-
66 (User Datagram Protocol) is an unreliable, datagram-oriented,-
67 connectionless protocol. In practice, this means that TCP is-
68 better suited for continuous transmission of data, whereas the-
69 more lightweight UDP can be used when reliability isn't-
70 important.-
71-
72 QAbstractSocket's API unifies most of the differences between the-
73 two protocols. For example, although UDP is connectionless,-
74 connectToHost() establishes a virtual connection for UDP sockets,-
75 enabling you to use QAbstractSocket in more or less the same way-
76 regardless of the underlying protocol. Internally,-
77 QAbstractSocket remembers the address and port passed to-
78 connectToHost(), and functions like read() and write() use these-
79 values.-
80-
81 At any time, QAbstractSocket has a state (returned by-
82 state()). The initial state is UnconnectedState. After-
83 calling connectToHost(), the socket first enters-
84 HostLookupState. If the host is found, QAbstractSocket enters-
85 ConnectingState and emits the hostFound() signal. When the-
86 connection has been established, it enters ConnectedState and-
87 emits connected(). If an error occurs at any stage, error() is-
88 emitted. Whenever the state changes, stateChanged() is emitted.-
89 For convenience, isValid() returns \c true if the socket is ready for-
90 reading and writing, but note that the socket's state must be-
91 ConnectedState before reading and writing can occur.-
92-
93 Read or write data by calling read() or write(), or use the-
94 convenience functions readLine() and readAll(). QAbstractSocket-
95 also inherits getChar(), putChar(), and ungetChar() from-
96 QIODevice, which work on single bytes. The bytesWritten() signal-
97 is emitted when data has been written to the socket. Note that Qt does-
98 not limit the write buffer size. You can monitor its size by listening-
99 to this signal.-
100-
101 The readyRead() signal is emitted every time a new chunk of data-
102 has arrived. bytesAvailable() then returns the number of bytes-
103 that are available for reading. Typically, you would connect the-
104 readyRead() signal to a slot and read all available data there.-
105 If you don't read all the data at once, the remaining data will-
106 still be available later, and any new incoming data will be-
107 appended to QAbstractSocket's internal read buffer. To limit the-
108 size of the read buffer, call setReadBufferSize().-
109-
110 To close the socket, call disconnectFromHost(). QAbstractSocket enters-
111 QAbstractSocket::ClosingState. After all pending data has been written to-
112 the socket, QAbstractSocket actually closes the socket, enters-
113 QAbstractSocket::UnconnectedState, and emits disconnected(). If you want-
114 to abort a connection immediately, discarding all pending data, call-
115 abort() instead. If the remote host closes the connection,-
116 QAbstractSocket will emit error(QAbstractSocket::RemoteHostClosedError),-
117 during which the socket state will still be ConnectedState, and then the-
118 disconnected() signal will be emitted.-
119-
120 The port and address of the connected peer is fetched by calling-
121 peerPort() and peerAddress(). peerName() returns the host name of-
122 the peer, as passed to connectToHost(). localPort() and-
123 localAddress() return the port and address of the local socket.-
124-
125 QAbstractSocket provides a set of functions that suspend the-
126 calling thread until certain signals are emitted. These functions-
127 can be used to implement blocking sockets:-
128-
129 \list-
130 \li waitForConnected() blocks until a connection has been established.-
131-
132 \li waitForReadyRead() blocks until new data is available for-
133 reading.-
134-
135 \li waitForBytesWritten() blocks until one payload of data has been-
136 written to the socket.-
137-
138 \li waitForDisconnected() blocks until the connection has closed.-
139 \endlist-
140-
141 We show an example:-
142-
143 \snippet network/tcpwait.cpp 0-
144-
145 If \l{QIODevice::}{waitForReadyRead()} returns \c false, the-
146 connection has been closed or an error has occurred.-
147-
148 Programming with a blocking socket is radically different from-
149 programming with a non-blocking socket. A blocking socket doesn't-
150 require an event loop and typically leads to simpler code.-
151 However, in a GUI application, blocking sockets should only be-
152 used in non-GUI threads, to avoid freezing the user interface.-
153 See the \l fortuneclient and \l blockingfortuneclient-
154 examples for an overview of both approaches.-
155-
156 \note We discourage the use of the blocking functions together-
157 with signals. One of the two possibilities should be used.-
158-
159 QAbstractSocket can be used with QTextStream and QDataStream's-
160 stream operators (operator<<() and operator>>()). There is one-
161 issue to be aware of, though: You must make sure that enough data-
162 is available before attempting to read it using operator>>().-
163-
164 \sa QNetworkAccessManager, QTcpServer-
165*/-
166-
167/*!-
168 \fn void QAbstractSocket::hostFound()-
169-
170 This signal is emitted after connectToHost() has been called and-
171 the host lookup has succeeded.-
172-
173 \note Since Qt 4.6.3 QAbstractSocket may emit hostFound()-
174 directly from the connectToHost() call since a DNS result could have been-
175 cached.-
176-
177 \sa connected()-
178*/-
179-
180/*!-
181 \fn void QAbstractSocket::connected()-
182-
183 This signal is emitted after connectToHost() has been called and-
184 a connection has been successfully established.-
185-
186 \note On some operating systems the connected() signal may-
187 be directly emitted from the connectToHost() call for connections-
188 to the localhost.-
189-
190 \sa connectToHost(), disconnected()-
191*/-
192-
193/*!-
194 \fn void QAbstractSocket::disconnected()-
195-
196 This signal is emitted when the socket has been disconnected.-
197-
198 \warning If you need to delete the sender() of this signal in a slot connected-
199 to it, use the \l{QObject::deleteLater()}{deleteLater()} function.-
200-
201 \sa connectToHost(), disconnectFromHost(), abort()-
202*/-
203-
204/*!-
205 \fn void QAbstractSocket::error(QAbstractSocket::SocketError socketError)-
206-
207 This signal is emitted after an error occurred. The \a socketError-
208 parameter describes the type of error that occurred.-
209-
210 When this signal is emitted, the socket may not be ready for a reconnect-
211 attempt. In that case, attempts to reconnect should be done from the event-
212 loop. For example, use a QTimer::singleShot() with 0 as the timeout.-
213-
214 QAbstractSocket::SocketError is not a registered metatype, so for queued-
215 connections, you will have to register it with Q_DECLARE_METATYPE() and-
216 qRegisterMetaType().-
217-
218 \sa error(), errorString(), {Creating Custom Qt Types}-
219*/-
220-
221/*!-
222 \fn void QAbstractSocket::stateChanged(QAbstractSocket::SocketState socketState)-
223-
224 This signal is emitted whenever QAbstractSocket's state changes.-
225 The \a socketState parameter is the new state.-
226-
227 QAbstractSocket::SocketState is not a registered metatype, so for queued-
228 connections, you will have to register it with Q_DECLARE_METATYPE() and-
229 qRegisterMetaType().-
230-
231 \sa state(), {Creating Custom Qt Types}-
232*/-
233-
234/*!-
235 \fn void QAbstractSocket::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator)-
236 \since 4.3-
237-
238 This signal can be emitted when a \a proxy that requires-
239 authentication is used. The \a authenticator object can then be-
240 filled in with the required details to allow authentication and-
241 continue the connection.-
242-
243 \note It is not possible to use a QueuedConnection to connect to-
244 this signal, as the connection will fail if the authenticator has-
245 not been filled in with new information when the signal returns.-
246-
247 \sa QAuthenticator, QNetworkProxy-
248*/-
249-
250/*!-
251 \enum QAbstractSocket::NetworkLayerProtocol-
252-
253 This enum describes the network layer protocol values used in Qt.-
254-
255 \value IPv4Protocol IPv4-
256 \value IPv6Protocol IPv6-
257 \value AnyIPProtocol Either IPv4 or IPv6-
258 \value UnknownNetworkLayerProtocol Other than IPv4 and IPv6-
259-
260 \sa QHostAddress::protocol()-
261*/-
262-
263/*!-
264 \enum QAbstractSocket::SocketType-
265-
266 This enum describes the transport layer protocol.-
267-
268 \value TcpSocket TCP-
269 \value UdpSocket UDP-
270 \value UnknownSocketType Other than TCP and UDP-
271-
272 \sa QAbstractSocket::socketType()-
273*/-
274-
275/*!-
276 \enum QAbstractSocket::SocketError-
277-
278 This enum describes the socket errors that can occur.-
279-
280 \value ConnectionRefusedError The connection was refused by the-
281 peer (or timed out).-
282 \value RemoteHostClosedError The remote host closed the-
283 connection. Note that the client socket (i.e., this socket)-
284 will be closed after the remote close notification has-
285 been sent.-
286 \value HostNotFoundError The host address was not found.-
287 \value SocketAccessError The socket operation failed because the-
288 application lacked the required privileges.-
289 \value SocketResourceError The local system ran out of resources-
290 (e.g., too many sockets).-
291 \value SocketTimeoutError The socket operation timed out.-
292 \value DatagramTooLargeError The datagram was larger than the-
293 operating system's limit (which can be as low as 8192-
294 bytes).-
295 \value NetworkError An error occurred with the network (e.g., the-
296 network cable was accidentally plugged out).-
297 \value AddressInUseError The address specified to QAbstractSocket::bind() is-
298 already in use and was set to be exclusive.-
299 \value SocketAddressNotAvailableError The address specified to-
300 QAbstractSocket::bind() does not belong to the host.-
301 \value UnsupportedSocketOperationError The requested socket operation is-
302 not supported by the local operating system (e.g., lack of-
303 IPv6 support).-
304 \value ProxyAuthenticationRequiredError The socket is using a proxy, and-
305 the proxy requires authentication.-
306 \value SslHandshakeFailedError The SSL/TLS handshake failed, so-
307 the connection was closed (only used in QSslSocket)-
308 \value UnfinishedSocketOperationError Used by QAbstractSocketEngine only,-
309 The last operation attempted has not finished yet (still in progress in-
310 the background).-
311 \value ProxyConnectionRefusedError Could not contact the proxy server because-
312 the connection to that server was denied-
313 \value ProxyConnectionClosedError The connection to the proxy server was closed-
314 unexpectedly (before the connection to the final peer was established)-
315 \value ProxyConnectionTimeoutError The connection to the proxy server timed out-
316 or the proxy server stopped responding in the authentication phase.-
317 \value ProxyNotFoundError The proxy address set with setProxy() (or the application-
318 proxy) was not found.-
319 \value ProxyProtocolError The connection negotiation with the proxy server failed,-
320 because the response from the proxy server could not be understood.-
321 \value OperationError An operation was attempted while the socket was in a state that-
322 did not permit it.-
323 \value SslInternalError The SSL library being used reported an internal error. This is-
324 probably the result of a bad installation or misconfiguration of the library.-
325 \value SslInvalidUserDataError Invalid data (certificate, key, cypher, etc.) was-
326 provided and its use resulted in an error in the SSL library.-
327 \value TemporaryError A temporary error occurred (e.g., operation would block and socket-
328 is non-blocking).-
329-
330 \value UnknownSocketError An unidentified error occurred.-
331 \sa QAbstractSocket::error()-
332*/-
333-
334/*!-
335 \enum QAbstractSocket::SocketState-
336-
337 This enum describes the different states in which a socket can be.-
338-
339 \value UnconnectedState The socket is not connected.-
340 \value HostLookupState The socket is performing a host name lookup.-
341 \value ConnectingState The socket has started establishing a connection.-
342 \value ConnectedState A connection is established.-
343 \value BoundState The socket is bound to an address and port.-
344 \value ClosingState The socket is about to close (data may still-
345 be waiting to be written).-
346 \value ListeningState For internal use only.-
347-
348 \sa QAbstractSocket::state()-
349*/-
350-
351/*!-
352 \enum QAbstractSocket::SocketOption-
353 \since 4.6-
354-
355 This enum represents the options that can be set on a socket. If-
356 desired, they can be set after having received the connected()-
357 signal from the socket or after having received a new socket from-
358 a QTcpServer.-
359-
360 \value LowDelayOption Try to optimize the socket for low-
361 latency. For a QTcpSocket this would set the TCP_NODELAY option-
362 and disable Nagle's algorithm. Set this to 1 to enable.-
363-
364 \value KeepAliveOption Set this to 1 to enable the SO_KEEPALIVE-
365 socket option-
366-
367 \value MulticastTtlOption Set this to an integer value to set-
368 IP_MULTICAST_TTL (TTL for multicast datagrams) socket option.-
369-
370 \value MulticastLoopbackOption Set this to 1 to enable the-
371 IP_MULTICAST_LOOP (multicast loopback) socket option.-
372-
373 \value TypeOfServiceOption This option is not supported on-
374 Windows. This maps to the IP_TOS socket option. For possible values,-
375 see table below.-
376-
377 \value SendBufferSizeSocketOption Sets the socket send buffer size-
378 in bytes at the OS level. This maps to the SO_SNDBUF socket option.-
379 This option does not affect the QIODevice or QAbstractSocket buffers.-
380 This enum value has been introduced in Qt 5.3.-
381-
382 \value ReceiveBufferSizeSocketOption Sets the socket receive-
383 buffer size in bytes at the OS level.-
384 This maps to the SO_RCVBUF socket option.-
385 This option does not affect the QIODevice or QAbstractSocket buffers-
386 (see \l{QAbstractSocket::}{setReadBufferSize()}).-
387 This enum value has been introduced in Qt 5.3.-
388-
389 Possible values for \e{TypeOfServiceOption} are:-
390-
391 \table-
392 \header \li Value \li Description-
393 \row \li 224 \li Network control-
394 \row \li 192 \li Internetwork control-
395 \row \li 160 \li CRITIC/ECP-
396 \row \li 128 \li Flash override-
397 \row \li 96 \li Flash-
398 \row \li 64 \li Immediate-
399 \row \li 32 \li Priority-
400 \row \li 0 \li Routine-
401 \endtable-
402-
403 \sa QAbstractSocket::setSocketOption(), QAbstractSocket::socketOption()-
404*/-
405-
406/*! \enum QAbstractSocket::BindFlag-
407 \since 5.0-
408-
409 This enum describes the different flags you can pass to modify the-
410 behavior of QAbstractSocket::bind().-
411-
412 \value ShareAddress Allow other services to bind to the same address-
413 and port. This is useful when multiple processes share-
414 the load of a single service by listening to the same address and port-
415 (e.g., a web server with several pre-forked listeners can greatly-
416 improve response time). However, because any service is allowed to-
417 rebind, this option is subject to certain security considerations.-
418 Note that by combining this option with ReuseAddressHint, you will-
419 also allow your service to rebind an existing shared address. On-
420 Unix, this is equivalent to the SO_REUSEADDR socket option. On Windows,-
421 this option is ignored.-
422-
423 \value DontShareAddress Bind the address and port exclusively, so that-
424 no other services are allowed to rebind. By passing this option to-
425 QAbstractSocket::bind(), you are guaranteed that on successs, your service-
426 is the only one that listens to the address and port. No services are-
427 allowed to rebind, even if they pass ReuseAddressHint. This option-
428 provides more security than ShareAddress, but on certain operating-
429 systems, it requires you to run the server with administrator privileges.-
430 On Unix and \macos, not sharing is the default behavior for binding-
431 an address and port, so this option is ignored. On Windows, this-
432 option uses the SO_EXCLUSIVEADDRUSE socket option.-
433-
434 \value ReuseAddressHint Provides a hint to QAbstractSocket that it should try-
435 to rebind the service even if the address and port are already bound by-
436 another socket. On Windows and Unix, this is equivalent to the SO_REUSEADDR-
437 socket option.-
438-
439 \value DefaultForPlatform The default option for the current platform.-
440 On Unix and \macos, this is equivalent to (DontShareAddress-
441 + ReuseAddressHint), and on Windows, its equivalent to ShareAddress.-
442*/-
443-
444/*! \enum QAbstractSocket::PauseMode-
445 \since 5.0-
446-
447 This enum describes the behavior of when the socket should hold-
448 back with continuing data transfer.-
449 The only notification currently supported is QSslSocket::sslErrors().-
450-
451 \value PauseNever Do not pause data transfer on the socket. This is the-
452 default and matches the behaviour of Qt 4.-
453 \value PauseOnSslErrors Pause data transfer on the socket upon receiving an-
454 SSL error notification. I.E. QSslSocket::sslErrors().-
455*/-
456-
457#include "qabstractsocket.h"-
458#include "qabstractsocket_p.h"-
459-
460#include "private/qhostinfo_p.h"-
461#include "private/qnetworksession_p.h"-
462-
463#include <qabstracteventdispatcher.h>-
464#include <qhostaddress.h>-
465#include <qhostinfo.h>-
466#include <qmetaobject.h>-
467#include <qpointer.h>-
468#include <qtimer.h>-
469#include <qelapsedtimer.h>-
470#include <qscopedvaluerollback.h>-
471#include <qvarlengtharray.h>-
472-
473#ifndef QT_NO_SSL-
474#include <QtNetwork/qsslsocket.h>-
475#endif-
476-
477#include <private/qthread_p.h>-
478-
479#ifdef QABSTRACTSOCKET_DEBUG-
480#include <qdebug.h>-
481#endif-
482-
483#include <time.h>-
484-
485#define Q_CHECK_SOCKETENGINE(returnValue) do { \-
486 if (!d->socketEngine) { \-
487 return returnValue; \-
488 } } while (0)-
489-
490#ifndef QABSTRACTSOCKET_BUFFERSIZE-
491#define QABSTRACTSOCKET_BUFFERSIZE 32768-
492#endif-
493#define QT_CONNECT_TIMEOUT 30000-
494#define QT_TRANSFER_TIMEOUT 120000-
495-
496QT_BEGIN_NAMESPACE-
497-
498#if defined QABSTRACTSOCKET_DEBUG-
499QT_BEGIN_INCLUDE_NAMESPACE-
500#include <qstring.h>-
501#include <ctype.h>-
502QT_END_INCLUDE_NAMESPACE-
503-
504/*-
505 Returns a human readable representation of the first \a len-
506 characters in \a data.-
507*/-
508static QByteArray qt_prettyDebug(const char *data, int len, int maxLength)-
509{-
510 if (!data) return "(null)";-
511 QByteArray out;-
512 for (int i = 0; i < qMin(len, maxLength); ++i) {-
513 char c = data[i];-
514 if (isprint(int(uchar(c)))) {-
515 out += c;-
516 } else switch (c) {-
517 case '\n': out += "\\n"; break;-
518 case '\r': out += "\\r"; break;-
519 case '\t': out += "\\t"; break;-
520 default:-
521 QString tmp;-
522 tmp.sprintf("\\%o", c);-
523 out += tmp.toLatin1();-
524 }-
525 }-
526-
527 if (len < maxLength)-
528 out += "...";-
529-
530 return out;-
531}-
532#endif-
533-
534static bool isProxyError(QAbstractSocket::SocketError error)-
535{-
536 switch (error) {-
537 case QAbstractSocket::ProxyAuthenticationRequiredError:
executed 10 times by 4 tests: case QAbstractSocket::ProxyAuthenticationRequiredError:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
10
538 case QAbstractSocket::ProxyConnectionRefusedError:
executed 4 times by 4 tests: case QAbstractSocket::ProxyConnectionRefusedError:
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
4
539 case QAbstractSocket::ProxyConnectionClosedError:
executed 33 times by 3 tests: case QAbstractSocket::ProxyConnectionClosedError:
Executed by:
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
33
540 case QAbstractSocket::ProxyConnectionTimeoutError:
never executed: case QAbstractSocket::ProxyConnectionTimeoutError:
0
541 case QAbstractSocket::ProxyNotFoundError:
executed 8 times by 4 tests: case QAbstractSocket::ProxyNotFoundError:
Executed by:
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
8
542 case QAbstractSocket::ProxyProtocolError:
executed 7 times by 2 tests: case QAbstractSocket::ProxyProtocolError:
Executed by:
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
7
543 return true;
executed 62 times by 6 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
62
544 default:
executed 364 times by 10 tests: default:
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
364
545 return false;
executed 364 times by 10 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
364
546 }-
547}-
548-
549/*! \internal-
550-
551 Constructs a QAbstractSocketPrivate. Initializes all members.-
552*/-
553QAbstractSocketPrivate::QAbstractSocketPrivate()-
554 : emittedReadyRead(false),-
555 emittedBytesWritten(false),-
556 abortCalled(false),-
557 pendingClose(false),-
558 pauseMode(QAbstractSocket::PauseNever),-
559 port(0),-
560 localPort(0),-
561 peerPort(0),-
562 socketEngine(0),-
563 cachedSocketDescriptor(-1),-
564 readBufferMaxSize(0),-
565 isBuffered(false),-
566 connectTimer(0),-
567 disconnectTimer(0),-
568 hostLookupId(-1),-
569 socketType(QAbstractSocket::UnknownSocketType),-
570 state(QAbstractSocket::UnconnectedState),-
571 socketError(QAbstractSocket::UnknownSocketError),-
572 preferredNetworkLayerProtocol(QAbstractSocket::UnknownNetworkLayerProtocol)-
573{-
574 writeBufferChunkSize = QABSTRACTSOCKET_BUFFERSIZE;-
575}
executed 8976 times by 33 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpnetworkreply - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • ...
8976
576-
577/*! \internal-
578-
579 Destructs the QAbstractSocket. If the socket layer is open, it-
580 will be reset.-
581*/-
582QAbstractSocketPrivate::~QAbstractSocketPrivate()-
583{-
584}-
585-
586/*! \internal-
587-
588 Resets the socket layer and deletes any socket notifiers.-
589*/-
590void QAbstractSocketPrivate::resetSocketLayer()-
591{-
592#if defined (QABSTRACTSOCKET_DEBUG)-
593 qDebug("QAbstractSocketPrivate::resetSocketLayer()");-
594#endif-
595-
596 if (socketEngine) {
socketEngineDescription
TRUEevaluated 5800 times by 30 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 10430 times by 30 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
5800-10430
597 socketEngine->close();-
598 socketEngine->disconnect();-
599 delete socketEngine;-
600 socketEngine = 0;-
601 cachedSocketDescriptor = -1;-
602 }
executed 5799 times by 30 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
5799
603 if (connectTimer)
connectTimerDescription
TRUEevaluated 4566 times by 24 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_spdy - unknown status
FALSEevaluated 11663 times by 30 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
4566-11663
604 connectTimer->stop();
executed 4566 times by 24 tests: connectTimer->stop();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
  • tst_spdy - unknown status
4566
605 if (disconnectTimer)
disconnectTimerDescription
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 16177 times by 31 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
52-16177
606 disconnectTimer->stop();
executed 52 times by 2 tests: disconnectTimer->stop();
Executed by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
52
607}
executed 16229 times by 31 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
16229
608-
609/*! \internal-
610-
611 Initializes the socket layer to by of type \a type, using the-
612 network layer protocol \a protocol. Resets the socket layer first-
613 if it's already initialized. Sets up the socket notifiers.-
614*/-
615bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtocol protocol)-
616{-
617#ifdef QT_NO_NETWORKPROXY-
618 // this is here to avoid a duplication of the call to createSocketEngine below-
619 static const QNetworkProxy &proxyInUse = *(QNetworkProxy *)0;-
620#endif-
621-
622 Q_Q(QAbstractSocket);-
623#if defined (QABSTRACTSOCKET_DEBUG)-
624 QString typeStr;-
625 if (q->socketType() == QAbstractSocket::TcpSocket) typeStr = QLatin1String("TcpSocket");-
626 else if (q->socketType() == QAbstractSocket::UdpSocket) typeStr = QLatin1String("UdpSocket");-
627 else typeStr = QLatin1String("UnknownSocketType");-
628 QString protocolStr;-
629 if (protocol == QAbstractSocket::IPv4Protocol) protocolStr = QLatin1String("IPv4Protocol");-
630 else if (protocol == QAbstractSocket::IPv6Protocol) protocolStr = QLatin1String("IPv6Protocol");-
631 else protocolStr = QLatin1String("UnknownNetworkLayerProtocol");-
632#endif-
633-
634 resetSocketLayer();-
635 socketEngine = QAbstractSocketEngine::createSocketEngine(q->socketType(), proxyInUse, q);-
636 if (!socketEngine) {
!socketEngineDescription
TRUEnever evaluated
FALSEevaluated 5068 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
0-5068
637 setError(QAbstractSocket::UnsupportedSocketOperationError,-
638 QAbstractSocket::tr("Operation on socket is not supported"));-
639 return false;
never executed: return false;
0
640 }-
641#ifndef QT_NO_BEARERMANAGEMENT-
642 //copy network session down to the socket engine (if it has been set)-
643 socketEngine->setProperty("_q_networksession", q->property("_q_networksession"));-
644#endif-
645 if (!socketEngine->initialize(q->socketType(), protocol)) {
!socketEngine-...e(), protocol)Description
TRUEnever evaluated
FALSEevaluated 5068 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
0-5068
646#if defined (QABSTRACTSOCKET_DEBUG)-
647 qDebug("QAbstractSocketPrivate::initSocketLayer(%s, %s) failed (%s)",-
648 typeStr.toLatin1().constData(), protocolStr.toLatin1().constData(),-
649 socketEngine->errorString().toLatin1().constData());-
650#endif-
651 setError(socketEngine->error(), socketEngine->errorString());-
652 return false;
never executed: return false;
0
653 }-
654-
655 configureCreatedSocket();-
656-
657 if (threadData->hasEventDispatcher())
threadData->ha...ntDispatcher()Description
TRUEevaluated 5060 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
8-5060
658 socketEngine->setReceiver(this);
executed 5060 times by 27 tests: socketEngine->setReceiver(this);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
5060
659-
660#if defined (QABSTRACTSOCKET_DEBUG)-
661 qDebug("QAbstractSocketPrivate::initSocketLayer(%s, %s) success",-
662 typeStr.toLatin1().constData(), protocolStr.toLatin1().constData());-
663#endif-
664 return true;
executed 5068 times by 27 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
5068
665}-
666-
667/*! \internal-
668*/-
669void QAbstractSocketPrivate::configureCreatedSocket()-
670{-
671}-
672-
673/*! \internal-
674-
675 Slot connected to the read socket notifier. This slot is called-
676 when new data is available for reading, or when the socket has-
677 been closed. Handles recursive calls.-
678*/-
679bool QAbstractSocketPrivate::canReadNotification()-
680{-
681 Q_Q(QAbstractSocket);-
682#if defined (QABSTRACTSOCKET_DEBUG)-
683 qDebug("QAbstractSocketPrivate::canReadNotification()");-
684#endif-
685-
686 if (!isBuffered)
!isBufferedDescription
TRUEevaluated 3989 times by 10 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
FALSEevaluated 30041 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
3989-30041
687 socketEngine->setReadNotificationEnabled(false);
executed 3989 times by 10 tests: socketEngine->setReadNotificationEnabled(false);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
3989
688-
689 // If buffered, read data from the socket into the read buffer-
690 if (isBuffered) {
isBufferedDescription
TRUEevaluated 30041 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3989 times by 10 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
3989-30041
691 const qint64 oldBufferSize = buffer.size();-
692-
693 // Return if there is no space in the buffer-
694 if (readBufferMaxSize && oldBufferSize >= readBufferMaxSize) {
readBufferMaxSizeDescription
TRUEevaluated 12250 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 17791 times by 24 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
oldBufferSize ...dBufferMaxSizeDescription
TRUEnever evaluated
FALSEevaluated 12250 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-17791
695#if defined (QABSTRACTSOCKET_DEBUG)-
696 qDebug("QAbstractSocketPrivate::canReadNotification() buffer is full");-
697#endif-
698 return false;
never executed: return false;
0
699 }-
700-
701 // If reading from the socket fails after getting a read-
702 // notification, close the socket.-
703 if (!readFromSocket()) {
!readFromSocket()Description
TRUEevaluated 1694 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 28346 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
1694-28346
704#if defined (QABSTRACTSOCKET_DEBUG)-
705 qDebug("QAbstractSocketPrivate::canReadNotification() disconnecting socket");-
706#endif-
707 q->disconnectFromHost();-
708 return false;
executed 1694 times by 13 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1694
709 }-
710-
711 // Return if there is no new data available.-
712 if (buffer.size() == oldBufferSize) {
buffer.size() == oldBufferSizeDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 28334 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
12-28334
713 // If the socket is opened only for writing, return true-
714 // to indicate that the data was discarded.-
715 return !q->isReadable();
executed 12 times by 2 tests: return !q->isReadable();
Executed by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
12
716 }-
717-
718 // If read buffer is full, disable the read socket notifier.-
719 if (readBufferMaxSize && buffer.size() == readBufferMaxSize) {
readBufferMaxSizeDescription
TRUEevaluated 11761 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 16573 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
buffer.size() ...dBufferMaxSizeDescription
TRUEevaluated 43 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 11718 times by 11 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
43-16573
720 socketEngine->setReadNotificationEnabled(false);-
721 }
executed 43 times by 4 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
43
722 }
executed 28334 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
28334
723-
724 emitReadyRead();-
725-
726 // If we were closed as a result of the readyRead() signal,-
727 // return.-
728 if (state == QAbstractSocket::UnconnectedState || state == QAbstractSocket::ClosingState) {
state == QAbst...connectedStateDescription
TRUEevaluated 361 times by 11 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 31962 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • ...
state == QAbst...::ClosingStateDescription
TRUEevaluated 44 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 31918 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
44-31962
729#if defined (QABSTRACTSOCKET_DEBUG)-
730 qDebug("QAbstractSocketPrivate::canReadNotification() socket is closing - returning");-
731#endif-
732 return true;
executed 405 times by 11 tests: return true;
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
405
733 }-
734-
735 // turn the socket engine off if we've reached the buffer size limit-
736 if (socketEngine && isBuffered)
socketEngineDescription
TRUEevaluated 31918 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
isBufferedDescription
TRUEevaluated 28055 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 3863 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
0-31918
737 socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable());
executed 28055 times by 22 tests: socketEngine->setReadNotificationEnabled(readBufferMaxSize == 0 || readBufferMaxSize > q->bytesAvailable());
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
28055
738-
739 return true;
executed 31918 times by 25 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
31918
740}-
741-
742/*! \internal-
743-
744 Slot connected to the close socket notifier. It's called when the-
745 socket is closed.-
746*/-
747void QAbstractSocketPrivate::canCloseNotification()-
748{-
749 Q_Q(QAbstractSocket);-
750 // Note that this method is only called on Windows. Other platforms close in the canReadNotification()-
751-
752#if defined (QABSTRACTSOCKET_DEBUG)-
753 qDebug("QAbstractSocketPrivate::canCloseNotification()");-
754#endif-
755-
756 qint64 newBytes = 0;-
757 if (isBuffered) {
isBufferedDescription
TRUEnever evaluated
FALSEnever evaluated
0
758 // Try to read to the buffer, if the read fail we can close the socket.-
759 newBytes = buffer.size();-
760 qint64 oldReadBufferMaxSize = readBufferMaxSize;-
761 readBufferMaxSize = 0; // temporarily disable max read buffer, we want to empty the OS buffer-
762 bool hadReadFromSocket = readFromSocket();-
763 readBufferMaxSize = oldReadBufferMaxSize;-
764 if (!hadReadFromSocket) {
!hadReadFromSocketDescription
TRUEnever evaluated
FALSEnever evaluated
0
765 q->disconnectFromHost();-
766 return;
never executed: return;
0
767 }-
768 newBytes = buffer.size() - newBytes;-
769 if (newBytes) {
newBytesDescription
TRUEnever evaluated
FALSEnever evaluated
0
770 // If there was still some data to be read from the socket-
771 // then we could get another FD_READ. The disconnect will-
772 // then occur when we read from the socket again and fail-
773 // in canReadNotification or by the manually created-
774 // closeNotification below.-
775 emitReadyRead();-
776-
777 QMetaObject::invokeMethod(socketEngine, "closeNotification", Qt::QueuedConnection);-
778 }
never executed: end of block
0
779 } else if (socketType == QAbstractSocket::TcpSocket && socketEngine) {
never executed: end of block
socketType == ...ket::TcpSocketDescription
TRUEnever evaluated
FALSEnever evaluated
socketEngineDescription
TRUEnever evaluated
FALSEnever evaluated
0
780 emitReadyRead();-
781 }
never executed: end of block
0
782}
never executed: end of block
0
783-
784-
785/*! \internal-
786-
787 Slot connected to the write socket notifier. It's called during a-
788 delayed connect or when the socket is ready for writing.-
789*/-
790bool QAbstractSocketPrivate::canWriteNotification()-
791{-
792#if defined (QABSTRACTSOCKET_DEBUG)-
793 qDebug("QAbstractSocketPrivate::canWriteNotification() flushing");-
794#endif-
795 bool dataWasWritten = writeToSocket();-
796-
797 if (socketEngine && writeBuffer.isEmpty() && socketEngine->bytesToWrite() == 0)
socketEngineDescription
TRUEevaluated 23587 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 189 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
writeBuffer.isEmpty()Description
TRUEevaluated 19062 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 4525 times by 5 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
socketEngine->...ToWrite() == 0Description
TRUEevaluated 18042 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 1020 times by 7 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
189-23587
798 socketEngine->setWriteNotificationEnabled(false);
executed 18042 times by 26 tests: socketEngine->setWriteNotificationEnabled(false);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
18042
799-
800 return dataWasWritten;
executed 23776 times by 27 tests: return dataWasWritten;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
23776
801}-
802-
803/*! \internal-
804-
805 Slot connected to a notification of connection status-
806 change. Either we finished connecting or we failed to connect.-
807*/-
808void QAbstractSocketPrivate::connectionNotification()-
809{-
810 // If in connecting state, check if the connection has been-
811 // established, otherwise flush pending data.-
812 if (state == QAbstractSocket::ConnectingState) {
state == QAbst...onnectingStateDescription
TRUEevaluated 3288 times by 16 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
9-3288
813#if defined (QABSTRACTSOCKET_DEBUG)-
814 qDebug("QAbstractSocketPrivate::connectionNotification() testing connection");-
815#endif-
816 _q_testConnection();-
817 }
executed 3288 times by 16 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
3288
818}
executed 3297 times by 16 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
3297
819-
820/*! \internal-
821-
822 Writes one pending data block in the write buffer to the socket.-
823-
824 It is usually invoked by canWriteNotification after one or more-
825 calls to write().-
826-
827 Emits bytesWritten().-
828*/-
829bool QAbstractSocketPrivate::writeToSocket()-
830{-
831 Q_Q(QAbstractSocket);-
832 if (!socketEngine || !socketEngine->isValid() || (writeBuffer.isEmpty()
!socketEngineDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_qtcpsocket - unknown status
FALSEevaluated 26620 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
!socketEngine->isValid()Description
TRUEnever evaluated
FALSEevaluated 26620 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
writeBuffer.isEmpty()Description
TRUEevaluated 2557 times by 18 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 24063 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-26620
833 && socketEngine->bytesToWrite() == 0)) {
socketEngine->...ToWrite() == 0Description
TRUEevaluated 1925 times by 18 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 632 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
632-1925
834#if defined (QABSTRACTSOCKET_DEBUG)-
835 qDebug("QAbstractSocketPrivate::writeToSocket() nothing to do: valid ? %s, writeBuffer.isEmpty() ? %s",-
836 (socketEngine && socketEngine->isValid()) ? "yes" : "no", writeBuffer.isEmpty() ? "yes" : "no");-
837#endif-
838-
839 // this covers the case when the buffer was empty, but we had to wait for the socket engine to finish-
840 if (state == QAbstractSocket::ClosingState)
state == QAbst...::ClosingStateDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 1924 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
4-1924
841 q->disconnectFromHost();
executed 4 times by 1 test: q->disconnectFromHost();
Executed by:
  • tst_qtcpsocket - unknown status
4
842-
843 return false;
executed 1928 times by 19 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
1928
844 }-
845-
846 qint64 nextSize = writeBuffer.nextDataBlockSize();-
847 const char *ptr = writeBuffer.readPointer();-
848-
849 // Attempt to write it all in one chunk.-
850 qint64 written = nextSize ? socketEngine->write(ptr, nextSize) : Q_INT64_C(0);
nextSizeDescription
TRUEevaluated 24063 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 632 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
632-24063
851 if (written < 0) {
written < 0Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 24686 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
9-24686
852#if defined (QABSTRACTSOCKET_DEBUG)-
853 qDebug() << "QAbstractSocketPrivate::writeToSocket() write error, aborting."-
854 << socketEngine->errorString();-
855#endif-
856 setErrorAndEmit(socketEngine->error(), socketEngine->errorString());-
857 // an unexpected error so close the socket.-
858 q->abort();-
859 return false;
executed 9 times by 2 tests: return false;
Executed by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
9
860 }-
861-
862#if defined (QABSTRACTSOCKET_DEBUG)-
863 qDebug("QAbstractSocketPrivate::writeToSocket() %lld bytes written to the network",-
864 written);-
865#endif-
866-
867 if (written > 0) {
written > 0Description
TRUEevaluated 23852 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 834 times by 5 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
834-23852
868 // Remove what we wrote so far.-
869 writeBuffer.free(written);-
870 // Don't emit bytesWritten() recursively.-
871 if (!emittedBytesWritten) {
!emittedBytesWrittenDescription
TRUEevaluated 23852 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-23852
872 QScopedValueRollback<bool> r(emittedBytesWritten);-
873 emittedBytesWritten = true;-
874 emit q->bytesWritten(written);-
875 }
executed 23852 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
23852
876 emit q->channelBytesWritten(0, written);-
877 }
executed 23852 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
23852
878-
879 if (writeBuffer.isEmpty() && socketEngine && socketEngine->isWriteNotificationEnabled()
writeBuffer.isEmpty()Description
TRUEevaluated 19864 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 4822 times by 5 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
socketEngineDescription
TRUEevaluated 19810 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 54 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
socketEngine->...ationEnabled()Description
TRUEevaluated 19798 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
12-19864
880 && !socketEngine->bytesToWrite())
!socketEngine->bytesToWrite()Description
TRUEevaluated 18754 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1044 times by 7 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1044-18754
881 socketEngine->setWriteNotificationEnabled(false);
executed 18754 times by 21 tests: socketEngine->setWriteNotificationEnabled(false);
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
18754
882 if (state == QAbstractSocket::ClosingState)
state == QAbst...::ClosingStateDescription
TRUEevaluated 738 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 23948 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
738-23948
883 q->disconnectFromHost();
executed 738 times by 7 tests: q->disconnectFromHost();
Executed by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
738
884-
885 return written > 0;
executed 24686 times by 21 tests: return written > 0;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24686
886}-
887-
888/*! \internal-
889-
890 Writes pending data in the write buffers to the socket. The function-
891 writes as much as it can without blocking. If any data was written,-
892 this function returns true; otherwise false is returned.-
893*/-
894bool QAbstractSocketPrivate::flush()-
895{-
896 bool dataWasWritten = false;-
897-
898 while (!writeBuffer.isEmpty() && writeToSocket())
!writeBuffer.isEmpty()Description
TRUEevaluated 2847 times by 11 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2562 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
writeToSocket()Description
TRUEevaluated 2645 times by 11 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 202 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
202-2847
899 dataWasWritten = true;
executed 2645 times by 11 tests: dataWasWritten = true;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
2645
900-
901 return dataWasWritten;
executed 2764 times by 12 tests: return dataWasWritten;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
2764
902}-
903-
904#ifndef QT_NO_NETWORKPROXY-
905/*! \internal-
906-
907 Resolve the proxy to its final value.-
908*/-
909void QAbstractSocketPrivate::resolveProxy(const QString &hostname, quint16 port)-
910{-
911 QList<QNetworkProxy> proxies;-
912-
913 if (proxy.type() != QNetworkProxy::DefaultProxy) {
proxy.type() !...::DefaultProxyDescription
TRUEevaluated 2332 times by 16 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 5475 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
2332-5475
914 // a non-default proxy was set with setProxy-
915 proxies << proxy;-
916 } else {
executed 2332 times by 16 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2332
917 // try the application settings instead-
918 QNetworkProxyQuery query(hostname, port, QString(),-
919 socketType == QAbstractSocket::TcpSocket ?-
920 QNetworkProxyQuery::TcpSocket :-
921 QNetworkProxyQuery::UdpSocket);-
922 proxies = QNetworkProxyFactory::proxyForQuery(query);-
923 }
executed 5475 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
5475
924-
925 // return the first that we can use-
926 for (const QNetworkProxy &p : qAsConst(proxies)) {-
927 if (socketType == QAbstractSocket::UdpSocket &&
socketType == ...ket::UdpSocketDescription
TRUEevaluated 135 times by 3 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
FALSEevaluated 7680 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
135-7680
928 (p.capabilities() & QNetworkProxy::UdpTunnelingCapability) == 0)
(p.capabilitie...pability) == 0Description
TRUEnever evaluated
FALSEevaluated 135 times by 3 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
0-135
929 continue;
never executed: continue;
0
930-
931 if (socketType == QAbstractSocket::TcpSocket &&
socketType == ...ket::TcpSocketDescription
TRUEevaluated 7680 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 135 times by 3 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
135-7680
932 (p.capabilities() & QNetworkProxy::TunnelingCapability) == 0)
(p.capabilitie...pability) == 0Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 7662 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
18-7662
933 continue;
executed 18 times by 1 test: continue;
Executed by:
  • tst_qtcpsocket - unknown status
18
934-
935 proxyInUse = p;-
936 return;
executed 7797 times by 29 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
7797
937 }-
938-
939 // no proxy found-
940 // DefaultProxy here will raise an error-
941 proxyInUse = QNetworkProxy();-
942}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qtcpsocket - unknown status
10
943-
944/*!-
945 \internal-
946-
947 Starts the connection to \a host, like _q_startConnecting below,-
948 but without hostname resolution.-
949*/-
950void QAbstractSocketPrivate::startConnectingByName(const QString &host)-
951{-
952 Q_Q(QAbstractSocket);-
953 if (state == QAbstractSocket::ConnectingState || state == QAbstractSocket::ConnectedState)
state == QAbst...onnectingStateDescription
TRUEnever evaluated
FALSEevaluated 785 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
state == QAbst...ConnectedStateDescription
TRUEnever evaluated
FALSEevaluated 785 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-785
954 return;
never executed: return;
0
955-
956#if defined(QABSTRACTSOCKET_DEBUG)-
957 qDebug("QAbstractSocketPrivate::startConnectingByName(host == %s)", qPrintable(host));-
958#endif-
959-
960 // ### Let the socket engine drive this?-
961 state = QAbstractSocket::ConnectingState;-
962 emit q->stateChanged(state);-
963-
964 if (cachedSocketDescriptor != -1 || initSocketLayer(QAbstractSocket::UnknownNetworkLayerProtocol)) {
cachedSocketDescriptor != -1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 783 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
initSocketLaye...LayerProtocol)Description
TRUEevaluated 783 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-783
965 if (socketEngine->connectToHostByName(host, port) ||
socketEngine->...me(host, port)Description
TRUEnever evaluated
FALSEevaluated 785 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-785
966 socketEngine->state() == QAbstractSocket::ConnectingState) {
socketEngine->...onnectingStateDescription
TRUEevaluated 785 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-785
967 cachedSocketDescriptor = socketEngine->socketDescriptor();-
968-
969 return;
executed 785 times by 7 tests: return;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
785
970 }-
971-
972 // failed to connect-
973 setError(socketEngine->error(), socketEngine->errorString());-
974 }
never executed: end of block
0
975-
976 state = QAbstractSocket::UnconnectedState;-
977 emit q->error(socketError);-
978 emit q->stateChanged(state);-
979}
never executed: end of block
0
980-
981#endif-
982-
983/*! \internal-
984-
985 Slot connected to QHostInfo::lookupHost() in connectToHost(). This-
986 function starts the process of connecting to any number of-
987 candidate IP addresses for the host, if it was found. Calls-
988 _q_connectToNextAddress().-
989*/-
990void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo)-
991{-
992 Q_Q(QAbstractSocket);-
993 addresses.clear();-
994 if (state != QAbstractSocket::HostLookupState)
state != QAbst...ostLookupStateDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qsslsocket - unknown status
FALSEevaluated 3951 times by 28 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
1-3951
995 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_qsslsocket - unknown status
1
996-
997 if (hostLookupId != -1 && hostLookupId != hostInfo.lookupId()) {
hostLookupId != -1Description
TRUEevaluated 57 times by 6 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 3894 times by 28 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
hostLookupId !...nfo.lookupId()Description
TRUEnever evaluated
FALSEevaluated 57 times by 6 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
0-3894
998 qWarning("QAbstractSocketPrivate::_q_startConnecting() received hostInfo for wrong lookup ID %d expected %d", hostInfo.lookupId(), hostLookupId);-
999 }
never executed: end of block
0
1000-
1001 // Only add the addresses for the preferred network layer.-
1002 // Or all if preferred network layer is not set.-
1003 if (preferredNetworkLayerProtocol == QAbstractSocket::UnknownNetworkLayerProtocol || preferredNetworkLayerProtocol == QAbstractSocket::AnyIPProtocol) {
preferredNetwo...kLayerProtocolDescription
TRUEnever evaluated
FALSEevaluated 3951 times by 28 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
preferredNetwo...:AnyIPProtocolDescription
TRUEevaluated 3100 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 851 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
0-3951
1004 addresses = hostInfo.addresses();-
1005 } else {
executed 3100 times by 22 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
3100
1006 const auto candidates = hostInfo.addresses();-
1007 for (const QHostAddress &address : candidates) {-
1008 if (address.protocol() == preferredNetworkLayerProtocol)
address.protoc...kLayerProtocolDescription
TRUEevaluated 855 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 330 times by 3 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
330-855
1009 addresses += address;
executed 855 times by 8 tests: addresses += address;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
855
1010 }
executed 1185 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
1185
1011 }
executed 851 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
851
1012-
1013-
1014#if defined(QABSTRACTSOCKET_DEBUG)-
1015 QString s = QLatin1String("{");-
1016 for (int i = 0; i < addresses.count(); ++i) {-
1017 if (i != 0) s += QLatin1String(", ");-
1018 s += addresses.at(i).toString();-
1019 }-
1020 s += QLatin1Char('}');-
1021 qDebug("QAbstractSocketPrivate::_q_startConnecting(hostInfo == %s)", s.toLatin1().constData());-
1022#endif-
1023-
1024 // Try all addresses twice.-
1025 addresses += addresses;-
1026-
1027 // If there are no addresses in the host list, report this to the-
1028 // user.-
1029 if (addresses.isEmpty()) {
addresses.isEmpty()Description
TRUEevaluated 17 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 3934 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
17-3934
1030#if defined(QABSTRACTSOCKET_DEBUG)-
1031 qDebug("QAbstractSocketPrivate::_q_startConnecting(), host not found");-
1032#endif-
1033 state = QAbstractSocket::UnconnectedState;-
1034 setError(QAbstractSocket::HostNotFoundError, QAbstractSocket::tr("Host not found"));-
1035 emit q->stateChanged(state);-
1036 emit q->error(QAbstractSocket::HostNotFoundError);-
1037 return;
executed 17 times by 8 tests: return;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
17
1038 }-
1039-
1040 // Enter Connecting state (see also sn_write, which is called by-
1041 // the write socket notifier after connect())-
1042 state = QAbstractSocket::ConnectingState;-
1043 emit q->stateChanged(state);-
1044-
1045 // Report the successful host lookup-
1046 emit q->hostFound();-
1047-
1048 // The addresses returned by the lookup will be tested one after-
1049 // another by _q_connectToNextAddress().-
1050 _q_connectToNextAddress();-
1051}
executed 3934 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
3934
1052-
1053/*! \internal-
1054-
1055 Called by a queued or direct connection from _q_startConnecting() or-
1056 _q_testConnection(), this function takes the first address of the-
1057 pending addresses list and tries to connect to it. If the-
1058 connection succeeds, QAbstractSocket will emit-
1059 connected(). Otherwise, error(ConnectionRefusedError) or-
1060 error(SocketTimeoutError) is emitted.-
1061*/-
1062void QAbstractSocketPrivate::_q_connectToNextAddress()-
1063{-
1064 Q_Q(QAbstractSocket);-
1065 do {-
1066 // Check for more pending addresses-
1067 if (addresses.isEmpty()) {
addresses.isEmpty()Description
TRUEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4126 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
259-4126
1068#if defined(QABSTRACTSOCKET_DEBUG)-
1069 qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), all addresses failed.");-
1070#endif-
1071 state = QAbstractSocket::UnconnectedState;-
1072 if (socketEngine) {
socketEngineDescription
TRUEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-259
1073 if ((socketEngine->error() == QAbstractSocket::UnknownSocketError
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-259
1074#ifdef Q_OS_AIX
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-259
1075 // On AIX, the second connect call will result in EINVAL and not
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-259
1076 // ECONNECTIONREFUSED; although the meaning is the same.
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-259
1077 || socketEngine->error() == QAbstractSocket::UnsupportedSocketOperationError
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-259
1078#endif
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-259
1079 ) && socketEngine->state() == QAbstractSocket::ConnectingState) {
(socketEngine-...nSocketError )Description
TRUEnever evaluated
FALSEevaluated 259 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
socketEngine->...onnectingStateDescription
TRUEnever evaluated
FALSEnever evaluated
0-259
1080 setError(QAbstractSocket::ConnectionRefusedError,-
1081 QAbstractSocket::tr("Connection refused"));-
1082 } else {
never executed: end of block
0
1083 setError(socketEngine->error(), socketEngine->errorString());-
1084 }
executed 259 times by 12 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
259
1085 } else {-
1086// socketError = QAbstractSocket::ConnectionRefusedError;-
1087// q->setErrorString(QAbstractSocket::tr("Connection refused"));-
1088 }
never executed: end of block
0
1089 emit q->stateChanged(state);-
1090 emit q->error(socketError);-
1091 return;
executed 259 times by 12 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
259
1092 }-
1093-
1094 // Pick the first host address candidate-
1095 host = addresses.takeFirst();-
1096#if defined(QABSTRACTSOCKET_DEBUG)-
1097 qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), connecting to %s:%i, %d left to try",-
1098 host.toString().toLatin1().constData(), port, addresses.count());-
1099#endif-
1100-
1101 if (cachedSocketDescriptor == -1 && !initSocketLayer(host.protocol())) {
cachedSocketDescriptor == -1Description
TRUEevaluated 4091 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
!initSocketLay...st.protocol())Description
TRUEnever evaluated
FALSEevaluated 4091 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
0-4091
1102 // hope that the next address is better-
1103#if defined(QABSTRACTSOCKET_DEBUG)-
1104 qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), failed to initialize sock layer");-
1105#endif-
1106 continue;
never executed: continue;
0
1107 }-
1108-
1109 // Tries to connect to the address. If it succeeds immediately-
1110 // (localhost address on BSD or any UDP connect), emit-
1111 // connected() and return.-
1112 if (socketEngine->connectToHost(host, port)) {
socketEngine->...st(host, port)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEevaluated 4122 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4-4122
1113 //_q_testConnection();-
1114 fetchConnectionParameters();-
1115 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_QUdpSocket
4
1116 }-
1117-
1118 // Check that we're in delayed connection state. If not, try-
1119 // the next address-
1120 if (socketEngine->state() != QAbstractSocket::ConnectingState) {
socketEngine->...onnectingStateDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 4116 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
6-4116
1121#if defined(QABSTRACTSOCKET_DEBUG)-
1122 qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), connection failed (%s)",-
1123 socketEngine->errorString().toLatin1().constData());-
1124#endif-
1125 continue;
executed 6 times by 2 tests: continue;
Executed by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
6
1126 }-
1127-
1128 // Start the connect timer.-
1129 if (threadData->hasEventDispatcher()) {
threadData->ha...ntDispatcher()Description
TRUEevaluated 4110 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
6-4110
1130 if (!connectTimer) {
!connectTimerDescription
TRUEevaluated 3565 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 545 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
545-3565
1131 connectTimer = new QTimer(q);-
1132 QObject::connect(connectTimer, SIGNAL(timeout()),-
1133 q, SLOT(_q_abortConnectionAttempt()),-
1134 Qt::DirectConnection);-
1135 }
executed 3565 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
3565
1136 connectTimer->start(QT_CONNECT_TIMEOUT);-
1137 }
executed 4110 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4110
1138-
1139 // Wait for a write notification that will eventually call-
1140 // _q_testConnection().-
1141 socketEngine->setWriteNotificationEnabled(true);-
1142 break;
executed 4116 times by 27 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4116
1143 } while (state != QAbstractSocket::ConnectedState);
state != QAbst...ConnectedStateDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
2-4
1144}
executed 4118 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4118
1145-
1146/*! \internal-
1147-
1148 Tests if a connection has been established. If it has, connected()-
1149 is emitted. Otherwise, _q_connectToNextAddress() is invoked.-
1150*/-
1151void QAbstractSocketPrivate::_q_testConnection()-
1152{-
1153 if (socketEngine) {
socketEngineDescription
TRUEevaluated 4665 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEnever evaluated
0-4665
1154 if (threadData->hasEventDispatcher()) {
threadData->ha...ntDispatcher()Description
TRUEevaluated 4653 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
12-4653
1155 if (connectTimer)
connectTimerDescription
TRUEevaluated 3884 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 769 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
769-3884
1156 connectTimer->stop();
executed 3884 times by 27 tests: connectTimer->stop();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
3884
1157 }
executed 4653 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4653
1158-
1159 if (socketEngine->state() == QAbstractSocket::ConnectedState) {
socketEngine->...ConnectedStateDescription
TRUEevaluated 4239 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 426 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
426-4239
1160 // Fetch the parameters if our connection is completed;-
1161 // otherwise, fall out and try the next address.-
1162 fetchConnectionParameters();-
1163 if (pendingClose) {
pendingCloseDescription
TRUEevaluated 19 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 4220 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
19-4220
1164 q_func()->disconnectFromHost();-
1165 pendingClose = false;-
1166 }
executed 19 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
19
1167 return;
executed 4239 times by 27 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4239
1168 }-
1169-
1170 // don't retry the other addresses if we had a proxy error-
1171 if (isProxyError(socketEngine->error()))
isProxyError(s...gine->error())Description
TRUEevaluated 62 times by 6 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 364 times by 10 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
62-364
1172 addresses.clear();
executed 62 times by 6 tests: addresses.clear();
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
62
1173 }
executed 426 times by 11 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
426
1174-
1175 if (threadData->hasEventDispatcher()) {
threadData->ha...ntDispatcher()Description
TRUEevaluated 426 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-426
1176 if (connectTimer)
connectTimerDescription
TRUEevaluated 393 times by 9 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 33 times by 6 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
33-393
1177 connectTimer->stop();
executed 393 times by 9 tests: connectTimer->stop();
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
393
1178 }
executed 426 times by 11 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
426
1179-
1180#if defined(QABSTRACTSOCKET_DEBUG)-
1181 qDebug("QAbstractSocketPrivate::_q_testConnection() connection failed,"-
1182 " checking for alternative addresses");-
1183#endif-
1184 _q_connectToNextAddress();-
1185}
executed 426 times by 11 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qtcpsocket - unknown status
426
1186-
1187/*! \internal-
1188-
1189 This function is called after a certain number of seconds has-
1190 passed while waiting for a connection. It simply tests the-
1191 connection, and continues to the next address if the connection-
1192 failed.-
1193*/-
1194void QAbstractSocketPrivate::_q_abortConnectionAttempt()-
1195{-
1196 Q_Q(QAbstractSocket);-
1197#if defined(QABSTRACTSOCKET_DEBUG)-
1198 qDebug("QAbstractSocketPrivate::_q_abortConnectionAttempt() (timed out)");-
1199#endif-
1200 if (socketEngine)
socketEngineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFtp
FALSEnever evaluated
0-2
1201 socketEngine->setWriteNotificationEnabled(false);
executed 2 times by 1 test: socketEngine->setWriteNotificationEnabled(false);
Executed by:
  • tst_QFtp
2
1202-
1203 connectTimer->stop();-
1204-
1205 if (addresses.isEmpty()) {
addresses.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFtp
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFtp
1
1206 state = QAbstractSocket::UnconnectedState;-
1207 setError(QAbstractSocket::SocketTimeoutError,-
1208 QAbstractSocket::tr("Connection timed out"));-
1209 emit q->stateChanged(state);-
1210 emit q->error(socketError);-
1211 } else {
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFtp
1
1212 _q_connectToNextAddress();-
1213 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFtp
1
1214}-
1215-
1216void QAbstractSocketPrivate::_q_forceDisconnect()-
1217{-
1218 Q_Q(QAbstractSocket);-
1219 if (socketEngine && socketEngine->isValid() && state == QAbstractSocket::ClosingState) {
socketEngineDescription
TRUEnever evaluated
FALSEnever evaluated
socketEngine->isValid()Description
TRUEnever evaluated
FALSEnever evaluated
state == QAbst...::ClosingStateDescription
TRUEnever evaluated
FALSEnever evaluated
0
1220 socketEngine->close();-
1221 q->disconnectFromHost();-
1222 }
never executed: end of block
0
1223}
never executed: end of block
0
1224-
1225/*! \internal-
1226-
1227 Reads data from the socket layer into the read buffer. Returns-
1228 true on success; otherwise false.-
1229*/-
1230bool QAbstractSocketPrivate::readFromSocket()-
1231{-
1232 Q_Q(QAbstractSocket);-
1233 // Find how many bytes we can read from the socket layer.-
1234 qint64 bytesToRead = socketEngine->bytesAvailable();-
1235 if (bytesToRead == 0) {
bytesToRead == 0Description
TRUEevaluated 1705 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 28336 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
1705-28336
1236 // Under heavy load, certain conditions can trigger read notifications-
1237 // for socket notifiers on which there is no activity. If we continue-
1238 // to read 0 bytes from the socket, we will trigger behavior similar-
1239 // to that which signals a remote close. When we hit this condition,-
1240 // we try to read 4k of data from the socket, which will give us either-
1241 // an EAGAIN/EWOULDBLOCK if the connection is alive (i.e., the remote-
1242 // host has _not_ disappeared).-
1243 bytesToRead = 4096;-
1244 }
executed 1705 times by 13 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1705
1245-
1246 if (q->isReadable()) {
q->isReadable()Description
TRUEevaluated 30039 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
2-30039
1247 if (readBufferMaxSize && bytesToRead > (readBufferMaxSize - buffer.size()))
readBufferMaxSizeDescription
TRUEevaluated 12250 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 17789 times by 24 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
bytesToRead > ...buffer.size())Description
TRUEevaluated 40 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 12210 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
40-17789
1248 bytesToRead = readBufferMaxSize - buffer.size();
executed 40 times by 4 tests: bytesToRead = readBufferMaxSize - buffer.size();
Executed by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
40
1249-
1250#if defined(QABSTRACTSOCKET_DEBUG)-
1251 qDebug("QAbstractSocketPrivate::readFromSocket() about to read %lld bytes",-
1252 bytesToRead);-
1253#endif-
1254-
1255 // Read from the socket, store data in the read buffer.-
1256 char *ptr = buffer.reserve(bytesToRead);-
1257 qint64 readBytes = socketEngine->read(ptr, bytesToRead);-
1258 if (readBytes == -2) {
readBytes == -2Description
TRUEnever evaluated
FALSEevaluated 30039 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
0-30039
1259 // No bytes currently available for reading.-
1260 buffer.chop(bytesToRead);-
1261 return true;
never executed: return true;
0
1262 }-
1263 buffer.chop(bytesToRead - (readBytes < 0 ? qint64(0) : readBytes));-
1264#if defined(QABSTRACTSOCKET_DEBUG)-
1265 qDebug("QAbstractSocketPrivate::readFromSocket() got %lld bytes, buffer size = %lld",-
1266 readBytes, buffer.size());-
1267#endif-
1268 } else {
executed 30039 times by 25 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
30039
1269 // Discard unwanted data if opened in WriteOnly mode-
1270 QVarLengthArray<char, 4096> discardBuffer(bytesToRead);-
1271-
1272#if defined(QABSTRACTSOCKET_DEBUG)-
1273 qDebug("QAbstractSocketPrivate::readFromSocket() about to discard %lld bytes",-
1274 bytesToRead);-
1275#endif-
1276 socketEngine->read(discardBuffer.data(), bytesToRead);-
1277 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qtcpsocket - unknown status
2
1278-
1279 if (!socketEngine->isValid()) {
!socketEngine->isValid()Description
TRUEevaluated 1695 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 28346 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
1695-28346
1280 setErrorAndEmit(socketEngine->error(), socketEngine->errorString());-
1281#if defined(QABSTRACTSOCKET_DEBUG)-
1282 qDebug("QAbstractSocketPrivate::readFromSocket() read failed: %s",-
1283 q->errorString().toLatin1().constData());-
1284#endif-
1285 resetSocketLayer();-
1286 return false;
executed 1694 times by 13 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1694
1287 }-
1288-
1289 return true;
executed 28346 times by 23 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
28346
1290}-
1291-
1292/*! \internal-
1293-
1294 Prevents from the recursive readyRead() emission.-
1295*/-
1296void QAbstractSocketPrivate::emitReadyRead()-
1297{-
1298 Q_Q(QAbstractSocket);-
1299 // Only emit readyRead() when not recursing.-
1300 if (!emittedReadyRead) {
!emittedReadyReadDescription
TRUEevaluated 32322 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
1-32322
1301 QScopedValueRollback<bool> r(emittedReadyRead);-
1302 emittedReadyRead = true;-
1303 emit q->readyRead();-
1304 }
executed 32322 times by 26 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • ...
32322
1305 emit q->channelReadyRead(0);-
1306}
executed 32323 times by 26 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • ...
32323
1307-
1308/*! \internal-
1309-
1310 Sets up the internal state after the connection has succeeded.-
1311*/-
1312void QAbstractSocketPrivate::fetchConnectionParameters()-
1313{-
1314 Q_Q(QAbstractSocket);-
1315-
1316 peerName = hostName;-
1317 if (socketEngine) {
socketEngineDescription
TRUEevaluated 4243 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEnever evaluated
0-4243
1318 if (q->isReadable()) {
q->isReadable()Description
TRUEevaluated 4216 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 27 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
27-4216
1319 const int inboundStreamCount = socketEngine->inboundStreamCount();-
1320 setReadChannelCount(qMax(1, inboundStreamCount));-
1321 if (inboundStreamCount == 0)
inboundStreamCount == 0Description
TRUEnever evaluated
FALSEevaluated 4216 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
0-4216
1322 readChannelCount = 0;
never executed: readChannelCount = 0;
0
1323 }
executed 4216 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4216
1324 if (q->isWritable()) {
q->isWritable()Description
TRUEevaluated 4218 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 25 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
25-4218
1325 const int outboundStreamCount = socketEngine->outboundStreamCount();-
1326 setWriteChannelCount(qMax(1, outboundStreamCount));-
1327 if (outboundStreamCount == 0)
outboundStreamCount == 0Description
TRUEnever evaluated
FALSEevaluated 4218 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
0-4218
1328 writeChannelCount = 0;
never executed: writeChannelCount = 0;
0
1329 }
executed 4218 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4218
1330 socketEngine->setReadNotificationEnabled(true);-
1331 socketEngine->setWriteNotificationEnabled(true);-
1332 localPort = socketEngine->localPort();-
1333 peerPort = socketEngine->peerPort();-
1334 localAddress = socketEngine->localAddress();-
1335 peerAddress = socketEngine->peerAddress();-
1336 cachedSocketDescriptor = socketEngine->socketDescriptor();-
1337 }
executed 4243 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4243
1338-
1339 state = QAbstractSocket::ConnectedState;-
1340 emit q->stateChanged(state);-
1341 emit q->connected();-
1342-
1343#if defined(QABSTRACTSOCKET_DEBUG)-
1344 qDebug("QAbstractSocketPrivate::fetchConnectionParameters() connection to %s:%i established",-
1345 host.toString().toLatin1().constData(), port);-
1346#endif-
1347}
executed 4243 times by 27 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
4243
1348-
1349-
1350void QAbstractSocketPrivate::pauseSocketNotifiers(QAbstractSocket *socket)-
1351{-
1352 QAbstractSocketEngine *socketEngine = socket->d_func()->socketEngine;-
1353 if (!socketEngine)
!socketEngineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 343 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
2-343
1354 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
2
1355 socket->d_func()->prePauseReadSocketNotifierState = socketEngine->isReadNotificationEnabled();-
1356 socket->d_func()->prePauseWriteSocketNotifierState = socketEngine->isWriteNotificationEnabled();-
1357 socket->d_func()->prePauseExceptionSocketNotifierState = socketEngine->isExceptionNotificationEnabled();-
1358 socketEngine->setReadNotificationEnabled(false);-
1359 socketEngine->setWriteNotificationEnabled(false);-
1360 socketEngine->setExceptionNotificationEnabled(false);-
1361}
executed 343 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
343
1362-
1363void QAbstractSocketPrivate::resumeSocketNotifiers(QAbstractSocket *socket)-
1364{-
1365 QAbstractSocketEngine *socketEngine = socket->d_func()->socketEngine;-
1366 if (!socketEngine)
!socketEngineDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 343 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
2-343
1367 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QNetworkReply
2
1368 socketEngine->setReadNotificationEnabled(socket->d_func()->prePauseReadSocketNotifierState);-
1369 socketEngine->setWriteNotificationEnabled(socket->d_func()->prePauseWriteSocketNotifierState);-
1370 socketEngine->setExceptionNotificationEnabled(socket->d_func()->prePauseExceptionSocketNotifierState);-
1371}
executed 343 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
343
1372-
1373QAbstractSocketEngine* QAbstractSocketPrivate::getSocketEngine(QAbstractSocket *socket)-
1374{-
1375 return socket->d_func()->socketEngine;
never executed: return socket->d_func()->socketEngine;
0
1376}-
1377-
1378/*!-
1379 \internal-
1380-
1381 Sets the socket error state to \c errorCode and \a errorString.-
1382*/-
1383void QAbstractSocketPrivate::setError(QAbstractSocket::SocketError errorCode,-
1384 const QString &errStr)-
1385{-
1386 socketError = errorCode;-
1387 errorString = errStr;-
1388}
executed 2704 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
2704
1389-
1390/*!-
1391 \internal-
1392-
1393 Sets the socket error state to \c errorCode and \a errorString,-
1394 and emits the QAbstractSocket::error() signal.-
1395*/-
1396void QAbstractSocketPrivate::setErrorAndEmit(QAbstractSocket::SocketError errorCode,-
1397 const QString &errorString)-
1398{-
1399 Q_Q(QAbstractSocket);-
1400 setError(errorCode, errorString);-
1401 emit q->error(errorCode);-
1402}
executed 2189 times by 19 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
2189
1403-
1404/*! \internal-
1405-
1406 Constructs a new abstract socket of type \a socketType. The \a-
1407 parent argument is passed to QObject's constructor.-
1408*/-
1409QAbstractSocket::QAbstractSocket(SocketType socketType,-
1410 QAbstractSocketPrivate &dd, QObject *parent)-
1411 : QIODevice(dd, parent)-
1412{-
1413 Q_D(QAbstractSocket);-
1414#if defined(QABSTRACTSOCKET_DEBUG)-
1415 qDebug("QAbstractSocket::QAbstractSocket(%sSocket, QAbstractSocketPrivate == %p, parent == %p)",-
1416 socketType == TcpSocket ? "Tcp" : socketType == UdpSocket-
1417 ? "Udp" : "Unknown", &dd, parent);-
1418#endif-
1419 d->socketType = socketType;-
1420}
executed 8969 times by 31 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • ...
8969
1421-
1422/*!-
1423 Creates a new abstract socket of type \a socketType. The \a-
1424 parent argument is passed to QObject's constructor.-
1425-
1426 \sa socketType(), QTcpSocket, QUdpSocket-
1427*/-
1428QAbstractSocket::QAbstractSocket(SocketType socketType, QObject *parent)-
1429 : QIODevice(*new QAbstractSocketPrivate, parent)-
1430{-
1431 Q_D(QAbstractSocket);-
1432#if defined(QABSTRACTSOCKET_DEBUG)-
1433 qDebug("QAbstractSocket::QAbstractSocket(%p)", parent);-
1434#endif-
1435 d->socketType = socketType;-
1436}
executed 7 times by 3 tests: end of block
Executed by:
  • tst_qabstractsocket - unknown status
  • tst_qhttpnetworkreply - unknown status
  • tst_qtcpsocket - unknown status
7
1437-
1438/*!-
1439 Destroys the socket.-
1440*/-
1441QAbstractSocket::~QAbstractSocket()-
1442{-
1443 Q_D(QAbstractSocket);-
1444#if defined(QABSTRACTSOCKET_DEBUG)-
1445 qDebug("QAbstractSocket::~QAbstractSocket()");-
1446#endif-
1447 if (d->state != UnconnectedState)
d->state != UnconnectedStateDescription
TRUEevaluated 4433 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 4517 times by 32 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpnetworkreply - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • ...
4433-4517
1448 abort();
executed 4433 times by 21 tests: abort();
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
4433
1449}
executed 8950 times by 34 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpnetworkreply - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • ...
8950
1450-
1451/*!-
1452 \since 5.0-
1453-
1454 Continues data transfer on the socket. This method should only be used-
1455 after the socket has been set to pause upon notifications and a-
1456 notification has been received.-
1457 The only notification currently supported is QSslSocket::sslErrors().-
1458 Calling this method if the socket is not paused results in undefined-
1459 behavior.-
1460-
1461 \sa pauseMode(), setPauseMode()-
1462*/-
1463void QAbstractSocket::resume()-
1464{-
1465 QAbstractSocketPrivate::resumeSocketNotifiers(this);-
1466}
executed 20 times by 1 test: end of block
Executed by:
  • tst_qsslsocket - unknown status
20
1467-
1468/*!-
1469 \since 5.0-
1470-
1471 Returns the pause mode of this socket.-
1472-
1473 \sa setPauseMode(), resume()-
1474*/-
1475QAbstractSocket::PauseModes QAbstractSocket::pauseMode() const-
1476{-
1477 return d_func()->pauseMode;
executed 94 times by 6 tests: return d_func()->pauseMode;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
94
1478}-
1479-
1480-
1481/*!-
1482 \since 5.0-
1483-
1484 Controls whether to pause upon receiving a notification. The \a pauseMode parameter-
1485 specifies the conditions in which the socket should be paused. The only notification-
1486 currently supported is QSslSocket::sslErrors(). If set to PauseOnSslErrors,-
1487 data transfer on the socket will be paused and needs to be enabled explicitly-
1488 again by calling resume().-
1489 By default this option is set to PauseNever.-
1490 This option must be called before connecting to the server, otherwise it will-
1491 result in undefined behavior.-
1492-
1493 \sa pauseMode(), resume()-
1494*/-
1495void QAbstractSocket::setPauseMode(PauseModes pauseMode)-
1496{-
1497 d_func()->pauseMode = pauseMode;-
1498}
executed 20 times by 1 test: end of block
Executed by:
  • tst_qsslsocket - unknown status
20
1499-
1500/*!-
1501 \since 5.0-
1502-
1503 Binds to \a address on port \a port, using the BindMode \a mode.-
1504-
1505 Binds this socket to the address \a address and the port \a port.-
1506-
1507 For UDP sockets, after binding, the signal QUdpSocket::readyRead() is emitted-
1508 whenever a UDP datagram arrives on the specified address and port.-
1509 Thus, This function is useful to write UDP servers.-
1510-
1511 For TCP sockets, this function may be used to specify which interface to use-
1512 for an outgoing connection, which is useful in case of multiple network-
1513 interfaces.-
1514-
1515 By default, the socket is bound using the DefaultForPlatform BindMode.-
1516 If a port is not specified, a random port is chosen.-
1517-
1518 On success, the functions returns \c true and the socket enters-
1519 BoundState; otherwise it returns \c false.-
1520-
1521*/-
1522bool QAbstractSocket::bind(const QHostAddress &address, quint16 port, BindMode mode)-
1523{-
1524 Q_D(QAbstractSocket);-
1525 return d->bind(address, port, mode);
executed 211 times by 5 tests: return d->bind(address, port, mode);
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
211
1526}-
1527-
1528bool QAbstractSocketPrivate::bind(const QHostAddress &address, quint16 port, QAbstractSocket::BindMode mode)-
1529{-
1530 Q_Q(QAbstractSocket);-
1531-
1532 // now check if the socket engine is initialized and to the right type-
1533 if (!socketEngine || !socketEngine->isValid()) {
!socketEngineDescription
TRUEevaluated 180 times by 5 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
!socketEngine->isValid()Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
0-180
1534 QHostAddress nullAddress;-
1535 resolveProxy(nullAddress.toString(), port);-
1536-
1537 QAbstractSocket::NetworkLayerProtocol protocol = address.protocol();-
1538 if (protocol == QAbstractSocket::UnknownNetworkLayerProtocol)
protocol == QA...kLayerProtocolDescription
TRUEnever evaluated
FALSEevaluated 180 times by 5 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
0-180
1539 protocol = nullAddress.protocol();
never executed: protocol = nullAddress.protocol();
0
1540-
1541 if (!initSocketLayer(protocol))
!initSocketLayer(protocol)Description
TRUEnever evaluated
FALSEevaluated 180 times by 5 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
0-180
1542 return false;
never executed: return false;
0
1543 }
executed 180 times by 5 tests: end of block
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
180
1544-
1545 if (mode != QAbstractSocket::DefaultForPlatform) {
mode != QAbstr...ultForPlatformDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEevaluated 193 times by 5 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
3-193
1546#ifdef Q_OS_UNIX-
1547 if ((mode & QAbstractSocket::ShareAddress) || (mode & QAbstractSocket::ReuseAddressHint))-
1548 socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);
executed 3 times by 1 test: socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);
Executed by:
  • tst_QUdpSocket
3
1549 else-
1550 socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 0);
never executed: socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 0);
0
1551#endif-
1552#ifdef Q_OS_WIN-
1553 if (mode & QAbstractSocket::ReuseAddressHint)-
1554 socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 1);-
1555 else-
1556 socketEngine->setOption(QAbstractSocketEngine::AddressReusable, 0);-
1557 if (mode & QAbstractSocket::DontShareAddress)-
1558 socketEngine->setOption(QAbstractSocketEngine::BindExclusively, 1);-
1559 else-
1560 socketEngine->setOption(QAbstractSocketEngine::BindExclusively, 0);-
1561#endif-
1562 }-
1563 bool result = socketEngine->bind(address, port);-
1564 cachedSocketDescriptor = socketEngine->socketDescriptor();-
1565-
1566 if (!result) {
!resultDescription
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
FALSEevaluated 185 times by 5 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
11-185
1567 setErrorAndEmit(socketEngine->error(), socketEngine->errorString());-
1568 return false;
executed 11 times by 2 tests: return false;
Executed by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
11
1569 }-
1570-
1571 state = QAbstractSocket::BoundState;-
1572 localAddress = socketEngine->localAddress();-
1573 localPort = socketEngine->localPort();-
1574-
1575 emit q->stateChanged(state);-
1576 if (socketType == QAbstractSocket::UdpSocket)
socketType == ...ket::UdpSocketDescription
TRUEevaluated 129 times by 3 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
FALSEevaluated 56 times by 2 tests
Evaluated by:
  • tst_QTcpServer
  • tst_qtcpsocket - unknown status
56-129
1577 socketEngine->setReadNotificationEnabled(true);
executed 129 times by 3 tests: socketEngine->setReadNotificationEnabled(true);
Executed by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
129
1578 return true;
executed 185 times by 5 tests: return true;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
185
1579}-
1580-
1581/*!-
1582 \since 5.0-
1583 \overload-
1584-
1585 Binds to QHostAddress:Any on port \a port, using the BindMode \a mode.-
1586-
1587 By default, the socket is bound using the DefaultForPlatform BindMode.-
1588 If a port is not specified, a random port is chosen.-
1589*/-
1590bool QAbstractSocket::bind(quint16 port, BindMode mode)-
1591{-
1592 return bind(QHostAddress::Any, port, mode);
executed 84 times by 4 tests: return bind(QHostAddress::Any, port, mode);
Executed by:
  • tst_QUdpSocket
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
84
1593}-
1594-
1595/*!-
1596 Returns \c true if the socket is valid and ready for use; otherwise-
1597 returns \c false.-
1598-
1599 \note The socket's state must be ConnectedState before reading and-
1600 writing can occur.-
1601-
1602 \sa state()-
1603*/-
1604bool QAbstractSocket::isValid() const-
1605{-
1606 return d_func()->socketEngine ? d_func()->socketEngine->isValid() : isOpen();
executed 1279724 times by 12 tests: return d_func()->socketEngine ? d_func()->socketEngine->isValid() : isOpen();
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1279724
1607}-
1608-
1609/*!-
1610 Attempts to make a connection to \a hostName on the given \a port.-
1611 The \a protocol parameter can be used to specify which network-
1612 protocol to use (eg. IPv4 or IPv6).-
1613-
1614 The socket is opened in the given \a openMode and first enters-
1615 HostLookupState, then performs a host name lookup of \a hostName.-
1616 If the lookup succeeds, hostFound() is emitted and QAbstractSocket-
1617 enters ConnectingState. It then attempts to connect to the address-
1618 or addresses returned by the lookup. Finally, if a connection is-
1619 established, QAbstractSocket enters ConnectedState and-
1620 emits connected().-
1621-
1622 At any point, the socket can emit error() to signal that an error-
1623 occurred.-
1624-
1625 \a hostName may be an IP address in string form (e.g.,-
1626 "43.195.83.32"), or it may be a host name (e.g.,-
1627 "example.com"). QAbstractSocket will do a lookup only if-
1628 required. \a port is in native byte order.-
1629-
1630 \sa state(), peerName(), peerAddress(), peerPort(), waitForConnected()-
1631*/-
1632void QAbstractSocket::connectToHost(const QString &hostName, quint16 port,-
1633 OpenMode openMode,-
1634 NetworkLayerProtocol protocol)-
1635{-
1636 Q_D(QAbstractSocket);-
1637#if defined(QABSTRACTSOCKET_DEBUG)-
1638 qDebug("QAbstractSocket::connectToHost(\"%s\", %i, %i)...", qPrintable(hostName), port,-
1639 (int) openMode);-
1640#endif-
1641-
1642 if (d->state == ConnectedState || d->state == ConnectingState
d->state == ConnectedStateDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qsocks5socketengine - unknown status
FALSEevaluated 7613 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
d->state == ConnectingStateDescription
TRUEnever evaluated
FALSEevaluated 7613 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
0-7613
1643 || d->state == ClosingState || d->state == HostLookupState) {
d->state == ClosingStateDescription
TRUEnever evaluated
FALSEevaluated 7613 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
d->state == HostLookupStateDescription
TRUEnever evaluated
FALSEevaluated 7613 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
0-7613
1644 qWarning("QAbstractSocket::connectToHost() called when already looking up or connecting/connected to \"%s\"", qPrintable(hostName));-
1645 d->setErrorAndEmit(OperationError, tr("Trying to connect while connection is in progress"));-
1646 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qsocks5socketengine - unknown status
2
1647 }-
1648-
1649 d->preferredNetworkLayerProtocol = protocol;-
1650 d->hostName = hostName;-
1651 d->port = port;-
1652 d->setReadChannelCount(0);-
1653 d->setWriteChannelCount(0);-
1654 d->abortCalled = false;-
1655 d->pendingClose = false;-
1656 if (d->state != BoundState) {
d->state != BoundStateDescription
TRUEevaluated 7586 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 27 times by 3 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
27-7586
1657 d->state = UnconnectedState;-
1658 d->localPort = 0;-
1659 d->localAddress.clear();-
1660 }
executed 7586 times by 29 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
7586
1661 d->peerPort = 0;-
1662 d->peerAddress.clear();-
1663 d->peerName = hostName;-
1664 if (d->hostLookupId != -1) {
d->hostLookupId != -1Description
TRUEnever evaluated
FALSEevaluated 7613 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
0-7613
1665 QHostInfo::abortHostLookup(d->hostLookupId);-
1666 d->hostLookupId = -1;-
1667 }
never executed: end of block
0
1668-
1669#ifndef QT_NO_NETWORKPROXY-
1670 // Get the proxy information-
1671 d->resolveProxy(hostName, port);-
1672 if (d->proxyInUse.type() == QNetworkProxy::DefaultProxy) {
d->proxyInUse....::DefaultProxyDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 7603 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
10-7603
1673 // failed to setup the proxy-
1674 d->setErrorAndEmit(UnsupportedSocketOperationError,-
1675 tr("Operation on socket is not supported"));-
1676 return;
executed 10 times by 1 test: return;
Executed by:
  • tst_qtcpsocket - unknown status
10
1677 }-
1678#endif-
1679-
1680 if (openMode & QIODevice::Unbuffered)
openMode & QIO...ce::UnbufferedDescription
TRUEevaluated 614 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 6989 times by 24 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
614-6989
1681 d->isBuffered = false; // Unbuffered QTcpSocket
executed 614 times by 8 tests: d->isBuffered = false;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
614
1682 else if (!d_func()->isBuffered)
!d_func()->isBufferedDescription
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
FALSEevaluated 6982 times by 24 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
7-6982
1683 openMode |= QAbstractSocket::Unbuffered; // QUdpSocket
executed 7 times by 2 tests: openMode |= QAbstractSocket::Unbuffered;
Executed by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
7
1684-
1685 QIODevice::open(openMode);-
1686 d->readChannelCount = d->writeChannelCount = 0;-
1687-
1688 d->state = HostLookupState;-
1689 emit stateChanged(d->state);-
1690-
1691 QHostAddress temp;-
1692 if (temp.setAddress(hostName)) {
temp.setAddress(hostName)Description
TRUEevaluated 1920 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5683 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
1920-5683
1693 QHostInfo info;-
1694 info.setAddresses(QList<QHostAddress>() << temp);-
1695 d->_q_startConnecting(info);-
1696#ifndef QT_NO_NETWORKPROXY-
1697 } else if (d->proxyInUse.capabilities() & QNetworkProxy::HostNameLookupCapability) {
executed 1920 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->proxyInUse....okupCapabilityDescription
TRUEevaluated 785 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4898 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
785-4898
1698 // the proxy supports connection by name, so use it-
1699 d->startConnectingByName(hostName);-
1700 return;
executed 785 times by 7 tests: return;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
785
1701#endif-
1702 } else {-
1703 if (d->threadData->hasEventDispatcher()) {
d->threadData-...ntDispatcher()Description
TRUEevaluated 4896 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
2-4896
1704 // this internal API for QHostInfo either immediately gives us the desired-
1705 // QHostInfo from cache or later calls the _q_startConnecting slot.-
1706 bool immediateResultValid = false;-
1707 QHostInfo hostInfo = qt_qhostinfo_lookup(hostName,-
1708 this,-
1709 SLOT(_q_startConnecting(QHostInfo)),-
1710 &immediateResultValid,-
1711 &d->hostLookupId);-
1712 if (immediateResultValid) {
immediateResultValidDescription
TRUEevaluated 1882 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 3014 times by 13 tests
Evaluated by:
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1882-3014
1713 d->hostLookupId = -1;-
1714 d->_q_startConnecting(hostInfo);-
1715 }
executed 1882 times by 20 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
1882
1716 }
executed 4896 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
4896
1717 }
executed 4898 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
4898
1718-
1719#if defined(QABSTRACTSOCKET_DEBUG)-
1720 qDebug("QAbstractSocket::connectToHost(\"%s\", %i) == %s%s", hostName.toLatin1().constData(), port,-
1721 (d->state == ConnectedState) ? "true" : "false",-
1722 (d->state == ConnectingState || d->state == HostLookupState)-
1723 ? " (connection in progress)" : "");-
1724#endif-
1725}-
1726-
1727/*! \overload-
1728-
1729 Attempts to make a connection to \a address on port \a port.-
1730*/-
1731void QAbstractSocket::connectToHost(const QHostAddress &address, quint16 port,-
1732 OpenMode openMode)-
1733{-
1734#if defined(QABSTRACTSOCKET_DEBUG)-
1735 qDebug("QAbstractSocket::connectToHost([%s], %i, %i)...",-
1736 address.toString().toLatin1().constData(), port, (int) openMode);-
1737#endif-
1738 connectToHost(address.toString(), port, openMode);-
1739}
executed 110 times by 10 tests: end of block
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qimagereader - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
110
1740-
1741/*!-
1742 Returns the number of bytes that are waiting to be written. The-
1743 bytes are written when control goes back to the event loop or-
1744 when flush() is called.-
1745-
1746 \sa bytesAvailable(), flush()-
1747*/-
1748qint64 QAbstractSocket::bytesToWrite() const-
1749{-
1750 const qint64 pendingBytes = QIODevice::bytesToWrite();-
1751#if defined(QABSTRACTSOCKET_DEBUG)-
1752 qDebug("QAbstractSocket::bytesToWrite() == %lld", pendingBytes);-
1753#endif-
1754 return pendingBytes;
executed 38165 times by 15 tests: return pendingBytes;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
38165
1755}-
1756-
1757/*!-
1758 Returns the number of incoming bytes that are waiting to be read.-
1759-
1760 \sa bytesToWrite(), read()-
1761*/-
1762qint64 QAbstractSocket::bytesAvailable() const-
1763{-
1764 Q_D(const QAbstractSocket);-
1765 qint64 available = QIODevice::bytesAvailable();-
1766-
1767 if (!d->isBuffered && d->socketEngine && d->socketEngine->isValid())
!d->isBufferedDescription
TRUEevaluated 15239 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 62012 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
d->socketEngineDescription
TRUEevaluated 15166 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 73 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QUdpSocket
d->socketEngine->isValid()Description
TRUEevaluated 15166 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
FALSEnever evaluated
0-62012
1768 available += d->socketEngine->bytesAvailable();
executed 15166 times by 9 tests: available += d->socketEngine->bytesAvailable();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
15166
1769-
1770#if defined(QABSTRACTSOCKET_DEBUG)-
1771 qDebug("QAbstractSocket::bytesAvailable() == %lld", available);-
1772#endif-
1773 return available;
executed 77251 times by 21 tests: return available;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
77251
1774}-
1775-
1776/*!-
1777 Returns the host port number (in native byte order) of the local-
1778 socket if available; otherwise returns 0.-
1779-
1780 \sa localAddress(), peerPort(), setLocalPort()-
1781*/-
1782quint16 QAbstractSocket::localPort() const-
1783{-
1784 Q_D(const QAbstractSocket);-
1785 return d->localPort;
executed 1437 times by 13 tests: return d->localPort;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1437
1786}-
1787-
1788/*!-
1789 Returns the host address of the local socket if available;-
1790 otherwise returns QHostAddress::Null.-
1791-
1792 This is normally the main IP address of the host, but can be-
1793 QHostAddress::LocalHost (127.0.0.1) for connections to the-
1794 local host.-
1795-
1796 \sa localPort(), peerAddress(), setLocalAddress()-
1797*/-
1798QHostAddress QAbstractSocket::localAddress() const-
1799{-
1800 Q_D(const QAbstractSocket);-
1801 return d->localAddress;
executed 4841 times by 15 tests: return d->localAddress;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
4841
1802}-
1803-
1804/*!-
1805 Returns the port of the connected peer if the socket is in-
1806 ConnectedState; otherwise returns 0.-
1807-
1808 \sa peerAddress(), localPort(), setPeerPort()-
1809*/-
1810quint16 QAbstractSocket::peerPort() const-
1811{-
1812 Q_D(const QAbstractSocket);-
1813 return d->peerPort;
executed 847 times by 9 tests: return d->peerPort;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
847
1814}-
1815-
1816/*!-
1817 Returns the address of the connected peer if the socket is in-
1818 ConnectedState; otherwise returns QHostAddress::Null.-
1819-
1820 \sa peerName(), peerPort(), localAddress(), setPeerAddress()-
1821*/-
1822QHostAddress QAbstractSocket::peerAddress() const-
1823{-
1824 Q_D(const QAbstractSocket);-
1825 return d->peerAddress;
executed 876 times by 9 tests: return d->peerAddress;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
876
1826}-
1827-
1828/*!-
1829 Returns the name of the peer as specified by connectToHost(), or-
1830 an empty QString if connectToHost() has not been called.-
1831-
1832 \sa peerAddress(), peerPort(), setPeerName()-
1833*/-
1834QString QAbstractSocket::peerName() const-
1835{-
1836 Q_D(const QAbstractSocket);-
1837 return d->peerName.isEmpty() ? d->hostName : d->peerName;
executed 2148 times by 9 tests: return d->peerName.isEmpty() ? d->hostName : d->peerName;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2148
1838}-
1839-
1840/*!-
1841 Returns \c true if a line of data can be read from the socket;-
1842 otherwise returns \c false.-
1843-
1844 \sa readLine()-
1845*/-
1846bool QAbstractSocket::canReadLine() const-
1847{-
1848 bool hasLine = QIODevice::canReadLine();-
1849#if defined (QABSTRACTSOCKET_DEBUG)-
1850 qDebug("QAbstractSocket::canReadLine() == %s, buffer size = %lld, size = %lld",-
1851 hasLine ? "true" : "false", d_func()->buffer.size(), d_func()->buffer.size());-
1852#endif-
1853 return hasLine;
executed 10266 times by 8 tests: return hasLine;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
10266
1854}-
1855-
1856/*!-
1857 Returns the native socket descriptor of the QAbstractSocket object-
1858 if this is available; otherwise returns -1.-
1859-
1860 If the socket is using QNetworkProxy, the returned descriptor-
1861 may not be usable with native socket functions.-
1862-
1863 The socket descriptor is not available when QAbstractSocket is in-
1864 UnconnectedState.-
1865-
1866 \sa setSocketDescriptor()-
1867*/-
1868qintptr QAbstractSocket::socketDescriptor() const-
1869{-
1870 Q_D(const QAbstractSocket);-
1871 return d->cachedSocketDescriptor;
executed 2210 times by 13 tests: return d->cachedSocketDescriptor;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2210
1872}-
1873-
1874/*!-
1875 Initializes QAbstractSocket with the native socket descriptor \a-
1876 socketDescriptor. Returns \c true if \a socketDescriptor is accepted-
1877 as a valid socket descriptor; otherwise returns \c false.-
1878 The socket is opened in the mode specified by \a openMode, and-
1879 enters the socket state specified by \a socketState.-
1880 Read and write buffers are cleared, discarding any pending data.-
1881-
1882 \b{Note:} It is not possible to initialize two abstract sockets-
1883 with the same native socket descriptor.-
1884-
1885 \sa socketDescriptor()-
1886*/-
1887bool QAbstractSocket::setSocketDescriptor(qintptr socketDescriptor, SocketState socketState,-
1888 OpenMode openMode)-
1889{-
1890 Q_D(QAbstractSocket);-
1891-
1892 d->resetSocketLayer();-
1893 d->setReadChannelCount(0);-
1894 d->setWriteChannelCount(0);-
1895 d->socketEngine = QAbstractSocketEngine::createSocketEngine(socketDescriptor, this);-
1896 if (!d->socketEngine) {
!d->socketEngineDescription
TRUEnever evaluated
FALSEevaluated 995 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-995
1897 d->setError(UnsupportedSocketOperationError, tr("Operation on socket is not supported"));-
1898 return false;
never executed: return false;
0
1899 }-
1900#ifndef QT_NO_BEARERMANAGEMENT-
1901 //copy network session down to the socket engine (if it has been set)-
1902 d->socketEngine->setProperty("_q_networksession", property("_q_networksession"));-
1903#endif-
1904 bool result = d->socketEngine->initialize(socketDescriptor, socketState);-
1905 if (!result) {
!resultDescription
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 988 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
7-988
1906 d->setError(d->socketEngine->error(), d->socketEngine->errorString());-
1907 return false;
executed 7 times by 2 tests: return false;
Executed by:
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
7
1908 }-
1909-
1910 if (d->threadData->hasEventDispatcher())
d->threadData-...ntDispatcher()Description
TRUEevaluated 988 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-988
1911 d->socketEngine->setReceiver(d);
executed 988 times by 18 tests: d->socketEngine->setReceiver(d);
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
988
1912-
1913 QIODevice::open(openMode);-
1914-
1915 if (socketState == ConnectedState) {
socketState == ConnectedStateDescription
TRUEevaluated 986 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
2-986
1916 if (isReadable()) {
isReadable()Description
TRUEevaluated 985 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qlocalsocket - unknown status
1-985
1917 const int inboundStreamCount = d->socketEngine->inboundStreamCount();-
1918 d->setReadChannelCount(qMax(1, inboundStreamCount));-
1919 if (inboundStreamCount == 0)
inboundStreamCount == 0Description
TRUEnever evaluated
FALSEevaluated 985 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-985
1920 d->readChannelCount = 0;
never executed: d->readChannelCount = 0;
0
1921 }
executed 985 times by 18 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
985
1922 if (isWritable()) {
isWritable()Description
TRUEevaluated 986 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-986
1923 const int outboundStreamCount = d->socketEngine->outboundStreamCount();-
1924 d->setWriteChannelCount(qMax(1, outboundStreamCount));-
1925 if (outboundStreamCount == 0)
outboundStreamCount == 0Description
TRUEnever evaluated
FALSEevaluated 986 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-986
1926 d->writeChannelCount = 0;
never executed: d->writeChannelCount = 0;
0
1927 }
executed 986 times by 18 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
986
1928 } else {
executed 986 times by 18 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
986
1929 d->readChannelCount = d->writeChannelCount = 0;-
1930 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qtcpsocket - unknown status
2
1931-
1932 if (d->state != socketState) {
d->state != socketStateDescription
TRUEevaluated 986 times by 18 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
2-986
1933 d->state = socketState;-
1934 emit stateChanged(d->state);-
1935 }
executed 986 times by 18 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
986
1936-
1937 d->pendingClose = false;-
1938 d->socketEngine->setReadNotificationEnabled(true);-
1939 d->localPort = d->socketEngine->localPort();-
1940 d->peerPort = d->socketEngine->peerPort();-
1941 d->localAddress = d->socketEngine->localAddress();-
1942 d->peerAddress = d->socketEngine->peerAddress();-
1943 d->cachedSocketDescriptor = socketDescriptor;-
1944-
1945 return true;
executed 988 times by 18 tests: return true;
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
988
1946}-
1947-
1948/*!-
1949 \since 4.6-
1950 Sets the given \a option to the value described by \a value.-
1951-
1952 \note On Windows Runtime, QAbstractSocket::KeepAliveOption must be set-
1953 before the socket is connected.-
1954-
1955 \sa socketOption()-
1956*/-
1957void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value)-
1958{-
1959 if (!d_func()->socketEngine)
!d_func()->socketEngineDescription
TRUEnever evaluated
FALSEevaluated 1818 times by 11 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qtcpsocket - unknown status
0-1818
1960 return;
never executed: return;
0
1961-
1962 switch (option) {-
1963 case LowDelayOption:
executed 935 times by 3 tests: case LowDelayOption:
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
935
1964 d_func()->socketEngine->setOption(QAbstractSocketEngine::LowDelayOption, value.toInt());-
1965 break;
executed 935 times by 3 tests: break;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
935
1966-
1967 case KeepAliveOption:
executed 855 times by 9 tests: case KeepAliveOption:
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qtcpsocket - unknown status
855
1968 d_func()->socketEngine->setOption(QAbstractSocketEngine::KeepAliveOption, value.toInt());-
1969 break;
executed 855 times by 9 tests: break;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qtcpsocket - unknown status
855
1970-
1971 case MulticastTtlOption:
executed 12 times by 1 test: case MulticastTtlOption:
Executed by:
  • tst_QUdpSocket
12
1972 d_func()->socketEngine->setOption(QAbstractSocketEngine::MulticastTtlOption, value.toInt());-
1973 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_QUdpSocket
12
1974-
1975 case MulticastLoopbackOption:
executed 14 times by 1 test: case MulticastLoopbackOption:
Executed by:
  • tst_QUdpSocket
14
1976 d_func()->socketEngine->setOption(QAbstractSocketEngine::MulticastLoopbackOption, value.toInt());-
1977 break;
executed 14 times by 1 test: break;
Executed by:
  • tst_QUdpSocket
14
1978-
1979 case TypeOfServiceOption:
executed 2 times by 1 test: case TypeOfServiceOption:
Executed by:
  • tst_qtcpsocket - unknown status
2
1980 d_func()->socketEngine->setOption(QAbstractSocketEngine::TypeOfServiceOption, value.toInt());-
1981 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qtcpsocket - unknown status
2
1982-
1983 case SendBufferSizeSocketOption:
never executed: case SendBufferSizeSocketOption:
0
1984 d_func()->socketEngine->setOption(QAbstractSocketEngine::SendBufferSocketOption, value.toInt());-
1985 break;
never executed: break;
0
1986-
1987 case ReceiveBufferSizeSocketOption:
never executed: case ReceiveBufferSizeSocketOption:
0
1988 d_func()->socketEngine->setOption(QAbstractSocketEngine::ReceiveBufferSocketOption, value.toInt());-
1989 break;
never executed: break;
0
1990 }-
1991}
executed 1818 times by 11 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qtcpsocket - unknown status
1818
1992-
1993/*!-
1994 \since 4.6-
1995 Returns the value of the \a option option.-
1996-
1997 \sa setSocketOption()-
1998*/-
1999QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option)-
2000{-
2001 if (!d_func()->socketEngine)
!d_func()->socketEngineDescription
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
0-36
2002 return QVariant();
never executed: return QVariant();
0
2003-
2004 int ret = -1;-
2005 switch (option) {-
2006 case LowDelayOption:
executed 4 times by 1 test: case LowDelayOption:
Executed by:
  • tst_qtcpsocket - unknown status
4
2007 ret = d_func()->socketEngine->option(QAbstractSocketEngine::LowDelayOption);-
2008 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qtcpsocket - unknown status
4
2009-
2010 case KeepAliveOption:
executed 4 times by 1 test: case KeepAliveOption:
Executed by:
  • tst_qtcpsocket - unknown status
4
2011 ret = d_func()->socketEngine->option(QAbstractSocketEngine::KeepAliveOption);-
2012 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qtcpsocket - unknown status
4
2013-
2014 case MulticastTtlOption:
executed 12 times by 1 test: case MulticastTtlOption:
Executed by:
  • tst_QUdpSocket
12
2015 ret = d_func()->socketEngine->option(QAbstractSocketEngine::MulticastTtlOption);-
2016 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_QUdpSocket
12
2017 case MulticastLoopbackOption:
executed 14 times by 1 test: case MulticastLoopbackOption:
Executed by:
  • tst_QUdpSocket
14
2018 ret = d_func()->socketEngine->option(QAbstractSocketEngine::MulticastLoopbackOption);-
2019 break;
executed 14 times by 1 test: break;
Executed by:
  • tst_QUdpSocket
14
2020-
2021 case TypeOfServiceOption:
executed 2 times by 1 test: case TypeOfServiceOption:
Executed by:
  • tst_qtcpsocket - unknown status
2
2022 ret = d_func()->socketEngine->option(QAbstractSocketEngine::TypeOfServiceOption);-
2023 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qtcpsocket - unknown status
2
2024-
2025 case SendBufferSizeSocketOption:
never executed: case SendBufferSizeSocketOption:
0
2026 ret = d_func()->socketEngine->option(QAbstractSocketEngine::SendBufferSocketOption);-
2027 break;
never executed: break;
0
2028-
2029 case ReceiveBufferSizeSocketOption:
never executed: case ReceiveBufferSizeSocketOption:
0
2030 ret = d_func()->socketEngine->option(QAbstractSocketEngine::ReceiveBufferSocketOption);-
2031 break;
never executed: break;
0
2032 }-
2033 if (ret == -1)
ret == -1Description
TRUEnever evaluated
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
0-36
2034 return QVariant();
never executed: return QVariant();
0
2035 else-
2036 return QVariant(ret);
executed 36 times by 2 tests: return QVariant(ret);
Executed by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
36
2037}-
2038-
2039/*!-
2040 Waits until the socket is connected, up to \a msecs-
2041 milliseconds. If the connection has been established, this-
2042 function returns \c true; otherwise it returns \c false. In the case-
2043 where it returns \c false, you can call error() to determine-
2044 the cause of the error.-
2045-
2046 The following example waits up to one second for a connection-
2047 to be established:-
2048-
2049 \snippet code/src_network_socket_qabstractsocket.cpp 0-
2050-
2051 If msecs is -1, this function will not time out.-
2052-
2053 \note This function may wait slightly longer than \a msecs,-
2054 depending on the time it takes to complete the host lookup.-
2055-
2056 \note Multiple calls to this functions do not accumulate the time.-
2057 If the function times out, the connecting process will be aborted.-
2058-
2059 \note This function may fail randomly on Windows. Consider using the event-
2060 loop and the connected() signal if your software will run on Windows.-
2061-
2062 \sa connectToHost(), connected()-
2063*/-
2064bool QAbstractSocket::waitForConnected(int msecs)-
2065{-
2066 Q_D(QAbstractSocket);-
2067#if defined (QABSTRACTSOCKET_DEBUG)-
2068 qDebug("QAbstractSocket::waitForConnected(%i)", msecs);-
2069#endif-
2070-
2071 if (state() == ConnectedState) {
state() == ConnectedStateDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEevaluated 1421 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
4-1421
2072#if defined (QABSTRACTSOCKET_DEBUG)-
2073 qDebug("QAbstractSocket::waitForConnected(%i) already connected", msecs);-
2074#endif-
2075 return true;
executed 4 times by 1 test: return true;
Executed by:
  • tst_QUdpSocket
4
2076 }-
2077-
2078 bool wasPendingClose = d->pendingClose;-
2079 d->pendingClose = false;-
2080 QElapsedTimer stopWatch;-
2081 stopWatch.start();-
2082-
2083 if (d->state == HostLookupState) {
d->state == HostLookupStateDescription
TRUEevaluated 92 times by 7 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1329 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
92-1329
2084#if defined (QABSTRACTSOCKET_DEBUG)-
2085 qDebug("QAbstractSocket::waitForConnected(%i) doing host name lookup", msecs);-
2086#endif-
2087 QHostInfo::abortHostLookup(d->hostLookupId);-
2088 d->hostLookupId = -1;-
2089#ifndef QT_NO_BEARERMANAGEMENT-
2090 QSharedPointer<QNetworkSession> networkSession;-
2091 QVariant v(property("_q_networksession"));-
2092 if (v.isValid()) {
v.isValid()Description
TRUEnever evaluated
FALSEevaluated 92 times by 7 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-92
2093 networkSession = qvariant_cast< QSharedPointer<QNetworkSession> >(v);-
2094 d->_q_startConnecting(QHostInfoPrivate::fromName(d->hostName, networkSession));-
2095 } else
never executed: end of block
0
2096#endif-
2097 {-
2098 QHostAddress temp;-
2099 if (temp.setAddress(d->hostName)) {
temp.setAddress(d->hostName)Description
TRUEnever evaluated
FALSEevaluated 92 times by 7 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-92
2100 QHostInfo info;-
2101 info.setAddresses(QList<QHostAddress>() << temp);-
2102 d->_q_startConnecting(info);-
2103 } else {
never executed: end of block
0
2104 d->_q_startConnecting(QHostInfo::fromName(d->hostName));-
2105 }
executed 92 times by 7 tests: end of block
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_lancelot - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
92
2106 }-
2107 }-
2108 if (state() == UnconnectedState)
state() == UnconnectedStateDescription
TRUEevaluated 11 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_lancelot - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1410 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
11-1410
2109 return false; // connect not im progress anymore!
executed 11 times by 4 tests: return false;
Executed by:
  • tst_QTcpServer
  • tst_lancelot - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
11
2110-
2111 bool timedOut = true;-
2112#if defined (QABSTRACTSOCKET_DEBUG)-
2113 int attempt = 1;-
2114#endif-
2115 while (state() == ConnectingState && (msecs == -1 || stopWatch.elapsed() < msecs)) {
state() == ConnectingStateDescription
TRUEevaluated 1427 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1380 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
msecs == -1Description
TRUEevaluated 23 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1404 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
stopWatch.elapsed() < msecsDescription
TRUEevaluated 1374 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
23-1427
2116 int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed());-
2117 if (msecs != -1 && timeout > QT_CONNECT_TIMEOUT)
msecs != -1Description
TRUEevaluated 1374 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 23 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
timeout > 30000Description
TRUEnever evaluated
FALSEevaluated 1374 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
0-1374
2118 timeout = QT_CONNECT_TIMEOUT;
never executed: timeout = 30000;
0
2119#if defined (QABSTRACTSOCKET_DEBUG)-
2120 qDebug("QAbstractSocket::waitForConnected(%i) waiting %.2f secs for connection attempt #%i",-
2121 msecs, timeout / 1000.0, attempt++);-
2122#endif-
2123 timedOut = false;-
2124-
2125 if (d->socketEngine && d->socketEngine->waitForWrite(timeout, &timedOut) && !timedOut) {
d->socketEngineDescription
TRUEevaluated 1395 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
d->socketEngin...ut, &timedOut)Description
TRUEevaluated 1385 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
!timedOutDescription
TRUEevaluated 1377 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
2-1395
2126 d->_q_testConnection();-
2127 } else {
executed 1377 times by 18 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
1377
2128 d->_q_connectToNextAddress();-
2129 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
20
2130 }-
2131-
2132 if ((timedOut && state() != ConnectedState) || state() == ConnectingState) {
timedOutDescription
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1372 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
state() != ConnectedStateDescription
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
state() == ConnectingStateDescription
TRUEnever evaluated
FALSEevaluated 1372 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
0-1372
2133 d->setError(SocketTimeoutError, tr("Socket operation timed out"));-
2134 d->state = UnconnectedState;-
2135 emit stateChanged(d->state);-
2136 d->resetSocketLayer();-
2137 }
executed 38 times by 2 tests: end of block
Executed by:
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
38
2138-
2139#if defined (QABSTRACTSOCKET_DEBUG)-
2140 qDebug("QAbstractSocket::waitForConnected(%i) == %s", msecs,-
2141 state() == ConnectedState ? "true" : "false");-
2142#endif-
2143 if (state() != ConnectedState)
state() != ConnectedStateDescription
TRUEevaluated 59 times by 6 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QTcpServer
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1351 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
59-1351
2144 return false;
executed 59 times by 6 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QTcpServer
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
59
2145 if (wasPendingClose)
wasPendingCloseDescription
TRUEevaluated 20 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 1331 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
20-1331
2146 disconnectFromHost();
executed 20 times by 1 test: disconnectFromHost();
Executed by:
  • tst_qtcpsocket - unknown status
20
2147 return true;
executed 1351 times by 18 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
1351
2148}-
2149-
2150/*!-
2151 This function blocks until new data is available for reading and the-
2152 \l{QIODevice::}{readyRead()} signal has been emitted. The function-
2153 will timeout after \a msecs milliseconds; the default timeout is-
2154 30000 milliseconds.-
2155-
2156 The function returns \c true if the readyRead() signal is emitted and-
2157 there is new data available for reading; otherwise it returns \c false-
2158 (if an error occurred or the operation timed out).-
2159-
2160 \note This function may fail randomly on Windows. Consider using the event-
2161 loop and the readyRead() signal if your software will run on Windows.-
2162-
2163 \sa waitForBytesWritten()-
2164*/-
2165bool QAbstractSocket::waitForReadyRead(int msecs)-
2166{-
2167 Q_D(QAbstractSocket);-
2168#if defined (QABSTRACTSOCKET_DEBUG)-
2169 qDebug("QAbstractSocket::waitForReadyRead(%i)", msecs);-
2170#endif-
2171-
2172 // require calling connectToHost() before waitForReadyRead()-
2173 if (state() == UnconnectedState) {
state() == UnconnectedStateDescription
TRUEevaluated 68 times by 6 tests
Evaluated by:
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4312 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
68-4312
2174 /* If all you have is a QIODevice pointer to an abstractsocket, you cannot check-
2175 this, so you cannot avoid this warning. */-
2176// qWarning("QAbstractSocket::waitForReadyRead() is not allowed in UnconnectedState");-
2177 return false;
executed 68 times by 6 tests: return false;
Executed by:
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
68
2178 }-
2179-
2180 QElapsedTimer stopWatch;-
2181 stopWatch.start();-
2182-
2183 // handle a socket in connecting state-
2184 if (state() == HostLookupState || state() == ConnectingState) {
state() == HostLookupStateDescription
TRUEevaluated 29 times by 3 tests
Evaluated by:
  • tst_QTcpServer
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4283 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
state() == ConnectingStateDescription
TRUEevaluated 536 times by 10 tests
Evaluated by:
  • tst_QFtp
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 3747 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
29-4283
2185 if (!waitForConnected(msecs))
!waitForConnected(msecs)Description
TRUEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QTcpServer
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 558 times by 10 tests
Evaluated by:
  • tst_QFtp
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
7-558
2186 return false;
executed 7 times by 3 tests: return false;
Executed by:
  • tst_QTcpServer
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
7
2187 }
executed 558 times by 10 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
558
2188-
2189 do {-
2190 if (state() != ConnectedState && state() != BoundState)
state() != ConnectedStateDescription
TRUEevaluated 187 times by 8 tests
Evaluated by:
  • tst_QNetworkSession
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 5437 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
state() != BoundStateDescription
TRUEevaluated 63 times by 7 tests
Evaluated by:
  • tst_QNetworkSession
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 124 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qsocks5socketengine - unknown status
63-5437
2191 return false;
executed 63 times by 7 tests: return false;
Executed by:
  • tst_QNetworkSession
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
63
2192-
2193 bool readyToRead = false;-
2194 bool readyToWrite = false;-
2195 if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, true, !d->writeBuffer.isEmpty(),
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 84 times by 8 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 5477 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
84-5477
2196 qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) {
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 84 times by 8 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 5477 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
84-5477
2197#if defined (QABSTRACTSOCKET_DEBUG)-
2198 qDebug("QAbstractSocket::waitForReadyRead(%i) failed (%i, %s)",-
2199 msecs, d->socketEngine->error(), d->socketEngine->errorString().toLatin1().constData());-
2200#endif-
2201 d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());-
2202 if (d->socketError != SocketTimeoutError)
d->socketError...etTimeoutErrorDescription
TRUEnever evaluated
FALSEevaluated 84 times by 8 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
0-84
2203 close();
never executed: close();
0
2204 return false;
executed 84 times by 8 tests: return false;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
84
2205 }-
2206-
2207 if (readyToRead) {
readyToReadDescription
TRUEevaluated 4221 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1256 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1256-4221
2208 if (d->canReadNotification())
d->canReadNotification()Description
TRUEevaluated 4158 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 63 times by 7 tests
Evaluated by:
  • tst_QNetworkSession
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
63-4158
2209 return true;
executed 4158 times by 15 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
4158
2210 }
executed 63 times by 7 tests: end of block
Executed by:
  • tst_QNetworkSession
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
63
2211-
2212 if (readyToWrite)
readyToWriteDescription
TRUEevaluated 1258 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 61 times by 7 tests
Evaluated by:
  • tst_QNetworkSession
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
61-1258
2213 d->canWriteNotification();
executed 1258 times by 11 tests: d->canWriteNotification();
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1258
2214 } while (msecs == -1 || qt_subtract_from_timeout(msecs, stopWatch.elapsed()) > 0);
executed 1319 times by 14 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
msecs == -1Description
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 1277 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
qt_subtract_fr...elapsed()) > 0Description
TRUEevaluated 1277 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-1319
2215 return false;
never executed: return false;
0
2216}-
2217-
2218/*! \reimp-
2219-
2220 This function blocks until at least one byte has been written on the socket-
2221 and the \l{QIODevice::}{bytesWritten()} signal has been emitted. The-
2222 function will timeout after \a msecs milliseconds; the default timeout is-
2223 30000 milliseconds.-
2224-
2225 The function returns \c true if the bytesWritten() signal is emitted;-
2226 otherwise it returns \c false (if an error occurred or the operation timed-
2227 out).-
2228-
2229 \note This function may fail randomly on Windows. Consider using the event-
2230 loop and the bytesWritten() signal if your software will run on Windows.-
2231-
2232 \sa waitForReadyRead()-
2233 */-
2234bool QAbstractSocket::waitForBytesWritten(int msecs)-
2235{-
2236 Q_D(QAbstractSocket);-
2237#if defined (QABSTRACTSOCKET_DEBUG)-
2238 qDebug("QAbstractSocket::waitForBytesWritten(%i)", msecs);-
2239#endif-
2240-
2241 // require calling connectToHost() before waitForBytesWritten()-
2242 if (state() == UnconnectedState) {
state() == UnconnectedStateDescription
TRUEnever evaluated
FALSEevaluated 9163 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-9163
2243 qWarning("QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState");-
2244 return false;
never executed: return false;
0
2245 }-
2246-
2247 if (d->writeBuffer.isEmpty())
d->writeBuffer.isEmpty()Description
TRUEevaluated 298 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 8865 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
298-8865
2248 return false;
executed 298 times by 8 tests: return false;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
298
2249-
2250 QElapsedTimer stopWatch;-
2251 stopWatch.start();-
2252-
2253 // handle a socket in connecting state-
2254 if (state() == HostLookupState || state() == ConnectingState) {
state() == HostLookupStateDescription
TRUEnever evaluated
FALSEevaluated 8865 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
state() == ConnectingStateDescription
TRUEnever evaluated
FALSEevaluated 8865 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-8865
2255 if (!waitForConnected(msecs))
!waitForConnected(msecs)Description
TRUEnever evaluated
FALSEnever evaluated
0
2256 return false;
never executed: return false;
0
2257 }
never executed: end of block
0
2258-
2259 forever {-
2260 bool readyToRead = false;-
2261 bool readyToWrite = false;-
2262 if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite,
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
FALSEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24-8841
2263 !d->readBufferMaxSize || d->buffer.size() < d->readBufferMaxSize,
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
FALSEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24-8841
2264 !d->writeBuffer.isEmpty(),
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
FALSEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24-8841
2265 qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) {
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
FALSEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24-8841
2266#if defined (QABSTRACTSOCKET_DEBUG)-
2267 qDebug("QAbstractSocket::waitForBytesWritten(%i) failed (%i, %s)",-
2268 msecs, d->socketEngine->error(), d->socketEngine->errorString().toLatin1().constData());-
2269#endif-
2270 d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());-
2271 if (d->socketError != SocketTimeoutError)
d->socketError...etTimeoutErrorDescription
TRUEnever evaluated
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
0-24
2272 close();
never executed: close();
0
2273 return false;
executed 24 times by 2 tests: return false;
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
24
2274 }-
2275-
2276 if (readyToRead) {
readyToReadDescription
TRUEnever evaluated
FALSEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-8841
2277#if defined (QABSTRACTSOCKET_DEBUG)-
2278 qDebug("QAbstractSocket::waitForBytesWritten calls canReadNotification");-
2279#endif-
2280 d->canReadNotification();-
2281 }
never executed: end of block
0
2282-
2283-
2284 if (readyToWrite) {
readyToWriteDescription
TRUEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-8841
2285 if (d->canWriteNotification()) {
d->canWriteNotification()Description
TRUEevaluated 8841 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEnever evaluated
0-8841
2286#if defined (QABSTRACTSOCKET_DEBUG)-
2287 qDebug("QAbstractSocket::waitForBytesWritten returns true");-
2288#endif-
2289 return true;
executed 8841 times by 14 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
8841
2290 }-
2291 }
never executed: end of block
0
2292-
2293 if (state() != ConnectedState)
state() != ConnectedStateDescription
TRUEnever evaluated
FALSEnever evaluated
0
2294 return false;
never executed: return false;
0
2295 }
never executed: end of block
0
2296 return false;
never executed: return false;
0
2297}-
2298-
2299/*!-
2300 Waits until the socket has disconnected, up to \a msecs-
2301 milliseconds. If the connection has been disconnected, this-
2302 function returns \c true; otherwise it returns \c false. In the case-
2303 where it returns \c false, you can call error() to determine-
2304 the cause of the error.-
2305-
2306 The following example waits up to one second for a connection-
2307 to be closed:-
2308-
2309 \snippet code/src_network_socket_qabstractsocket.cpp 1-
2310-
2311 If msecs is -1, this function will not time out.-
2312-
2313 \note This function may fail randomly on Windows. Consider using the event-
2314 loop and the disconnected() signal if your software will run on Windows.-
2315-
2316 \sa disconnectFromHost(), close()-
2317*/-
2318bool QAbstractSocket::waitForDisconnected(int msecs)-
2319{-
2320 Q_D(QAbstractSocket);-
2321-
2322 // require calling connectToHost() before waitForDisconnected()-
2323 if (state() == UnconnectedState) {
state() == UnconnectedStateDescription
TRUEnever evaluated
FALSEevaluated 203 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
0-203
2324 qWarning("QAbstractSocket::waitForDisconnected() is not allowed in UnconnectedState");-
2325 return false;
never executed: return false;
0
2326 }-
2327-
2328 QElapsedTimer stopWatch;-
2329 stopWatch.start();-
2330-
2331 // handle a socket in connecting state-
2332 if (state() == HostLookupState || state() == ConnectingState) {
state() == HostLookupStateDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 194 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
state() == ConnectingStateDescription
TRUEevaluated 53 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 141 times by 4 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
9-194
2333 if (!waitForConnected(msecs))
!waitForConnected(msecs)Description
TRUEnever evaluated
FALSEevaluated 62 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
0-62
2334 return false;
never executed: return false;
0
2335 if (state() == UnconnectedState)
state() == UnconnectedStateDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 56 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
6-56
2336 return true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_qtcpsocket - unknown status
6
2337 }
executed 56 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
56
2338-
2339 forever {-
2340 bool readyToRead = false;-
2341 bool readyToWrite = false;-
2342 if (!d->socketEngine->waitForReadOrWrite(&readyToRead, &readyToWrite, state() == ConnectedState,
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 1267 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
6-1267
2343 !d->writeBuffer.isEmpty(),
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 1267 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
6-1267
2344 qt_subtract_from_timeout(msecs, stopWatch.elapsed()))) {
!d->socketEngi...ch.elapsed()))Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 1267 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
6-1267
2345#if defined (QABSTRACTSOCKET_DEBUG)-
2346 qDebug("QAbstractSocket::waitForReadyRead(%i) failed (%i, %s)",-
2347 msecs, d->socketEngine->error(), d->socketEngine->errorString().toLatin1().constData());-
2348#endif-
2349 d->setErrorAndEmit(d->socketEngine->error(), d->socketEngine->errorString());-
2350 if (d->socketError != SocketTimeoutError)
d->socketError...etTimeoutErrorDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
0-6
2351 close();
never executed: close();
0
2352 return false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_qtcpsocket - unknown status
6
2353 }-
2354-
2355 if (readyToRead)
readyToReadDescription
TRUEevaluated 1142 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 125 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
125-1142
2356 d->canReadNotification();
executed 1142 times by 5 tests: d->canReadNotification();
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
1142
2357 if (readyToWrite)
readyToWriteDescription
TRUEevaluated 126 times by 4 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1141 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
126-1141
2358 d->canWriteNotification();
executed 126 times by 4 tests: d->canWriteNotification();
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
126
2359-
2360 if (state() == UnconnectedState)
state() == UnconnectedStateDescription
TRUEevaluated 191 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1076 times by 5 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
191-1076
2361 return true;
executed 191 times by 5 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
191
2362 }
executed 1076 times by 5 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
1076
2363 return false;
never executed: return false;
0
2364}-
2365-
2366/*!-
2367 Aborts the current connection and resets the socket. Unlike disconnectFromHost(),-
2368 this function immediately closes the socket, discarding any pending data in the-
2369 write buffer.-
2370-
2371 \sa disconnectFromHost(), close()-
2372*/-
2373void QAbstractSocket::abort()-
2374{-
2375 Q_D(QAbstractSocket);-
2376#if defined (QABSTRACTSOCKET_DEBUG)-
2377 qDebug("QAbstractSocket::abort()");-
2378#endif-
2379 d->setWriteChannelCount(0);-
2380 if (d->state == UnconnectedState)
d->state == UnconnectedStateDescription
TRUEevaluated 24 times by 3 tests
Evaluated by:
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4655 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
24-4655
2381 return;
executed 24 times by 3 tests: return;
Executed by:
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
24
2382#ifndef QT_NO_SSL-
2383 if (QSslSocket *socket = qobject_cast<QSslSocket *>(this)) {
QSslSocket *so...ocket *>(this)Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 4647 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
8-4647
2384 socket->abort();-
2385 return;
executed 8 times by 2 tests: return;
Executed by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
8
2386 }-
2387#endif-
2388 if (d->connectTimer) {
d->connectTimerDescription
TRUEevaluated 846 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 3801 times by 15 tests
Evaluated by:
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
846-3801
2389 d->connectTimer->stop();-
2390 delete d->connectTimer;-
2391 d->connectTimer = 0;-
2392 }
executed 846 times by 17 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
846
2393-
2394 d->abortCalled = true;-
2395 close();-
2396}
executed 4647 times by 22 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
4647
2397-
2398/*! \reimp-
2399*/-
2400bool QAbstractSocket::isSequential() const-
2401{-
2402 return true;
executed 5417 times by 28 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpnetworkreply - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
5417
2403}-
2404-
2405/*! \reimp-
2406-
2407 Returns \c true if no more data is currently-
2408 available for reading; otherwise returns \c false.-
2409-
2410 This function is most commonly used when reading data from the-
2411 socket in a loop. For example:-
2412-
2413 \snippet code/src_network_socket_qabstractsocket.cpp 2-
2414-
2415 \sa bytesAvailable(), readyRead()-
2416 */-
2417bool QAbstractSocket::atEnd() const-
2418{-
2419 return QIODevice::atEnd();
executed 272 times by 3 tests: return QIODevice::atEnd();
Executed by:
  • tst_QNetworkReply
  • tst_qimagereader - unknown status
  • tst_qtcpsocket - unknown status
272
2420}-
2421-
2422/*!-
2423 This function writes as much as possible from the internal write buffer to-
2424 the underlying network socket, without blocking. If any data was written,-
2425 this function returns \c true; otherwise false is returned.-
2426-
2427 Call this function if you need QAbstractSocket to start sending buffered-
2428 data immediately. The number of bytes successfully written depends on the-
2429 operating system. In most cases, you do not need to call this function,-
2430 because QAbstractSocket will start sending data automatically once control-
2431 goes back to the event loop. In the absence of an event loop, call-
2432 waitForBytesWritten() instead.-
2433-
2434 \sa write(), waitForBytesWritten()-
2435*/-
2436// Note! docs copied to QSslSocket::flush()-
2437bool QAbstractSocket::flush()-
2438{-
2439 Q_D(QAbstractSocket);-
2440#ifndef QT_NO_SSL-
2441 // Manual polymorphism; flush() isn't virtual, but QSslSocket overloads-
2442 // it.-
2443 if (QSslSocket *socket = qobject_cast<QSslSocket *>(this))
QSslSocket *so...ocket *>(this)Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 2774 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
9-2774
2444 return socket->flush();
executed 9 times by 1 test: return socket->flush();
Executed by:
  • tst_qtcpsocket - unknown status
9
2445#endif-
2446 Q_CHECK_SOCKETENGINE(false);
executed 10 times by 2 tests: return false;
Executed by:
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
!d->socketEngineDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 2764 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
10-2764
2447 return d->flush();
executed 2764 times by 12 tests: return d->flush();
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
2764
2448}-
2449-
2450/*! \reimp-
2451*/-
2452qint64 QAbstractSocket::readData(char *data, qint64 maxSize)-
2453{-
2454 Q_D(QAbstractSocket);-
2455-
2456 // if we're not connected, return -1 indicating EOF-
2457 if (!d->socketEngine || !d->socketEngine->isValid() || d->state != QAbstractSocket::ConnectedState)
!d->socketEngineDescription
TRUEevaluated 3525 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 175620 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
!d->socketEngine->isValid()Description
TRUEnever evaluated
FALSEevaluated 175620 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
d->state != QA...ConnectedStateDescription
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qsslsocket - unknown status
FALSEevaluated 175582 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
0-175620
2458 return maxSize ? qint64(-1) : qint64(0);
executed 3563 times by 11 tests: return maxSize ? qint64(-1) : qint64(0);
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
3563
2459-
2460 qint64 readBytes = (maxSize && !d->isBuffered) ? d->socketEngine->read(data, maxSize)
maxSizeDescription
TRUEevaluated 155274 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 20308 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
!d->isBufferedDescription
TRUEevaluated 133714 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
FALSEevaluated 21560 times by 19 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
20308-155274
2461 : qint64(0);-
2462 if (readBytes == -2) {
readBytes == -2Description
TRUEevaluated 1176 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 174406 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
1176-174406
2463 // -2 from the engine means no bytes available (EAGAIN) so read more later-
2464 readBytes = 0;-
2465 }
executed 1176 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
1176
2466 if (readBytes < 0) {
readBytes < 0Description
TRUEevaluated 77 times by 3 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
FALSEevaluated 175505 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
77-175505
2467 d->setError(d->socketEngine->error(), d->socketEngine->errorString());-
2468 d->resetSocketLayer();-
2469 d->state = QAbstractSocket::UnconnectedState;-
2470 } else if (!d->socketEngine->isReadNotificationEnabled()) {
executed 77 times by 3 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
!d->socketEngi...ationEnabled()Description
TRUEevaluated 3807 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 171698 times by 23 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
77-171698
2471 // Only do this when there was no error-
2472 d->socketEngine->setReadNotificationEnabled(true);-
2473 }
executed 3807 times by 9 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qtcpsocket - unknown status
3807
2474-
2475#if defined (QABSTRACTSOCKET_DEBUG)-
2476 qDebug("QAbstractSocket::readData(%p \"%s\", %lli) == %lld [engine]",-
2477 data, qt_prettyDebug(data, 32, readBytes).data(), maxSize,-
2478 readBytes);-
2479#endif-
2480 return readBytes;
executed 175582 times by 23 tests: return readBytes;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
  • tst_qxmlsimplereader - unknown status
175582
2481}-
2482-
2483/*! \reimp-
2484*/-
2485qint64 QAbstractSocket::readLineData(char *data, qint64 maxlen)-
2486{-
2487 return QIODevice::readLineData(data, maxlen);
executed 113 times by 5 tests: return QIODevice::readLineData(data, maxlen);
Executed by:
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_qiodevice - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
113
2488}-
2489-
2490/*! \reimp-
2491*/-
2492qint64 QAbstractSocket::writeData(const char *data, qint64 size)-
2493{-
2494 Q_D(QAbstractSocket);-
2495 if (d->state == QAbstractSocket::UnconnectedState
d->state == QA...connectedStateDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 655176 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
20-655176
2496 || (!d->socketEngine && d->socketType != TcpSocket && !d->isBuffered)) {
!d->socketEngineDescription
TRUEevaluated 19 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
FALSEevaluated 655157 times by 26 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
d->socketType != TcpSocketDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
!d->isBufferedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEnever evaluated
0-655157
2497 d->setError(UnknownSocketError, tr("Socket is not connected"));-
2498 return -1;
executed 21 times by 3 tests: return -1;
Executed by:
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
21
2499 }-
2500-
2501 if (!d->isBuffered && d->socketType == TcpSocket
!d->isBufferedDescription
TRUEevaluated 630787 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 24388 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->socketType == TcpSocketDescription
TRUEevaluated 2077 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 628710 times by 1 test
Evaluated by:
  • tst_QUdpSocket
2077-630787
2502 && d->socketEngine && d->writeBuffer.isEmpty()) {
d->socketEngineDescription
TRUEevaluated 2077 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
d->writeBuffer.isEmpty()Description
TRUEevaluated 1763 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 314 times by 1 test
Evaluated by:
  • tst_QNetworkReply
0-2077
2503 // This code is for the new Unbuffered QTcpSocket use case-
2504 qint64 written = size ? d->socketEngine->write(data, size) : Q_INT64_C(0);
sizeDescription
TRUEevaluated 1763 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-1763
2505 if (written < 0) {
written < 0Description
TRUEnever evaluated
FALSEevaluated 1763 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
0-1763
2506 d->setError(d->socketEngine->error(), d->socketEngine->errorString());-
2507 } else if (written < size) {
never executed: end of block
written < sizeDescription
TRUEevaluated 101 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1662 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
0-1662
2508 // Buffer what was not written yet-
2509 d->writeBuffer.append(data + written, size - written);-
2510 written = size;-
2511 d->socketEngine->setWriteNotificationEnabled(true);-
2512 }
executed 101 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
101
2513-
2514#if defined (QABSTRACTSOCKET_DEBUG)-
2515 qDebug("QAbstractSocket::writeData(%p \"%s\", %lli) == %lli", data,-
2516 qt_prettyDebug(data, qMin((int)size, 32), size).data(),-
2517 size, written);-
2518#endif-
2519 return written; // written = actually written + what has been buffered
executed 1763 times by 8 tests: return written;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1763
2520 } else if (!d->isBuffered && d->socketType != TcpSocket) {
!d->isBufferedDescription
TRUEevaluated 629024 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QUdpSocket
FALSEevaluated 24388 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->socketType != TcpSocketDescription
TRUEevaluated 628710 times by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEevaluated 314 times by 1 test
Evaluated by:
  • tst_QNetworkReply
314-629024
2521 // This is for a QUdpSocket that was connect()ed-
2522 qint64 written = d->socketEngine->write(data, size);-
2523 if (written < 0)
written < 0Description
TRUEnever evaluated
FALSEevaluated 628710 times by 1 test
Evaluated by:
  • tst_QUdpSocket
0-628710
2524 d->setError(d->socketEngine->error(), d->socketEngine->errorString());
never executed: d->setError(d->socketEngine->error(), d->socketEngine->errorString());
0
2525-
2526#if defined (QABSTRACTSOCKET_DEBUG)-
2527 qDebug("QAbstractSocket::writeData(%p \"%s\", %lli) == %lli", data,-
2528 qt_prettyDebug(data, qMin((int)size, 32), size).data(),-
2529 size, written);-
2530#endif-
2531 if (written >= 0) {
written >= 0Description
TRUEevaluated 628710 times by 1 test
Evaluated by:
  • tst_QUdpSocket
FALSEnever evaluated
0-628710
2532 emit bytesWritten(written);-
2533 emit channelBytesWritten(0, written);-
2534 }
executed 628710 times by 1 test: end of block
Executed by:
  • tst_QUdpSocket
628710
2535 return written;
executed 628710 times by 1 test: return written;
Executed by:
  • tst_QUdpSocket
628710
2536 }-
2537-
2538 // This is the code path for normal buffered QTcpSocket or-
2539 // unbuffered QTcpSocket when there was already something in the-
2540 // write buffer and therefore we could not do a direct engine write.-
2541 // We just write to our write buffer and enable the write notifier-
2542 // The write notifier then flush()es the buffer.-
2543-
2544 d->writeBuffer.append(data, size);-
2545 qint64 written = size;-
2546-
2547 if (d->socketEngine && !d->writeBuffer.isEmpty())
d->socketEngineDescription
TRUEevaluated 24684 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
!d->writeBuffer.isEmpty()Description
TRUEevaluated 24670 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
14-24684
2548 d->socketEngine->setWriteNotificationEnabled(true);
executed 24670 times by 21 tests: d->socketEngine->setWriteNotificationEnabled(true);
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24670
2549-
2550#if defined (QABSTRACTSOCKET_DEBUG)-
2551 qDebug("QAbstractSocket::writeData(%p \"%s\", %lli) == %lli", data,-
2552 qt_prettyDebug(data, qMin((int)size, 32), size).data(),-
2553 size, written);-
2554#endif-
2555 return written;
executed 24702 times by 21 tests: return written;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
24702
2556}-
2557-
2558/*!-
2559 \since 4.1-
2560-
2561 Sets the port on the local side of a connection to \a port.-
2562-
2563 You can call this function in a subclass of QAbstractSocket to-
2564 change the return value of the localPort() function after a-
2565 connection has been established. This feature is commonly used by-
2566 proxy connections for virtual connection settings.-
2567-
2568 Note that this function does not bind the local port of the socket-
2569 prior to a connection (e.g., QAbstractSocket::bind()).-
2570-
2571 \sa localAddress(), setLocalAddress(), setPeerPort()-
2572*/-
2573void QAbstractSocket::setLocalPort(quint16 port)-
2574{-
2575 Q_D(QAbstractSocket);-
2576 d->localPort = port;-
2577}
executed 2098 times by 10 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2098
2578-
2579/*!-
2580 \since 4.1-
2581-
2582 Sets the address on the local side of a connection to-
2583 \a address.-
2584-
2585 You can call this function in a subclass of QAbstractSocket to-
2586 change the return value of the localAddress() function after a-
2587 connection has been established. This feature is commonly used by-
2588 proxy connections for virtual connection settings.-
2589-
2590 Note that this function does not bind the local address of the socket-
2591 prior to a connection (e.g., QAbstractSocket::bind()).-
2592-
2593 \sa localAddress(), setLocalPort(), setPeerAddress()-
2594*/-
2595void QAbstractSocket::setLocalAddress(const QHostAddress &address)-
2596{-
2597 Q_D(QAbstractSocket);-
2598 d->localAddress = address;-
2599}
executed 2096 times by 9 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2096
2600-
2601/*!-
2602 \since 4.1-
2603-
2604 Sets the port of the remote side of the connection to-
2605 \a port.-
2606-
2607 You can call this function in a subclass of QAbstractSocket to-
2608 change the return value of the peerPort() function after a-
2609 connection has been established. This feature is commonly used by-
2610 proxy connections for virtual connection settings.-
2611-
2612 \sa peerPort(), setPeerAddress(), setLocalPort()-
2613*/-
2614void QAbstractSocket::setPeerPort(quint16 port)-
2615{-
2616 Q_D(QAbstractSocket);-
2617 d->peerPort = port;-
2618}
executed 2098 times by 10 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2098
2619-
2620/*!-
2621 \since 4.1-
2622-
2623 Sets the address of the remote side of the connection-
2624 to \a address.-
2625-
2626 You can call this function in a subclass of QAbstractSocket to-
2627 change the return value of the peerAddress() function after a-
2628 connection has been established. This feature is commonly used by-
2629 proxy connections for virtual connection settings.-
2630-
2631 \sa peerAddress(), setPeerPort(), setLocalAddress()-
2632*/-
2633void QAbstractSocket::setPeerAddress(const QHostAddress &address)-
2634{-
2635 Q_D(QAbstractSocket);-
2636 d->peerAddress = address;-
2637}
executed 2096 times by 9 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2096
2638-
2639/*!-
2640 \since 4.1-
2641-
2642 Sets the host name of the remote peer to \a name.-
2643-
2644 You can call this function in a subclass of QAbstractSocket to-
2645 change the return value of the peerName() function after a-
2646 connection has been established. This feature is commonly used by-
2647 proxy connections for virtual connection settings.-
2648-
2649 \sa peerName()-
2650*/-
2651void QAbstractSocket::setPeerName(const QString &name)-
2652{-
2653 Q_D(QAbstractSocket);-
2654 d->peerName = name;-
2655}
executed 2096 times by 9 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2096
2656-
2657/*!-
2658 Closes the I/O device for the socket and calls disconnectFromHost()-
2659 to close the socket's connection.-
2660-
2661 See QIODevice::close() for a description of the actions that occur when an I/O-
2662 device is closed.-
2663-
2664 \sa abort()-
2665*/-
2666void QAbstractSocket::close()-
2667{-
2668 Q_D(QAbstractSocket);-
2669#if defined(QABSTRACTSOCKET_DEBUG)-
2670 qDebug("QAbstractSocket::close()");-
2671#endif-
2672 QIODevice::close();-
2673 if (d->state != UnconnectedState)
d->state != UnconnectedStateDescription
TRUEevaluated 6725 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 2378 times by 15 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
2378-6725
2674 disconnectFromHost();
executed 6725 times by 27 tests: disconnectFromHost();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
6725
2675}
executed 9102 times by 30 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
9102
2676-
2677/*!-
2678 Attempts to close the socket. If there is pending data waiting to-
2679 be written, QAbstractSocket will enter ClosingState and wait-
2680 until all data has been written. Eventually, it will enter-
2681 UnconnectedState and emit the disconnected() signal.-
2682-
2683 \sa connectToHost()-
2684*/-
2685void QAbstractSocket::disconnectFromHost()-
2686{-
2687 Q_D(QAbstractSocket);-
2688#if defined(QABSTRACTSOCKET_DEBUG)-
2689 qDebug("QAbstractSocket::disconnectFromHost()");-
2690#endif-
2691-
2692 if (d->state == UnconnectedState) {
d->state == UnconnectedStateDescription
TRUEevaluated 396 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 9295 times by 31 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
396-9295
2693#if defined(QABSTRACTSOCKET_DEBUG)-
2694 qDebug("QAbstractSocket::disconnectFromHost() was called on an unconnected socket");-
2695#endif-
2696 return;
executed 396 times by 8 tests: return;
Executed by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
396
2697 }-
2698-
2699 if (!d->abortCalled && (d->state == ConnectingState || d->state == HostLookupState)) {
!d->abortCalledDescription
TRUEevaluated 4647 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 4648 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
d->state == ConnectingStateDescription
TRUEevaluated 59 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
FALSEevaluated 4588 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
d->state == HostLookupStateDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
FALSEevaluated 4580 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
8-4648
2700#if defined(QABSTRACTSOCKET_DEBUG)-
2701 qDebug("QAbstractSocket::disconnectFromHost() but we're still connecting");-
2702#endif-
2703 d->pendingClose = true;-
2704 return;
executed 67 times by 2 tests: return;
Executed by:
  • tst_QNetworkReply
  • tst_qtcpsocket - unknown status
67
2705 }-
2706-
2707 // Disable and delete read notification-
2708 if (d->socketEngine)
d->socketEngineDescription
TRUEevaluated 5054 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
FALSEevaluated 4174 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
4174-5054
2709 d->socketEngine->setReadNotificationEnabled(false);
executed 5054 times by 29 tests: d->socketEngine->setReadNotificationEnabled(false);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • ...
5054
2710-
2711 if (d->abortCalled) {
d->abortCalledDescription
TRUEevaluated 4648 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 4580 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
4580-4648
2712#if defined(QABSTRACTSOCKET_DEBUG)-
2713 qDebug("QAbstractSocket::disconnectFromHost() aborting immediately");-
2714#endif-
2715 if (d->state == HostLookupState) {
d->state == HostLookupStateDescription
TRUEevaluated 2867 times by 4 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QUdpSocket
  • tst_qobject - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 1781 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
1781-2867
2716 QHostInfo::abortHostLookup(d->hostLookupId);-
2717 d->hostLookupId = -1;-
2718 }
executed 2867 times by 4 tests: end of block
Executed by:
  • tst_QHostInfo
  • tst_QUdpSocket
  • tst_qobject - unknown status
  • tst_qsslsocket - unknown status
2867
2719 } else {
executed 4648 times by 22 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
4648
2720 // Perhaps emit closing()-
2721 if (d->state != ClosingState) {
d->state != ClosingStateDescription
TRUEevaluated 3749 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 831 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
831-3749
2722 d->state = ClosingState;-
2723#if defined(QABSTRACTSOCKET_DEBUG)-
2724 qDebug("QAbstractSocket::disconnectFromHost() emits stateChanged()(ClosingState)");-
2725#endif-
2726 emit stateChanged(d->state);-
2727 } else {
executed 3749 times by 29 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
3749
2728#if defined(QABSTRACTSOCKET_DEBUG)-
2729 qDebug("QAbstractSocket::disconnectFromHost() return from delayed close");-
2730#endif-
2731 }
executed 831 times by 7 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
831
2732-
2733 // Wait for pending data to be written.-
2734 if (d->socketEngine && d->socketEngine->isValid() && (d->writeBuffer.size() > 0
d->socketEngineDescription
TRUEevaluated 3273 times by 27 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 1307 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->socketEngine->isValid()Description
TRUEevaluated 2886 times by 27 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
FALSEevaluated 387 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
d->writeBuffer.size() > 0Description
TRUEevaluated 244 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 2642 times by 27 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
244-3273
2735 || d->socketEngine->bytesToWrite() > 0)) {
d->socketEngin...sToWrite() > 0Description
TRUEevaluated 626 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 2016 times by 27 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
626-2016
2736 // hack: when we are waiting for the socket engine to write bytes (only-
2737 // possible when using Socks5 or HTTP socket engine), then close-
2738 // anyway after 2 seconds. This is to prevent a timeout on Mac, where we-
2739 // sometimes just did not get the write notifier from the underlying-
2740 // CFSocket and no progress was made.-
2741 if (d->writeBuffer.size() == 0 && d->socketEngine->bytesToWrite() > 0) {
d->writeBuffer.size() == 0Description
TRUEevaluated 626 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 244 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
d->socketEngin...sToWrite() > 0Description
TRUEevaluated 626 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-626
2742 if (!d->disconnectTimer) {
!d->disconnectTimerDescription
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 598 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
28-598
2743 d->disconnectTimer = new QTimer(this);-
2744 connect(d->disconnectTimer, SIGNAL(timeout()), this,-
2745 SLOT(_q_forceDisconnect()), Qt::DirectConnection);-
2746 }
executed 28 times by 2 tests: end of block
Executed by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
28
2747 if (!d->disconnectTimer->isActive())
!d->disconnect...er->isActive()Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 598 times by 2 tests
Evaluated by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
28-598
2748 d->disconnectTimer->start(2000);
executed 28 times by 2 tests: d->disconnectTimer->start(2000);
Executed by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
28
2749 }
executed 626 times by 2 tests: end of block
Executed by:
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
626
2750 d->socketEngine->setWriteNotificationEnabled(true);-
2751-
2752#if defined(QABSTRACTSOCKET_DEBUG)-
2753 qDebug("QAbstractSocket::disconnectFromHost() delaying disconnect");-
2754#endif-
2755 return;
executed 870 times by 8 tests: return;
Executed by:
  • tst_QFtp
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
870
2756 } else {-
2757#if defined(QABSTRACTSOCKET_DEBUG)-
2758 qDebug("QAbstractSocket::disconnectFromHost() disconnecting immediately");-
2759#endif-
2760 }
executed 3710 times by 29 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
3710
2761 }-
2762-
2763 SocketState previousState = d->state;-
2764 d->resetSocketLayer();-
2765 d->state = UnconnectedState;-
2766 emit stateChanged(d->state);-
2767 emit readChannelFinished(); // we got an EOF-
2768-
2769 // only emit disconnected if we were connected before-
2770 if (previousState == ConnectedState || previousState == ClosingState)
previousState ...ConnectedStateDescription
TRUEevaluated 1426 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
FALSEevaluated 6931 times by 30 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
previousState == ClosingStateDescription
TRUEevaluated 3748 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 3183 times by 9 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
1426-6931
2771 emit disconnected();
executed 5174 times by 30 tests: disconnected();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
5174
2772-
2773 d->localPort = 0;-
2774 d->peerPort = 0;-
2775 d->localAddress.clear();-
2776 d->peerAddress.clear();-
2777 d->peerName.clear();-
2778 d->setWriteChannelCount(0);-
2779-
2780#if defined(QABSTRACTSOCKET_DEBUG)-
2781 qDebug("QAbstractSocket::disconnectFromHost() disconnected!");-
2782#endif-
2783-
2784}
executed 8357 times by 31 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
8357
2785-
2786/*!-
2787 Returns the size of the internal read buffer. This limits the-
2788 amount of data that the client can receive before you call read()-
2789 or readAll().-
2790-
2791 A read buffer size of 0 (the default) means that the buffer has-
2792 no size limit, ensuring that no data is lost.-
2793-
2794 \sa setReadBufferSize(), read()-
2795*/-
2796qint64 QAbstractSocket::readBufferSize() const-
2797{-
2798 return d_func()->readBufferMaxSize;
executed 120 times by 5 tests: return d_func()->readBufferMaxSize;
Executed by:
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
120
2799}-
2800-
2801/*!-
2802 Sets the size of QAbstractSocket's internal read buffer to be \a-
2803 size bytes.-
2804-
2805 If the buffer size is limited to a certain size, QAbstractSocket-
2806 won't buffer more than this size of data. Exceptionally, a buffer-
2807 size of 0 means that the read buffer is unlimited and all-
2808 incoming data is buffered. This is the default.-
2809-
2810 This option is useful if you only read the data at certain points-
2811 in time (e.g., in a real-time streaming application) or if you-
2812 want to protect your socket against receiving too much data,-
2813 which may eventually cause your application to run out of memory.-
2814-
2815 Only QTcpSocket uses QAbstractSocket's internal buffer; QUdpSocket-
2816 does not use any buffering at all, but rather relies on the-
2817 implicit buffering provided by the operating system.-
2818 Because of this, calling this function on QUdpSocket has no-
2819 effect.-
2820-
2821 \sa readBufferSize(), read()-
2822*/-
2823void QAbstractSocket::setReadBufferSize(qint64 size)-
2824{-
2825 Q_D(QAbstractSocket);-
2826-
2827 if (d->readBufferMaxSize == size)
d->readBufferMaxSize == sizeDescription
TRUEevaluated 949 times by 10 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1867 times by 18 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
949-1867
2828 return;
executed 949 times by 10 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
949
2829 d->readBufferMaxSize = size;-
2830 if (!d->emittedReadyRead && d->socketEngine) {
!d->emittedReadyReadDescription
TRUEevaluated 1863 times by 18 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qtcpsocket - unknown status
d->socketEngineDescription
TRUEevaluated 780 times by 11 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_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1083 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
4-1863
2831 // ensure that the read notification is enabled if we've now got-
2832 // room in the read buffer-
2833 // but only if we're not inside canReadNotification -- that will take care on its own-
2834 if ((size == 0 || d->buffer.size() < size) && d->state == QAbstractSocket::ConnectedState) // Do not change the notifier unless we are connected.
size == 0Description
TRUEevaluated 5 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 775 times by 11 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_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
d->buffer.size() < sizeDescription
TRUEevaluated 775 times by 11 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_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
d->state == QA...ConnectedStateDescription
TRUEevaluated 19 times by 4 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 761 times by 8 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
0-775
2835 d->socketEngine->setReadNotificationEnabled(true);
executed 19 times by 4 tests: d->socketEngine->setReadNotificationEnabled(true);
Executed by:
  • tst_QNetworkReply
  • tst_qhttpsocketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
19
2836 }
executed 780 times by 11 tests: end of block
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_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
780
2837}
executed 1867 times by 18 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qabstractsocket - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1867
2838-
2839/*!-
2840 Returns the state of the socket.-
2841-
2842 \sa error()-
2843*/-
2844QAbstractSocket::SocketState QAbstractSocket::state() const-
2845{-
2846 return d_func()->state;
executed 141752 times by 29 tests: return d_func()->state;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
141752
2847}-
2848-
2849/*!-
2850 Sets the state of the socket to \a state.-
2851-
2852 \sa state()-
2853*/-
2854void QAbstractSocket::setSocketState(SocketState state)-
2855{-
2856 d_func()->state = state;-
2857}
executed 4200 times by 10 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_spdy - unknown status
4200
2858-
2859/*!-
2860 Returns the socket type (TCP, UDP, or other).-
2861-
2862 \sa QTcpSocket, QUdpSocket-
2863*/-
2864QAbstractSocket::SocketType QAbstractSocket::socketType() const-
2865{-
2866 return d_func()->socketType;
executed 10235 times by 27 tests: return d_func()->socketType;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • ...
10235
2867}-
2868-
2869/*!-
2870 Returns the type of error that last occurred.-
2871-
2872 \sa state(), errorString()-
2873*/-
2874QAbstractSocket::SocketError QAbstractSocket::error() const-
2875{-
2876 return d_func()->socketError;
executed 733 times by 15 tests: return d_func()->socketError;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
733
2877}-
2878-
2879/*!-
2880 Sets the type of error that last occurred to \a socketError.-
2881-
2882 \sa setSocketState(), setErrorString()-
2883*/-
2884void QAbstractSocket::setSocketError(SocketError socketError)-
2885{-
2886 d_func()->socketError = socketError;-
2887}
executed 685 times by 9 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
  • tst_qlocalsocket - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
685
2888-
2889#ifndef QT_NO_NETWORKPROXY-
2890/*!-
2891 \since 4.1-
2892-
2893 Sets the explicit network proxy for this socket to \a networkProxy.-
2894-
2895 To disable the use of a proxy for this socket, use the-
2896 QNetworkProxy::NoProxy proxy type:-
2897-
2898 \snippet code/src_network_socket_qabstractsocket.cpp 3-
2899-
2900 The default value for the proxy is QNetworkProxy::DefaultProxy,-
2901 which means the socket will use the application settings: if a-
2902 proxy is set with QNetworkProxy::setApplicationProxy, it will use-
2903 that; otherwise, if a factory is set with-
2904 QNetworkProxyFactory::setApplicationProxyFactory, it will query-
2905 that factory with type QNetworkProxyQuery::TcpSocket.-
2906-
2907 \sa proxy(), QNetworkProxy, QNetworkProxyFactory::queryProxy()-
2908*/-
2909void QAbstractSocket::setProxy(const QNetworkProxy &networkProxy)-
2910{-
2911 Q_D(QAbstractSocket);-
2912 d->proxy = networkProxy;-
2913}
executed 2783 times by 17 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
2783
2914-
2915/*!-
2916 \since 4.1-
2917-
2918 Returns the network proxy for this socket.-
2919 By default QNetworkProxy::DefaultProxy is used, which means this-
2920 socket will query the default proxy settings for the application.-
2921-
2922 \sa setProxy(), QNetworkProxy, QNetworkProxyFactory-
2923*/-
2924QNetworkProxy QAbstractSocket::proxy() const-
2925{-
2926 Q_D(const QAbstractSocket);-
2927 return d->proxy;
executed 6909 times by 22 tests: return d->proxy;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qtextstream - unknown status
6909
2928}-
2929#endif // QT_NO_NETWORKPROXY-
2930-
2931#ifndef QT_NO_DEBUG_STREAM-
2932Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketError error)-
2933{-
2934 QDebugStateSaver saver(debug);-
2935 debug.resetFormat().nospace();-
2936 switch (error) {-
2937 case QAbstractSocket::ConnectionRefusedError:
never executed: case QAbstractSocket::ConnectionRefusedError:
0
2938 debug << "QAbstractSocket::ConnectionRefusedError";-
2939 break;
never executed: break;
0
2940 case QAbstractSocket::RemoteHostClosedError:
executed 28 times by 1 test: case QAbstractSocket::RemoteHostClosedError:
Executed by:
  • tst_QNetworkReply
28
2941 debug << "QAbstractSocket::RemoteHostClosedError";-
2942 break;
executed 28 times by 1 test: break;
Executed by:
  • tst_QNetworkReply
28
2943 case QAbstractSocket::HostNotFoundError:
never executed: case QAbstractSocket::HostNotFoundError:
0
2944 debug << "QAbstractSocket::HostNotFoundError";-
2945 break;
never executed: break;
0
2946 case QAbstractSocket::SocketAccessError:
never executed: case QAbstractSocket::SocketAccessError:
0
2947 debug << "QAbstractSocket::SocketAccessError";-
2948 break;
never executed: break;
0
2949 case QAbstractSocket::SocketResourceError:
never executed: case QAbstractSocket::SocketResourceError:
0
2950 debug << "QAbstractSocket::SocketResourceError";-
2951 break;
never executed: break;
0
2952 case QAbstractSocket::SocketTimeoutError:
executed 1 time by 1 test: case QAbstractSocket::SocketTimeoutError:
Executed by:
  • tst_QUdpSocket
1
2953 debug << "QAbstractSocket::SocketTimeoutError";-
2954 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QUdpSocket
1
2955 case QAbstractSocket::DatagramTooLargeError:
never executed: case QAbstractSocket::DatagramTooLargeError:
0
2956 debug << "QAbstractSocket::DatagramTooLargeError";-
2957 break;
never executed: break;
0
2958 case QAbstractSocket::NetworkError:
never executed: case QAbstractSocket::NetworkError:
0
2959 debug << "QAbstractSocket::NetworkError";-
2960 break;
never executed: break;
0
2961 case QAbstractSocket::AddressInUseError:
never executed: case QAbstractSocket::AddressInUseError:
0
2962 debug << "QAbstractSocket::AddressInUseError";-
2963 break;
never executed: break;
0
2964 case QAbstractSocket::SocketAddressNotAvailableError:
never executed: case QAbstractSocket::SocketAddressNotAvailableError:
0
2965 debug << "QAbstractSocket::SocketAddressNotAvailableError";-
2966 break;
never executed: break;
0
2967 case QAbstractSocket::UnsupportedSocketOperationError:
never executed: case QAbstractSocket::UnsupportedSocketOperationError:
0
2968 debug << "QAbstractSocket::UnsupportedSocketOperationError";-
2969 break;
never executed: break;
0
2970 case QAbstractSocket::UnfinishedSocketOperationError:
never executed: case QAbstractSocket::UnfinishedSocketOperationError:
0
2971 debug << "QAbstractSocket::UnfinishedSocketOperationError";-
2972 break;
never executed: break;
0
2973 case QAbstractSocket::ProxyAuthenticationRequiredError:
never executed: case QAbstractSocket::ProxyAuthenticationRequiredError:
0
2974 debug << "QAbstractSocket::ProxyAuthenticationRequiredError";-
2975 break;
never executed: break;
0
2976 case QAbstractSocket::UnknownSocketError:
executed 50 times by 2 tests: case QAbstractSocket::UnknownSocketError:
Executed by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
50
2977 debug << "QAbstractSocket::UnknownSocketError";-
2978 break;
executed 50 times by 2 tests: break;
Executed by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
50
2979 case QAbstractSocket::ProxyConnectionRefusedError:
never executed: case QAbstractSocket::ProxyConnectionRefusedError:
0
2980 debug << "QAbstractSocket::ProxyConnectionRefusedError";-
2981 break;
never executed: break;
0
2982 case QAbstractSocket::ProxyConnectionClosedError:
never executed: case QAbstractSocket::ProxyConnectionClosedError:
0
2983 debug << "QAbstractSocket::ProxyConnectionClosedError";-
2984 break;
never executed: break;
0
2985 case QAbstractSocket::ProxyConnectionTimeoutError:
never executed: case QAbstractSocket::ProxyConnectionTimeoutError:
0
2986 debug << "QAbstractSocket::ProxyConnectionTimeoutError";-
2987 break;
never executed: break;
0
2988 case QAbstractSocket::ProxyNotFoundError:
never executed: case QAbstractSocket::ProxyNotFoundError:
0
2989 debug << "QAbstractSocket::ProxyNotFoundError";-
2990 break;
never executed: break;
0
2991 case QAbstractSocket::ProxyProtocolError:
never executed: case QAbstractSocket::ProxyProtocolError:
0
2992 debug << "QAbstractSocket::ProxyProtocolError";-
2993 break;
never executed: break;
0
2994 default:
never executed: default:
0
2995 debug << "QAbstractSocket::SocketError(" << int(error) << ')';-
2996 break;
never executed: break;
0
2997 }-
2998 return debug;
executed 79 times by 3 tests: return debug;
Executed by:
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
79
2999}-
3000-
3001Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QAbstractSocket::SocketState state)-
3002{-
3003 QDebugStateSaver saver(debug);-
3004 debug.resetFormat().nospace();-
3005 switch (state) {-
3006 case QAbstractSocket::UnconnectedState:
never executed: case QAbstractSocket::UnconnectedState:
0
3007 debug << "QAbstractSocket::UnconnectedState";-
3008 break;
never executed: break;
0
3009 case QAbstractSocket::HostLookupState:
never executed: case QAbstractSocket::HostLookupState:
0
3010 debug << "QAbstractSocket::HostLookupState";-
3011 break;
never executed: break;
0
3012 case QAbstractSocket::ConnectingState:
never executed: case QAbstractSocket::ConnectingState:
0
3013 debug << "QAbstractSocket::ConnectingState";-
3014 break;
never executed: break;
0
3015 case QAbstractSocket::ConnectedState:
never executed: case QAbstractSocket::ConnectedState:
0
3016 debug << "QAbstractSocket::ConnectedState";-
3017 break;
never executed: break;
0
3018 case QAbstractSocket::BoundState:
executed 45 times by 1 test: case QAbstractSocket::BoundState:
Executed by:
  • tst_QUdpSocket
45
3019 debug << "QAbstractSocket::BoundState";-
3020 break;
executed 45 times by 1 test: break;
Executed by:
  • tst_QUdpSocket
45
3021 case QAbstractSocket::ListeningState:
never executed: case QAbstractSocket::ListeningState:
0
3022 debug << "QAbstractSocket::ListeningState";-
3023 break;
never executed: break;
0
3024 case QAbstractSocket::ClosingState:
executed 6 times by 1 test: case QAbstractSocket::ClosingState:
Executed by:
  • tst_qtcpsocket - unknown status
6
3025 debug << "QAbstractSocket::ClosingState";-
3026 break;
executed 6 times by 1 test: break;
Executed by:
  • tst_qtcpsocket - unknown status
6
3027 default:
never executed: default:
0
3028 debug << "QAbstractSocket::SocketState(" << int(state) << ')';-
3029 break;
never executed: break;
0
3030 }-
3031 return debug;
executed 51 times by 2 tests: return debug;
Executed by:
  • tst_QUdpSocket
  • tst_qtcpsocket - unknown status
51
3032}-
3033#endif-
3034-
3035QT_END_NAMESPACE-
3036-
3037#include "moc_qabstractsocket.cpp"-
Source codeSwitch to Preprocessed file

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