qhostaddress.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/kernel/qhostaddress.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtNetwork module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qhostaddress.h"-
35#include "qhostaddress_p.h"-
36#include "private/qipaddress_p.h"-
37#include "qdebug.h"-
38#if defined(Q_OS_WIN)-
39# include <winsock2.h>-
40#else-
41# include <netinet/in.h>-
42#endif-
43#include "qplatformdefs.h"-
44#include "qstringlist.h"-
45#include "qendian.h"-
46#ifndef QT_NO_DATASTREAM-
47#include <qdatastream.h>-
48#endif-
49#ifdef __SSE2__-
50# include <private/qsimd_p.h>-
51#endif-
52-
53#ifdef QT_LINUXBASE-
54# include <arpa/inet.h>-
55#endif-
56-
57QT_BEGIN_NAMESPACE-
58-
59#define QT_ENSURE_PARSED(a) \-
60 do { \-
61 if (!(a)->d->isParsed) \-
62 (a)->d->parse(); \-
63 } while (0)-
64-
65#ifdef Q_OS_WIN-
66// sockaddr_in6 size changed between old and new SDK-
67// Only the new version is the correct one, so always-
68// use this structure.-
69#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)-
70# if !defined(u_char)-
71# define u_char unsigned char-
72# endif-
73# if !defined(u_short)-
74# define u_short unsigned short-
75# endif-
76# if !defined(u_long)-
77# define u_long unsigned long-
78# endif-
79#endif-
80struct qt_in6_addr {-
81 u_char qt_s6_addr[16];-
82};-
83typedef struct {-
84 short sin6_family; /* AF_INET6 */-
85 u_short sin6_port; /* Transport level port number */-
86 u_long sin6_flowinfo; /* IPv6 flow information */-
87 struct qt_in6_addr sin6_addr; /* IPv6 address */-
88 u_long sin6_scope_id; /* set of interfaces for a scope */-
89} qt_sockaddr_in6;-
90#else-
91#define qt_sockaddr_in6 sockaddr_in6-
92#define qt_s6_addr s6_addr-
93#endif-
94-
95-
96class QHostAddressPrivate-
97{-
98public:-
99 QHostAddressPrivate();-
100-
101 void setAddress(quint32 a_ = 0);-
102 void setAddress(const quint8 *a_);-
103 void setAddress(const Q_IPV6ADDR &a_);-
104-
105 bool parse();-
106 void clear();-
107-
108 QString ipString;-
109 QString scopeId;-
110-
111 quint32 a; // IPv4 address-
112 union {-
113 Q_IPV6ADDR a6; // IPv6 address-
114 struct { quint64 c[2]; } a6_64;-
115 struct { quint32 c[4]; } a6_32;-
116 };-
117 QAbstractSocket::NetworkLayerProtocol protocol;-
118-
119 bool isParsed;-
120-
121 friend class QHostAddress;-
122};-
123-
124QHostAddressPrivate::QHostAddressPrivate()-
125 : a(0), protocol(QAbstractSocket::UnknownNetworkLayerProtocol), isParsed(true)-
126{-
127 memset(&a6, 0, sizeof(a6));-
128}
executed 233854 times by 47 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_platformsocketengine - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qeventloop - unknown status
  • ...
233854
129-
130void QHostAddressPrivate::setAddress(quint32 a_)-
131{-
132 a = a_;-
133 protocol = QAbstractSocket::IPv4Protocol;-
134 isParsed = true;-
135-
136 //create mapped address, except for a_ == 0 (any)-
137 a6_64.c[0] = 0;-
138 if (a) {
aDescription
TRUEevaluated 20893 times by 42 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • ...
FALSEevaluated 645 times by 11 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
645-20893
139 a6_32.c[2] = qToBigEndian(0xffff);-
140 a6_32.c[3] = qToBigEndian(a);-
141 } else {
executed 20893 times by 42 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • ...
20893
142 a6_64.c[1] = 0;-
143 }
executed 645 times by 11 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
645
144}-
145-
146/// parses v4-mapped addresses or the AnyIPv6 address and stores in \a a;-
147/// returns true if the address was one of those-
148static bool convertToIpv4(quint32& a, const Q_IPV6ADDR &a6)-
149{-
150 const uchar *ptr = a6.c;-
151 if (qFromUnaligned<quint64>(ptr) != 0)
qFromUnaligned...t64>(ptr) != 0Description
TRUEevaluated 1566 times by 27 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
FALSEevaluated 2280 times by 30 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • ...
1566-2280
152 return false;
executed 1566 times by 27 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
1566
153 if (qFromBigEndian<quint32>(ptr + 8) == 0) {
qFromBigEndian...(ptr + 8) == 0Description
TRUEevaluated 1297 times by 30 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • ...
FALSEevaluated 983 times by 11 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
983-1297
154 // is it AnyIPv6?-
155 a = 0;-
156 return qFromBigEndian<quint32>(ptr + 12) == 0;
executed 1297 times by 30 tests: return qFromBigEndian<quint32>(ptr + 12) == 0;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • ...
1297
157 }-
158 if (qFromBigEndian<quint32>(ptr + 8) != 0xFFFF)
qFromBigEndian...+ 8) != 0xFFFFDescription
TRUEnever evaluated
FALSEevaluated 983 times by 11 tests
Evaluated by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
0-983
159 return false;
never executed: return false;
0
160 a = qFromBigEndian<quint32>(ptr + 12);-
161 return true;
executed 983 times by 11 tests: return true;
Executed by:
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
983
162}-
163-
164void QHostAddressPrivate::setAddress(const quint8 *a_)-
165{-
166 protocol = QAbstractSocket::IPv6Protocol;-
167 isParsed = true;-
168 memcpy(a6.c, a_, sizeof(a6));-
169 a = 0;-
170 convertToIpv4(a, a6);-
171}
executed 3838 times by 34 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • ...
3838
172-
173void QHostAddressPrivate::setAddress(const Q_IPV6ADDR &a_)-
174{-
175 setAddress(a_.c);-
176}
executed 1928 times by 16 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1928
177-
178static bool parseIp6(const QString &address, QIPAddressUtils::IPv6Address &addr, QString *scopeId)-
179{-
180 QString tmp = address;-
181 int scopeIdPos = tmp.lastIndexOf(QLatin1Char('%'));-
182 if (scopeIdPos != -1) {
scopeIdPos != -1Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
FALSEevaluated 313 times by 13 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
6-313
183 *scopeId = tmp.mid(scopeIdPos + 1);-
184 tmp.chop(tmp.size() - scopeIdPos);-
185 } else {
executed 6 times by 2 tests: end of block
Executed by:
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
6
186 scopeId->clear();-
187 }
executed 313 times by 13 tests: end of block
Executed by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
313
188 return QIPAddressUtils::parseIp6(addr, tmp.constBegin(), tmp.constEnd()) == 0;
executed 319 times by 13 tests: return QIPAddressUtils::parseIp6(addr, tmp.constBegin(), tmp.constEnd()) == 0;
Executed by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
319
189}-
190-
191Q_NEVER_INLINE bool QHostAddressPrivate::parse()-
192{-
193 isParsed = true;-
194 protocol = QAbstractSocket::UnknownNetworkLayerProtocol;-
195 QString a = ipString.simplified();-
196 if (a.isEmpty())
a.isEmpty()Description
TRUEevaluated 3495 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - 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
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 19070 times by 37 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookie - unknown status
  • ...
3495-19070
197 return false;
executed 3495 times by 21 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - 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
  • tst_qxmlsimplereader - unknown status
3495
198-
199 // All IPv6 addresses contain a ':', and may contain a '.'.-
200 if (a.contains(QLatin1Char(':'))) {
a.contains(QLatin1Char(':'))Description
TRUEevaluated 319 times by 13 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 18751 times by 37 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookie - unknown status
  • ...
319-18751
201 quint8 maybeIp6[16];-
202 if (parseIp6(a, maybeIp6, &scopeId)) {
parseIp6(a, ma...Ip6, &scopeId)Description
TRUEevaluated 272 times by 12 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 47 times by 3 tests
Evaluated by:
  • tst_QHostInfo
  • tst_Spdy
  • tst_qhostaddress - unknown status
47-272
203 setAddress(maybeIp6);-
204 return true;
executed 272 times by 12 tests: return true;
Executed by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
272
205 }-
206 }
executed 47 times by 3 tests: end of block
Executed by:
  • tst_QHostInfo
  • tst_Spdy
  • tst_qhostaddress - unknown status
47
207-
208 quint32 maybeIp4 = 0;-
209 if (QIPAddressUtils::parseIp4(maybeIp4, a.constBegin(), a.constEnd())) {
QIPAddressUtil... a.constEnd())Description
TRUEevaluated 3302 times by 28 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - 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 15496 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_Spdy
  • tst_lancelot - unknown status
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkcookie - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qnetworkreply - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
3302-15496
210 setAddress(maybeIp4);-
211 return true;
executed 3302 times by 28 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • ...
3302
212 }-
213-
214 return false;
executed 15496 times by 29 tests: return false;
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_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkcookie - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qnetworkreply - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • ...
15496
215}-
216-
217void QHostAddressPrivate::clear()-
218{-
219 a = 0;-
220 protocol = QAbstractSocket::UnknownNetworkLayerProtocol;-
221 isParsed = true;-
222 memset(&a6, 0, sizeof(a6));-
223}
executed 217689 times by 36 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_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qnetworkaddressentry - unknown status
  • ...
217689
224-
225-
226bool QNetmaskAddress::setAddress(const QString &address)-
227{-
228 length = -1;-
229 QHostAddress other;-
230 return other.setAddress(address) && setAddress(other);
executed 16 times by 1 test: return other.setAddress(address) && setAddress(other);
Executed by:
  • tst_qhostaddress - unknown status
other.setAddress(address)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
setAddress(other)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
1-16
231}-
232-
233bool QNetmaskAddress::setAddress(const QHostAddress &address)-
234{-
235 static const quint8 zeroes[16] = { 0 };-
236 union {-
237 quint32 v4;-
238 quint8 v6[16];-
239 } ip;-
240-
241 int netmask = 0;-
242 quint8 *ptr = ip.v6;-
243 quint8 *end;-
244 length = -1;-
245-
246 QHostAddress::operator=(address);-
247-
248 if (d->protocol == QAbstractSocket::IPv4Protocol) {
d->protocol ==...::IPv4ProtocolDescription
TRUEevaluated 634 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 625 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
625-634
249 ip.v4 = qToBigEndian(d->a);-
250 end = ptr + 4;-
251 } else if (d->protocol == QAbstractSocket::IPv6Protocol) {
executed 634 times by 22 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 621 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
4-634
252 memcpy(ip.v6, d->a6.c, 16);-
253 end = ptr + 16;-
254 } else {
executed 621 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
621
255 d->clear();-
256 return false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_qnetworkaddressentry - unknown status
4
257 }-
258-
259 while (ptr < end) {
ptr < endDescription
TRUEevaluated 8881 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 207 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
207-8881
260 switch (*ptr) {-
261 case 255:
executed 7833 times by 22 tests: case 255:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
7833
262 netmask += 8;-
263 ++ptr;-
264 continue;
executed 7833 times by 22 tests: continue;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
7833
265-
266 default:
executed 4 times by 2 tests: default:
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
4
267 d->clear();-
268 return false; // invalid IP-style netmask
executed 4 times by 2 tests: return false;
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
4
269-
270 // the rest always falls through-
271 case 254:
executed 4 times by 2 tests: case 254:
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
4
272 ++netmask;-
273 case 252:
code before this statement executed 4 times by 2 tests: case 252:
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
executed 1 time by 1 test: case 252:
Executed by:
  • tst_qhostaddress - unknown status
1-4
274 ++netmask;-
275 case 248:
code before this statement executed 5 times by 2 tests: case 248:
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
executed 205 times by 21 tests: case 248:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
5-205
276 ++netmask;-
277 case 240:
code before this statement executed 210 times by 22 tests: case 240:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
executed 3 times by 2 tests: case 240:
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
3-210
278 ++netmask;-
279 case 224:
code before this statement executed 213 times by 22 tests: case 224:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
executed 2 times by 2 tests: case 224:
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
2-213
280 ++netmask;-
281 case 192:
code before this statement executed 215 times by 22 tests: case 192:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
executed 1 time by 1 test: case 192:
Executed by:
  • tst_qhostaddress - unknown status
1-215
282 ++netmask;-
283 case 128:
code before this statement executed 216 times by 22 tests: case 128:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
executed 1 time by 1 test: case 128:
Executed by:
  • tst_qhostaddress - unknown status
1-216
284 ++netmask;-
285 case 0:
code before this statement executed 217 times by 22 tests: case 0:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
executed 1044 times by 22 tests: case 0:
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
217-1044
286 break;
executed 1044 times by 22 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1044
287 }-
288 break;
executed 1044 times by 22 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1044
289 }-
290-
291 // confirm that the rest is only zeroes-
292 if (ptr < end && memcmp(ptr + 1, zeroes, end - ptr - 1) != 0) {
ptr < endDescription
TRUEevaluated 1044 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 207 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
memcmp(ptr + 1... ptr - 1) != 0Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 1042 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
2-1044
293 d->clear();-
294 return false;
executed 2 times by 2 tests: return false;
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
2
295 }-
296-
297 length = netmask;-
298 return true;
executed 1249 times by 22 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
1249
299}-
300-
301static void clearBits(quint8 *where, int start, int end)-
302{-
303 Q_ASSERT(end == 32 || end == 128);-
304 if (start == end)
start == endDescription
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 33 times by 3 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
2-33
305 return;
executed 2 times by 2 tests: return;
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
2
306-
307 // for the byte where 'start' is, clear the lower bits only-
308 quint8 bytemask = 256 - (1 << (8 - (start & 7)));-
309 where[start / 8] &= bytemask;-
310-
311 // for the tail part, clear everything-
312 memset(where + (start + 7) / 8, 0, end / 8 - (start + 7) / 8);-
313}
executed 33 times by 3 tests: end of block
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
33
314-
315int QNetmaskAddress::prefixLength() const-
316{-
317 return length;
executed 120 times by 3 tests: return length;
Executed by:
  • tst_QNetworkInterface
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
120
318}-
319-
320void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol proto, int newLength)-
321{-
322 length = newLength;-
323 if (length < 0 || length > (proto == QAbstractSocket::IPv4Protocol ? 32 :
length < 0Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
length > (prot...ol ? 128 : -1)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
12-32
324 proto == QAbstractSocket::IPv6Protocol ? 128 : -1)) {
length > (prot...ol ? 128 : -1)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
12-16
325 // invalid information, reject-
326 d->protocol = QAbstractSocket::UnknownNetworkLayerProtocol;-
327 length = -1;-
328 return;
executed 48 times by 1 test: return;
Executed by:
  • tst_qnetworkaddressentry - unknown status
48
329 }-
330-
331 d->protocol = proto;-
332 if (d->protocol == QAbstractSocket::IPv4Protocol) {
d->protocol ==...::IPv4ProtocolDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
5-7
333 if (length == 0) {
length == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
1-4
334 d->a = 0;-
335 } else if (length == 32) {
executed 1 time by 1 test: end of block
Executed by:
  • tst_qnetworkaddressentry - unknown status
length == 32Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qnetworkaddressentry - unknown status
1-3
336 d->a = quint32(0xffffffff);-
337 } else {
executed 1 time by 1 test: end of block
Executed by:
  • tst_qnetworkaddressentry - unknown status
1
338 d->a = quint32(0xffffffff) >> (32 - length) << (32 - length);-
339 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qnetworkaddressentry - unknown status
3
340 } else {-
341 memset(d->a6.c, 0xFF, sizeof(d->a6));-
342 clearBits(d->a6.c, length, 128);-
343 }
executed 7 times by 1 test: end of block
Executed by:
  • tst_qnetworkaddressentry - unknown status
7
344}-
345-
346/*!-
347 \class QHostAddress-
348 \brief The QHostAddress class provides an IP address.-
349 \ingroup network-
350 \inmodule QtNetwork-
351-
352 This class holds an IPv4 or IPv6 address in a platform- and-
353 protocol-independent manner.-
354-
355 QHostAddress is normally used with the QTcpSocket, QTcpServer,-
356 and QUdpSocket to connect to a host or to set up a server.-
357-
358 A host address is set with setAddress(), and retrieved with-
359 toIPv4Address(), toIPv6Address(), or toString(). You can check the-
360 type with protocol().-
361-
362 \note Please note that QHostAddress does not do DNS lookups.-
363 QHostInfo is needed for that.-
364-
365 The class also supports common predefined addresses: \l Null, \l-
366 LocalHost, \l LocalHostIPv6, \l Broadcast, and \l Any.-
367-
368 \sa QHostInfo, QTcpSocket, QTcpServer, QUdpSocket-
369*/-
370-
371/*! \enum QHostAddress::SpecialAddress-
372-
373 \value Null The null address object. Equivalent to QHostAddress().-
374 \value LocalHost The IPv4 localhost address. Equivalent to QHostAddress("127.0.0.1").-
375 \value LocalHostIPv6 The IPv6 localhost address. Equivalent to QHostAddress("::1").-
376 \value Broadcast The IPv4 broadcast address. Equivalent to QHostAddress("255.255.255.255").-
377 \value AnyIPv4 The IPv4 any-address. Equivalent to QHostAddress("0.0.0.0"). A socket bound with this address will listen only on IPv4 interaces.-
378 \value AnyIPv6 The IPv6 any-address. Equivalent to QHostAddress("::"). A socket bound with this address will listen only on IPv6 interaces.-
379 \value Any The dual stack any-address. A socket bound with this address will listen on both IPv4 and IPv6 interfaces.-
380*/-
381-
382/*! Constructs a null host address object, i.e. an address which is not valid for any host or interface.-
383-
384 \sa clear()-
385*/-
386QHostAddress::QHostAddress()-
387 : d(new QHostAddressPrivate)-
388{-
389}
executed 229619 times by 45 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_lancelot - unknown status
  • tst_platformsocketengine - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qeventloop - unknown status
  • ...
229619
390-
391/*!-
392 Constructs a host address object with the IPv4 address \a ip4Addr.-
393*/-
394QHostAddress::QHostAddress(quint32 ip4Addr)-
395 : d(new QHostAddressPrivate)-
396{-
397 setAddress(ip4Addr);-
398}
executed 286 times by 23 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
286
399-
400/*!-
401 Constructs a host address object with the IPv6 address \a ip6Addr.-
402-
403 \a ip6Addr must be a 16-byte array in network byte order (big-
404 endian).-
405*/-
406QHostAddress::QHostAddress(quint8 *ip6Addr)-
407 : d(new QHostAddressPrivate)-
408{-
409 setAddress(ip6Addr);-
410}
executed 18 times by 1 test: end of block
Executed by:
  • tst_qdnslookup - unknown status
18
411-
412/*!-
413 \since 5.5-
414 Constructs a host address object with the IPv6 address \a ip6Addr.-
415-
416 \a ip6Addr must be a 16-byte array in network byte order (big-
417 endian).-
418*/-
419QHostAddress::QHostAddress(const quint8 *ip6Addr)-
420 : d(new QHostAddressPrivate)-
421{-
422 setAddress(ip6Addr);-
423}
never executed: end of block
0
424-
425/*!-
426 Constructs a host address object with the IPv6 address \a ip6Addr.-
427*/-
428QHostAddress::QHostAddress(const Q_IPV6ADDR &ip6Addr)-
429 : d(new QHostAddressPrivate)-
430{-
431 setAddress(ip6Addr);-
432}
executed 14 times by 3 tests: end of block
Executed by:
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
14
433-
434/*!-
435 Constructs an IPv4 or IPv6 address based on the string \a address-
436 (e.g., "127.0.0.1").-
437-
438 \sa setAddress()-
439*/-
440QHostAddress::QHostAddress(const QString &address)-
441 : d(new QHostAddressPrivate)-
442{-
443 d->ipString = address;-
444 d->isParsed = false;-
445}
executed 1305 times by 21 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookie - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
1305
446-
447/*!-
448 \fn QHostAddress::QHostAddress(const sockaddr *sockaddr)-
449-
450 Constructs an IPv4 or IPv6 address using the address specified by-
451 the native structure \a sockaddr.-
452-
453 \sa setAddress()-
454*/-
455QHostAddress::QHostAddress(const struct sockaddr *sockaddr)-
456 : d(new QHostAddressPrivate)-
457{-
458#ifndef Q_OS_WINRT-
459 if (sockaddr->sa_family == AF_INET)
sockaddr->sa_family == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
460 setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
never executed: setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
0
461 else if (sockaddr->sa_family == AF_INET6)
sockaddr->sa_family == 10Description
TRUEnever evaluated
FALSEnever evaluated
0
462 setAddress(((const qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
never executed: setAddress(((const sockaddr_in6 *)sockaddr)->sin6_addr.__in6_u.__u6_addr8);
0
463#else-
464 Q_UNUSED(sockaddr)-
465#endif-
466}
never executed: end of block
0
467-
468/*!-
469 Constructs a copy of the given \a address.-
470*/-
471QHostAddress::QHostAddress(const QHostAddress &address)-
472 : d(new QHostAddressPrivate(*address.d.data()))-
473{-
474}
executed 58079 times by 41 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • ...
58079
475-
476/*!-
477 Constructs a QHostAddress object for \a address.-
478*/-
479QHostAddress::QHostAddress(SpecialAddress address)-
480 : d(new QHostAddressPrivate)-
481{-
482 Q_IPV6ADDR ip6;-
483 memset(&ip6, 0, sizeof ip6);-
484 quint32 ip4 = INADDR_ANY;-
485-
486 switch (address) {-
487 case Null:
executed 13 times by 2 tests: case Null:
Executed by:
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
13
488 return;
executed 13 times by 2 tests: return;
Executed by:
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
13
489-
490 case Broadcast:
executed 176 times by 3 tests: case Broadcast:
Executed by:
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
176
491 ip4 = INADDR_BROADCAST;-
492 break;
executed 176 times by 3 tests: break;
Executed by:
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
176
493 case LocalHost:
executed 269 times by 17 tests: case LocalHost:
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
269
494 ip4 = INADDR_LOOPBACK;-
495 break;
executed 269 times by 17 tests: break;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
269
496 case AnyIPv4:
executed 216 times by 8 tests: case AnyIPv4:
Executed by:
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qtcpsocket - unknown status
216
497 break;
executed 216 times by 8 tests: break;
Executed by:
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qtcpsocket - unknown status
216
498-
499 case LocalHostIPv6:
executed 55 times by 5 tests: case LocalHostIPv6:
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
55
500 ip6[15] = 1;-
501 // fall through-
502 case AnyIPv6:
code before this statement executed 55 times by 5 tests: case AnyIPv6:
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
executed 50 times by 6 tests: case AnyIPv6:
Executed by:
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
50-55
503 d->setAddress(ip6);-
504 return;
executed 105 times by 7 tests: return;
Executed by:
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
105
505-
506 case Any:
executed 1833 times by 15 tests: case Any:
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1833
507 d->protocol = QAbstractSocket::AnyIPProtocol;-
508 return;
executed 1833 times by 15 tests: return;
Executed by:
  • tst_NetworkSelfTest
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1833
509 }-
510-
511 // common IPv4 part-
512 d->setAddress(ip4);-
513}
executed 661 times by 17 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
661
514-
515/*!-
516 Destroys the host address object.-
517*/-
518QHostAddress::~QHostAddress()-
519{-
520}-
521-
522/*!-
523 Assigns another host \a address to this object, and returns a reference-
524 to this object.-
525*/-
526QHostAddress &QHostAddress::operator=(const QHostAddress &address)-
527{-
528 *d.data() = *address.d.data();-
529 return *this;
executed 28529 times by 39 tests: return *this;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • ...
28529
530}-
531-
532/*!-
533 Assigns the host address \a address to this object, and returns a-
534 reference to this object.-
535-
536 \sa setAddress()-
537*/-
538QHostAddress &QHostAddress::operator=(const QString &address)-
539{-
540 setAddress(address);-
541 return *this;
executed 2 times by 1 test: return *this;
Executed by:
  • tst_qhostaddress - unknown status
2
542}-
543-
544/*!-
545 \fn bool QHostAddress::operator!=(const QHostAddress &other) const-
546 \since 4.2-
547-
548 Returns \c true if this host address is not the same as the \a other-
549 address given; otherwise returns \c false.-
550*/-
551-
552/*!-
553 \fn bool QHostAddress::operator!=(SpecialAddress other) const-
554-
555 Returns \c true if this host address is not the same as the \a other-
556 address given; otherwise returns \c false.-
557*/-
558-
559/*!-
560 Sets the host address to 0.0.0.0.-
561*/-
562void QHostAddress::clear()-
563{-
564 d->clear();-
565}
executed 217679 times by 35 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_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qlocalsocket - unknown status
  • tst_qnetworkreply - unknown status
  • ...
217679
566-
567/*!-
568 Set the IPv4 address specified by \a ip4Addr.-
569*/-
570void QHostAddress::setAddress(quint32 ip4Addr)-
571{-
572 d->setAddress(ip4Addr);-
573}
executed 17575 times by 40 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • ...
17575
574-
575/*!-
576 \overload-
577-
578 Set the IPv6 address specified by \a ip6Addr.-
579-
580 \a ip6Addr must be an array of 16 bytes in network byte order-
581 (high-order byte first).-
582*/-
583void QHostAddress::setAddress(quint8 *ip6Addr)-
584{-
585 d->setAddress(ip6Addr);-
586}
executed 1638 times by 25 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qdnslookup - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
1638
587-
588/*!-
589 \overload-
590 \since 5.5-
591-
592 Set the IPv6 address specified by \a ip6Addr.-
593-
594 \a ip6Addr must be an array of 16 bytes in network byte order-
595 (high-order byte first).-
596*/-
597void QHostAddress::setAddress(const quint8 *ip6Addr)-
598{-
599 d->setAddress(ip6Addr);-
600}
never executed: end of block
0
601-
602/*!-
603 \overload-
604-
605 Set the IPv6 address specified by \a ip6Addr.-
606*/-
607void QHostAddress::setAddress(const Q_IPV6ADDR &ip6Addr)-
608{-
609 d->setAddress(ip6Addr);-
610}
executed 1823 times by 15 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1823
611-
612/*!-
613 \overload-
614-
615 Sets the IPv4 or IPv6 address specified by the string-
616 representation specified by \a address (e.g. "127.0.0.1").-
617 Returns \c true and sets the address if the address was successfully-
618 parsed; otherwise returns \c false.-
619*/-
620bool QHostAddress::setAddress(const QString &address)-
621{-
622 d->ipString = address;-
623 return d->parse();
executed 21255 times by 33 tests: return d->parse();
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_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkreply - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • ...
21255
624}-
625-
626/*!-
627 \fn void QHostAddress::setAddress(const sockaddr *sockaddr)-
628 \overload-
629-
630 Sets the IPv4 or IPv6 address specified by the native structure \a-
631 sockaddr. Returns \c true and sets the address if the address was-
632 successfully parsed; otherwise returns \c false.-
633*/-
634void QHostAddress::setAddress(const struct sockaddr *sockaddr)-
635{-
636#ifndef Q_OS_WINRT-
637 clear();-
638 if (sockaddr->sa_family == AF_INET)
sockaddr->sa_family == 2Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEnever evaluated
0-1
639 setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
executed 1 time by 1 test: setAddress(htonl(((const sockaddr_in *)sockaddr)->sin_addr.s_addr));
Executed by:
  • tst_qhostaddress - unknown status
1
640 else if (sockaddr->sa_family == AF_INET6)
sockaddr->sa_family == 10Description
TRUEnever evaluated
FALSEnever evaluated
0
641 setAddress(((const qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
never executed: setAddress(((const sockaddr_in6 *)sockaddr)->sin6_addr.__in6_u.__u6_addr8);
0
642#else-
643 Q_UNUSED(sockaddr)-
644#endif-
645}
executed 1 time by 1 test: end of block
Executed by:
  • tst_qhostaddress - unknown status
1
646-
647/*!-
648 Returns the IPv4 address as a number.-
649-
650 For example, if the address is 127.0.0.1, the returned value is-
651 2130706433 (i.e. 0x7f000001).-
652-
653 This value is valid if the protocol() is-
654 \l{QAbstractSocket::}{IPv4Protocol},-
655 or if the protocol is-
656 \l{QAbstractSocket::}{IPv6Protocol},-
657 and the IPv6 address is an IPv4 mapped address. (RFC4291)-
658-
659 \sa toString()-
660*/-
661quint32 QHostAddress::toIPv4Address() const-
662{-
663 return toIPv4Address(Q_NULLPTR);
executed 10664 times by 39 tests: return toIPv4Address(nullptr);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • ...
10664
664}-
665-
666/*!-
667 Returns the IPv4 address as a number.-
668-
669 For example, if the address is 127.0.0.1, the returned value is-
670 2130706433 (i.e. 0x7f000001).-
671-
672 This value is valid if the protocol() is-
673 \l{QAbstractSocket::}{IPv4Protocol},-
674 or if the protocol is-
675 \l{QAbstractSocket::}{IPv6Protocol},-
676 and the IPv6 address is an IPv4 mapped address. (RFC4291). In those-
677 cases, \a ok will be set to true. Otherwise, it will be set to false.-
678-
679 \sa toString()-
680*/-
681quint32 QHostAddress::toIPv4Address(bool *ok) const-
682{-
683 QT_ENSURE_PARSED(this);
executed 7 times by 1 test: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 10666 times by 39 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • ...
7-10666
684 quint32 dummy;-
685 if (ok)
okDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 10664 times by 39 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • ...
9-10664
686 *ok = d->protocol == QAbstractSocket::IPv4Protocol || d->protocol == QAbstractSocket::AnyIPProtocol
executed 9 times by 1 test: *ok = d->protocol == QAbstractSocket::IPv4Protocol || d->protocol == QAbstractSocket::AnyIPProtocol || (d->protocol == QAbstractSocket::IPv6Protocol && convertToIpv4(dummy, d->a6));
Executed by:
  • tst_qhostaddress - unknown status
d->protocol ==...::IPv4ProtocolDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
d->protocol ==...:AnyIPProtocolDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
0-9
687 || (d->protocol == QAbstractSocket::IPv6Protocol && convertToIpv4(dummy, d->a6));
executed 9 times by 1 test: *ok = d->protocol == QAbstractSocket::IPv4Protocol || d->protocol == QAbstractSocket::AnyIPProtocol || (d->protocol == QAbstractSocket::IPv6Protocol && convertToIpv4(dummy, d->a6));
Executed by:
  • tst_qhostaddress - unknown status
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEnever evaluated
convertToIpv4(dummy, d->a6)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
0-9
688 return d->a;
executed 10673 times by 39 tests: return d->a;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • ...
10673
689}-
690-
691/*!-
692 Returns the network layer protocol of the host address.-
693*/-
694QAbstractSocket::NetworkLayerProtocol QHostAddress::protocol() const-
695{-
696 QT_ENSURE_PARSED(this);
executed 286 times by 12 tests: (this)->d->parse();
Executed by:
  • tst_QHostInfo
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookie - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 286 times by 12 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qnetworkcookie - unknown status
  • tst_qnetworkcookiejar - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 40778 times by 40 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • ...
286-40778
697 return d->protocol;
executed 41064 times by 41 tests: return d->protocol;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • ...
41064
698}-
699-
700/*!-
701 Returns the IPv6 address as a Q_IPV6ADDR structure. The structure-
702 consists of 16 unsigned characters.-
703-
704 \snippet code/src_network_kernel_qhostaddress.cpp 0-
705-
706 This value is valid if the protocol() is-
707 \l{QAbstractSocket::}{IPv6Protocol}.-
708 If the protocol is-
709 \l{QAbstractSocket::}{IPv4Protocol},-
710 then the address is returned an an IPv4 mapped IPv6 address. (RFC4291)-
711-
712 \sa toString()-
713*/-
714Q_IPV6ADDR QHostAddress::toIPv6Address() const-
715{-
716 QT_ENSURE_PARSED(this);
executed 1 time by 1 test: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 1828 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - 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_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1-1828
717 return d->a6;
executed 1829 times by 16 tests: return d->a6;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - 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_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1829
718}-
719-
720/*!-
721 Returns the address as a string.-
722-
723 For example, if the address is the IPv4 address 127.0.0.1, the-
724 returned string is "127.0.0.1". For IPv6 the string format will-
725 follow the RFC5952 recommendation.-
726 For QHostAddress::Any, its IPv4 address will be returned ("0.0.0.0")-
727-
728 \sa toIPv4Address()-
729*/-
730QString QHostAddress::toString() const-
731{-
732 QT_ENSURE_PARSED(this);
executed 3 times by 2 tests: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
FALSEevaluated 2974 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - 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
3-2974
733 if (d->protocol == QAbstractSocket::IPv4Protocol
d->protocol ==...::IPv4ProtocolDescription
TRUEevaluated 2479 times by 25 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - 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 498 times by 13 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
498-2479
734 || d->protocol == QAbstractSocket::AnyIPProtocol) {
d->protocol ==...:AnyIPProtocolDescription
TRUEevaluated 23 times by 2 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
FALSEevaluated 475 times by 13 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
23-475
735 quint32 i = toIPv4Address();-
736 QString s;-
737 QIPAddressUtils::toString(s, i);-
738 return s;
executed 2502 times by 25 tests: return s;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkaddressentry - 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
2502
739 }-
740-
741 if (d->protocol == QAbstractSocket::IPv6Protocol) {
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 294 times by 10 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 181 times by 6 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
181-294
742 QString s;-
743 QIPAddressUtils::toString(s, d->a6.c);-
744-
745 if (!d->scopeId.isEmpty())
!d->scopeId.isEmpty()Description
TRUEevaluated 33 times by 5 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
FALSEevaluated 261 times by 10 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
33-261
746 s.append(QLatin1Char('%') + d->scopeId);
executed 33 times by 5 tests: s.append(QLatin1Char('%') + d->scopeId);
Executed by:
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
33
747 return s;
executed 294 times by 10 tests: return s;
Executed by:
  • tst_QHostInfo
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qtcpsocket - unknown status
294
748 }-
749-
750 return QString();
executed 181 times by 6 tests: return QString();
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhttpsocketengine - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
181
751}-
752-
753/*!-
754 \since 4.1-
755-
756 Returns the scope ID of an IPv6 address. For IPv4 addresses, or if the-
757 address does not contain a scope ID, an empty QString is returned.-
758-
759 The IPv6 scope ID specifies the scope of \e reachability for non-global-
760 IPv6 addresses, limiting the area in which the address can be used. All-
761 IPv6 addresses are associated with such a reachability scope. The scope ID-
762 is used to disambiguate addresses that are not guaranteed to be globally-
763 unique.-
764-
765 IPv6 specifies the following four levels of reachability:-
766-
767 \list-
768-
769 \li Node-local: Addresses that are only used for communicating with-
770 services on the same interface (e.g., the loopback interface "::1").-
771-
772 \li Link-local: Addresses that are local to the network interface-
773 (\e{link}). There is always one link-local address for each IPv6 interface-
774 on your host. Link-local addresses ("fe80...") are generated from the MAC-
775 address of the local network adaptor, and are not guaranteed to be unique.-
776-
777 \li Global: For globally routable addresses, such as public servers on the-
778 Internet.-
779-
780 \endlist-
781-
782 When using a link-local or site-local address for IPv6 connections, you-
783 must specify the scope ID. The scope ID for a link-local address is-
784 usually the same as the interface name (e.g., "eth0", "en1") or number-
785 (e.g., "1", "2").-
786-
787 \sa setScopeId(), QNetworkInterface, QNetworkInterface::interfaceFromName-
788*/-
789QString QHostAddress::scopeId() const-
790{-
791 QT_ENSURE_PARSED(this);
executed 2 times by 1 test: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 1818 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - 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_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
2-1818
792 return (d->protocol == QAbstractSocket::IPv6Protocol) ? d->scopeId : QString();
executed 1820 times by 16 tests: return (d->protocol == QAbstractSocket::IPv6Protocol) ? d->scopeId : QString();
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - 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_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
(d->protocol =...:IPv6Protocol)Description
TRUEevaluated 1112 times by 10 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 708 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
708-1820
793}-
794-
795/*!-
796 \since 4.1-
797-
798 Sets the IPv6 scope ID of the address to \a id. If the address protocol is-
799 not IPv6, this function does nothing. The scope ID may be set as an-
800 interface name (such as "eth0" or "en1") or as an integer representing the-
801 interface index. If \a id is an interface name, QtNetwork will convert to-
802 an interface index using QNetworkInterface::interfaceIndexFromName() before-
803 calling the operating system networking functions.-
804-
805 \sa scopeId(), QNetworkInterface, QNetworkInterface::interfaceFromName-
806*/-
807void QHostAddress::setScopeId(const QString &id)-
808{-
809 QT_ENSURE_PARSED(this);
never executed: (this)->d->parse();
!(this)->d->isParsedDescription
TRUEnever evaluated
FALSEevaluated 443 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
0-443
810 if (d->protocol == QAbstractSocket::IPv6Protocol)
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 443 times by 21 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
FALSEnever evaluated
0-443
811 d->scopeId = id;
executed 443 times by 21 tests: d->scopeId = id;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
443
812}
executed 443 times by 21 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qhostaddress - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qtcpsocket - unknown status
443
813-
814/*!-
815 Returns \c true if this host address is the same as the \a other address-
816 given; otherwise returns \c false.-
817*/-
818bool QHostAddress::operator==(const QHostAddress &other) const-
819{-
820 QT_ENSURE_PARSED(this);
never executed: (this)->d->parse();
!(this)->d->isParsedDescription
TRUEnever evaluated
FALSEevaluated 6280 times by 26 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - 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
  • ...
0-6280
821 QT_ENSURE_PARSED(&other);
executed 53 times by 3 tests: (&other)->d->parse();
Executed by:
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qsocks5socketengine - unknown status
!(&other)->d->isParsedDescription
TRUEevaluated 53 times by 3 tests
Evaluated by:
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qsocks5socketengine - unknown status
FALSEevaluated 6227 times by 26 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - 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
  • ...
53-6227
822-
823 if (d->protocol == QAbstractSocket::IPv4Protocol)
d->protocol ==...::IPv4ProtocolDescription
TRUEevaluated 5484 times by 26 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - 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
  • ...
FALSEevaluated 796 times by 20 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaddressentry - 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
796-5484
824 return other.d->protocol == QAbstractSocket::IPv4Protocol && d->a == other.d->a;
executed 5484 times by 26 tests: return other.d->protocol == QAbstractSocket::IPv4Protocol && d->a == other.d->a;
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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - 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
  • ...
other.d->proto...::IPv4ProtocolDescription
TRUEevaluated 4978 times by 26 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - 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
  • ...
FALSEevaluated 506 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
d->a == other.d->aDescription
TRUEevaluated 4653 times by 26 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_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkaddressentry - 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
  • ...
FALSEevaluated 325 times by 8 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
325-5484
825 if (d->protocol == QAbstractSocket::IPv6Protocol) {
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 685 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 111 times by 8 tests
Evaluated by:
  • tst_QTcpServer
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
111-685
826 return other.d->protocol == QAbstractSocket::IPv6Protocol
executed 685 times by 18 tests: return other.d->protocol == QAbstractSocket::IPv6Protocol && memcmp(&d->a6, &other.d->a6, sizeof(Q_IPV6ADDR)) == 0;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
other.d->proto...::IPv6ProtocolDescription
TRUEevaluated 581 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 104 times by 10 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
104-685
827 && memcmp(&d->a6, &other.d->a6, sizeof(Q_IPV6ADDR)) == 0;
executed 685 times by 18 tests: return other.d->protocol == QAbstractSocket::IPv6Protocol && memcmp(&d->a6, &other.d->a6, sizeof(Q_IPV6ADDR)) == 0;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
memcmp(&d->a6,...PV6ADDR)) == 0Description
TRUEevaluated 359 times by 17 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qhostaddress - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 222 times by 5 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_qsslsocket_onDemandCertificates_member - unknown status
  • tst_qsslsocket_onDemandCertificates_static - unknown status
222-685
828 }-
829 return d->protocol == other.d->protocol;
executed 111 times by 8 tests: return d->protocol == other.d->protocol;
Executed by:
  • tst_QTcpServer
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaddressentry - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
111
830}-
831-
832/*!-
833 Returns \c true if this host address is the same as the \a other-
834 address given; otherwise returns \c false.-
835*/-
836bool QHostAddress::operator ==(SpecialAddress other) const-
837{-
838 QT_ENSURE_PARSED(this);
executed 15 times by 1 test: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 2554 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
15-2554
839 quint32 ip4 = INADDR_ANY;-
840 switch (other) {-
841 case Null:
executed 8 times by 1 test: case Null:
Executed by:
  • tst_qhostaddress - unknown status
8
842 return d->protocol == QAbstractSocket::UnknownNetworkLayerProtocol;
executed 8 times by 1 test: return d->protocol == QAbstractSocket::UnknownNetworkLayerProtocol;
Executed by:
  • tst_qhostaddress - unknown status
8
843-
844 case Broadcast:
executed 8 times by 1 test: case Broadcast:
Executed by:
  • tst_qhostaddress - unknown status
8
845 ip4 = INADDR_BROADCAST;-
846 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
8
847-
848 case LocalHost:
executed 12 times by 1 test: case LocalHost:
Executed by:
  • tst_qhostaddress - unknown status
12
849 ip4 = INADDR_LOOPBACK;-
850 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
12
851-
852 case Any:
executed 60 times by 5 tests: case Any:
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qtcpsocket - unknown status
60
853 return d->protocol == QAbstractSocket::AnyIPProtocol;
executed 60 times by 5 tests: return d->protocol == QAbstractSocket::AnyIPProtocol;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qtcpsocket - unknown status
60
854-
855 case AnyIPv4:
executed 1239 times by 15 tests: case AnyIPv4:
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1239
856 break;
executed 1239 times by 15 tests: break;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1239
857-
858 case LocalHostIPv6:
executed 16 times by 3 tests: case LocalHostIPv6:
Executed by:
  • tst_QNetworkInterface
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
16
859 case AnyIPv6:
executed 1226 times by 15 tests: case AnyIPv6:
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
1226
860 if (d->protocol == QAbstractSocket::IPv6Protocol) {
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 1226 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 16 times by 4 tests
Evaluated by:
  • tst_QNetworkInterface
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
16-1226
861 quint64 second = quint8(other == LocalHostIPv6); // 1 for localhost, 0 for any-
862 return d->a6_64.c[0] == 0 && d->a6_64.c[1] == qToBigEndian(second);
executed 1226 times by 16 tests: return d->a6_64.c[0] == 0 && d->a6_64.c[1] == qToBigEndian(second);
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->a6_64.c[0] == 0Description
TRUEevaluated 1208 times by 16 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
d->a6_64.c[1] ...Endian(second)Description
TRUEevaluated 633 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
FALSEevaluated 575 times by 13 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
18-1226
863 }-
864 return false;
executed 16 times by 4 tests: return false;
Executed by:
  • tst_QNetworkInterface
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
16
865 }-
866-
867 // common IPv4 part-
868 return d->protocol == QAbstractSocket::IPv4Protocol && d->a == ip4;
executed 1259 times by 15 tests: return d->protocol == QAbstractSocket::IPv4Protocol && d->a == ip4;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->protocol ==...::IPv4ProtocolDescription
TRUEevaluated 40 times by 5 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1219 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qsslsocket - unknown status
  • tst_qtcpsocket - unknown status
  • tst_qxmlsimplereader - unknown status
d->a == ip4Description
TRUEevaluated 31 times by 4 tests
Evaluated by:
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 9 times by 3 tests
Evaluated by:
  • tst_QTcpServer
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
9-1259
869}-
870-
871/*!-
872 Returns \c true if this host address is null (INADDR_ANY or in6addr_any).-
873 The default constructor creates a null address, and that address is-
874 not valid for any host or interface.-
875*/-
876bool QHostAddress::isNull() const-
877{-
878 QT_ENSURE_PARSED(this);
executed 76 times by 2 tests: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qsslsocket - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 76 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qsslsocket - unknown status
FALSEevaluated 4237 times by 29 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • ...
76-4237
879 return d->protocol == QAbstractSocket::UnknownNetworkLayerProtocol;
executed 4313 times by 29 tests: return d->protocol == QAbstractSocket::UnknownNetworkLayerProtocol;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_platformsocketengine - unknown status
  • tst_qdnslookup - unknown status
  • tst_qdnslookup_appless - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaddressentry - unknown status
  • ...
4313
880}-
881-
882/*!-
883 \since 4.5-
884-
885 Returns \c true if this IP is in the subnet described by the network-
886 prefix \a subnet and netmask \a netmask.-
887-
888 An IP is considered to belong to a subnet if it is contained-
889 between the lowest and the highest address in that subnet. In the-
890 case of IP version 4, the lowest address is the network address,-
891 while the highest address is the broadcast address.-
892-
893 The \a subnet argument does not have to be the actual network-
894 address (the lowest address in the subnet). It can be any valid IP-
895 belonging to that subnet. In particular, if it is equal to the IP-
896 address held by this object, this function will always return true-
897 (provided the netmask is a valid value).-
898-
899 \sa parseSubnet()-
900*/-
901bool QHostAddress::isInSubnet(const QHostAddress &subnet, int netmask) const-
902{-
903 QT_ENSURE_PARSED(this);
executed 12 times by 1 test: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 62 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
12-62
904 if (subnet.protocol() != d->protocol || netmask < 0)
subnet.protoco...!= d->protocolDescription
TRUEevaluated 26 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 48 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
netmask < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 47 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
1-48
905 return false;
executed 27 times by 4 tests: return false;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
27
906-
907 union {-
908 quint32 ip;-
909 quint8 data[4];-
910 } ip4, net4;-
911 const quint8 *ip;-
912 const quint8 *net;-
913 if (d->protocol == QAbstractSocket::IPv4Protocol) {
d->protocol ==...::IPv4ProtocolDescription
TRUEevaluated 26 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 21 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
21-26
914 if (netmask > 32)
netmask > 32Description
TRUEnever evaluated
FALSEevaluated 26 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
0-26
915 netmask = 32;
never executed: netmask = 32;
0
916 ip4.ip = qToBigEndian(d->a);-
917 net4.ip = qToBigEndian(subnet.d->a);-
918 ip = ip4.data;-
919 net = net4.data;-
920 } else if (d->protocol == QAbstractSocket::IPv6Protocol) {
executed 26 times by 4 tests: end of block
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 20 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
1-26
921 if (netmask > 128)
netmask > 128Description
TRUEnever evaluated
FALSEevaluated 20 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
0-20
922 netmask = 128;
never executed: netmask = 128;
0
923 ip = d->a6.c;-
924 net = subnet.d->a6.c;-
925 } else {
executed 20 times by 4 tests: end of block
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
20
926 return false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_qhostaddress - unknown status
1
927 }-
928-
929 if (netmask >= 8 && memcmp(ip, net, netmask / 8) != 0)
netmask >= 8Description
TRUEevaluated 30 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
memcmp(ip, net...mask / 8) != 0Description
TRUEevaluated 13 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 17 times by 4 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
13-30
930 return false;
executed 13 times by 4 tests: return false;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
13
931 if ((netmask & 7) == 0)
(netmask & 7) == 0Description
TRUEevaluated 16 times by 3 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
FALSEevaluated 17 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
16-17
932 return true;
executed 16 times by 3 tests: return true;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_qhostaddress - unknown status
16
933-
934 // compare the last octet now-
935 quint8 bytemask = 256 - (1 << (8 - (netmask & 7)));-
936 quint8 ipbyte = ip[netmask / 8];-
937 quint8 netbyte = net[netmask / 8];-
938 return (ipbyte & bytemask) == (netbyte & bytemask);
executed 17 times by 2 tests: return (ipbyte & bytemask) == (netbyte & bytemask);
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
17
939}-
940-
941/*!-
942 \since 4.5-
943 \overload-
944-
945 Returns \c true if this IP is in the subnet described by \a-
946 subnet. The QHostAddress member of \a subnet contains the network-
947 prefix and the int (second) member contains the netmask (prefix-
948 length).-
949*/-
950bool QHostAddress::isInSubnet(const QPair<QHostAddress, int> &subnet) const-
951{-
952 return isInSubnet(subnet.first, subnet.second);
executed 10 times by 1 test: return isInSubnet(subnet.first, subnet.second);
Executed by:
  • tst_qtcpsocket - unknown status
10
953}-
954-
955-
956/*!-
957 \since 4.5-
958-
959 Parses the IP and subnet information contained in \a subnet and-
960 returns the network prefix for that network and its prefix length.-
961-
962 The IP address and the netmask must be separated by a slash-
963 (/).-
964-
965 This function supports arguments in the form:-
966 \list-
967 \li 123.123.123.123/n where n is any value between 0 and 32-
968 \li 123.123.123.123/255.255.255.255-
969 \li <ipv6-address>/n where n is any value between 0 and 128-
970 \endlist-
971-
972 For IP version 4, this function accepts as well missing trailing-
973 components (i.e., less than 4 octets, like "192.168.1"), followed-
974 or not by a dot. If the netmask is also missing in that case, it-
975 is set to the number of octets actually passed (in the example-
976 above, it would be 24, for 3 octets).-
977-
978 \sa isInSubnet()-
979*/-
980QPair<QHostAddress, int> QHostAddress::parseSubnet(const QString &subnet)-
981{-
982 // We support subnets in the form:-
983 // ddd.ddd.ddd.ddd/nn-
984 // ddd.ddd.ddd/nn-
985 // ddd.ddd/nn-
986 // ddd/nn-
987 // ddd.ddd.ddd.-
988 // ddd.ddd.ddd-
989 // ddd.ddd.-
990 // ddd.ddd-
991 // ddd.-
992 // ddd-
993 // <ipv6-address>/nn-
994 //-
995 // where nn can be an IPv4-style netmask for the IPv4 forms-
996-
997 const QPair<QHostAddress, int> invalid = qMakePair(QHostAddress(), -1);-
998 if (subnet.isEmpty())
subnet.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 85 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
1-85
999 return invalid;
executed 1 time by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
1
1000-
1001 int slash = subnet.indexOf(QLatin1Char('/'));-
1002 QString netStr = subnet;-
1003 if (slash != -1)
slash != -1Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
13-72
1004 netStr.truncate(slash);
executed 72 times by 2 tests: netStr.truncate(slash);
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
72
1005-
1006 int netmask = -1;-
1007 bool isIpv6 = netStr.contains(QLatin1Char(':'));-
1008-
1009 if (slash != -1) {
slash != -1Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
13-72
1010 // is the netmask given in IP-form or in bit-count form?-
1011 if (!isIpv6 && subnet.indexOf(QLatin1Char('.'), slash + 1) != -1) {
!isIpv6Description
TRUEevaluated 40 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
subnet.indexOf...ash + 1) != -1Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
16-40
1012 // IP-style, convert it to bit-count form-
1013 QNetmaskAddress parser;-
1014 if (!parser.setAddress(subnet.mid(slash + 1)))
!parser.setAdd...id(slash + 1))Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
3-13
1015 return invalid;
executed 3 times by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
3
1016 netmask = parser.prefixLength();-
1017 } else {
executed 13 times by 1 test: end of block
Executed by:
  • tst_qhostaddress - unknown status
13
1018 bool ok;-
1019 netmask = subnet.mid(slash + 1).toUInt(&ok);-
1020 if (!ok)
!okDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 52 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
4-52
1021 return invalid; // failed to parse the subnet
executed 4 times by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
4
1022 }
executed 52 times by 2 tests: end of block
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
52
1023 }-
1024-
1025 if (isIpv6) {
isIpv6Description
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 48 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
30-48
1026 // looks like it's an IPv6 address-
1027 if (netmask > 128)
netmask > 128Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 29 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
1-29
1028 return invalid; // invalid netmask
executed 1 time by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
1
1029 if (netmask < 0)
netmask < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
1-28
1030 netmask = 128;
executed 1 time by 1 test: netmask = 128;
Executed by:
  • tst_qhostaddress - unknown status
1
1031-
1032 QHostAddress net;-
1033 if (!net.setAddress(netStr))
!net.setAddress(netStr)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
1-28
1034 return invalid; // failed to parse the IP
executed 1 time by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
1
1035-
1036 clearBits(net.d->a6.c, netmask, 128);-
1037 return qMakePair(net, netmask);
executed 28 times by 2 tests: return qMakePair(net, netmask);
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
28
1038 }-
1039-
1040 if (netmask > 32)
netmask > 32Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 47 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
1-47
1041 return invalid; // invalid netmask
executed 1 time by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
1
1042-
1043 // parse the address manually-
1044 QStringList parts = netStr.split(QLatin1Char('.'));-
1045 if (parts.isEmpty() || parts.count() > 4)
parts.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 47 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
parts.count() > 4Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 45 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
0-47
1046 return invalid; // invalid IPv4 address
executed 2 times by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
2
1047-
1048 if (parts.last().isEmpty())
parts.last().isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 43 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
2-43
1049 parts.removeLast();
executed 2 times by 1 test: parts.removeLast();
Executed by:
  • tst_qhostaddress - unknown status
2
1050-
1051 quint32 addr = 0;-
1052 for (int i = 0; i < parts.count(); ++i) {
i < parts.count()Description
TRUEevaluated 154 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
42-154
1053 bool ok;-
1054 uint byteValue = parts.at(i).toUInt(&ok);-
1055 if (!ok || byteValue > 255)
!okDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
byteValue > 255Description
TRUEnever evaluated
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
0-151
1056 return invalid; // invalid IPv4 address
executed 3 times by 1 test: return invalid;
Executed by:
  • tst_qhostaddress - unknown status
3
1057-
1058 addr <<= 8;-
1059 addr += byteValue;-
1060 }
executed 151 times by 2 tests: end of block
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
151
1061 addr <<= 8 * (4 - parts.count());-
1062 if (netmask == -1) {
netmask == -1Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 35 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
7-35
1063 netmask = 8 * parts.count();-
1064 } else if (netmask == 0) {
executed 7 times by 1 test: end of block
Executed by:
  • tst_qhostaddress - unknown status
netmask == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
3-32
1065 // special case here-
1066 // x86's instructions "shr" and "shl" do not operate when-
1067 // their argument is 32, so the code below doesn't work as expected-
1068 addr = 0;-
1069 } else if (netmask != 32) {
executed 3 times by 1 test: end of block
Executed by:
  • tst_qhostaddress - unknown status
netmask != 32Description
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
2-30
1070 // clear remaining bits-
1071 quint32 mask = quint32(0xffffffff) >> (32 - netmask) << (32 - netmask);-
1072 addr &= mask;-
1073 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
30
1074-
1075 return qMakePair(QHostAddress(addr), netmask);
executed 42 times by 2 tests: return qMakePair(QHostAddress(addr), netmask);
Executed by:
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
42
1076}-
1077-
1078/*!-
1079 \since 5.0-
1080-
1081 returns \c true if the address is the IPv6 loopback address, or any-
1082 of the IPv4 loopback addresses.-
1083*/-
1084bool QHostAddress::isLoopback() const-
1085{-
1086 QT_ENSURE_PARSED(this);
executed 838 times by 11 tests: (this)->d->parse();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 838 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_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 10338 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_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qiodevice - unknown status
  • tst_qnetworkreply - unknown status
  • tst_qobject - unknown status
  • tst_qsocketnotifier - unknown status
  • tst_qsocks5socketengine - unknown status
  • ...
838-10338
1087 if ((d->a & 0xFF000000) == 0x7F000000)
(d->a & 0xFF00... == 0x7F000000Description
TRUEevaluated 2373 times by 22 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkreply - 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 8803 times by 27 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_platformsocketengine - unknown status
  • tst_qhostaddress - 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
  • ...
2373-8803
1088 return true; // v4 range (including IPv6 wrapped IPv4 addresses)
executed 2373 times by 22 tests: return true;
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_platformsocketengine - unknown status
  • tst_qeventloop - unknown status
  • tst_qguieventloop - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - unknown status
  • tst_qnetworkreply - 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
2373
1089 if (d->protocol == QAbstractSocket::IPv6Protocol) {
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 1103 times by 11 tests
Evaluated by:
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
FALSEevaluated 7700 times by 25 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_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - 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
  • tst_qxmlsimplereader - unknown status
1103-7700
1090#ifdef __SSE2__-
1091 const __m128i loopback = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);-
1092 __m128i ipv6 = _mm_loadu_si128((const __m128i *)d->a6.c);-
1093 __m128i cmp = _mm_cmpeq_epi8(ipv6, loopback);-
1094 return _mm_movemask_epi8(cmp) == 0xffff;
executed 1103 times by 11 tests: return _mm_movemask_epi8(cmp) == 0xffff;
Executed by:
  • tst_QHostInfo
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qobject - unknown status
  • tst_qsocks5socketengine - unknown status
  • tst_qtcpsocket - unknown status
1103
1095#else-
1096 if (d->a6_64.c[0] != 0 || qFromBigEndian(d->a6_64.c[1]) != 1)-
1097 return false;-
1098#endif-
1099 return true;
dead code: return true;
-
1100 }-
1101 return false;
executed 7700 times by 25 tests: return 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_Spdy
  • tst_platformsocketengine - unknown status
  • tst_qhostaddress - unknown status
  • tst_qhttpsocketengine - unknown status
  • tst_qimagereader - 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
  • tst_qxmlsimplereader - unknown status
7700
1102}-
1103-
1104/*!-
1105 \since 5.6-
1106-
1107 Returns \c true if the address is an IPv4 or IPv6 multicast address, \c-
1108 false otherwise.-
1109*/-
1110bool QHostAddress::isMulticast() const-
1111{-
1112 QT_ENSURE_PARSED(this);
executed 17 times by 1 test: (this)->d->parse();
Executed by:
  • tst_qhostaddress - unknown status
!(this)->d->isParsedDescription
TRUEevaluated 17 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
8-17
1113 if ((d->a & 0xF0000000) == 0xE0000000)
(d->a & 0xF000... == 0xE0000000Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
4-21
1114 return true; // 224.0.0.0-239.255.255.255 (including v4-mapped IPv6 addresses)
executed 4 times by 1 test: return true;
Executed by:
  • tst_qhostaddress - unknown status
4
1115 if (d->protocol == QAbstractSocket::IPv6Protocol)
d->protocol ==...::IPv6ProtocolDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
10-11
1116 return d->a6.c[0] == 0xff;
executed 11 times by 1 test: return d->a6.c[0] == 0xff;
Executed by:
  • tst_qhostaddress - unknown status
11
1117 return false;
executed 10 times by 1 test: return false;
Executed by:
  • tst_qhostaddress - unknown status
10
1118}-
1119-
1120#ifndef QT_NO_DEBUG_STREAM-
1121QDebug operator<<(QDebug d, const QHostAddress &address)-
1122{-
1123 QDebugStateSaver saver(d);-
1124 d.resetFormat().nospace();-
1125 if (address == QHostAddress::Any)
address == QHostAddress::AnyDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QTcpServer
  • tst_QUdpSocket
0-4
1126 d << "QHostAddress(QHostAddress::Any)";
never executed: d << "QHostAddress(QHostAddress::Any)";
0
1127 else-
1128 d << "QHostAddress(" << address.toString() << ')';
executed 4 times by 2 tests: d << "QHostAddress(" << address.toString() << ')';
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
4
1129 return d;
executed 4 times by 2 tests: return d;
Executed by:
  • tst_QTcpServer
  • tst_QUdpSocket
4
1130}-
1131#endif-
1132-
1133/*!-
1134 \since 5.0-
1135 \relates QHostAddress-
1136 Returns a hash of the host address \a key, using \a seed to seed the calculation.-
1137*/-
1138uint qHash(const QHostAddress &key, uint seed)-
1139{-
1140 // both lines might throw-
1141 QT_ENSURE_PARSED(&key);
never executed: (&key)->d->parse();
!(&key)->d->isParsedDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
0-10
1142 return qHashBits(key.d->a6.c, 16, seed);
executed 10 times by 1 test: return qHashBits(key.d->a6.c, 16, seed);
Executed by:
  • tst_qhostaddress - unknown status
10
1143}-
1144-
1145/*!-
1146 \relates QHostAddress-
1147 \fn operator==(QHostAddress::SpecialAddress lhs, const QHostAddress &rhs)-
1148-
1149 Returns \c true if special address \a lhs is the same as host address \a rhs;-
1150 otherwise returns \c false.-
1151-
1152 \sa isEqual()-
1153*/-
1154#ifndef QT_NO_DATASTREAM-
1155-
1156/*! \relates QHostAddress-
1157-
1158 Writes host address \a address to the stream \a out and returns a reference-
1159 to the stream.-
1160-
1161 \sa {Serializing Qt Data Types}-
1162*/-
1163QDataStream &operator<<(QDataStream &out, const QHostAddress &address)-
1164{-
1165 qint8 prot;-
1166 prot = qint8(address.protocol());-
1167 out << prot;-
1168 switch (address.protocol()) {-
1169 case QAbstractSocket::UnknownNetworkLayerProtocol:
executed 3 times by 1 test: case QAbstractSocket::UnknownNetworkLayerProtocol:
Executed by:
  • tst_qhostaddress - unknown status
3
1170 case QAbstractSocket::AnyIPProtocol:
executed 1 time by 1 test: case QAbstractSocket::AnyIPProtocol:
Executed by:
  • tst_qhostaddress - unknown status
1
1171 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
4
1172 case QAbstractSocket::IPv4Protocol:
executed 5 times by 1 test: case QAbstractSocket::IPv4Protocol:
Executed by:
  • tst_qhostaddress - unknown status
5
1173 out << address.toIPv4Address();-
1174 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
5
1175 case QAbstractSocket::IPv6Protocol:
executed 4 times by 1 test: case QAbstractSocket::IPv6Protocol:
Executed by:
  • tst_qhostaddress - unknown status
4
1176 {-
1177 Q_IPV6ADDR ipv6 = address.toIPv6Address();-
1178 for (int i = 0; i < 16; ++i)
i < 16Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
4-64
1179 out << ipv6[i];
executed 64 times by 1 test: out << ipv6[i];
Executed by:
  • tst_qhostaddress - unknown status
64
1180 out << address.scopeId();-
1181 }-
1182 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
4
1183 }-
1184 return out;
executed 13 times by 1 test: return out;
Executed by:
  • tst_qhostaddress - unknown status
13
1185}-
1186-
1187/*! \relates QHostAddress-
1188-
1189 Reads a host address into \a address from the stream \a in and returns a-
1190 reference to the stream.-
1191-
1192 \sa {Serializing Qt Data Types}-
1193*/-
1194QDataStream &operator>>(QDataStream &in, QHostAddress &address)-
1195{-
1196 qint8 prot;-
1197 in >> prot;-
1198 switch (QAbstractSocket::NetworkLayerProtocol(prot)) {-
1199 case QAbstractSocket::UnknownNetworkLayerProtocol:
executed 3 times by 1 test: case QAbstractSocket::UnknownNetworkLayerProtocol:
Executed by:
  • tst_qhostaddress - unknown status
3
1200 address.clear();-
1201 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
3
1202 case QAbstractSocket::IPv4Protocol:
executed 5 times by 1 test: case QAbstractSocket::IPv4Protocol:
Executed by:
  • tst_qhostaddress - unknown status
5
1203 {-
1204 quint32 ipv4;-
1205 in >> ipv4;-
1206 address.setAddress(ipv4);-
1207 }-
1208 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
5
1209 case QAbstractSocket::IPv6Protocol:
executed 4 times by 1 test: case QAbstractSocket::IPv6Protocol:
Executed by:
  • tst_qhostaddress - unknown status
4
1210 {-
1211 Q_IPV6ADDR ipv6;-
1212 for (int i = 0; i < 16; ++i)
i < 16Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qhostaddress - unknown status
4-64
1213 in >> ipv6[i];
executed 64 times by 1 test: in >> ipv6[i];
Executed by:
  • tst_qhostaddress - unknown status
64
1214 address.setAddress(ipv6);-
1215-
1216 QString scope;-
1217 in >> scope;-
1218 address.setScopeId(scope);-
1219 }-
1220 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
4
1221 case QAbstractSocket::AnyIPProtocol:
executed 1 time by 1 test: case QAbstractSocket::AnyIPProtocol:
Executed by:
  • tst_qhostaddress - unknown status
1
1222 address = QHostAddress::Any;-
1223 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qhostaddress - unknown status
1
1224 default:
never executed: default:
0
1225 address.clear();-
1226 in.setStatus(QDataStream::ReadCorruptData);-
1227 }
never executed: end of block
0
1228 return in;
executed 13 times by 1 test: return in;
Executed by:
  • tst_qhostaddress - unknown status
13
1229}-
1230-
1231#endif //QT_NO_DATASTREAM-
1232-
1233QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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