OpenCoverage

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

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