OpenCoverage

qqmlenginecontrolclient.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qmldebug/qqmlenginecontrolclient.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QQmlEngineControlClient::QQmlEngineControlClient(QQmlDebugConnection *connection) :-
6 QQmlDebugClient(*(new QQmlEngineControlClientPrivate(connection)))-
7{-
8}
executed 44 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
44
9-
10QQmlEngineControlClient::QQmlEngineControlClient(QQmlEngineControlClientPrivate &dd) :-
11 QQmlDebugClient(dd)-
12{-
13}
never executed: end of block
0
14void QQmlEngineControlClient::blockEngine(int engineId)-
15{-
16 QQmlEngineControlClientPrivate * const d = d_func();-
17 ((d->blockedEngines.contains(engineId)) ? static_cast<void>(0) : qt_assert("d->blockedEngines.contains(engineId)", __FILE__, 70));-
18 d->blockedEngines[engineId].blockers++;-
19}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
16
20-
21-
22-
23-
24-
25void QQmlEngineControlClient::releaseEngine(int engineId)-
26{-
27 QQmlEngineControlClientPrivate * const d = d_func();-
28 ((d->blockedEngines.contains(engineId)) ? static_cast<void>(0) : qt_assert("d->blockedEngines.contains(engineId)", __FILE__, 81));-
29-
30 QQmlEngineControlClientPrivate::EngineState &state = d->blockedEngines[engineId];-
31 if (--
--state.blockers == 0Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
FALSEnever evaluated
state.blockers == 0
--state.blockers == 0Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
FALSEnever evaluated
) {
0-16
32 ((state.releaseCommand != QQmlEngineControlClientPrivate::InvalidCommand) ? static_cast<void>(0) : qt_assert("state.releaseCommand != QQmlEngineControlClientPrivate::InvalidCommand", __FILE__, 85));-
33 d->sendCommand(state.releaseCommand, engineId);-
34 d->blockedEngines.remove(engineId);-
35 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
16
36}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
16
37-
38QList<int> QQmlEngineControlClient::blockedEngines() const-
39{-
40 const QQmlEngineControlClientPrivate * const d = d_func();-
41 return
executed 108 times by 2 tests: return d->blockedEngines.keys();
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
d->blockedEngines.keys();
executed 108 times by 2 tests: return d->blockedEngines.keys();
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
108
42}-
43-
44void QQmlEngineControlClient::messageReceived(const QByteArray &data)-
45{-
46 QQmlEngineControlClientPrivate * const d = d_func();-
47 QPacket stream(d->connection->currentDataStreamVersion(), data);-
48 qint32 message;-
49 qint32 id;-
50 QString name;-
51-
52 stream >> message >> id;-
53-
54 if (!stream.atEnd()
!stream.atEnd()Description
TRUEnever evaluated
FALSEevaluated 92 times by 2 tests
Evaluated by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
)
0-92
55 stream >> name;
never executed: stream >> name;
0
56-
57 auto handleWaiting = [&](-
58 QQmlEngineControlClientPrivate::CommandType command, std::function<void()> emitter) {-
59 QQmlEngineControlClientPrivate::EngineState &state = d->blockedEngines[id];-
60 ((state.blockers == 0) ? static_cast<void>(0) : qt_assert("state.blockers == 0", __FILE__, 113));-
61 ((state.releaseCommand == QQmlEngineControlClientPrivate::InvalidCommand) ? static_cast<void>(0) : qt_assert("state.releaseCommand == QQmlEngineControlClientPrivate::InvalidCommand", __FILE__, 114));-
62 state.releaseCommand = command;-
63 emitter();-
64 if (state.blockers == 0
state.blockers == 0Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qqmlprofilerservice
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
) {
16-30
65 d->sendCommand(state.releaseCommand, id);-
66 d->blockedEngines.remove(id);-
67 }
executed 30 times by 1 test: end of block
Executed by:
  • tst_qqmlprofilerservice
30
68 }
executed 46 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
;
46
69-
70 switch (message) {-
71 case
executed 36 times by 2 tests: case QQmlEngineControlClientPrivate::EngineAboutToBeAdded:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
QQmlEngineControlClientPrivate::EngineAboutToBeAdded:
executed 36 times by 2 tests: case QQmlEngineControlClientPrivate::EngineAboutToBeAdded:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
36
72 handleWaiting(QQmlEngineControlClientPrivate::StartWaitingEngine, [&](){-
73 engineAboutToBeAdded(id, name);-
74 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
)
;
36
75 break;
executed 36 times by 2 tests: break;
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
36
76 case
executed 36 times by 2 tests: case QQmlEngineControlClientPrivate::EngineAdded:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
QQmlEngineControlClientPrivate::EngineAdded:
executed 36 times by 2 tests: case QQmlEngineControlClientPrivate::EngineAdded:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
36
77 engineAdded(id, name);-
78 break;
executed 36 times by 2 tests: break;
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
36
79 case
executed 10 times by 2 tests: case QQmlEngineControlClientPrivate::EngineAboutToBeRemoved:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
QQmlEngineControlClientPrivate::EngineAboutToBeRemoved:
executed 10 times by 2 tests: case QQmlEngineControlClientPrivate::EngineAboutToBeRemoved:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
10
80 handleWaiting(QQmlEngineControlClientPrivate::StopWaitingEngine, [&](){-
81 engineAboutToBeRemoved(id, name);-
82 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
)
;
10
83 break;
executed 10 times by 2 tests: break;
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
10
84 case
executed 10 times by 2 tests: case QQmlEngineControlClientPrivate::EngineRemoved:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
QQmlEngineControlClientPrivate::EngineRemoved:
executed 10 times by 2 tests: case QQmlEngineControlClientPrivate::EngineRemoved:
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
10
85 engineRemoved(id, name);-
86 break;
executed 10 times by 2 tests: break;
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
10
87 }-
88}
executed 92 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
92
89-
90QQmlEngineControlClientPrivate::QQmlEngineControlClientPrivate(QQmlDebugConnection *connection) :-
91 QQmlDebugClientPrivate(QLatin1String("EngineControl"), connection)-
92{-
93}
executed 44 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
44
94-
95void QQmlEngineControlClientPrivate::sendCommand(-
96 QQmlEngineControlClientPrivate::CommandType command, int engineId)-
97{-
98 QQmlEngineControlClient * const q = q_func();-
99 QPacket stream(connection->currentDataStreamVersion());-
100 stream << static_cast<qint32>(command) << engineId;-
101 q->sendMessage(stream.data());-
102}
executed 46 times by 2 tests: end of block
Executed by:
  • tst_qqmlenginecontrol
  • tst_qqmlprofilerservice
46
103-
104-
105-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0