OpenCoverage

qparallelanimationgroup.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/animation/qparallelanimationgroup.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7typedef QList<QAbstractAnimation *>::ConstIterator AnimationListConstIt;-
8typedef QHash<QAbstractAnimation*, int>::Iterator AnimationTimeHashIt;-
9typedef QHash<QAbstractAnimation*, int>::ConstIterator AnimationTimeHashConstIt;-
10-
11-
12-
13-
14-
15QParallelAnimationGroup::QParallelAnimationGroup(QObject *parent)-
16 : QAnimationGroup(*new QParallelAnimationGroupPrivate, parent)-
17{-
18}
executed 81 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
81
19-
20-
21-
22-
23QParallelAnimationGroup::QParallelAnimationGroup(QParallelAnimationGroupPrivate &dd,-
24 QObject *parent)-
25 : QAnimationGroup(dd, parent)-
26{-
27}
never executed: end of block
0
28-
29-
30-
31-
32QParallelAnimationGroup::~QParallelAnimationGroup()-
33{-
34}-
35-
36-
37-
38-
39int QParallelAnimationGroup::duration() const-
40{-
41 const QParallelAnimationGroupPrivate * const d = d_func();-
42 int ret = 0;-
43-
44 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 1365 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 508 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
; ++it) {
508-1365
45 const int currentDuration = (*it)->totalDuration();-
46 if (currentDuration == -1
currentDuration == -1Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
FALSEevaluated 1356 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
9-1356
47 return
executed 9 times by 2 tests: return -1;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
-1;
executed 9 times by 2 tests: return -1;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
9
48-
49 ret = qMax(ret, currentDuration);-
50 }
executed 1356 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
1356
51-
52 return
executed 508 times by 5 tests: return ret;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
ret;
executed 508 times by 5 tests: return ret;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
508
53}-
54-
55-
56-
57-
58void QParallelAnimationGroup::updateCurrentTime(int currentTime)-
59{-
60 QParallelAnimationGroupPrivate * const d = d_func();-
61 if (d->animations.isEmpty()
d->animations.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 328 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
0-328
62 return;
never executed: return;
0
63-
64 if (d->currentLoop > d->lastLoop
d->currentLoop > d->lastLoopDescription
TRUEevaluated 45 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
FALSEevaluated 283 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
) {
45-283
65-
66 int dura = duration();-
67 if (dura > 0
dura > 0Description
TRUEevaluated 45 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
FALSEnever evaluated
) {
0-45
68 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
FALSEevaluated 45 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
; ++it) {
45-136
69 QAbstractAnimation *animation = (*it);-
70 if (animation->state() != QAbstractAnimation::Stopped
animation->sta...ation::StoppedDescription
TRUEevaluated 52 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
FALSEevaluated 84 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
)
52-84
71 animation->setCurrentTime(dura);
executed 52 times by 2 tests: animation->setCurrentTime(dura);
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
52
72 }
executed 136 times by 2 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
136
73 }
executed 45 times by 2 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
45
74 }
executed 45 times by 2 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
else if (d->currentLoop < d->lastLoop
d->currentLoop < d->lastLoopDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 255 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
) {
28-255
75-
76 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
; ++it) {
28-84
77 QAbstractAnimation *animation = *it;-
78-
79-
80 d->applyGroupState(animation);-
81 animation->setCurrentTime(0);-
82 animation->stop();-
83 }
executed 84 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
84
84 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
28
85-
86-
87-
88-
89-
90-
91 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 953 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 328 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
; ++it) {
328-953
92 QAbstractAnimation *animation = *it;-
93 const int dura = animation->totalDuration();-
94-
95 if (d->currentLoop > d->lastLoop
d->currentLoop > d->lastLoopDescription
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
FALSEevaluated 817 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
136-817
96-
97-
98 || d->shouldAnimationStart(animation, d->lastCurrentTime > dura )
d->shouldAnima...tTime > dura )Description
TRUEevaluated 551 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 266 times by 4 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
) {
266-551
99 d->applyGroupState(animation);-
100 }
executed 687 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
687
101-
102 if (animation->state() == state()
animation->state() == state()Description
TRUEevaluated 767 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 186 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
) {
186-767
103 animation->setCurrentTime(currentTime);-
104 if (dura > 0
dura > 0Description
TRUEevaluated 655 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 112 times by 2 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
&& currentTime > dura
currentTime > duraDescription
TRUEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
FALSEevaluated 622 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
33-655
105 animation->stop();
executed 33 times by 3 tests: animation->stop();
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
33
106 }
executed 767 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
767
107 }
executed 953 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
953
108 d->lastLoop = d->currentLoop;-
109 d->lastCurrentTime = currentTime;-
110}
executed 328 times by 5 tests: end of block
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
328
111-
112-
113-
114-
115void QParallelAnimationGroup::updateState(QAbstractAnimation::State newState,-
116 QAbstractAnimation::State oldState)-
117{-
118 QParallelAnimationGroupPrivate * const d = d_func();-
119 QAnimationGroup::updateState(newState, oldState);-
120-
121 switch (newState) {-
122 case
executed 57 times by 3 tests: case Stopped:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
Stopped:
executed 57 times by 3 tests: case Stopped:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
57
123 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 41 times by 3 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
FALSEevaluated 57 times by 3 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
; ++it)
41-57
124 (*
executed 41 times by 3 tests: (*it)->stop();
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
it)->stop();
executed 41 times by 3 tests: (*it)->stop();
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
41
125 d->disconnectUncontrolledAnimations();-
126 break;
executed 57 times by 3 tests: break;
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
57
127 case
executed 4 times by 2 tests: case Paused:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
Paused:
executed 4 times by 2 tests: case Paused:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
4
128 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
; ++it) {
4-6
129 if ((*
(*it)->state() == RunningDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
it)->state() == Running
(*it)->state() == RunningDescription
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
)
1-5
130 (*
executed 5 times by 2 tests: (*it)->pause();
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
it)->pause();
executed 5 times by 2 tests: (*it)->pause();
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
5
131 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
6
132 break;
executed 4 times by 2 tests: break;
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
4
133 case
executed 62 times by 4 tests: case Running:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
Running:
executed 62 times by 4 tests: case Running:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
62
134 d->connectUncontrolledAnimations();-
135 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 168 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 62 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
; ++it) {
62-168
136 QAbstractAnimation *animation = *it;-
137 if (oldState == Stopped
oldState == StoppedDescription
TRUEevaluated 164 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QSequentialAnimationGroup
)
4-164
138 animation->stop();
executed 164 times by 4 tests: animation->stop();
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
164
139 animation->setDirection(d->direction);-
140 if (d->shouldAnimationStart(animation, oldState == Stopped)
d->shouldAnima...te == Stopped)Description
TRUEevaluated 114 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 54 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
)
54-114
141 animation->start();
executed 114 times by 4 tests: animation->start();
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
114
142 }
executed 168 times by 4 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
168
143 break;
executed 62 times by 4 tests: break;
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
62
144 }-
145}
executed 123 times by 4 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
123
146-
147void QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished()-
148{-
149 QParallelAnimationGroup * const q = q_func();-
150-
151 QAbstractAnimation *animation = qobject_cast<QAbstractAnimation *>(q->sender());-
152 ((!(animation)) ? qt_assert("animation",__FILE__,224) : qt_noop());-
153-
154 int uncontrolledRunningCount = 0;-
155 if (animation->duration() == -1
animation->duration() == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
|| animation->loopCount() < 0
animation->loopCount() < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEnever evaluated
) {
0-1
156 for (AnimationTimeHashIt it = uncontrolledFinishTime.begin(), cend = uncontrolledFinishTime.end(); it != cend
it != cendDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
; ++it) {
2-4
157 if (it.key() == animation
it.key() == animationDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
) {
2
158 *it = animation->currentTime();-
159 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
2
160 if (it.value() == -1
it.value() == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
)
1-3
161 ++
executed 1 time by 1 test: ++uncontrolledRunningCount;
Executed by:
  • tst_QParallelAnimationGroup
uncontrolledRunningCount;
executed 1 time by 1 test: ++uncontrolledRunningCount;
Executed by:
  • tst_QParallelAnimationGroup
1
162 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
4
163 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
2
164-
165 if (uncontrolledRunningCount > 0
uncontrolledRunningCount > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
)
1
166 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QParallelAnimationGroup
1
167-
168 int maxDuration = 0;-
169 for (AnimationListConstIt it = animations.constBegin(), cend = animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
; ++it)
1-3
170 maxDuration = qMax(maxDuration, (*it)->totalDuration());
executed 3 times by 1 test: maxDuration = qMax(maxDuration, (*it)->totalDuration());
Executed by:
  • tst_QParallelAnimationGroup
3
171-
172 if (currentTime >= maxDuration
currentTime >= maxDurationDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEnever evaluated
)
0-1
173 q->stop();
executed 1 time by 1 test: q->stop();
Executed by:
  • tst_QParallelAnimationGroup
1
174}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
1
175-
176void QParallelAnimationGroupPrivate::disconnectUncontrolledAnimations()-
177{-
178 for (AnimationTimeHashConstIt it = uncontrolledFinishTime.constBegin(), cend = uncontrolledFinishTime.constEnd(); it != cend
it != cendDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 57 times by 3 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
; ++it)
3-57
179 disconnectUncontrolledAnimation(it.key());
executed 3 times by 1 test: disconnectUncontrolledAnimation(it.key());
Executed by:
  • tst_QParallelAnimationGroup
3
180-
181 uncontrolledFinishTime.clear();-
182}
executed 57 times by 3 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QStateMachine
57
183-
184void QParallelAnimationGroupPrivate::connectUncontrolledAnimations()-
185{-
186 for (AnimationListConstIt it = animations.constBegin(), cend = animations.constEnd(); it != cend
it != cendDescription
TRUEevaluated 168 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 62 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
; ++it) {
62-168
187 QAbstractAnimation *animation = *it;-
188 if (animation->duration() == -1
animation->duration() == -1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 167 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
|| animation->loopCount() < 0
animation->loopCount() < 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 164 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
) {
1-167
189 uncontrolledFinishTime[animation] = -1;-
190 connectUncontrolledAnimation(animation);-
191 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
4
192 }
executed 168 times by 4 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
168
193}
executed 62 times by 4 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
62
194-
195bool QParallelAnimationGroupPrivate::shouldAnimationStart(QAbstractAnimation *animation, bool startIfAtEnd) const-
196{-
197 const int dura = animation->totalDuration();-
198 if (dura == -1
dura == -1Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
FALSEevaluated 965 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
20-965
199 return
executed 20 times by 2 tests: return !isUncontrolledAnimationFinished(animation);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
!isUncontrolledAnimationFinished(animation);
executed 20 times by 2 tests: return !isUncontrolledAnimationFinished(animation);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
20
200 if (startIfAtEnd
startIfAtEndDescription
TRUEevaluated 337 times by 4 tests
Evaluated by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 628 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
)
337-628
201 return
executed 337 times by 4 tests: return currentTime <= dura;
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
currentTime <= dura;
executed 337 times by 4 tests: return currentTime <= dura;
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
337
202 if (direction == QAbstractAnimation::Forward
direction == Q...ation::ForwardDescription
TRUEevaluated 565 times by 5 tests
Evaluated by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
FALSEevaluated 63 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
)
63-565
203 return
executed 565 times by 5 tests: return currentTime < dura;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
currentTime < dura;
executed 565 times by 5 tests: return currentTime < dura;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
565
204 else-
205 return
executed 63 times by 1 test: return currentTime && currentTime <= dura;
Executed by:
  • tst_QParallelAnimationGroup
currentTime && currentTime <= dura;
executed 63 times by 1 test: return currentTime && currentTime <= dura;
Executed by:
  • tst_QParallelAnimationGroup
63
206}-
207-
208void QParallelAnimationGroupPrivate::applyGroupState(QAbstractAnimation *animation)-
209{-
210 switch (state)-
211 {-
212 case
executed 634 times by 4 tests: case QAbstractAnimation::Running:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
QAbstractAnimation::Running:
executed 634 times by 4 tests: case QAbstractAnimation::Running:
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
634
213 animation->start();-
214 break;
executed 634 times by 4 tests: break;
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
634
215 case
never executed: case QAbstractAnimation::Paused:
QAbstractAnimation::Paused:
never executed: case QAbstractAnimation::Paused:
0
216 animation->pause();-
217 break;
never executed: break;
0
218 case
executed 137 times by 2 tests: case QAbstractAnimation::Stopped:
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
QAbstractAnimation::Stopped:
executed 137 times by 2 tests: case QAbstractAnimation::Stopped:
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
137
219 default
never executed: default:
:
never executed: default:
0
220 break;
executed 137 times by 2 tests: break;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
137
221 }-
222}-
223-
224-
225bool QParallelAnimationGroupPrivate::isUncontrolledAnimationFinished(QAbstractAnimation *anim) const-
226{-
227 return
executed 20 times by 2 tests: return uncontrolledFinishTime.value(anim, -1) >= 0;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
uncontrolledFinishTime.value(anim, -1) >= 0;
executed 20 times by 2 tests: return uncontrolledFinishTime.value(anim, -1) >= 0;
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
20
228}-
229-
230void QParallelAnimationGroupPrivate::animationRemoved(int index, QAbstractAnimation *anim)-
231{-
232 QAnimationGroupPrivate::animationRemoved(index, anim);-
233 disconnectUncontrolledAnimation(anim);-
234 uncontrolledFinishTime.remove(anim);-
235}
executed 164 times by 2 tests: end of block
Executed by:
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
164
236-
237-
238-
239-
240void QParallelAnimationGroup::updateDirection(QAbstractAnimation::Direction direction)-
241{-
242 QParallelAnimationGroupPrivate * const d = d_func();-
243-
244 if (state() != Stopped
state() != StoppedDescription
TRUEnever evaluated
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
) {
0-19
245 for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend
it != cendDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
246 (*
never executed: (*it)->setDirection(direction);
it)->setDirection(direction);
never executed: (*it)->setDirection(direction);
0
247 }
never executed: end of block
else {
0
248 if (direction == Forward
direction == ForwardDescription
TRUEnever evaluated
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
) {
0-19
249 d->lastLoop = 0;-
250 d->lastCurrentTime = 0;-
251 }
never executed: end of block
else {
0
252-
253 d->lastLoop = (d->loopCount == -1
d->loopCount == -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QParallelAnimationGroup
? 0 : d->loopCount - 1);
3-16
254 d->lastCurrentTime = duration();-
255 }
executed 19 times by 1 test: end of block
Executed by:
  • tst_QParallelAnimationGroup
19
256 }-
257}-
258-
259-
260-
261-
262bool QParallelAnimationGroup::event(QEvent *event)-
263{-
264 return
executed 520 times by 5 tests: return QAnimationGroup::event(event);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
QAnimationGroup::event(event);
executed 520 times by 5 tests: return QAnimationGroup::event(event);
Executed by:
  • tst_QAnimationGroup
  • tst_QParallelAnimationGroup
  • tst_QPauseAnimation
  • tst_QSequentialAnimationGroup
  • tst_QStateMachine
520
265}-
266-
267-
268-
Switch to Source codePreprocessed file

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