| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/statemachine/qsignaltransition.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | QSignalTransitionPrivate::QSignalTransitionPrivate() | - | ||||||||||||||||||
| 7 | { | - | ||||||||||||||||||
| 8 | sender = 0; | - | ||||||||||||||||||
| 9 | signalIndex = -1; | - | ||||||||||||||||||
| 10 | } executed 74 times by 2 tests: end of blockExecuted by:
| 74 | ||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | void QSignalTransitionPrivate::unregister() | - | ||||||||||||||||||
| 13 | { | - | ||||||||||||||||||
| 14 | QSignalTransition * const q = q_func(); | - | ||||||||||||||||||
| 15 | if ((
| 0-100010 | ||||||||||||||||||
| 16 | return; executed 100010 times by 1 test: return;Executed by:
| 100010 | ||||||||||||||||||
| 17 | QStateMachinePrivate::get(machine())->unregisterSignalTransition(q); | - | ||||||||||||||||||
| 18 | } executed 100003 times by 1 test: end of blockExecuted by:
| 100003 | ||||||||||||||||||
| 19 | - | |||||||||||||||||||
| 20 | void QSignalTransitionPrivate::maybeRegister() | - | ||||||||||||||||||
| 21 | { | - | ||||||||||||||||||
| 22 | QSignalTransition * const q = q_func(); | - | ||||||||||||||||||
| 23 | if (QStateMachine *mach = machine()
| 71-200010 | ||||||||||||||||||
| 24 | QStateMachinePrivate::get(mach)->maybeRegisterSignalTransition(q); executed 200010 times by 2 tests: QStateMachinePrivate::get(mach)->maybeRegisterSignalTransition(q);Executed by:
| 200010 | ||||||||||||||||||
| 25 | } executed 200081 times by 2 tests: end of blockExecuted by:
| 200081 | ||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | - | |||||||||||||||||||
| 28 | - | |||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | QSignalTransition::QSignalTransition(QState *sourceState) | - | ||||||||||||||||||
| 31 | : QAbstractTransition(*new QSignalTransitionPrivate, sourceState) | - | ||||||||||||||||||
| 32 | { | - | ||||||||||||||||||
| 33 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | - | |||||||||||||||||||
| 37 | - | |||||||||||||||||||
| 38 | - | |||||||||||||||||||
| 39 | QSignalTransition::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 blockExecuted by:
| 68 | ||||||||||||||||||
| 48 | QSignalTransition::~QSignalTransition() | - | ||||||||||||||||||
| 49 | { | - | ||||||||||||||||||
| 50 | } | - | ||||||||||||||||||
| 51 | - | |||||||||||||||||||
| 52 | - | |||||||||||||||||||
| 53 | - | |||||||||||||||||||
| 54 | - | |||||||||||||||||||
| 55 | QObject *QSignalTransition::senderObject() const | - | ||||||||||||||||||
| 56 | { | - | ||||||||||||||||||
| 57 | const QSignalTransitionPrivate * const d = d_func(); | - | ||||||||||||||||||
| 58 | return executed 161 times by 2 tests: const_cast<QObject *>(d->sender);return const_cast<QObject *>(d->sender);Executed by:
executed 161 times by 2 tests: return const_cast<QObject *>(d->sender);Executed by:
| 161 | ||||||||||||||||||
| 59 | } | - | ||||||||||||||||||
| 60 | - | |||||||||||||||||||
| 61 | - | |||||||||||||||||||
| 62 | - | |||||||||||||||||||
| 63 | - | |||||||||||||||||||
| 64 | void QSignalTransition::setSenderObject(const QObject *sender) | - | ||||||||||||||||||
| 65 | { | - | ||||||||||||||||||
| 66 | QSignalTransitionPrivate * const d = d_func(); | - | ||||||||||||||||||
| 67 | if (sender == d->sender
| 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 blockExecuted by:
| 200004 | ||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | - | |||||||||||||||||||
| 76 | - | |||||||||||||||||||
| 77 | - | |||||||||||||||||||
| 78 | QByteArray QSignalTransition::signal() const | - | ||||||||||||||||||
| 79 | { | - | ||||||||||||||||||
| 80 | const QSignalTransitionPrivate * const d = d_func(); | - | ||||||||||||||||||
| 81 | return executed 10 times by 1 test: d->signal;return d->signal;Executed by:
executed 10 times by 1 test: return d->signal;Executed by:
| 10 | ||||||||||||||||||
| 82 | } | - | ||||||||||||||||||
| 83 | - | |||||||||||||||||||
| 84 | - | |||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | - | |||||||||||||||||||
| 87 | void QSignalTransition::setSignal(const QByteArray &signal) | - | ||||||||||||||||||
| 88 | { | - | ||||||||||||||||||
| 89 | QSignalTransitionPrivate * const d = d_func(); | - | ||||||||||||||||||
| 90 | if (signal == d->signal
| 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 blockExecuted by:
| 9 | ||||||||||||||||||
| 97 | bool QSignalTransition::eventTest(QEvent *event) | - | ||||||||||||||||||
| 98 | { | - | ||||||||||||||||||
| 99 | const QSignalTransitionPrivate * const d = d_func(); | - | ||||||||||||||||||
| 100 | if (event->type() == QEvent::StateMachineSignal
| 89-2203 | ||||||||||||||||||
| 101 | if (d->signalIndex == -1
| 0-89 | ||||||||||||||||||
| 102 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 103 | QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event); | - | ||||||||||||||||||
| 104 | return executed 89 times by 2 tests: (se->sender() == d->sender)return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex);Executed by:
executed 89 times by 2 tests: return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex);Executed by:
| 89 | ||||||||||||||||||
| 105 | && (se->signalIndex() == d->signalIndex); executed 89 times by 2 tests: return (se->sender() == d->sender) && (se->signalIndex() == d->signalIndex);Executed by:
| 89 | ||||||||||||||||||
| 106 | } | - | ||||||||||||||||||
| 107 | return executed 2203 times by 2 tests: false;return false;Executed by:
executed 2203 times by 2 tests: return false;Executed by:
| 2203 | ||||||||||||||||||
| 108 | } | - | ||||||||||||||||||
| 109 | - | |||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | - | |||||||||||||||||||
| 113 | void QSignalTransition::onTransition(QEvent *event) | - | ||||||||||||||||||
| 114 | { | - | ||||||||||||||||||
| 115 | (void)event;; | - | ||||||||||||||||||
| 116 | } executed 71 times by 2 tests: end of blockExecuted by:
| 71 | ||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | - | |||||||||||||||||||
| 119 | - | |||||||||||||||||||
| 120 | - | |||||||||||||||||||
| 121 | bool QSignalTransition::event(QEvent *e) | - | ||||||||||||||||||
| 122 | { | - | ||||||||||||||||||
| 123 | return executed 2 times by 1 test: QAbstractTransition::event(e);return QAbstractTransition::event(e);Executed by:
executed 2 times by 1 test: return QAbstractTransition::event(e);Executed by:
| 2 | ||||||||||||||||||
| 124 | } | - | ||||||||||||||||||
| 125 | void QSignalTransitionPrivate::callOnTransition(QEvent *e) | - | ||||||||||||||||||
| 126 | { | - | ||||||||||||||||||
| 127 | QSignalTransition * const q = q_func(); | - | ||||||||||||||||||
| 128 | - | |||||||||||||||||||
| 129 | if (e->type() == QEvent::StateMachineSignal
| 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: else {end of blockExecuted by:
| 71 | ||||||||||||||||||
| 136 | q->onTransition(e); | - | ||||||||||||||||||
| 137 | } never executed: end of block | 0 | ||||||||||||||||||
| 138 | } | - | ||||||||||||||||||
| 139 | - | |||||||||||||||||||
| 140 | - | |||||||||||||||||||
| 141 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |