qfutureinterface.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/thread/qfutureinterface.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8enum {-
9 MaxProgressEmitsPerSecond = 25-
10};-
11-
12namespace {-
13class ThreadPoolThreadReleaser {-
14 QThreadPool *m_pool;-
15public:-
16 explicit ThreadPoolThreadReleaser(QThreadPool *pool)-
17 : m_pool(pool)-
18 { if (pool
poolDescription
TRUEnever evaluated
FALSEnever evaluated
) pool->releaseThread();
never executed: pool->releaseThread();
}
never executed: end of block
0
19 ~ThreadPoolThreadReleaser()-
20 { if (m_pool
m_poolDescription
TRUEnever evaluated
FALSEnever evaluated
) m_pool->reserveThread();
never executed: m_pool->reserveThread();
}
never executed: end of block
0
21};-
22}-
23-
24-
25QFutureInterfaceBase::QFutureInterfaceBase(State initialState)-
26 : d(new QFutureInterfaceBasePrivate(initialState))-
27{ }
executed 128690 times by 12 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128690
28-
29QFutureInterfaceBase::QFutureInterfaceBase(const QFutureInterfaceBase &other)-
30 : d(other.d)-
31{-
32 d->refCount.ref();-
33}
executed 160412 times by 12 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
160412
34-
35QFutureInterfaceBase::~QFutureInterfaceBase()-
36{-
37 if (!d->refCount.deref()
!d->refCount.deref()Description
TRUEevaluated 128616 times by 14 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qdebug - unknown status
  • tst_qtconcurrentiteratekernel - unknown status
FALSEevaluated 160486 times by 12 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
128616-160486
38 delete d;
executed 128616 times by 14 tests: delete d;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qdebug - unknown status
  • tst_qtconcurrentiteratekernel - unknown status
128616
39}
executed 289102 times by 14 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qdebug - unknown status
  • tst_qtconcurrentiteratekernel - unknown status
289102
40-
41static inline int switch_on(QAtomicInt &a, int which)-
42{-
43 return
executed 38 times by 5 tests: return a.fetchAndOrRelaxed(which) | which;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
a.fetchAndOrRelaxed(which) | which;
executed 38 times by 5 tests: return a.fetchAndOrRelaxed(which) | which;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
38
44}-
45-
46static inline int switch_off(QAtomicInt &a, int which)-
47{-
48 return
executed 26 times by 2 tests: return a.fetchAndAndRelaxed(~which) & ~which;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
a.fetchAndAndRelaxed(~which) & ~which;
executed 26 times by 2 tests: return a.fetchAndAndRelaxed(~which) & ~which;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
26
49}-
50-
51static inline int switch_from_to(QAtomicInt &a, int from, int to)-
52{-
53 int newValue;-
54 int expected = a.load();-
55 do {-
56 newValue = (expected & ~from) | to;-
57 }
executed 129440 times by 11 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
while (!a.testAndSetRelaxed(expected, newValue, expected)
!a.testAndSetR...lue, expected)Description
TRUEnever evaluated
FALSEevaluated 129440 times by 11 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
);
0-129440
58 return
executed 129440 times by 11 tests: return newValue;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
newValue;
executed 129440 times by 11 tests: return newValue;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
129440
59}-
60-
61void QFutureInterfaceBase::cancel()-
62{-
63 QMutexLocker locker(&d->m_mutex);-
64 if (d->state.load() & Canceled
d->state.load() & CanceledDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 1112 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentThreadEngine
)
5-1112
65 return;
executed 5 times by 1 test: return;
Executed by:
  • tst_QFutureWatcher
5
66-
67 switch_from_to(d->state, Paused, Canceled);-
68 d->waitCondition.wakeAll();-
69 d->pausedWaitCondition.wakeAll();-
70 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));-
71}
executed 1112 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentThreadEngine
1112
72-
73void QFutureInterfaceBase::setPaused(bool paused)-
74{-
75 QMutexLocker locker(&d->m_mutex);-
76 if (paused
pausedDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
) {
9
77 switch_on(d->state, Paused);-
78 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused));-
79 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
else {
9
80 switch_off(d->state, Paused);-
81 d->pausedWaitCondition.wakeAll();-
82 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));-
83 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
9
84}-
85-
86void QFutureInterfaceBase::togglePaused()-
87{-
88 QMutexLocker locker(&d->m_mutex);-
89 if (d->state.load() & Paused
d->state.load() & PausedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFuture
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
) {
1-7
90 switch_off(d->state, Paused);-
91 d->pausedWaitCondition.wakeAll();-
92 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));-
93 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFuture
else {
1
94 switch_on(d->state, Paused);-
95 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused));-
96 }
executed 7 times by 2 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
7
97}-
98-
99void QFutureInterfaceBase::setThrottled(bool enable)-
100{-
101 QMutexLocker lock(&d->m_mutex);-
102 if (enable
enableDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFuture
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
) {
2-16
103 switch_on(d->state, Throttled);-
104 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QFuture
else {
2
105 switch_off(d->state, Throttled);-
106 if (!(d->state.load() & Paused)
!(d->state.load() & Paused)Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
FALSEnever evaluated
)
0-16
107 d->pausedWaitCondition.wakeAll();
executed 16 times by 2 tests: d->pausedWaitCondition.wakeAll();
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
16
108 }
executed 16 times by 2 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
16
109}-
110-
111-
112bool QFutureInterfaceBase::isRunning() const-
113{-
114 return
executed 322807 times by 12 tests: return queryState(Running);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
queryState(Running);
executed 322807 times by 12 tests: return queryState(Running);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
322807
115}-
116-
117bool QFutureInterfaceBase::isStarted() const-
118{-
119 return
executed 28 times by 2 tests: return queryState(Started);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
queryState(Started);
executed 28 times by 2 tests: return queryState(Started);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
28
120}-
121-
122bool QFutureInterfaceBase::isCanceled() const-
123{-
124 return
executed 202250 times by 11 tests: return queryState(Canceled);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
queryState(Canceled);
executed 202250 times by 11 tests: return queryState(Canceled);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
202250
125}-
126-
127bool QFutureInterfaceBase::isFinished() const-
128{-
129 return
executed 128856 times by 12 tests: return queryState(Finished);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
queryState(Finished);
executed 128856 times by 12 tests: return queryState(Finished);
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128856
130}-
131-
132bool QFutureInterfaceBase::isPaused() const-
133{-
134 return
executed 13517 times by 6 tests: return queryState(Paused);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
queryState(Paused);
executed 13517 times by 6 tests: return queryState(Paused);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
13517
135}-
136-
137bool QFutureInterfaceBase::isThrottled() const-
138{-
139 return
executed 7 times by 2 tests: return queryState(Throttled);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
queryState(Throttled);
executed 7 times by 2 tests: return queryState(Throttled);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
7
140}-
141-
142bool QFutureInterfaceBase::isResultReadyAt(int index) const-
143{-
144 QMutexLocker lock(&d->m_mutex);-
145 return
executed 15004 times by 2 tests: return d->internal_isResultReadyAt(index);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
d->internal_isResultReadyAt(index);
executed 15004 times by 2 tests: return d->internal_isResultReadyAt(index);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
15004
146}-
147-
148bool QFutureInterfaceBase::waitForNextResult()-
149{-
150 QMutexLocker lock(&d->m_mutex);-
151 return
never executed: return d->internal_waitForNextResult();
d->internal_waitForNextResult();
never executed: return d->internal_waitForNextResult();
0
152}-
153-
154void QFutureInterfaceBase::waitForResume()-
155{-
156-
157 {-
158 const int state = d->state.load();-
159 if (!(state & Paused)
!(state & Paused)Description
TRUEevaluated 6309 times by 4 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
FALSEnever evaluated
|| (
(state & Canceled)Description
TRUEnever evaluated
FALSEnever evaluated
state & Canceled)
(state & Canceled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0-6309
160 return;
executed 6309 times by 4 tests: return;
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
6309
161 }-
162-
163 QMutexLocker lock(&d->m_mutex);-
164 const int state = d->state.load();-
165 if (!(state & Paused)
!(state & Paused)Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(state & Canceled)Description
TRUEnever evaluated
FALSEnever evaluated
state & Canceled)
(state & Canceled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
166 return;
never executed: return;
0
167-
168-
169 const ThreadPoolThreadReleaser releaser(d->pool());-
170-
171 d->pausedWaitCondition.wait(&d->m_mutex);-
172}
never executed: end of block
0
173-
174int QFutureInterfaceBase::progressValue() const-
175{-
176 const QMutexLocker lock(&d->m_mutex);-
177 return
executed 17 times by 2 tests: return d->m_progressValue;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
d->m_progressValue;
executed 17 times by 2 tests: return d->m_progressValue;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
17
178}-
179-
180int QFutureInterfaceBase::progressMinimum() const-
181{-
182 const QMutexLocker lock(&d->m_mutex);-
183 return
executed 12 times by 1 test: return d->m_progressMinimum;
Executed by:
  • tst_QFutureWatcher
d->m_progressMinimum;
executed 12 times by 1 test: return d->m_progressMinimum;
Executed by:
  • tst_QFutureWatcher
12
184}-
185-
186int QFutureInterfaceBase::progressMaximum() const-
187{-
188 const QMutexLocker lock(&d->m_mutex);-
189 return
executed 12 times by 1 test: return d->m_progressMaximum;
Executed by:
  • tst_QFutureWatcher
d->m_progressMaximum;
executed 12 times by 1 test: return d->m_progressMaximum;
Executed by:
  • tst_QFutureWatcher
12
190}-
191-
192int QFutureInterfaceBase::resultCount() const-
193{-
194 QMutexLocker lock(&d->m_mutex);-
195 return
executed 28711 times by 3 tests: return d->internal_resultCount();
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
d->internal_resultCount();
executed 28711 times by 3 tests: return d->internal_resultCount();
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
28711
196}-
197-
198QString QFutureInterfaceBase::progressText() const-
199{-
200 QMutexLocker locker(&d->m_mutex);-
201 return
executed 15 times by 2 tests: return d->m_progressText;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
d->m_progressText;
executed 15 times by 2 tests: return d->m_progressText;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
15
202}-
203-
204bool QFutureInterfaceBase::isProgressUpdateNeeded() const-
205{-
206 QMutexLocker locker(&d->m_mutex);-
207 return
executed 107 times by 1 test: return !d->progressTime.isValid() || (d->progressTime.elapsed() > (1000 / MaxProgressEmitsPerSecond));
Executed by:
  • tst_QFutureWatcher
!d->progressTime.isValid() || (d->progressTime.elapsed() > (1000 / MaxProgressEmitsPerSecond));
executed 107 times by 1 test: return !d->progressTime.isValid() || (d->progressTime.elapsed() > (1000 / MaxProgressEmitsPerSecond));
Executed by:
  • tst_QFutureWatcher
107
208}-
209-
210void QFutureInterfaceBase::reportStarted()-
211{-
212 QMutexLocker locker(&d->m_mutex);-
213 if (d->state.load() & (Started|Canceled|Finished)
d->state.load(...eled|Finished)Description
TRUEnever evaluated
FALSEevaluated 128329 times by 11 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
0-128329
214 return;
never executed: return;
0
215-
216 d->setState(State(Started | Running));-
217 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Started));-
218}
executed 128329 times by 11 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128329
219-
220void QFutureInterfaceBase::reportCanceled()-
221{-
222 cancel();-
223}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QFuture
3
224-
225-
226void QFutureInterfaceBase::reportException(const QException &exception)-
227{-
228 QMutexLocker locker(&d->m_mutex);-
229 if (d->state.load() & (Canceled|Finished)
d->state.load(...eled|Finished)Description
TRUEnever evaluated
FALSEevaluated 17 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
0-17
230 return;
never executed: return;
0
231-
232 d->m_exceptionStore.setException(exception);-
233 switch_on(d->state, Canceled);-
234 d->waitCondition.wakeAll();-
235 d->pausedWaitCondition.wakeAll();-
236 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));-
237}
executed 17 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
17
238-
239-
240void QFutureInterfaceBase::reportFinished()-
241{-
242 QMutexLocker locker(&d->m_mutex);-
243 if (!isFinished()
!isFinished()Description
TRUEevaluated 128328 times by 11 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEnever evaluated
) {
0-128328
244 switch_from_to(d->state, Running, Finished);-
245 d->waitCondition.wakeAll();-
246 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Finished));-
247 }
executed 128328 times by 11 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128328
248}
executed 128328 times by 11 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128328
249-
250void QFutureInterfaceBase::setExpectedResultCount(int resultCount)-
251{-
252 if (d->manualProgress == false
d->manualProgress == falseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
253 setProgressRange(0, resultCount);
never executed: setProgressRange(0, resultCount);
0
254 d->m_expectedResultCount = resultCount;-
255}
never executed: end of block
0
256-
257int QFutureInterfaceBase::expectedResultCount()-
258{-
259 return
never executed: return d->m_expectedResultCount;
d->m_expectedResultCount;
never executed: return d->m_expectedResultCount;
0
260}-
261-
262bool QFutureInterfaceBase::queryState(State state) const-
263{-
264 return
executed 737258 times by 12 tests: return d->state.load() & state;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
d->state.load() & state;
executed 737258 times by 12 tests: return d->state.load() & state;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
737258
265}-
266-
267void QFutureInterfaceBase::waitForResult(int resultIndex)-
268{-
269 d->m_exceptionStore.throwPossibleException();-
270-
271 QMutexLocker lock(&d->m_mutex);-
272 if (!isRunning()
!isRunning()Description
TRUEevaluated 15527 times by 7 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 60802 times by 7 tests
Evaluated by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
15527-60802
273 return;
executed 15527 times by 7 tests: return;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
15527
274 lock.unlock();-
275-
276-
277-
278 d->pool()->d_func()->stealAndRunRunnable(d->runnable);-
279-
280 lock.relock();-
281-
282 const int waitIndex = (
(resultIndex == -1)Description
TRUEevaluated 86 times by 4 tests
Evaluated by:
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 60716 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
resultIndex == -1)
(resultIndex == -1)Description
TRUEevaluated 86 times by 4 tests
Evaluated by:
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 60716 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
? 2147483647 : resultIndex;
86-60716
283 while (isRunning()
isRunning()Description
TRUEevaluated 28384 times by 7 tests
Evaluated by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 32891 times by 6 tests
Evaluated by:
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
&& !d->internal_isResultReadyAt(waitIndex)
!d->internal_i...yAt(waitIndex)Description
TRUEevaluated 473 times by 6 tests
Evaluated by:
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 27911 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
)
473-32891
284 d->waitCondition.wait(&d->m_mutex);
executed 473 times by 6 tests: d->waitCondition.wait(&d->m_mutex);
Executed by:
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
473
285-
286 d->m_exceptionStore.throwPossibleException();-
287}
executed 60800 times by 7 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
60800
288-
289void QFutureInterfaceBase::waitForFinished()-
290{-
291 QMutexLocker lock(&d->m_mutex);-
292 const bool alreadyFinished = !isRunning();-
293 lock.unlock();-
294-
295 if (!alreadyFinished
!alreadyFinishedDescription
TRUEevaluated 71411 times by 9 tests
Evaluated by:
  • tst_QDebug
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 4253 times by 10 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
) {
4253-71411
296 d->pool()->d_func()->stealAndRunRunnable(d->runnable);-
297-
298 lock.relock();-
299-
300 while (isRunning()
isRunning()Description
TRUEevaluated 38070 times by 9 tests
Evaluated by:
  • tst_QDebug
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 71411 times by 9 tests
Evaluated by:
  • tst_QDebug
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
38070-71411
301 d->waitCondition.wait(&d->m_mutex);
executed 38070 times by 9 tests: d->waitCondition.wait(&d->m_mutex);
Executed by:
  • tst_QDebug
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
38070
302 }
executed 71411 times by 9 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
71411
303-
304 d->m_exceptionStore.throwPossibleException();-
305}
executed 75653 times by 11 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
75653
306-
307void QFutureInterfaceBase::reportResultsReady(int beginIndex, int endIndex)-
308{-
309 if (beginIndex == endIndex
beginIndex == endIndexDescription
TRUEevaluated 53 times by 2 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
FALSEevaluated 34826 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
|| (
(d->state.load...led|Finished))Description
TRUEnever evaluated
FALSEevaluated 34826 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
d->state.load() & (Canceled|Finished))
(d->state.load...led|Finished))Description
TRUEnever evaluated
FALSEevaluated 34826 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
0-34826
310 return;
executed 53 times by 2 tests: return;
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
53
311-
312 d->waitCondition.wakeAll();-
313-
314 if (d->manualProgress == false
d->manualProgress == falseDescription
TRUEevaluated 34114 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 712 times by 4 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
) {
712-34114
315 if (d->internal_updateProgress(d->m_progressValue + endIndex - beginIndex) == false
d->internal_up...ndex) == falseDescription
TRUEevaluated 1119 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 32995 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
) {
1119-32995
316 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady,-
317 beginIndex,-
318 endIndex));-
319 return;
executed 1119 times by 5 tests: return;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
1119
320 }-
321-
322 d->sendCallOuts(QFutureCallOutEvent(QFutureCallOutEvent::Progress,-
323 d->m_progressValue,-
324 d->m_progressText),-
325 QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady,-
326 beginIndex,-
327 endIndex));-
328 return;
executed 32995 times by 8 tests: return;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
32995
329 }-
330 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady, beginIndex, endIndex));-
331}
executed 712 times by 4 tests: end of block
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
712
332-
333void QFutureInterfaceBase::setRunnable(QRunnable *runnable)-
334{-
335 d->runnable = runnable;-
336}
executed 67765 times by 7 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentRun
67765
337-
338void QFutureInterfaceBase::setThreadPool(QThreadPool *pool)-
339{-
340 d->m_pool = pool;-
341}
executed 67765 times by 7 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentRun
67765
342-
343void QFutureInterfaceBase::setFilterMode(bool enable)-
344{-
345 QMutexLocker locker(&d->m_mutex);-
346 resultStoreBase().setFilterMode(enable);-
347}
executed 34 times by 2 tests: end of block
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
34
348-
349void QFutureInterfaceBase::setProgressRange(int minimum, int maximum)-
350{-
351 QMutexLocker locker(&d->m_mutex);-
352 d->m_progressMinimum = minimum;-
353 d->m_progressMaximum = maximum;-
354 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange, minimum, maximum));-
355}
executed 260 times by 4 tests: end of block
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
260
356-
357void QFutureInterfaceBase::setProgressValue(int progressValue)-
358{-
359 setProgressValueAndText(progressValue, QString());-
360}
executed 105907 times by 5 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
105907
361-
362void QFutureInterfaceBase::setProgressValueAndText(int progressValue,-
363 const QString &progressText)-
364{-
365 QMutexLocker locker(&d->m_mutex);-
366 if (d->manualProgress == false
d->manualProgress == falseDescription
TRUEevaluated 261 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
FALSEevaluated 105651 times by 4 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
)
261-105651
367 d->manualProgress = true;
executed 261 times by 5 tests: d->manualProgress = true;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
261
368 if (d->m_progressValue >= progressValue
d->m_progressV... progressValueDescription
TRUEevaluated 48 times by 4 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
FALSEevaluated 105864 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
)
48-105864
369 return;
executed 48 times by 4 tests: return;
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
48
370-
371 if (d->state.load() & (Canceled|Finished)
d->state.load(...eled|Finished)Description
TRUEnever evaluated
FALSEevaluated 105864 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
)
0-105864
372 return;
never executed: return;
0
373-
374 if (d->internal_updateProgress(progressValue, progressText)
d->internal_up... progressText)Description
TRUEevaluated 524 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
FALSEevaluated 105340 times by 4 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
) {
524-105340
375 d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Progress,-
376 d->m_progressValue,-
377 d->m_progressText));-
378 }
executed 524 times by 5 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
524
379}
executed 105864 times by 5 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
105864
380-
381QMutex *QFutureInterfaceBase::mutex() const-
382{-
383 return
executed 111280 times by 8 tests: return &d->m_mutex;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
&d->m_mutex;
executed 111280 times by 8 tests: return &d->m_mutex;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
111280
384}-
385-
386QtPrivate::ExceptionStore &QFutureInterfaceBase::exceptionStore()-
387{-
388 return
executed 3 times by 1 test: return d->m_exceptionStore;
Executed by:
  • tst_QFuture
d->m_exceptionStore;
executed 3 times by 1 test: return d->m_exceptionStore;
Executed by:
  • tst_QFuture
3
389}-
390-
391QtPrivate::ResultStoreBase &QFutureInterfaceBase::resultStoreBase()-
392{-
393 return
executed 68791 times by 9 tests: return d->m_results;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qtconcurrentiteratekernel - unknown status
d->m_results;
executed 68791 times by 9 tests: return d->m_results;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qtconcurrentiteratekernel - unknown status
68791
394}-
395-
396const QtPrivate::ResultStoreBase &QFutureInterfaceBase::resultStoreBase() const-
397{-
398 return
executed 76299 times by 8 tests: return d->m_results;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
d->m_results;
executed 76299 times by 8 tests: return d->m_results;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
76299
399}-
400-
401QFutureInterfaceBase &QFutureInterfaceBase::operator=(const QFutureInterfaceBase &other)-
402{-
403 other.d->refCount.ref();-
404 if (!d->refCount.deref()
!d->refCount.deref()Description
TRUEevaluated 74 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
FALSEevaluated 26 times by 3 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentRun
)
26-74
405 delete d;
executed 74 times by 4 tests: delete d;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
74
406 d = other.d;-
407 return
executed 100 times by 4 tests: return *this;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
*this;
executed 100 times by 4 tests: return *this;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
100
408}-
409-
410bool QFutureInterfaceBase::refT() const-
411{-
412 return
executed 96297 times by 8 tests: return d->refCount.refT();
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
d->refCount.refT();
executed 96297 times by 8 tests: return d->refCount.refT();
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
96297
413}-
414-
415bool QFutureInterfaceBase::derefT() const-
416{-
417 return
executed 96297 times by 9 tests: return d->refCount.derefT();
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qtconcurrentiteratekernel - unknown status
d->refCount.derefT();
executed 96297 times by 9 tests: return d->refCount.derefT();
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
  • tst_qtconcurrentiteratekernel - unknown status
96297
418}-
419-
420QFutureInterfaceBasePrivate::QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState)-
421 : refCount(1), m_progressValue(0), m_progressMinimum(0), m_progressMaximum(0),-
422 state(initialState),-
423 manualProgress(false), m_expectedResultCount(0), runnable(0), m_pool(0)-
424{-
425 progressTime.invalidate();-
426}
executed 128690 times by 12 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureSynchronizer
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128690
427-
428int QFutureInterfaceBasePrivate::internal_resultCount() const-
429{-
430 return
executed 28711 times by 3 tests: return m_results.count();
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
m_results.count();
executed 28711 times by 3 tests: return m_results.count();
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
28711
431}-
432-
433bool QFutureInterfaceBasePrivate::internal_isResultReadyAt(int index) const-
434{-
435 return
executed 43388 times by 8 tests: return (m_results.contains(index));
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
(m_results.contains(index));
executed 43388 times by 8 tests: return (m_results.contains(index));
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
43388
436}-
437-
438bool QFutureInterfaceBasePrivate::internal_waitForNextResult()-
439{-
440 if (m_results.hasNextResult()
m_results.hasNextResult()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
441 return
never executed: return true;
true;
never executed: return true;
0
442-
443 while ((
(state.load() ...Base::Running)Description
TRUEnever evaluated
FALSEnever evaluated
state.load() & QFutureInterfaceBase::Running)
(state.load() ...Base::Running)Description
TRUEnever evaluated
FALSEnever evaluated
&& m_results.hasNextResult() == false
m_results.hasN...ult() == falseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
444 waitCondition.wait(&m_mutex);
never executed: waitCondition.wait(&m_mutex);
0
445-
446 return
never executed: return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
!(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
never executed: return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
0
447}-
448-
449bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,-
450 const QString &progressText)-
451{-
452 if (m_progressValue >= progress
m_progressValue >= progressDescription
TRUEnever evaluated
FALSEevaluated 139978 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
)
0-139978
453 return
never executed: return false;
false;
never executed: return false;
0
454-
455 m_progressValue = progress;-
456 m_progressText = progressText;-
457-
458 if (progressTime.isValid()
progressTime.isValid()Description
TRUEevaluated 106769 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 33209 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
&& m_progressValue != m_progressMaximum
m_progressValu...rogressMaximumDescription
TRUEevaluated 106522 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 247 times by 4 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
)
247-106769
459 if (progressTime.elapsed() < (1000 / MaxProgressEmitsPerSecond)
progressTime.e...mitsPerSecond)Description
TRUEevaluated 106459 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
FALSEevaluated 63 times by 3 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
)
63-106459
460 return
executed 106459 times by 6 tests: return false;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
false;
executed 106459 times by 6 tests: return false;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentThreadEngine
106459
461-
462 progressTime.start();-
463 return
executed 33519 times by 8 tests: return true;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
true;
executed 33519 times by 8 tests: return true;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
33519
464}-
465-
466void QFutureInterfaceBasePrivate::internal_setThrottled(bool enable)-
467{-
468-
469 if ((enable
enableDescription
TRUEevaluated 1164 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEnever evaluated
&& (
(state.load() ...se::Throttled)Description
TRUEevaluated 1161 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
state.load() & QFutureInterfaceBase::Throttled)
(state.load() ...se::Throttled)Description
TRUEevaluated 1161 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
0-1164
470 || (!enable
!enableDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
&& !(state.load() & QFutureInterfaceBase::Throttled)
!(state.load()...se::Throttled)Description
TRUEnever evaluated
FALSEnever evaluated
))
0-3
471 return;
executed 1161 times by 1 test: return;
Executed by:
  • tst_QFutureWatcher
1161
472-
473-
474 if (enable
enableDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEnever evaluated
) {
0-3
475 switch_on(state, QFutureInterfaceBase::Throttled);-
476 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
else {
3
477 switch_off(state, QFutureInterfaceBase::Throttled);-
478 if (!(state.load() & QFutureInterfaceBase::Paused)
!(state.load()...eBase::Paused)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
479 pausedWaitCondition.wakeAll();
never executed: pausedWaitCondition.wakeAll();
0
480 }
never executed: end of block
0
481}-
482-
483void QFutureInterfaceBasePrivate::sendCallOut(const QFutureCallOutEvent &callOutEvent)-
484{-
485 if (outputConnections.isEmpty()
outputConnections.isEmpty()Description
TRUEevaluated 259374 times by 11 tests
Evaluated by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 1053 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
1053-259374
486 return;
executed 259374 times by 11 tests: return;
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
259374
487-
488 for (int i = 0; i < outputConnections.count()
i < outputConnections.count()Description
TRUEevaluated 1053 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 1053 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
; ++i)
1053
489 outputConnections.at(i)->postCallOutEvent(callOutEvent);
executed 1053 times by 1 test: outputConnections.at(i)->postCallOutEvent(callOutEvent);
Executed by:
  • tst_QFutureWatcher
1053
490}
executed 1053 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
1053
491-
492void QFutureInterfaceBasePrivate::sendCallOuts(const QFutureCallOutEvent &callOutEvent1,-
493 const QFutureCallOutEvent &callOutEvent2)-
494{-
495 if (outputConnections.isEmpty()
outputConnections.isEmpty()Description
TRUEevaluated 32989 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
6-32989
496 return;
executed 32989 times by 8 tests: return;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
32989
497-
498 for (int i = 0; i < outputConnections.count()
i < outputConnections.count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
; ++i) {
6
499 QFutureCallOutInterface *interface = outputConnections.at(i);-
500 interface->postCallOutEvent(callOutEvent1);-
501 interface->postCallOutEvent(callOutEvent2);-
502 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
6
503}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
6
504-
505-
506-
507-
508-
509void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface *interface)-
510{-
511 QMutexLocker locker(&m_mutex);-
512-
513 if (state.load() & QFutureInterfaceBase::Started
state.load() &...eBase::StartedDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEnever evaluated
) {
0-28
514 interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Started));-
515 interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange,-
516 m_progressMinimum,-
517 m_progressMaximum));-
518 interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Progress,-
519 m_progressValue,-
520 m_progressText));-
521 }
executed 28 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
28
522-
523 QtPrivate::ResultIteratorBase it = m_results.begin();-
524 while (it != m_results.end()
it != m_results.end()Description
TRUEevaluated 177 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
) {
28-177
525 const int begin = it.resultIndex();-
526 const int end = begin + it.batchSize();-
527 interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady,-
528 begin,-
529 end));-
530 it.batchedAdvance();-
531 }
executed 177 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
177
532-
533 if (state.load() & QFutureInterfaceBase::Paused
state.load() &...ceBase::PausedDescription
TRUEnever evaluated
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
0-28
534 interface->
never executed: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
never executed: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
0
535-
536 if (state.load() & QFutureInterfaceBase::Canceled
state.load() &...Base::CanceledDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
5-23
537 interface->
executed 5 times by 1 test: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
Executed by:
  • tst_QFutureWatcher
postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
executed 5 times by 1 test: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
Executed by:
  • tst_QFutureWatcher
5
538-
539 if (state.load() & QFutureInterfaceBase::Finished
state.load() &...Base::FinishedDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
14
540 interface->
executed 14 times by 1 test: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
Executed by:
  • tst_QFutureWatcher
postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
executed 14 times by 1 test: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
Executed by:
  • tst_QFutureWatcher
14
541-
542 outputConnections.append(interface);-
543}
executed 28 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
28
544-
545void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *interface)-
546{-
547 QMutexLocker lock(&m_mutex);-
548 const int index = outputConnections.indexOf(interface);-
549 if (index == -1
index == -1Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_QFutureWatcher
)
23-28
550 return;
executed 23 times by 1 test: return;
Executed by:
  • tst_QFutureWatcher
23
551 outputConnections.removeAt(index);-
552-
553 interface->callOutInterfaceDisconnected();-
554}
executed 28 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
28
555-
556void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState)-
557{-
558 state.store(newState);-
559}
executed 128329 times by 11 tests: end of block
Executed by:
  • tst_QDebug
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QUrl
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128329
560-
561-
Switch to Source codePreprocessed file

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