OpenCoverage

qresultstore.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/thread/qresultstore.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore 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 "qresultstore.h"-
41-
42#ifndef QT_NO_QFUTURE-
43-
44QT_BEGIN_NAMESPACE-
45-
46namespace QtPrivate {-
47-
48ResultIteratorBase::ResultIteratorBase()-
49 : mapIterator(QMap<int, ResultItem>::const_iterator()), m_vectorIndex(0) { }
never executed: end of block
0
50ResultIteratorBase::ResultIteratorBase(QMap<int, ResultItem>::const_iterator _mapIterator, int _vectorIndex)-
51 : mapIterator(_mapIterator), m_vectorIndex(_vectorIndex) { }
executed 304147 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
304147
52-
53int ResultIteratorBase::vectorIndex() const { return m_vectorIndex; }
never executed: return m_vectorIndex;
0
54int ResultIteratorBase::resultIndex() const { return mapIterator.key() + m_vectorIndex; }
executed 205 times by 3 tests: return mapIterator.key() + m_vectorIndex;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentResultStore
205
55-
56ResultIteratorBase ResultIteratorBase::operator++()-
57{-
58 if (canIncrementVectorIndex()) {
canIncrementVectorIndex()Description
TRUEevaluated 215 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
FALSEevaluated 374 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentThreadEngine
215-374
59 ++m_vectorIndex;-
60 } else {
executed 215 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
215
61 ++mapIterator;-
62 m_vectorIndex = 0;-
63 }
executed 374 times by 6 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentThreadEngine
374
64 return *this;
executed 589 times by 6 tests: return *this;
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentThreadEngine
589
65}-
66-
67int ResultIteratorBase::batchSize() const-
68{-
69 return mapIterator.value().count();
executed 35102 times by 9 tests: return mapIterator.value().count();
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
35102
70}-
71-
72void ResultIteratorBase::batchedAdvance()-
73{-
74 ++mapIterator;-
75 m_vectorIndex = 0;-
76}
executed 177 times by 1 test: end of block
Executed by:
  • tst_QFutureWatcher
177
77-
78bool ResultIteratorBase::operator==(const ResultIteratorBase &other) const-
79{-
80 return (mapIterator == other.mapIterator && m_vectorIndex == other.m_vectorIndex);
executed 114300 times by 9 tests: return (mapIterator == other.mapIterator && m_vectorIndex == other.m_vectorIndex);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
114300
81}-
82-
83bool ResultIteratorBase::operator!=(const ResultIteratorBase &other) const-
84{-
85 return !operator==(other);
executed 114279 times by 9 tests: return !operator==(other);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
114279
86}-
87-
88bool ResultIteratorBase::isVector() const-
89{-
90 return mapIterator.value().isVector();
never executed: return mapIterator.value().isVector();
0
91}-
92-
93bool ResultIteratorBase::canIncrementVectorIndex() const-
94{-
95 return (m_vectorIndex + 1 < mapIterator.value().m_count);
executed 589 times by 6 tests: return (m_vectorIndex + 1 < mapIterator.value().m_count);
Executed by:
  • tst_QFuture
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentThreadEngine
589
96}-
97-
98ResultStoreBase::ResultStoreBase()-
99 : insertIndex(0), resultCount(0), m_filterMode(false), filteredResults(0) { }
executed 128734 times by 13 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_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
128734
100-
101void ResultStoreBase::setFilterMode(bool enable)-
102{-
103 m_filterMode = enable;-
104}
executed 50 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
50
105-
106bool ResultStoreBase::filterMode() const-
107{-
108 return m_filterMode;
executed 34881 times by 9 tests: return m_filterMode;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34881
109}-
110-
111void ResultStoreBase::syncResultCount()-
112{-
113 ResultIteratorBase it = resultAt(resultCount);-
114 while (it != end()) {
it != end()Description
TRUEevaluated 34925 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 34936 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34925-34936
115 resultCount += it.batchSize();-
116 it = resultAt(resultCount);-
117 }
executed 34925 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34925
118}
executed 34936 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34936
119-
120void ResultStoreBase::insertResultItemIfValid(int index, ResultItem &resultItem)-
121{-
122 if (resultItem.isValid()) {
resultItem.isValid()Description
TRUEevaluated 34936 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 229 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
229-34936
123 m_results[index] = resultItem;-
124 syncResultCount();-
125 } else {
executed 34936 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34936
126 filteredResults += resultItem.count();-
127 }
executed 229 times by 4 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
229
128}-
129-
130int ResultStoreBase::insertResultItem(int index, ResultItem &resultItem)-
131{-
132 int storeIndex;-
133 if (m_filterMode && index != -1 && index > insertIndex) {
m_filterModeDescription
TRUEevaluated 489 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
FALSEevaluated 34676 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
index != -1Description
TRUEevaluated 489 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
FALSEnever evaluated
index > insertIndexDescription
TRUEevaluated 58 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
FALSEevaluated 431 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
0-34676
134 pendingResults[index] = resultItem;-
135 storeIndex = index;-
136 } else {
executed 58 times by 2 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
58
137 storeIndex = updateInsertIndex(index, resultItem.count());-
138 insertResultItemIfValid(storeIndex - filteredResults, resultItem);-
139 }
executed 35107 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
35107
140 syncPendingResults();-
141 return storeIndex;
executed 35165 times by 9 tests: return storeIndex;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
35165
142}-
143-
144void ResultStoreBase::syncPendingResults()-
145{-
146 // check if we can insert any of the pending results:-
147 QMap<int, ResultItem>::iterator it = pendingResults.begin();-
148 while (it != pendingResults.end()) {
it != pendingResults.end()Description
TRUEevaluated 102 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
FALSEevaluated 35121 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
102-35121
149 int index = it.key();-
150 if (index != resultCount + filteredResults)
index != resul...ilteredResultsDescription
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
44-58
151 break;
executed 44 times by 2 tests: break;
Executed by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
44
152-
153 ResultItem result = it.value();-
154 insertResultItemIfValid(index - filteredResults, result);-
155 pendingResults.erase(it);-
156 it = pendingResults.begin();-
157 }
executed 58 times by 2 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
58
158}
executed 35165 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
35165
159-
160int ResultStoreBase::addResult(int index, const void *result)-
161{-
162 ResultItem resultItem(result, 0); // 0 means "not a vector"-
163 return insertResultItem(index, resultItem);
executed 34625 times by 9 tests: return insertResultItem(index, resultItem);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34625
164}-
165-
166int ResultStoreBase::addResults(int index, const void *results, int vectorSize, int totalCount)-
167{-
168 if (m_filterMode == false || vectorSize == totalCount) {
m_filterMode == falseDescription
TRUEevaluated 173 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
FALSEevaluated 231 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
vectorSize == totalCountDescription
TRUEevaluated 49 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
FALSEevaluated 182 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
49-231
169 ResultItem resultItem(results, vectorSize);-
170 return insertResultItem(index, resultItem);
executed 222 times by 5 tests: return insertResultItem(index, resultItem);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
222
171 } else {-
172 if (vectorSize > 0) {
vectorSize > 0Description
TRUEevaluated 136 times by 2 tests
Evaluated by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
FALSEevaluated 46 times by 4 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
46-136
173 ResultItem filteredIn(results, vectorSize);-
174 insertResultItem(index, filteredIn);-
175 }
executed 136 times by 2 tests: end of block
Executed by:
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
136
176 ResultItem filteredAway(0, totalCount - vectorSize);-
177 return insertResultItem(index + vectorSize, filteredAway);
executed 182 times by 4 tests: return insertResultItem(index + vectorSize, filteredAway);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentResultStore
182
178 }-
179}-
180-
181ResultIteratorBase ResultStoreBase::begin() const-
182{-
183 return ResultIteratorBase(m_results.begin());
executed 147 times by 7 tests: return ResultIteratorBase(m_results.begin());
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentThreadEngine
147
184}-
185-
186ResultIteratorBase ResultStoreBase::end() const-
187{-
188 return ResultIteratorBase(m_results.end());
executed 114284 times by 9 tests: return ResultIteratorBase(m_results.end());
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
114284
189}-
190-
191bool ResultStoreBase::hasNextResult() const-
192{-
193 return begin() != end();
never executed: return begin() != end();
0
194}-
195-
196ResultIteratorBase ResultStoreBase::resultAt(int index) const-
197{-
198 if (m_results.isEmpty())
m_results.isEmpty()Description
TRUEevaluated 252 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 189464 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
252-189464
199 return ResultIteratorBase(m_results.end());
executed 252 times by 8 tests: return ResultIteratorBase(m_results.end());
Executed by:
  • tst_QFuture
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
252
200 QMap<int, ResultItem>::const_iterator it = m_results.lowerBound(index);-
201-
202 // lowerBound returns either an iterator to the result or an iterator-
203 // to the nearest greater index. If the latter happens it might be-
204 // that the result is stored in a vector at the previous index.-
205 if (it == m_results.end()) {
it == m_results.end()Description
TRUEevaluated 42340 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 147124 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
42340-147124
206 --it;-
207 if (it.value().isVector() == false) {
it.value().isVector() == falseDescription
TRUEevaluated 34811 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 7529 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
7529-34811
208 return ResultIteratorBase(m_results.end());
executed 34811 times by 9 tests: return ResultIteratorBase(m_results.end());
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34811
209 }-
210 } else {
executed 7529 times by 5 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
7529
211 if (it.key() > index) {
it.key() > indexDescription
TRUEevaluated 51615 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
FALSEevaluated 95509 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
51615-95509
212 if (it == m_results.begin())
it == m_results.begin()Description
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
FALSEevaluated 51591 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
24-51591
213 return ResultIteratorBase(m_results.end());
executed 24 times by 2 tests: return ResultIteratorBase(m_results.end());
Executed by:
  • tst_QFuture
  • tst_QtConcurrentResultStore
24
214 --it;-
215 }
executed 51591 times by 5 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
51591
216 }
executed 147100 times by 9 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
147100
217-
218 const int vectorIndex = index - it.key();-
219-
220 if (vectorIndex >= it.value().count())
vectorIndex >=...alue().count()Description
TRUEevaluated 401 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
FALSEevaluated 154228 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
401-154228
221 return ResultIteratorBase(m_results.end());
executed 401 times by 5 tests: return ResultIteratorBase(m_results.end());
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
401
222 else if (it.value().isVector() == false && vectorIndex != 0)
it.value().isVector() == falseDescription
TRUEevaluated 84682 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 69546 times by 5 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
vectorIndex != 0Description
TRUEnever evaluated
FALSEevaluated 84682 times by 9 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
0-84682
223 return ResultIteratorBase(m_results.end());
never executed: return ResultIteratorBase(m_results.end());
0
224 return ResultIteratorBase(it, vectorIndex);
executed 154228 times by 9 tests: return ResultIteratorBase(it, vectorIndex);
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
154228
225}-
226-
227bool ResultStoreBase::contains(int index) const-
228{-
229 return (resultAt(index) != end());
executed 43525 times by 9 tests: return (resultAt(index) != end());
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
43525
230}-
231-
232int ResultStoreBase::count() const-
233{-
234 return resultCount;
executed 29310 times by 5 tests: return resultCount;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
29310
235}-
236-
237// returns the insert index, calling this function with-
238// index equal to -1 returns the next available index.-
239int ResultStoreBase::updateInsertIndex(int index, int _count)-
240{-
241 if (index == -1) {
index == -1Description
TRUEevaluated 34039 times by 8 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
FALSEevaluated 1068 times by 6 tests
Evaluated by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
1068-34039
242 index = insertIndex;-
243 insertIndex += _count;-
244 } else {
executed 34039 times by 8 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
34039
245 insertIndex = qMax(index + _count, insertIndex);-
246 }
executed 1068 times by 6 tests: end of block
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
1068
247 return index;
executed 35107 times by 9 tests: return index;
Executed by:
  • tst_QFuture
  • tst_QFutureWatcher
  • tst_QLockFile
  • tst_QtConcurrentFilter
  • tst_QtConcurrentIterateKernel
  • tst_QtConcurrentMap
  • tst_QtConcurrentResultStore
  • tst_QtConcurrentRun
  • tst_QtConcurrentThreadEngine
35107
248}-
249-
250} // namespace QtPrivate-
251-
252QT_END_NAMESPACE-
253-
254#endif // QT_NO_QFUTURE-
Source codeSwitch to Preprocessed file

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