qbearerengine.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/bearer/qbearerengine.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtNetwork module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qbearerengine_p.h"-
35-
36#ifndef QT_NO_BEARERMANAGEMENT-
37-
38QT_BEGIN_NAMESPACE-
39-
40QBearerEngine::QBearerEngine(QObject *parent)-
41 : QObject(parent), mutex(QMutex::Recursive)-
42{-
43}
executed 54 times by 16 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_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
54
44-
45QBearerEngine::~QBearerEngine()-
46{-
47 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator it;-
48 QHash<QString, QNetworkConfigurationPrivatePointer>::Iterator end;-
49-
50 for (it = snapConfigurations.begin(), end = snapConfigurations.end(); it != end; ++it) {
it != endDescription
TRUEnever evaluated
FALSEevaluated 58 times by 34 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_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • ...
0-58
51 it.value()->isValid = false;-
52 it.value()->id.clear();-
53 }
never executed: end of block
0
54 snapConfigurations.clear();-
55-
56 for (it = accessPointConfigurations.begin(), end = accessPointConfigurations.end();-
57 it != end; ++it) {
it != endDescription
TRUEevaluated 60 times by 19 tests
Evaluated by:
  • tst_QNetworkConfigurationManager
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkinterface - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qnetworksession - unknown status
  • tst_qtcpserver - unknown status
  • tst_qudpsocket - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
FALSEevaluated 58 times by 34 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_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • ...
58-60
58 it.value()->isValid = false;-
59 it.value()->id.clear();-
60 }
executed 60 times by 19 tests: end of block
Executed by:
  • tst_QNetworkConfigurationManager
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • tst_qnetworkdiskcache - unknown status
  • tst_qnetworkinterface - unknown status
  • tst_qnetworkproxyfactory - unknown status
  • tst_qnetworksession - unknown status
  • tst_qtcpserver - unknown status
  • tst_qudpsocket - unknown status
  • tst_qxmlinputsource - unknown status
  • tst_qxmlstream - unknown status
  • tst_spdy - unknown status
60
61 accessPointConfigurations.clear();-
62-
63 for (it = userChoiceConfigurations.begin(), end = userChoiceConfigurations.end();-
64 it != end; ++it) {
it != endDescription
TRUEnever evaluated
FALSEevaluated 58 times by 34 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_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • ...
0-58
65 it.value()->isValid = false;-
66 it.value()->id.clear();-
67 }
never executed: end of block
0
68 userChoiceConfigurations.clear();-
69}
executed 58 times by 34 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_networkselftest - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qftp - unknown status
  • tst_qhostinfo - unknown status
  • tst_qhttpnetworkconnection - unknown status
  • tst_qnetworkaccessmanager - unknown status
  • tst_qnetworkaccessmanager_and_qprogressdialog - unknown status
  • tst_qnetworkconfiguration - unknown status
  • tst_qnetworkconfigurationmanager - unknown status
  • ...
58
70-
71bool QBearerEngine::requiresPolling() const-
72{-
73 return false;
executed 125 times by 18 tests: return false;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFtp
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkConfiguration
  • tst_QNetworkConfigurationManager
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • tst_qnetworkaccessmanager - unknown status
125
74}-
75-
76/*-
77 Returns \c true if configurations are in use; otherwise returns \c false.-
78-
79 If configurations are in use and requiresPolling() returns \c true, polling will be enabled for-
80 this engine.-
81*/-
82bool QBearerEngine::configurationsInUse() const-
83{-
84 QHash<QString, QNetworkConfigurationPrivatePointer>::ConstIterator it;-
85 QHash<QString, QNetworkConfigurationPrivatePointer>::ConstIterator end;-
86-
87 QMutexLocker locker(&mutex);-
88-
89 for (it = accessPointConfigurations.constBegin(),-
90 end = accessPointConfigurations.constEnd(); it != end; ++it) {
it != endDescription
TRUEevaluated 12 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
FALSEevaluated 6 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
6-12
91 if (it.value()->ref.load() > 1)
it.value()->ref.load() > 1Description
TRUEnever evaluated
FALSEevaluated 12 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
0-12
92 return true;
never executed: return true;
0
93 }
executed 12 times by 4 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
12
94-
95 for (it = snapConfigurations.constBegin(),-
96 end = snapConfigurations.constEnd(); it != end; ++it) {
it != endDescription
TRUEnever evaluated
FALSEevaluated 6 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
0-6
97 if (it.value()->ref.load() > 1)
it.value()->ref.load() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
98 return true;
never executed: return true;
0
99 }
never executed: end of block
0
100-
101 for (it = userChoiceConfigurations.constBegin(),-
102 end = userChoiceConfigurations.constEnd(); it != end; ++it) {
it != endDescription
TRUEnever evaluated
FALSEevaluated 6 times by 4 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
0-6
103 if (it.value()->ref.load() > 1)
it.value()->ref.load() > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
104 return true;
never executed: return true;
0
105 }
never executed: end of block
0
106-
107 return false;
executed 6 times by 4 tests: return false;
Executed by:
  • tst_QFtp
  • tst_QNetworkConfigurationManager
  • tst_QTcpServer
  • tst_qnetworkaccessmanager - unknown status
6
108}-
109-
110#include "moc_qbearerengine_p.cpp"-
111-
112#endif // QT_NO_BEARERMANAGEMENT-
113-
114QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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