OpenCoverage

qcontinuinganimationgroupjob.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/animations/qcontinuinganimationgroupjob.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 Jolla Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "private/qcontinuinganimationgroupjob_p.h"-
41#include "private/qanimationjobutil_p.h"-
42-
43QT_BEGIN_NAMESPACE-
44-
45QContinuingAnimationGroupJob::QContinuingAnimationGroupJob()-
46{-
47}-
48-
49QContinuingAnimationGroupJob::~QContinuingAnimationGroupJob()-
50{-
51}-
52-
53void QContinuingAnimationGroupJob::updateCurrentTime(int /*currentTime*/)-
54{-
55 Q_ASSERT(firstChild());-
56-
57 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 1106 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
FALSEevaluated 1093 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
1093-1106
58 if (animation->state() == state()) {
animation->state() == state()Description
TRUEevaluated 1106 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
FALSEnever evaluated
0-1106
59 RETURN_IF_DELETED(animation->setCurrentTime(m_currentTime));
executed 13 times by 2 tests: return;
Executed by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
executed 13 times by 2 tests: *prevWasDeleted = true;
Executed by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
wasDeletedDescription
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
FALSEevaluated 1093 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
prevWasDeletedDescription
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_qquickbehaviors
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-1093
60 }
executed 1093 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
1093
61 }
executed 1093 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
1093
62}
executed 1093 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
1093
63-
64void QContinuingAnimationGroupJob::updateState(QAbstractAnimationJob::State newState,-
65 QAbstractAnimationJob::State oldState)-
66{-
67 QAnimationGroupJob::updateState(newState, oldState);-
68-
69 switch (newState) {-
70 case Stopped:
executed 99 times by 5 tests: case Stopped:
Executed by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
99
71 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
animationDescription
TRUEevaluated 45 times by 5 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
FALSEevaluated 99 times by 5 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
45-99
72 animation->stop();
executed 45 times by 5 tests: animation->stop();
Executed by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
45
73 break;
executed 99 times by 5 tests: break;
Executed by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
99
74 case Paused:
executed 2 times by 1 test: case Paused:
Executed by:
  • tst_qquicksmoothedanimation
2
75 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling())
animationDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicksmoothedanimation
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicksmoothedanimation
2
76 if (animation->isRunning())
animation->isRunning()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicksmoothedanimation
FALSEnever evaluated
0-2
77 animation->pause();
executed 2 times by 1 test: animation->pause();
Executed by:
  • tst_qquicksmoothedanimation
2
78 break;
executed 2 times by 1 test: break;
Executed by:
  • tst_qquicksmoothedanimation
2
79 case Running:
executed 121 times by 6 tests: case Running:
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
121
80 if (!firstChild()) {
!firstChild()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquicksmoothedanimation
FALSEevaluated 119 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
2-119
81 stop();-
82 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquicksmoothedanimation
2
83 }-
84 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEevaluated 119 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
FALSEevaluated 119 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
119
85 resetUncontrolledAnimationFinishTime(animation);-
86 animation->setDirection(m_direction);-
87 animation->start();-
88 }
executed 119 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
119
89 break;
executed 119 times by 6 tests: break;
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
119
90 }-
91}
executed 220 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
220
92-
93void QContinuingAnimationGroupJob::updateDirection(QAbstractAnimationJob::Direction direction)-
94{-
95 if (!isStopped()) {
!isStopped()Description
TRUEnever evaluated
FALSEnever evaluated
0
96 for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
animationDescription
TRUEnever evaluated
FALSEnever evaluated
0
97 animation->setDirection(direction);-
98 }
never executed: end of block
0
99 }
never executed: end of block
0
100}
never executed: end of block
0
101-
102void QContinuingAnimationGroupJob::uncontrolledAnimationFinished(QAbstractAnimationJob *animation)-
103{-
104 Q_ASSERT(animation && (animation->duration() == -1));-
105 int uncontrolledRunningCount = 0;-
106-
107 for (QAbstractAnimationJob *child = firstChild(); child; child = child->nextSibling()) {
childDescription
TRUEevaluated 45 times by 5 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
FALSEevaluated 45 times by 5 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
45
108 if (child == animation)
child == animationDescription
TRUEevaluated 45 times by 5 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
FALSEnever evaluated
0-45
109 setUncontrolledAnimationFinishTime(animation, animation->currentTime());
executed 45 times by 5 tests: setUncontrolledAnimationFinishTime(animation, animation->currentTime());
Executed by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
45
110 else if (uncontrolledAnimationFinishTime(child) == -1)
uncontrolledAn...e(child) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
111 ++uncontrolledRunningCount;
never executed: ++uncontrolledRunningCount;
0
112 }
executed 45 times by 5 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
45
113-
114 if (uncontrolledRunningCount > 0)
uncontrolledRunningCount > 0Description
TRUEnever evaluated
FALSEevaluated 45 times by 5 tests
Evaluated by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
0-45
115 return;
never executed: return;
0
116-
117 setUncontrolledAnimationFinishTime(this, currentTime());-
118 stop();-
119}
executed 45 times by 5 tests: end of block
Executed by:
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquicklistview
  • tst_qquicksmoothedanimation
  • tst_qquickspringanimation
45
120-
121void QContinuingAnimationGroupJob::debugAnimation(QDebug d) const-
122{-
123 d << "ContinuingAnimationGroupJob(" << hex << (const void *) this << dec << ")";-
124-
125 debugChildren(d);-
126}
never executed: end of block
0
127-
128QT_END_NAMESPACE-
129-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0