OpenCoverage

qquickspritegoal.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/particles/qquickspritegoal.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QQuickSpriteGoalAffector::QQuickSpriteGoalAffector(QQuickItem *parent) :-
4 QQuickParticleAffector(parent),-
5 m_goalIdx(-1),-
6 m_lastEngine(nullptr),-
7 m_jump(false),-
8 m_systemStates(false),-
9 m_notUsingEngine(false)-
10{-
11 m_ignoresTime = true;-
12}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickspritegoal
16
13-
14void QQuickSpriteGoalAffector::updateStateIndex(QQuickStochasticEngine* e)-
15{-
16 if (m_systemStates
m_systemStatesDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
){
0-2
17 m_goalIdx = m_system->groupIds[m_goalState];-
18 }
never executed: end of block
else{
0
19 m_lastEngine = e;-
20 for (int i=0; i<e->stateCount()
i<e->stateCount()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEnever evaluated
; i++){
0-4
21 if (e->state(i)->name() == m_goalState
e->state(i)->n...== m_goalStateDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
){
2
22 m_goalIdx = i;-
23 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickspritegoal
2
24 }-
25 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickspritegoal
2
26 m_goalIdx = -1;-
27 }
never executed: end of block
0
28}-
29-
30void QQuickSpriteGoalAffector::setGoalState(const QString &arg)-
31{-
32 if (m_goalState != arg
m_goalState != argDescription
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickspritegoal
FALSEnever evaluated
) {
0-16
33 m_goalState = arg;-
34 goalStateChanged(arg);-
35 if (m_goalState.isEmpty()
m_goalState.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickspritegoal
)
0-16
36 m_goalIdx = -1;
never executed: m_goalIdx = -1;
0
37 else-
38 m_goalIdx = -2;
executed 16 times by 2 tests: m_goalIdx = -2;
Executed by:
  • tst_examples
  • tst_qquickspritegoal
16
39 }-
40}
executed 16 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickspritegoal
16
41-
42bool QQuickSpriteGoalAffector::affectParticle(QQuickParticleData *d, qreal dt)-
43{-
44 (void)dt;;-
45 QQuickStochasticEngine *engine = nullptr;-
46 if (!m_systemStates
!m_systemStatesDescription
TRUEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEnever evaluated
){
0-22348
47-
48 for (auto _container_ = QtPrivate::qMakeForeachContainer(m_system->groupData[d->groupId]->painters); _container_.control
_container_.controlDescription
TRUEevaluated 44696 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEnever evaluated
&& _container_.i != _container_.e
_container_.i != _container_.eDescription
TRUEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
; ++_container_.i, _container_.control ^= 1) for (QQuickParticlePainter *p = *_container_.i; _container_.control
_container_.controlDescription
TRUEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
; _container_.control = 0)
0-44696
49 if (qobject_cast<QQuickImageParticle*>(p)
qobject_cast<Q...eParticle*>(p)Description
TRUEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEnever evaluated
)
0-22348
50 engine = qobject_cast<QQuickImageParticle*>(p)->spriteEngine();
executed 22348 times by 1 test: engine = qobject_cast<QQuickImageParticle*>(p)->spriteEngine();
Executed by:
  • tst_qquickspritegoal
22348
51 }
executed 22348 times by 1 test: end of block
Executed by:
  • tst_qquickspritegoal
else{
22348
52 engine = m_system->stateEngine;-
53 if (!engine
!engineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
54 m_notUsingEngine = true;
never executed: m_notUsingEngine = true;
0
55 }
never executed: end of block
0
56 if (!engine
!engineDescription
TRUEnever evaluated
FALSEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
&& !m_notUsingEngine
!m_notUsingEngineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-22348
57 return
never executed: return false;
false;
never executed: return false;
0
58-
59 if (m_goalIdx == -2
m_goalIdx == -2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEevaluated 22346 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
|| engine != m_lastEngine
engine != m_lastEngineDescription
TRUEnever evaluated
FALSEevaluated 22346 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
)
0-22346
60 updateStateIndex(engine);
executed 2 times by 1 test: updateStateIndex(engine);
Executed by:
  • tst_qquickspritegoal
2
61 int index = d->index;-
62 if (m_systemStates
m_systemStatesDescription
TRUEnever evaluated
FALSEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
)
0-22348
63 index = d->systemIndex;
never executed: index = d->systemIndex;
0
64 if (m_notUsingEngine
m_notUsingEngineDescription
TRUEnever evaluated
FALSEevaluated 22348 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
){
0-22348
65-
66 m_system->moveGroups(d, m_goalIdx);-
67 }
never executed: end of block
else if (engine->curState(index) != m_goalIdx
engine->curSta...) != m_goalIdxDescription
TRUEevaluated 1200 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
FALSEevaluated 21148 times by 1 test
Evaluated by:
  • tst_qquickspritegoal
){
0-21148
68 engine->setGoal(m_goalIdx, index, m_jump);-
69 return
executed 1200 times by 1 test: return true;
Executed by:
  • tst_qquickspritegoal
true;
executed 1200 times by 1 test: return true;
Executed by:
  • tst_qquickspritegoal
1200
70 }-
71 return
executed 21148 times by 1 test: return false;
Executed by:
  • tst_qquickspritegoal
false;
executed 21148 times by 1 test: return false;
Executed by:
  • tst_qquickspritegoal
21148
72}-
73-
74-
75-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0