OpenCoverage

qqmldebugconnection.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qmldebug/qqmldebugconnection.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static const int protocolVersion = 1;-
7static const QString serverId = QLatin1String("QDeclarativeDebugServer");-
8static const QString clientId = QLatin1String("QDeclarativeDebugClient");-
9-
10class QQmlDebugConnectionPrivate : public QObjectPrivate-
11{-
12 inline QQmlDebugConnection* q_func() { return static_cast<QQmlDebugConnection *>(q_ptr); } inline const QQmlDebugConnection* q_func() const { return static_cast<const QQmlDebugConnection *>(q_ptr); } friend class QQmlDebugConnection;-
13-
14public:-
15 QQmlDebugConnectionPrivate();-
16 QPacketProtocol *protocol = nullptr;-
17 QIODevice *device = nullptr;-
18 QLocalServer *server = nullptr;-
19 QEventLoop handshakeEventLoop;-
20 QTimer handshakeTimer;-
21-
22 bool gotHello = false;-
23 int currentDataStreamVersion = QDataStream::Qt_4_7;-
24 int maximumDataStreamVersion = QDataStream::Qt_DefaultCompiledVersion;-
25 QHash <QString, float> serverPlugins;-
26 QHash<QString, QQmlDebugClient *> plugins;-
27 QStringList removedPlugins;-
28-
29 void advertisePlugins();-
30 void createProtocol();-
31 void flush();-
32};-
33-
34QQmlDebugConnectionPrivate::QQmlDebugConnectionPrivate()-
35{-
36 handshakeTimer.setSingleShot(true);-
37 handshakeTimer.setInterval(3000);-
38}
executed 550 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
550
39-
40void QQmlDebugConnectionPrivate::advertisePlugins()-
41{-
42 QQmlDebugConnection * const q = q_func();-
43 if (!q->isConnected()
!q->isConnected()Description
TRUEevaluated 3192 times by 9 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 3208 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
3192-3208
44 return;
executed 3192 times by 9 tests: return;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3192
45-
46 QPacket pack(currentDataStreamVersion);-
47 pack << serverId << 1 << plugins.keys();-
48 protocol->send(pack.data());-
49 flush();-
50}
executed 3208 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3208
51-
52void QQmlDebugConnection::socketConnected()-
53{-
54 QQmlDebugConnectionPrivate * const d = d_func();-
55 QPacket pack(d->currentDataStreamVersion);-
56 pack << serverId << 0 << protocolVersion << d->plugins.keys() << d->maximumDataStreamVersion-
57 << true;-
58 d->protocol->send(pack.data());-
59 d->flush();-
60}
executed 547 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
547
61-
62void QQmlDebugConnection::socketDisconnected()-
63{-
64 QQmlDebugConnectionPrivate * const d = d_func();-
65 d->gotHello = false;-
66 disconnected();-
67}
executed 11 times by 3 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugservice
  • tst_qqmlprofilerservice
11
68-
69void QQmlDebugConnection::protocolReadyRead()-
70{-
71 QQmlDebugConnectionPrivate * const d = d_func();-
72 if (!d->gotHello
!d->gotHelloDescription
TRUEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 7394 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
) {
544-7394
73 QPacket pack(d->currentDataStreamVersion, d->protocol->read());-
74 QString name;-
75-
76 pack >> name;-
77-
78 bool validHello = false;-
79 if (name == clientId
name == clientIdDescription
TRUEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEnever evaluated
) {
0-544
80 int op = -1;-
81 pack >> op;-
82 if (op == 0
op == 0Description
TRUEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEnever evaluated
) {
0-544
83 int version = -1;-
84 pack >> version;-
85 if (version == protocolVersion
version == protocolVersionDescription
TRUEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEnever evaluated
) {
0-544
86 QStringList pluginNames;-
87 QList<float> pluginVersions;-
88 pack >> pluginNames;-
89 if (!pack.atEnd()
!pack.atEnd()Description
TRUEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEnever evaluated
)
0-544
90 pack >> pluginVersions;
executed 544 times by 11 tests: pack >> pluginVersions;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
544
91-
92 const int pluginNamesSize = pluginNames.size();-
93 const int pluginVersionsSize = pluginVersions.size();-
94 for (int i = 0; i < pluginNamesSize
i < pluginNamesSizeDescription
TRUEevaluated 3274 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
; ++i) {
544-3274
95 float pluginVersion = 1.0;-
96 if (i < pluginVersionsSize
i < pluginVersionsSizeDescription
TRUEevaluated 3274 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEnever evaluated
)
0-3274
97 pluginVersion = pluginVersions.at(i);
executed 3274 times by 11 tests: pluginVersion = pluginVersions.at(i);
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3274
98 d->serverPlugins.insert(pluginNames.at(i), pluginVersion);-
99 }
executed 3274 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3274
100-
101 pack >> d->currentDataStreamVersion;-
102 validHello = true;-
103 }
executed 544 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
544
104 }
executed 544 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
544
105 }
executed 544 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
544
106-
107 if (!validHello
!validHelloDescription
TRUEnever evaluated
FALSEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
) {
0-544
108 QMessageLogger(__FILE__, 158, __PRETTY_FUNCTION__).warning("QQmlDebugConnection: Invalid hello message");-
109 close();-
110 return;
never executed: return;
0
111 }-
112 d->gotHello = true;-
113 connected();-
114-
115 QHash<QString, QQmlDebugClient *>::Iterator iter = d->plugins.begin();-
116 for (; iter != d->plugins.end()
iter != d->plugins.end()Description
TRUEevaluated 3166 times by 9 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 544 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
; ++iter) {
544-3166
117 QQmlDebugClient::State newState = QQmlDebugClient::Unavailable;-
118 if (d->serverPlugins.contains(iter.key())
d->serverPlugi...ns(iter.key())Description
TRUEevaluated 2782 times by 9 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 384 times by 6 tests
Evaluated by:
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
384-2782
119 newState = QQmlDebugClient::Enabled;
executed 2782 times by 9 tests: newState = QQmlDebugClient::Enabled;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
2782
120 iter.value()->stateChanged(newState);-
121 }
executed 3166 times by 9 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3166
122-
123 d->handshakeTimer.stop();-
124 d->handshakeEventLoop.quit();-
125 }
executed 544 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
544
126-
127 while (d->protocol->packetsAvailable()
d->protocol->p...etsAvailable()Description
TRUEevaluated 7394 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 7938 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
) {
7394-7938
128 QPacket pack(d->currentDataStreamVersion, d->protocol->read());-
129 QString name;-
130 pack >> name;-
131-
132 if (name == clientId
name == clientIdDescription
TRUEnever evaluated
FALSEevaluated 7394 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
) {
0-7394
133 int op = -1;-
134 pack >> op;-
135-
136 if (op == 1
op == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
137-
138 QHash<QString, float> oldServerPlugins = d->serverPlugins;-
139 d->serverPlugins.clear();-
140-
141 QStringList pluginNames;-
142 QList<float> pluginVersions;-
143 pack >> pluginNames;-
144 if (!pack.atEnd()
!pack.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
145 pack >> pluginVersions;
never executed: pack >> pluginVersions;
0
146-
147 const int pluginNamesSize = pluginNames.size();-
148 const int pluginVersionsSize = pluginVersions.size();-
149 for (int i = 0; i < pluginNamesSize
i < pluginNamesSizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
150 float pluginVersion = 1.0;-
151 if (i < pluginVersionsSize
i < pluginVersionsSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
152 pluginVersion = pluginVersions.at(i);
never executed: pluginVersion = pluginVersions.at(i);
0
153 d->serverPlugins.insert(pluginNames.at(i), pluginVersion);-
154 }
never executed: end of block
0
155-
156 QHash<QString, QQmlDebugClient *>::Iterator iter = d->plugins.begin();-
157 for (; iter != d->plugins.end()
iter != d->plugins.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++iter) {
0
158 const QString pluginName = iter.key();-
159 QQmlDebugClient::State newSate = QQmlDebugClient::Unavailable;-
160 if (d->serverPlugins.contains(pluginName)
d->serverPlugi...ns(pluginName)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
161 newSate = QQmlDebugClient::Enabled;
never executed: newSate = QQmlDebugClient::Enabled;
0
162-
163 if (oldServerPlugins.contains(pluginName)
oldServerPlugi...ns(pluginName)Description
TRUEnever evaluated
FALSEnever evaluated
0
164 != d->serverPlugins.contains(pluginName)
oldServerPlugi...ns(pluginName)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
165 iter.value()->stateChanged(newSate);-
166 }
never executed: end of block
0
167 }
never executed: end of block
0
168 }
never executed: end of block
else {
0
169 QMessageLogger(__FILE__, 219, __PRETTY_FUNCTION__).warning() << "QQmlDebugConnection: Unknown control message id" << op;-
170 }
never executed: end of block
0
171 } else {-
172 QHash<QString, QQmlDebugClient *>::Iterator iter = d->plugins.find(name);-
173 if (iter == d->plugins.end()
iter == d->plugins.end()Description
TRUEevaluated 409 times by 4 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugjs
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 6985 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
) {
409-6985
174-
175-
176 if (!d->removedPlugins.contains(name)
!d->removedPlu...contains(name)Description
TRUEnever evaluated
FALSEevaluated 409 times by 4 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugjs
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
0-409
177 QMessageLogger(__FILE__, 227, __PRETTY_FUNCTION__).warning() << "QQmlDebugConnection: Message received for missing plugin"
never executed: QMessageLogger(__FILE__, 227, __PRETTY_FUNCTION__).warning() << "QQmlDebugConnection: Message received for missing plugin" << name;
0
178 << name;
never executed: QMessageLogger(__FILE__, 227, __PRETTY_FUNCTION__).warning() << "QQmlDebugConnection: Message received for missing plugin" << name;
0
179 }
executed 409 times by 4 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugjs
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
else {
409
180 QQmlDebugClient *client = *iter;-
181 QByteArray message;-
182 while (!pack.atEnd()
!pack.atEnd()Description
TRUEevaluated 3697 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 6985 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
) {
3697-6985
183 pack >> message;-
184 client->messageReceived(message);-
185 }
executed 3697 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3697
186 }
executed 6985 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
6985
187 }-
188 }-
189}
executed 7938 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
7938
190-
191void QQmlDebugConnection::handshakeTimeout()-
192{-
193 QQmlDebugConnectionPrivate * const d = d_func();-
194 if (!d->gotHello
!d->gotHelloDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugservice
FALSEnever evaluated
) {
0-3
195 QMessageLogger(__FILE__, 245, __PRETTY_FUNCTION__).warning() << "QQmlDebugConnection: Did not get handshake answer in time";-
196 d->handshakeEventLoop.quit();-
197 }
executed 3 times by 2 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugservice
3
198}
executed 3 times by 2 tests: end of block
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugservice
3
199-
200QQmlDebugConnection::QQmlDebugConnection(QObject *parent) :-
201 QObject(*(new QQmlDebugConnectionPrivate), parent)-
202{-
203 QQmlDebugConnectionPrivate * const d = d_func();-
204 connect(&d->handshakeTimer, &QTimer::timeout, this, &QQmlDebugConnection::handshakeTimeout);-
205}
executed 550 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
550
206-
207QQmlDebugConnection::~QQmlDebugConnection()-
208{-
209 QQmlDebugConnectionPrivate * const d = d_func();-
210 QHash<QString, QQmlDebugClient*>::iterator iter = d->plugins.begin();-
211 for (; iter != d->plugins.end()
iter != d->plugins.end()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qqmldebugjs
  • tst_qqmlenginedebugservice
FALSEevaluated 550 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
; ++iter)
4-550
212 iter.value()->stateChanged(QQmlDebugClient::NotConnected);
executed 4 times by 2 tests: iter.value()->stateChanged(QQmlDebugClient::NotConnected);
Executed by:
  • tst_qqmldebugjs
  • tst_qqmlenginedebugservice
4
213}
executed 550 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
550
214-
215int QQmlDebugConnection::currentDataStreamVersion() const-
216{-
217 const QQmlDebugConnectionPrivate * const d = d_func();-
218 return
executed 5415 times by 8 tests: return d->currentDataStreamVersion;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
d->currentDataStreamVersion;
executed 5415 times by 8 tests: return d->currentDataStreamVersion;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
5415
219}-
220-
221void QQmlDebugConnection::setMaximumDataStreamVersion(int maximumVersion)-
222{-
223 QQmlDebugConnectionPrivate * const d = d_func();-
224 d->maximumDataStreamVersion = maximumVersion;-
225}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebugservice
2
226-
227bool QQmlDebugConnection::isConnected() const-
228{-
229 const QQmlDebugConnectionPrivate * const d = d_func();-
230 return
executed 26853 times by 11 tests: return d->gotHello;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
d->gotHello;
executed 26853 times by 11 tests: return d->gotHello;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
26853
231}-
232-
233bool QQmlDebugConnection::isConnecting() const-
234{-
235 const QQmlDebugConnectionPrivate * const d = d_func();-
236 return
never executed: return !d->gotHello && d->device;
!d->gotHello && d->device;
never executed: return !d->gotHello && d->device;
0
237}-
238-
239void QQmlDebugConnection::close()-
240{-
241 QQmlDebugConnectionPrivate * const d = d_func();-
242 if (d->gotHello
d->gotHelloDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebugclient
FALSEnever evaluated
) {
0-2
243 d->gotHello = false;-
244 d->device->close();-
245-
246 QHash<QString, QQmlDebugClient*>::iterator iter = d->plugins.begin();-
247 for (; iter != d->plugins.end()
iter != d->plugins.end()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebugclient
; ++iter)
0-2
248 iter.value()->stateChanged(QQmlDebugClient::NotConnected);
never executed: iter.value()->stateChanged(QQmlDebugClient::NotConnected);
0
249 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebugclient
2
250-
251 if (d->device
d->deviceDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebugclient
FALSEnever evaluated
) {
0-2
252 d->device->deleteLater();-
253 d->device = nullptr;-
254 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebugclient
2
255}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebugclient
2
256-
257bool QQmlDebugConnection::waitForConnected(int msecs)-
258{-
259 QQmlDebugConnectionPrivate * const d = d_func();-
260 QAbstractSocket *socket = qobject_cast<QAbstractSocket*>(d->device);-
261 if (!socket
!socketDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
FALSEevaluated 67 times by 5 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
) {
2-67
262 if (!d->server
!d->serverDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
|| (!d->server->hasPendingConnections()
!d->server->ha...gConnections()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
FALSEnever evaluated
&&
0-2
263 !d->server->waitForNewConnection(msecs)
!d->server->wa...nection(msecs)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
))
0-2
264 return
never executed: return false;
false;
never executed: return false;
0
265 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebuglocal
else if (!socket->waitForConnected(msecs)
!socket->waitF...nnected(msecs)Description
TRUEnever evaluated
FALSEevaluated 67 times by 5 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
) {
0-67
266 return
never executed: return false;
false;
never executed: return false;
0
267 }-
268-
269 d->handshakeTimer.start();-
270 d->handshakeEventLoop.exec();-
271 return
executed 69 times by 6 tests: return d->gotHello;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
d->gotHello;
executed 69 times by 6 tests: return d->gotHello;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginedebugservice
69
272}-
273-
274QQmlDebugClient *QQmlDebugConnection::client(const QString &name) const-
275{-
276 const QQmlDebugConnectionPrivate * const d = d_func();-
277 return
executed 3696 times by 8 tests: return d->plugins.value(name, 0);
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
d->plugins.value(name, 0);
executed 3696 times by 8 tests: return d->plugins.value(name, 0);
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3696
278}-
279-
280bool QQmlDebugConnection::addClient(const QString &name, QQmlDebugClient *client)-
281{-
282 QQmlDebugConnectionPrivate * const d = d_func();-
283 if (d->plugins.contains(name)
d->plugins.contains(name)Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebuglocal
FALSEevaluated 3202 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
4-3202
284 return
executed 4 times by 2 tests: return false;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebuglocal
false;
executed 4 times by 2 tests: return false;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebuglocal
4
285 d->removedPlugins.removeAll(name);-
286 d->plugins.insert(name, client);-
287 d->advertisePlugins();-
288 return
executed 3202 times by 11 tests: return true;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
true;
executed 3202 times by 11 tests: return true;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3202
289}-
290-
291bool QQmlDebugConnection::removeClient(const QString &name)-
292{-
293 QQmlDebugConnectionPrivate * const d = d_func();-
294 if (!d->plugins.contains(name)
!d->plugins.contains(name)Description
TRUEnever evaluated
FALSEevaluated 3198 times by 11 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
0-3198
295 return
never executed: return false;
false;
never executed: return false;
0
296 d->plugins.remove(name);-
297 d->removedPlugins.append(name);-
298 d->advertisePlugins();-
299 return
executed 3198 times by 11 tests: return true;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
true;
executed 3198 times by 11 tests: return true;
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
3198
300}-
301-
302float QQmlDebugConnection::serviceVersion(const QString &serviceName) const-
303{-
304 const QQmlDebugConnectionPrivate * const d = d_func();-
305 return
executed 18603 times by 11 tests: return d->serverPlugins.value(serviceName, -1);
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
d->serverPlugins.value(serviceName, -1);
executed 18603 times by 11 tests: return d->serverPlugins.value(serviceName, -1);
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
18603
306}-
307-
308bool QQmlDebugConnection::sendMessage(const QString &name, const QByteArray &message)-
309{-
310 QQmlDebugConnectionPrivate * const d = d_func();-
311 if (!isConnected()
!isConnected()Description
TRUEnever evaluated
FALSEevaluated 1782 times by 9 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
|| !d->serverPlugins.contains(name)
!d->serverPlug...contains(name)Description
TRUEnever evaluated
FALSEevaluated 1782 times by 9 tests
Evaluated by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
0-1782
312 return
never executed: return false;
false;
never executed: return false;
0
313-
314 QPacket pack(d->currentDataStreamVersion);-
315 pack << name << message;-
316 d->protocol->send(pack.data());-
317 d->flush();-
318-
319 return
executed 1782 times by 9 tests: return true;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
true;
executed 1782 times by 9 tests: return true;
Executed by:
  • tst_qqmldebugclient
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
1782
320}-
321-
322void QQmlDebugConnectionPrivate::flush()-
323{-
324 if (QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(device)
QAbstractSocke...ket *>(device)Description
TRUEevaluated 5519 times by 10 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
)
18-5519
325 socket->flush();
executed 5519 times by 10 tests: socket->flush();
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
5519
326 else if (QLocalSocket *socket = qobject_cast<QLocalSocket *>(device)
QLocalSocket *...ket *>(device)Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
FALSEnever evaluated
)
0-18
327 socket->flush();
executed 18 times by 1 test: socket->flush();
Executed by:
  • tst_qqmldebuglocal
18
328}
executed 5537 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
5537
329-
330void QQmlDebugConnection::connectToHost(const QString &hostName, quint16 port)-
331{-
332 QQmlDebugConnectionPrivate * const d = d_func();-
333 if (d->gotHello
d->gotHelloDescription
TRUEnever evaluated
FALSEevaluated 545 times by 10 tests
Evaluated by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
)
0-545
334 close();
never executed: close();
0
335 QTcpSocket *socket = new QTcpSocket(this);-
336 d->device = socket;-
337 d->createProtocol();-
338 connect(socket, &QAbstractSocket::disconnected, this, &QQmlDebugConnection::socketDisconnected);-
339 connect(socket, &QAbstractSocket::connected, this, &QQmlDebugConnection::socketConnected);-
340 connect(socket, static_cast<void(QAbstractSocket::*)(QAbstractSocket::SocketError)>(-
341 &QAbstractSocket::error), this, &QQmlDebugConnection::socketError);-
342 connect(socket, &QAbstractSocket::stateChanged, this, &QQmlDebugConnection::socketStateChanged);-
343 socket->connectToHost(hostName, port);-
344}
executed 545 times by 10 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
545
345-
346void QQmlDebugConnection::startLocalServer(const QString &fileName)-
347{-
348 QQmlDebugConnectionPrivate * const d = d_func();-
349 if (d->gotHello
d->gotHelloDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
)
0-2
350 close();
never executed: close();
0
351 if (d->server
d->serverDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qqmldebuglocal
)
0-2
352 d->server->deleteLater();
never executed: d->server->deleteLater();
0
353 d->server = new QLocalServer(this);-
354-
355 connect(d->server, &QLocalServer::newConnection,-
356 this, &QQmlDebugConnection::newConnection, Qt::QueuedConnection);-
357 d->server->listen(fileName);-
358}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebuglocal
2
359-
360class LocalSocketSignalTranslator : public QObject-
361{-
362 public:-
363#pragma GCC diagnostic push-
364 -
365#pragma GCC diagnostic ignored "-Wsuggest-override"-
366 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private:-
367#pragma GCC diagnostic ignored "-Wattributes"-
368 __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
369#pragma GCC diagnostic pop-
370 struct QPrivateSignal {};-
371public:-
372 LocalSocketSignalTranslator(QLocalSocket *parent) : QObject(parent)-
373 {-
374 connect(parent, &QLocalSocket::stateChanged,-
375 this, &LocalSocketSignalTranslator::onStateChanged);-
376 connect(parent, static_cast<void(QLocalSocket::*)(QLocalSocket::LocalSocketError)>(-
377 &QLocalSocket::error), this, &LocalSocketSignalTranslator::onError);-
378 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebuglocal
2
379-
380 void onError(QLocalSocket::LocalSocketError error)-
381 {-
382 socketError(static_cast<QAbstractSocket::SocketError>(error));-
383 }
never executed: end of block
0
384-
385 void onStateChanged(QLocalSocket::LocalSocketState state)-
386 {-
387 socketStateChanged(static_cast<QAbstractSocket::SocketState>(state));-
388 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qqmldebuglocal
4
389-
390public :-
391 void socketError(QAbstractSocket::SocketError error);-
392 void socketStateChanged(QAbstractSocket::SocketState state);-
393};-
394-
395void QQmlDebugConnection::newConnection()-
396{-
397 QQmlDebugConnectionPrivate * const d = d_func();-
398 delete d->device;-
399 QLocalSocket *socket = d->server->nextPendingConnection();-
400 d->server->close();-
401 d->device = socket;-
402 d->createProtocol();-
403 connect(socket, &QLocalSocket::disconnected, this, &QQmlDebugConnection::socketDisconnected);-
404 LocalSocketSignalTranslator *translator = new LocalSocketSignalTranslator(socket);-
405-
406 connect(translator, &LocalSocketSignalTranslator::socketError,-
407 this, &QQmlDebugConnection::socketError);-
408 connect(translator, &LocalSocketSignalTranslator::socketStateChanged,-
409 this, &QQmlDebugConnection::socketStateChanged);-
410 socketConnected();-
411}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qqmldebuglocal
2
412-
413void QQmlDebugConnectionPrivate::createProtocol()-
414{-
415 QQmlDebugConnection * const q = q_func();-
416 delete protocol;-
417 protocol = new QPacketProtocol(device, q);-
418 QObject::connect(protocol, &QPacketProtocol::readyRead,-
419 q, &QQmlDebugConnection::protocolReadyRead);-
420}
executed 547 times by 11 tests: end of block
Executed by:
  • tst_qdebugmessageservice
  • tst_qqmldebugclient
  • tst_qqmldebuggingenabler
  • tst_qqmldebugjs
  • tst_qqmldebuglocal
  • tst_qqmldebugservice
  • tst_qqmlenginecontrol
  • tst_qqmlenginedebuginspectorintegration
  • tst_qqmlenginedebugservice
  • tst_qqmlinspector
  • tst_qqmlprofilerservice
547
421-
422-
423-
424-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0