qlocalsocket.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/network/socket/qlocalsocket.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QLocalSocket::QLocalSocket(QObject * parent)-
6 : QIODevice(*new QLocalSocketPrivate, parent)-
7{-
8 QLocalSocketPrivate * const d = d_func();-
9 d->init();-
10}
executed 165 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_qlocalsocket - unknown status
165
11-
12-
13-
14-
15QLocalSocket::~QLocalSocket()-
16{-
17 close();-
18-
19 QLocalSocketPrivate * const d = d_func();-
20 d->unixSocket.setParent(0);-
21-
22}
executed 165 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_qlocalsocket - unknown status
165
23-
24bool QLocalSocket::open(OpenMode openMode)-
25{-
26 connectToServer(openMode);-
27 return
executed 1 time by 1 test: return isOpen();
Executed by:
  • tst_qlocalsocket - unknown status
isOpen();
executed 1 time by 1 test: return isOpen();
Executed by:
  • tst_qlocalsocket - unknown status
1
28}-
29void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)-
30{-
31 setServerName(name);-
32 connectToServer(openMode);-
33}
executed 88 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
88
34void QLocalSocket::setServerName(const QString & name)-
35{-
36 QLocalSocketPrivate * const d = d_func();-
37 if (d->state != UnconnectedState
d->state != UnconnectedStateDescription
TRUEnever evaluated
FALSEevaluated 89 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
) {
0-89
38 QMessageLogger(__FILE__, 401, __PRETTY_FUNCTION__).warning("QLocalSocket::setServerName() called while not in unconnected state");-
39 return;
never executed: return;
0
40 }-
41 d->serverName = name;-
42}
executed 89 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
89
43QString QLocalSocket::serverName() const-
44{-
45 const QLocalSocketPrivate * const d = d_func();-
46 return
executed 15 times by 1 test: return d->serverName;
Executed by:
  • tst_qlocalsocket - unknown status
d->serverName;
executed 15 times by 1 test: return d->serverName;
Executed by:
  • tst_qlocalsocket - unknown status
15
47}-
48QString QLocalSocket::fullServerName() const-
49{-
50 const QLocalSocketPrivate * const d = d_func();-
51 return
executed 15 times by 1 test: return d->fullServerName;
Executed by:
  • tst_qlocalsocket - unknown status
d->fullServerName;
executed 15 times by 1 test: return d->fullServerName;
Executed by:
  • tst_qlocalsocket - unknown status
15
52}-
53-
54-
55-
56-
57-
58-
59QLocalSocket::LocalSocketState QLocalSocket::state() const-
60{-
61 const QLocalSocketPrivate * const d = d_func();-
62 return
executed 2780 times by 3 tests: return d->state;
Executed by:
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_qlocalsocket - unknown status
d->state;
executed 2780 times by 3 tests: return d->state;
Executed by:
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_qlocalsocket - unknown status
2780
63}-
64-
65-
66-
67bool QLocalSocket::isSequential() const-
68{-
69 return
executed 306 times by 2 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
true;
executed 306 times by 2 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_qlocalsocket - unknown status
306
70}-
71QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketError error)-
72{-
73 QDebugStateSaver saver(debug);-
74 debug.resetFormat().nospace();-
75 switch (error) {-
76 case
executed 1 time by 1 test: case QLocalSocket::ConnectionRefusedError:
Executed by:
  • tst_qlocalsocket - unknown status
QLocalSocket::ConnectionRefusedError:
executed 1 time by 1 test: case QLocalSocket::ConnectionRefusedError:
Executed by:
  • tst_qlocalsocket - unknown status
1
77 debug << "QLocalSocket::ConnectionRefusedError";-
78 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qlocalsocket - unknown status
1
79 case
never executed: case QLocalSocket::PeerClosedError:
QLocalSocket::PeerClosedError:
never executed: case QLocalSocket::PeerClosedError:
0
80 debug << "QLocalSocket::PeerClosedError";-
81 break;
never executed: break;
0
82 case
never executed: case QLocalSocket::ServerNotFoundError:
QLocalSocket::ServerNotFoundError:
never executed: case QLocalSocket::ServerNotFoundError:
0
83 debug << "QLocalSocket::ServerNotFoundError";-
84 break;
never executed: break;
0
85 case
never executed: case QLocalSocket::SocketAccessError:
QLocalSocket::SocketAccessError:
never executed: case QLocalSocket::SocketAccessError:
0
86 debug << "QLocalSocket::SocketAccessError";-
87 break;
never executed: break;
0
88 case
never executed: case QLocalSocket::SocketResourceError:
QLocalSocket::SocketResourceError:
never executed: case QLocalSocket::SocketResourceError:
0
89 debug << "QLocalSocket::SocketResourceError";-
90 break;
never executed: break;
0
91 case
never executed: case QLocalSocket::SocketTimeoutError:
QLocalSocket::SocketTimeoutError:
never executed: case QLocalSocket::SocketTimeoutError:
0
92 debug << "QLocalSocket::SocketTimeoutError";-
93 break;
never executed: break;
0
94 case
never executed: case QLocalSocket::DatagramTooLargeError:
QLocalSocket::DatagramTooLargeError:
never executed: case QLocalSocket::DatagramTooLargeError:
0
95 debug << "QLocalSocket::DatagramTooLargeError";-
96 break;
never executed: break;
0
97 case
never executed: case QLocalSocket::ConnectionError:
QLocalSocket::ConnectionError:
never executed: case QLocalSocket::ConnectionError:
0
98 debug << "QLocalSocket::ConnectionError";-
99 break;
never executed: break;
0
100 case
never executed: case QLocalSocket::UnsupportedSocketOperationError:
QLocalSocket::UnsupportedSocketOperationError:
never executed: case QLocalSocket::UnsupportedSocketOperationError:
0
101 debug << "QLocalSocket::UnsupportedSocketOperationError";-
102 break;
never executed: break;
0
103 case
never executed: case QLocalSocket::UnknownSocketError:
QLocalSocket::UnknownSocketError:
never executed: case QLocalSocket::UnknownSocketError:
0
104 debug << "QLocalSocket::UnknownSocketError";-
105 break;
never executed: break;
0
106 default
never executed: default:
:
never executed: default:
0
107 debug << "QLocalSocket::SocketError(" << int(error) << ')';-
108 break;
never executed: break;
0
109 }-
110 return
executed 1 time by 1 test: return debug;
Executed by:
  • tst_qlocalsocket - unknown status
debug;
executed 1 time by 1 test: return debug;
Executed by:
  • tst_qlocalsocket - unknown status
1
111}-
112-
113QDebug operator<<(QDebug debug, QLocalSocket::LocalSocketState state)-
114{-
115 QDebugStateSaver saver(debug);-
116 debug.resetFormat().nospace();-
117 switch (state) {-
118 case
executed 1 time by 1 test: case QLocalSocket::UnconnectedState:
Executed by:
  • tst_qlocalsocket - unknown status
QLocalSocket::UnconnectedState:
executed 1 time by 1 test: case QLocalSocket::UnconnectedState:
Executed by:
  • tst_qlocalsocket - unknown status
1
119 debug << "QLocalSocket::UnconnectedState";-
120 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qlocalsocket - unknown status
1
121 case
never executed: case QLocalSocket::ConnectingState:
QLocalSocket::ConnectingState:
never executed: case QLocalSocket::ConnectingState:
0
122 debug << "QLocalSocket::ConnectingState";-
123 break;
never executed: break;
0
124 case
never executed: case QLocalSocket::ConnectedState:
QLocalSocket::ConnectedState:
never executed: case QLocalSocket::ConnectedState:
0
125 debug << "QLocalSocket::ConnectedState";-
126 break;
never executed: break;
0
127 case
never executed: case QLocalSocket::ClosingState:
QLocalSocket::ClosingState:
never executed: case QLocalSocket::ClosingState:
0
128 debug << "QLocalSocket::ClosingState";-
129 break;
never executed: break;
0
130 default
never executed: default:
:
never executed: default:
0
131 debug << "QLocalSocket::SocketState(" << int(state) << ')';-
132 break;
never executed: break;
0
133 }-
134 return
executed 1 time by 1 test: return debug;
Executed by:
  • tst_qlocalsocket - unknown status
debug;
executed 1 time by 1 test: return debug;
Executed by:
  • tst_qlocalsocket - unknown status
1
135}-
136-
137-
138-
139-
140-
141-
Switch to Source codePreprocessed file

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