qsignaltransition.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/statemachine/qsignaltransition.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QSignalTransitionPrivate::QSignalTransitionPrivate()-
7{-
8 sender = 0;-
9 signalIndex = -1;-
10}
executed 74 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
74
11-
12void QSignalTransitionPrivate::unregister()-
13{-
14 QSignalTransition * const q = q_func();-
15 if ((
(signalIndex == -1)Description
TRUEevaluated 100010 times by 1 test
Evaluated by:
  • tst_QStateMachine
FALSEevaluated 100003 times by 1 test
Evaluated by:
  • tst_QStateMachine
signalIndex == -1)
(signalIndex == -1)Description
TRUEevaluated 100010 times by 1 test
Evaluated by:
  • tst_QStateMachine
FALSEevaluated 100003 times by 1 test
Evaluated by:
  • tst_QStateMachine
|| !machine()
!machine()Description
TRUEnever evaluated
FALSEevaluated 100003 times by 1 test
Evaluated by:
  • tst_QStateMachine
)
0-100010
16 return;
executed 100010 times by 1 test: return;
Executed by:
  • tst_QStateMachine
100010
17 QStateMachinePrivate::get(machine())->unregisterSignalTransition(q);-
18}
executed 100003 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
100003
19-
20void QSignalTransitionPrivate::maybeRegister()-
21{-
22 QSignalTransition * const q = q_func();-
23 if (QStateMachine *mach = machine()
QStateMachine ...ch = machine()Description
TRUEevaluated 200010 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
FALSEevaluated 71 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
)
71-200010
24 QStateMachinePrivate::get(mach)->maybeRegisterSignalTransition(q);
executed 200010 times by 2 tests: QStateMachinePrivate::get(mach)->maybeRegisterSignalTransition(q);
Executed by:
  • tst_QState
  • tst_QStateMachine
200010
25}
executed 200081 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
200081
26-
27-
28-
29-
30QSignalTransition::QSignalTransition(QState *sourceState)-
31 : QAbstractTransition(*new QSignalTransitionPrivate, sourceState)-
32{-
33}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
6
34-
35-
36-
37-
38-
39QSignalTransition::QSignalTransition(const QObject *sender, const char *signal,-
40 QState *sourceState)-
41 : QAbstractTransition(*new QSignalTransitionPrivate, sourceState)-
42{-
43 QSignalTransitionPrivate * const d = d_func();-
44 d->sender = sender;-
45 d->signal = signal;-
46 d->maybeRegister();-
47}
executed 68 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
68
48QSignalTransition::~QSignalTransition()-
49{-
50}-
51-
52-
53-
54-
55QObject *QSignalTransition::senderObject() const-
56{-
57 const QSignalTransitionPrivate * const d = d_func();-
58 return
executed 161 times by 2 tests: return const_cast<QObject *>(d->sender);
Executed by:
  • tst_QState
  • tst_QStateMachine
const_cast<QObject *>(d->sender);
executed 161 times by 2 tests: return const_cast<QObject *>(d->sender);
Executed by:
  • tst_QState
  • tst_QStateMachine
161
59}-
60-
61-
62-
63-
64void QSignalTransition::setSenderObject(const QObject *sender)-
65{-
66 QSignalTransitionPrivate * const d = d_func();-
67 if (sender == d->sender
sender == d->senderDescription
TRUEnever evaluated
FALSEevaluated 200004 times by 1 test
Evaluated by:
  • tst_QStateMachine
)
0-200004
68 return;
never executed: return;
0
69 d->unregister();-
70 d->sender = sender;-
71 d->maybeRegister();-
72 senderObjectChanged(QPrivateSignal());-
73}
executed 200004 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
200004
74-
75-
76-
77-
78QByteArray QSignalTransition::signal() const-
79{-
80 const QSignalTransitionPrivate * const d = d_func();-
81 return
executed 10 times by 1 test: return d->signal;
Executed by:
  • tst_QStateMachine
d->signal;
executed 10 times by 1 test: return d->signal;
Executed by:
  • tst_QStateMachine
10
82}-
83-
84-
85-
86-
87void QSignalTransition::setSignal(const QByteArray &signal)-
88{-
89 QSignalTransitionPrivate * const d = d_func();-
90 if (signal == d->signal
signal == d->signalDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QStateMachine
)
0-9
91 return;
never executed: return;
0
92 d->unregister();-
93 d->signal = signal;-
94 d->maybeRegister();-
95 signalChanged(QPrivateSignal());-
96}
executed 9 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
9
97bool QSignalTransition::eventTest(QEvent *event)-
98{-
99 const QSignalTransitionPrivate * const d = d_func();-
100 if (event->type() == QEvent::StateMachineSignal
event->type() ...eMachineSignalDescription
TRUEevaluated 89 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
FALSEevaluated 2203 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
) {
89-2203
101 if (d->signalIndex == -1
d->signalIndex == -1Description
TRUEnever evaluated
FALSEevaluated 89 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
)
0-89
102 return
never executed: return false;
false;
never executed: return false;
0
103 QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);-
104 return
executed 89 times by 2 tests: return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex);
Executed by:
  • tst_QState
  • tst_QStateMachine
(se->sender() == d->sender)
executed 89 times by 2 tests: return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex);
Executed by:
  • tst_QState
  • tst_QStateMachine
89
105 && (se->signalIndex() == d->signalIndex);
executed 89 times by 2 tests: return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex);
Executed by:
  • tst_QState
  • tst_QStateMachine
89
106 }-
107 return
executed 2203 times by 2 tests: return false;
Executed by:
  • tst_QState
  • tst_QStateMachine
false;
executed 2203 times by 2 tests: return false;
Executed by:
  • tst_QState
  • tst_QStateMachine
2203
108}-
109-
110-
111-
112-
113void QSignalTransition::onTransition(QEvent *event)-
114{-
115 (void)event;;-
116}
executed 71 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
71
117-
118-
119-
120-
121bool QSignalTransition::event(QEvent *e)-
122{-
123 return
executed 2 times by 1 test: return QAbstractTransition::event(e);
Executed by:
  • tst_QStateMachine
QAbstractTransition::event(e);
executed 2 times by 1 test: return QAbstractTransition::event(e);
Executed by:
  • tst_QStateMachine
2
124}-
125void QSignalTransitionPrivate::callOnTransition(QEvent *e)-
126{-
127 QSignalTransition * const q = q_func();-
128-
129 if (e->type() == QEvent::StateMachineSignal
e->type() == Q...eMachineSignalDescription
TRUEevaluated 71 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
FALSEnever evaluated
) {
0-71
130 QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent *>(e);-
131 int savedSignalIndex = se->m_signalIndex;-
132 se->m_signalIndex = originalSignalIndex;-
133 q->onTransition(e);-
134 se->m_signalIndex = savedSignalIndex;-
135 }
executed 71 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
else {
71
136 q->onTransition(e);-
137 }
never executed: end of block
0
138}-
139-
140-
141-
Switch to Source codePreprocessed file

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