Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/network/socket/qlocalsocket.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | QLocalSocket::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:
| 165 | ||||||
11 | - | |||||||
12 | - | |||||||
13 | - | |||||||
14 | - | |||||||
15 | QLocalSocket::~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:
| 165 | ||||||
23 | - | |||||||
24 | bool QLocalSocket::open(OpenMode openMode) | - | ||||||
25 | { | - | ||||||
26 | connectToServer(openMode); | - | ||||||
27 | return executed 1 time by 1 test: isOpen();return isOpen(); Executed by:
executed 1 time by 1 test: return isOpen(); Executed by:
| 1 | ||||||
28 | } | - | ||||||
29 | void 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:
| 88 | ||||||
34 | void QLocalSocket::setServerName(const QString & name) | - | ||||||
35 | { | - | ||||||
36 | QLocalSocketPrivate * const d = d_func(); | - | ||||||
37 | if (d->state != UnconnectedState
| 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:
| 89 | ||||||
43 | QString QLocalSocket::serverName() const | - | ||||||
44 | { | - | ||||||
45 | const QLocalSocketPrivate * const d = d_func(); | - | ||||||
46 | return executed 15 times by 1 test: d->serverName;return d->serverName; Executed by:
executed 15 times by 1 test: return d->serverName; Executed by:
| 15 | ||||||
47 | } | - | ||||||
48 | QString QLocalSocket::fullServerName() const | - | ||||||
49 | { | - | ||||||
50 | const QLocalSocketPrivate * const d = d_func(); | - | ||||||
51 | return executed 15 times by 1 test: d->fullServerName;return d->fullServerName; Executed by:
executed 15 times by 1 test: return d->fullServerName; Executed by:
| 15 | ||||||
52 | } | - | ||||||
53 | - | |||||||
54 | - | |||||||
55 | - | |||||||
56 | - | |||||||
57 | - | |||||||
58 | - | |||||||
59 | QLocalSocket::LocalSocketState QLocalSocket::state() const | - | ||||||
60 | { | - | ||||||
61 | const QLocalSocketPrivate * const d = d_func(); | - | ||||||
62 | return executed 2780 times by 3 tests: d->state;return d->state; Executed by:
executed 2780 times by 3 tests: return d->state; Executed by:
| 2780 | ||||||
63 | } | - | ||||||
64 | - | |||||||
65 | - | |||||||
66 | - | |||||||
67 | bool QLocalSocket::isSequential() const | - | ||||||
68 | { | - | ||||||
69 | return executed 306 times by 2 tests: true;return true; Executed by:
executed 306 times by 2 tests: return true; Executed by:
| 306 | ||||||
70 | } | - | ||||||
71 | QDebug 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: QLocalSocket::ConnectionRefusedError:case QLocalSocket::ConnectionRefusedError: Executed by:
executed 1 time by 1 test: case QLocalSocket::ConnectionRefusedError: Executed by:
| 1 | ||||||
77 | debug << "QLocalSocket::ConnectionRefusedError"; | - | ||||||
78 | break; executed 1 time by 1 test: break; Executed by:
| 1 | ||||||
79 | case never executed: QLocalSocket::PeerClosedError:case QLocalSocket::PeerClosedError: never executed: case QLocalSocket::PeerClosedError: | 0 | ||||||
80 | debug << "QLocalSocket::PeerClosedError"; | - | ||||||
81 | break; never executed: break; | 0 | ||||||
82 | case never executed: QLocalSocket::ServerNotFoundError:case QLocalSocket::ServerNotFoundError: never executed: case QLocalSocket::ServerNotFoundError: | 0 | ||||||
83 | debug << "QLocalSocket::ServerNotFoundError"; | - | ||||||
84 | break; never executed: break; | 0 | ||||||
85 | case never executed: QLocalSocket::SocketAccessError:case QLocalSocket::SocketAccessError: never executed: case QLocalSocket::SocketAccessError: | 0 | ||||||
86 | debug << "QLocalSocket::SocketAccessError"; | - | ||||||
87 | break; never executed: break; | 0 | ||||||
88 | case never executed: QLocalSocket::SocketResourceError:case QLocalSocket::SocketResourceError: never executed: case QLocalSocket::SocketResourceError: | 0 | ||||||
89 | debug << "QLocalSocket::SocketResourceError"; | - | ||||||
90 | break; never executed: break; | 0 | ||||||
91 | case never executed: QLocalSocket::SocketTimeoutError:case QLocalSocket::SocketTimeoutError: never executed: case QLocalSocket::SocketTimeoutError: | 0 | ||||||
92 | debug << "QLocalSocket::SocketTimeoutError"; | - | ||||||
93 | break; never executed: break; | 0 | ||||||
94 | case never executed: QLocalSocket::DatagramTooLargeError:case QLocalSocket::DatagramTooLargeError: never executed: case QLocalSocket::DatagramTooLargeError: | 0 | ||||||
95 | debug << "QLocalSocket::DatagramTooLargeError"; | - | ||||||
96 | break; never executed: break; | 0 | ||||||
97 | case never executed: QLocalSocket::ConnectionError:case QLocalSocket::ConnectionError: never executed: case QLocalSocket::ConnectionError: | 0 | ||||||
98 | debug << "QLocalSocket::ConnectionError"; | - | ||||||
99 | break; never executed: break; | 0 | ||||||
100 | case never executed: QLocalSocket::UnsupportedSocketOperationError:case QLocalSocket::UnsupportedSocketOperationError: never executed: case QLocalSocket::UnsupportedSocketOperationError: | 0 | ||||||
101 | debug << "QLocalSocket::UnsupportedSocketOperationError"; | - | ||||||
102 | break; never executed: break; | 0 | ||||||
103 | case never executed: QLocalSocket::UnknownSocketError:case 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: debug;return debug; Executed by:
executed 1 time by 1 test: return debug; Executed by:
| 1 | ||||||
111 | } | - | ||||||
112 | - | |||||||
113 | QDebug 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: QLocalSocket::UnconnectedState:case QLocalSocket::UnconnectedState: Executed by:
executed 1 time by 1 test: case QLocalSocket::UnconnectedState: Executed by:
| 1 | ||||||
119 | debug << "QLocalSocket::UnconnectedState"; | - | ||||||
120 | break; executed 1 time by 1 test: break; Executed by:
| 1 | ||||||
121 | case never executed: QLocalSocket::ConnectingState:case QLocalSocket::ConnectingState: never executed: case QLocalSocket::ConnectingState: | 0 | ||||||
122 | debug << "QLocalSocket::ConnectingState"; | - | ||||||
123 | break; never executed: break; | 0 | ||||||
124 | case never executed: QLocalSocket::ConnectedState:case QLocalSocket::ConnectedState: never executed: case QLocalSocket::ConnectedState: | 0 | ||||||
125 | debug << "QLocalSocket::ConnectedState"; | - | ||||||
126 | break; never executed: break; | 0 | ||||||
127 | case never executed: QLocalSocket::ClosingState:case 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: debug;return debug; Executed by:
executed 1 time by 1 test: return debug; Executed by:
| 1 | ||||||
135 | } | - | ||||||
136 | - | |||||||
137 | - | |||||||
138 | - | |||||||
139 | - | |||||||
140 | - | |||||||
141 | - | |||||||
Switch to Source code | Preprocessed file |