OpenCoverage

qnoncontiguousbytedevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qnoncontiguousbytedevice.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QNonContiguousByteDevice::QNonContiguousByteDevice() : QObject((QObject*)0)-
4{-
5}
executed 494 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
494
6-
7QNonContiguousByteDevice::~QNonContiguousByteDevice()-
8{-
9}-
10-
11-
12QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(QBuffer *b) : QNonContiguousByteDevice()-
13{-
14 buffer = b;-
15 byteArray = QByteArray::fromRawData(buffer->buffer().constData() + buffer->pos(), buffer->size() - buffer->pos());-
16 arrayImpl = new QNonContiguousByteDeviceByteArrayImpl(&byteArray);-
17 arrayImpl->setParent(this);-
18 connect(arrayImpl, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "145"), qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "145"));-
19 connect(arrayImpl, qFlagLocation("2""readProgress(qint64,qint64)" "\0" __FILE__ ":" "146"), qFlagLocation("2""readProgress(qint64,qint64)" "\0" __FILE__ ":" "146"));-
20}
executed 79 times by 3 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
79
21-
22QNonContiguousByteDeviceBufferImpl::~QNonContiguousByteDeviceBufferImpl()-
23{-
24}-
25-
26const char* QNonContiguousByteDeviceBufferImpl::readPointer(qint64 maximumLength, qint64 &len)-
27{-
28 return
executed 1306 times by 3 tests: return arrayImpl->readPointer(maximumLength, len);
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
arrayImpl->readPointer(maximumLength, len);
executed 1306 times by 3 tests: return arrayImpl->readPointer(maximumLength, len);
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1306
29}-
30-
31bool QNonContiguousByteDeviceBufferImpl::advanceReadPointer(qint64 amount)-
32{-
33 return
executed 1273 times by 2 tests: return arrayImpl->advanceReadPointer(amount);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
arrayImpl->advanceReadPointer(amount);
executed 1273 times by 2 tests: return arrayImpl->advanceReadPointer(amount);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
1273
34}-
35-
36bool QNonContiguousByteDeviceBufferImpl::atEnd() const-
37{-
38 return
executed 1051 times by 3 tests: return arrayImpl->atEnd();
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
arrayImpl->atEnd();
executed 1051 times by 3 tests: return arrayImpl->atEnd();
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1051
39}-
40-
41bool QNonContiguousByteDeviceBufferImpl::reset()-
42{-
43 return
executed 3 times by 1 test: return arrayImpl->reset();
Executed by:
  • tst_QNetworkReply
arrayImpl->reset();
executed 3 times by 1 test: return arrayImpl->reset();
Executed by:
  • tst_QNetworkReply
3
44}-
45-
46qint64 QNonContiguousByteDeviceBufferImpl::size() const-
47{-
48 return
executed 1100 times by 3 tests: return arrayImpl->size();
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
arrayImpl->size();
executed 1100 times by 3 tests: return arrayImpl->size();
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1100
49}-
50-
51QNonContiguousByteDeviceByteArrayImpl::QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba) : QNonContiguousByteDevice(), currentPosition(0)-
52{-
53 byteArray = ba;-
54}
executed 84 times by 4 tests: end of block
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
84
55-
56QNonContiguousByteDeviceByteArrayImpl::~QNonContiguousByteDeviceByteArrayImpl()-
57{-
58}-
59-
60const char* QNonContiguousByteDeviceByteArrayImpl::readPointer(qint64 maximumLength, qint64 &len)-
61{-
62 if (atEnd()
atEnd()Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 1278 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
) {
32-1278
63 len = -1;-
64 return
executed 32 times by 2 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
0;
executed 32 times by 2 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
32
65 }-
66-
67 if (maximumLength != -1
maximumLength != -1Description
TRUEevaluated 1272 times by 4 tests
Evaluated by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
6-1272
68 len = qMin(maximumLength, size() - currentPosition);
executed 1272 times by 4 tests: len = qMin(maximumLength, size() - currentPosition);
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1272
69 else-
70 len = size() - currentPosition;
executed 6 times by 1 test: len = size() - currentPosition;
Executed by:
  • tst_QNetworkReply
6
71-
72 return
executed 1278 times by 4 tests: return byteArray->constData() + currentPosition;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
byteArray->constData() + currentPosition;
executed 1278 times by 4 tests: return byteArray->constData() + currentPosition;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
1278
73}-
74-
75bool QNonContiguousByteDeviceByteArrayImpl::advanceReadPointer(qint64 amount)-
76{-
77 currentPosition += amount;-
78 readProgress(currentPosition, size());-
79 return
executed 1277 times by 3 tests: return true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
true;
executed 1277 times by 3 tests: return true;
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_Spdy
1277
80}-
81-
82bool QNonContiguousByteDeviceByteArrayImpl::atEnd() const-
83{-
84 return
executed 2361 times by 4 tests: return currentPosition >= size();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
currentPosition >= size();
executed 2361 times by 4 tests: return currentPosition >= size();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
2361
85}-
86-
87bool QNonContiguousByteDeviceByteArrayImpl::reset()-
88{-
89 currentPosition = 0;-
90 return
executed 3 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
3
91}-
92-
93qint64 QNonContiguousByteDeviceByteArrayImpl::size() const-
94{-
95 return
executed 6023 times by 4 tests: return byteArray->size();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
byteArray->size();
executed 6023 times by 4 tests: return byteArray->size();
Executed by:
  • tst_QHttpNetworkConnection
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
6023
96}-
97-
98qint64 QNonContiguousByteDeviceByteArrayImpl::pos() const-
99{-
100 return
executed 4 times by 1 test: return currentPosition;
Executed by:
  • tst_QHttpNetworkConnection
currentPosition;
executed 4 times by 1 test: return currentPosition;
Executed by:
  • tst_QHttpNetworkConnection
4
101}-
102-
103QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb)-
104 : QNonContiguousByteDevice(), currentPosition(0)-
105{-
106 ringBuffer = rb;-
107}
executed 99 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
99
108-
109QNonContiguousByteDeviceRingBufferImpl::~QNonContiguousByteDeviceRingBufferImpl()-
110{-
111}-
112-
113const char* QNonContiguousByteDeviceRingBufferImpl::readPointer(qint64 maximumLength, qint64 &len)-
114{-
115 if (atEnd()
atEnd()Description
TRUEnever evaluated
FALSEevaluated 892 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
0-892
116 len = -1;-
117 return
never executed: return 0;
0;
never executed: return 0;
0
118 }-
119-
120 const char *returnValue = ringBuffer->readPointerAtPosition(currentPosition, len);-
121-
122 if (maximumLength != -1
maximumLength != -1Description
TRUEevaluated 892 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEnever evaluated
)
0-892
123 len = qMin(len, maximumLength);
executed 892 times by 1 test: len = qMin(len, maximumLength);
Executed by:
  • tst_QNetworkReply
892
124-
125 return
executed 892 times by 1 test: return returnValue;
Executed by:
  • tst_QNetworkReply
returnValue;
executed 892 times by 1 test: return returnValue;
Executed by:
  • tst_QNetworkReply
892
126}-
127-
128bool QNonContiguousByteDeviceRingBufferImpl::advanceReadPointer(qint64 amount)-
129{-
130 currentPosition += amount;-
131 readProgress(currentPosition, size());-
132 return
executed 892 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
true;
executed 892 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
892
133}-
134-
135bool QNonContiguousByteDeviceRingBufferImpl::atEnd() const-
136{-
137 return
executed 1126 times by 1 test: return currentPosition >= size();
Executed by:
  • tst_QNetworkReply
currentPosition >= size();
executed 1126 times by 1 test: return currentPosition >= size();
Executed by:
  • tst_QNetworkReply
1126
138}-
139-
140qint64 QNonContiguousByteDeviceRingBufferImpl::pos() const-
141{-
142 return
executed 716 times by 1 test: return currentPosition;
Executed by:
  • tst_QNetworkReply
currentPosition;
executed 716 times by 1 test: return currentPosition;
Executed by:
  • tst_QNetworkReply
716
143}-
144-
145bool QNonContiguousByteDeviceRingBufferImpl::reset()-
146{-
147 currentPosition = 0;-
148 return
executed 117 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
true;
executed 117 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
117
149}-
150-
151qint64 QNonContiguousByteDeviceRingBufferImpl::size() const-
152{-
153 return
executed 2293 times by 1 test: return ringBuffer->size();
Executed by:
  • tst_QNetworkReply
ringBuffer->size();
executed 2293 times by 1 test: return ringBuffer->size();
Executed by:
  • tst_QNetworkReply
2293
154}-
155-
156QNonContiguousByteDeviceIoDeviceImpl::QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d)-
157 : QNonContiguousByteDevice(),-
158 currentReadBuffer(0), currentReadBufferSize(16*1024),-
159 currentReadBufferAmount(0), currentReadBufferPosition(0), totalAdvancements(0),-
160 eof(false)-
161{-
162 device = d;-
163 initialPosition = d->pos();-
164 connect(device, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "291"), this, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "291"), Qt::QueuedConnection);-
165 connect(device, qFlagLocation("2""readChannelFinished()" "\0" __FILE__ ":" "292"), this, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "292"), Qt::QueuedConnection);-
166}
executed 77 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
77
167-
168QNonContiguousByteDeviceIoDeviceImpl::~QNonContiguousByteDeviceIoDeviceImpl()-
169{-
170 delete currentReadBuffer;-
171}
executed 77 times by 2 tests: end of block
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
77
172-
173const char* QNonContiguousByteDeviceIoDeviceImpl::readPointer(qint64 maximumLength, qint64 &len)-
174{-
175 if (eof == true
eof == trueDescription
TRUEnever evaluated
FALSEevaluated 2250 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
0-2250
176 len = -1;-
177 return
never executed: return 0;
0;
never executed: return 0;
0
178 }-
179-
180 if (currentReadBuffer == 0
currentReadBuffer == 0Description
TRUEevaluated 77 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2173 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
77-2173
181 currentReadBuffer = new QByteArray(currentReadBufferSize, '\0');
executed 77 times by 2 tests: currentReadBuffer = new QByteArray(currentReadBufferSize, '\0');
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
77
182-
183 if (maximumLength == -1
maximumLength == -1Description
TRUEevaluated 698 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1552 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
698-1552
184 maximumLength = currentReadBufferSize;
executed 698 times by 1 test: maximumLength = currentReadBufferSize;
Executed by:
  • tst_QNetworkReply
698
185-
186 if (currentReadBufferAmount - currentReadBufferPosition > 0
currentReadBuf...erPosition > 0Description
TRUEnever evaluated
FALSEevaluated 2250 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
0-2250
187 len = currentReadBufferAmount - currentReadBufferPosition;-
188 return
never executed: return currentReadBuffer->data() + currentReadBufferPosition;
currentReadBuffer->data() + currentReadBufferPosition;
never executed: return currentReadBuffer->data() + currentReadBufferPosition;
0
189 }-
190-
191 qint64 haveRead = device->read(currentReadBuffer->data(), qMin(maximumLength, currentReadBufferSize));-
192-
193 if ((
(haveRead == -1)Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 2222 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
haveRead == -1)
(haveRead == -1)Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 2222 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
|| (haveRead == 0
haveRead == 0Description
TRUEevaluated 100 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 2122 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
&& device->atEnd()
device->atEnd()Description
TRUEevaluated 96 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
&& !device->isSequential()
!device->isSequential()Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
FALSEevaluated 85 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)) {
4-2222
194 eof = true;-
195 len = -1;-
196-
197 if (size() == -1
size() == -1Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
11-28
198 readProgress(totalAdvancements, totalAdvancements);
executed 28 times by 1 test: readProgress(totalAdvancements, totalAdvancements);
Executed by:
  • tst_QNetworkReply
28
199 return
executed 39 times by 2 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
0;
executed 39 times by 2 tests: return 0;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
39
200 }-
201-
202 currentReadBufferAmount = haveRead;-
203 currentReadBufferPosition = 0;-
204-
205 len = haveRead;-
206 return
executed 2211 times by 2 tests: return currentReadBuffer->data();
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
currentReadBuffer->data();
executed 2211 times by 2 tests: return currentReadBuffer->data();
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
2211
207}-
208-
209bool QNonContiguousByteDeviceIoDeviceImpl::advanceReadPointer(qint64 amount)-
210{-
211 totalAdvancements += amount;-
212-
213-
214 currentReadBufferPosition += amount;-
215-
216 if (size() == -1
size() == -1Description
TRUEevaluated 577 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1545 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
577-1545
217 readProgress(totalAdvancements, totalAdvancements);
executed 577 times by 1 test: readProgress(totalAdvancements, totalAdvancements);
Executed by:
  • tst_QNetworkReply
577
218 else-
219 readProgress(totalAdvancements, size());
executed 1545 times by 2 tests: readProgress(totalAdvancements, size());
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
1545
220-
221-
222 if (currentReadBufferPosition > currentReadBufferAmount
currentReadBuf...adBufferAmountDescription
TRUEnever evaluated
FALSEevaluated 2122 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
) {
0-2122
223 qint64 i = currentReadBufferPosition - currentReadBufferAmount;-
224 while (i > 0
i > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
225 if (device->getChar(0) == false
device->getChar(0) == falseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
226 readProgress(totalAdvancements - i, size());-
227 return
never executed: return false;
false;
never executed: return false;
0
228 }-
229 i--;-
230 }
never executed: end of block
0
231-
232 currentReadBufferPosition = 0;-
233 currentReadBufferAmount = 0;-
234 }
never executed: end of block
0
235-
236-
237 return
executed 2122 times by 2 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
true;
executed 2122 times by 2 tests: return true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
2122
238}-
239-
240bool QNonContiguousByteDeviceIoDeviceImpl::atEnd() const-
241{-
242 return
executed 1580 times by 2 tests: return eof == true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
eof == true;
executed 1580 times by 2 tests: return eof == true;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
1580
243}-
244-
245bool QNonContiguousByteDeviceIoDeviceImpl::reset()-
246{-
247 bool reset = (
(initialPosition == 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
initialPosition == 0)
(initialPosition == 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
? device->reset() : device->seek(initialPosition);
1-6
248 if (reset
resetDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
1-6
249 eof = false;-
250 totalAdvancements = 0;-
251 if (currentReadBuffer
currentReadBufferDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QNetworkReply
) {
2-4
252 delete currentReadBuffer;-
253 currentReadBuffer = 0;-
254 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
2
255 currentReadBufferAmount = 0;-
256 currentReadBufferPosition = 0;-
257 return
executed 6 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_QNetworkReply
6
258 }-
259-
260 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QNetworkReply
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QNetworkReply
1
261}-
262-
263qint64 QNonContiguousByteDeviceIoDeviceImpl::size() const-
264{-
265-
266-
267 if (device->isSequential()
device->isSequential()Description
TRUEevaluated 607 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 4707 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
607-4707
268 return
executed 607 times by 1 test: return -1;
Executed by:
  • tst_QNetworkReply
-1;
executed 607 times by 1 test: return -1;
Executed by:
  • tst_QNetworkReply
607
269-
270 return
executed 4707 times by 2 tests: return device->size() - initialPosition;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
device->size() - initialPosition;
executed 4707 times by 2 tests: return device->size() - initialPosition;
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
4707
271}-
272-
273qint64 QNonContiguousByteDeviceIoDeviceImpl::pos() const-
274{-
275 if (device->isSequential()
device->isSequential()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
276 return
never executed: return -1;
-1;
never executed: return -1;
0
277-
278 return
never executed: return device->pos();
device->pos();
never executed: return device->pos();
0
279}-
280-
281QByteDeviceWrappingIoDevice::QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd) : QIODevice((QObject*)0)-
282{-
283 byteDevice = bd;-
284 connect(bd, qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "411"), qFlagLocation("2""readyRead()" "\0" __FILE__ ":" "411"));-
285-
286 open(ReadOnly);-
287}
executed 13 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
13
288-
289QByteDeviceWrappingIoDevice::~QByteDeviceWrappingIoDevice()-
290{-
291-
292}-
293-
294bool QByteDeviceWrappingIoDevice::isSequential() const-
295{-
296 return
executed 55 times by 1 test: return (byteDevice->size() == -1);
Executed by:
  • tst_QNetworkReply
(byteDevice->size() == -1);
executed 55 times by 1 test: return (byteDevice->size() == -1);
Executed by:
  • tst_QNetworkReply
55
297}-
298-
299bool QByteDeviceWrappingIoDevice::atEnd() const-
300{-
301 return
never executed: return byteDevice->atEnd();
byteDevice->atEnd();
never executed: return byteDevice->atEnd();
0
302}-
303-
304bool QByteDeviceWrappingIoDevice::reset()-
305{-
306 return
never executed: return byteDevice->reset();
byteDevice->reset();
never executed: return byteDevice->reset();
0
307}-
308-
309qint64 QByteDeviceWrappingIoDevice::size() const-
310{-
311 if (isSequential()
isSequential()Description
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
0-22
312 return
never executed: return 0;
0;
never executed: return 0;
0
313-
314 return
executed 22 times by 1 test: return byteDevice->size();
Executed by:
  • tst_QNetworkReply
byteDevice->size();
executed 22 times by 1 test: return byteDevice->size();
Executed by:
  • tst_QNetworkReply
22
315}-
316-
317-
318qint64 QByteDeviceWrappingIoDevice::readData( char * data, qint64 maxSize)-
319{-
320 qint64 len;-
321 const char *readPointer = byteDevice->readPointer(maxSize, len);-
322 if (len == -1
len == -1Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QNetworkReply
FALSEevaluated 147 times by 1 test
Evaluated by:
  • tst_QNetworkReply
)
11-147
323 return
executed 11 times by 1 test: return -1;
Executed by:
  • tst_QNetworkReply
-1;
executed 11 times by 1 test: return -1;
Executed by:
  • tst_QNetworkReply
11
324-
325 memcpy(data, readPointer, len);-
326 byteDevice->advanceReadPointer(len);-
327 return
executed 147 times by 1 test: return len;
Executed by:
  • tst_QNetworkReply
len;
executed 147 times by 1 test: return len;
Executed by:
  • tst_QNetworkReply
147
328}-
329-
330qint64 QByteDeviceWrappingIoDevice::writeData( const char* data, qint64 maxSize)-
331{-
332 (void)data;;-
333 (void)maxSize;;-
334 return
never executed: return -1;
-1;
never executed: return -1;
0
335}-
336QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QIODevice *device)-
337{-
338-
339 if (QBuffer* buffer = qobject_cast<QBuffer*>(device)
QBuffer* buffe...ffer*>(device)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
340 return
never executed: return new QNonContiguousByteDeviceBufferImpl(buffer);
new QNonContiguousByteDeviceBufferImpl(buffer);
never executed: return new QNonContiguousByteDeviceBufferImpl(buffer);
0
341 }-
342-
343-
344-
345-
346-
347 return
never executed: return new QNonContiguousByteDeviceIoDeviceImpl(device);
new QNonContiguousByteDeviceIoDeviceImpl(device);
never executed: return new QNonContiguousByteDeviceIoDeviceImpl(device);
0
348}-
349-
350-
351-
352-
353-
354-
355-
356QSharedPointer<QNonContiguousByteDevice> QNonContiguousByteDeviceFactory::createShared(QIODevice *device)-
357{-
358-
359 if (QBuffer *buffer = qobject_cast<QBuffer*>(device)
QBuffer *buffe...ffer*>(device)Description
TRUEevaluated 79 times by 3 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 77 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_Spdy
)
77-79
360 return
executed 79 times by 3 tests: return QSharedPointer<QNonContiguousByteDeviceBufferImpl>::create(buffer);
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
QSharedPointer<QNonContiguousByteDeviceBufferImpl>::create(buffer);
executed 79 times by 3 tests: return QSharedPointer<QNonContiguousByteDeviceBufferImpl>::create(buffer);
Executed by:
  • tst_QNetworkReply
  • tst_QXmlInputSource
  • tst_Spdy
79
361-
362-
363-
364-
365-
366 return
executed 77 times by 2 tests: return QSharedPointer<QNonContiguousByteDeviceIoDeviceImpl>::create(device);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
QSharedPointer<QNonContiguousByteDeviceIoDeviceImpl>::create(device);
executed 77 times by 2 tests: return QSharedPointer<QNonContiguousByteDeviceIoDeviceImpl>::create(device);
Executed by:
  • tst_QNetworkReply
  • tst_Spdy
77
367}-
368QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QSharedPointer<QRingBuffer> ringBuffer)-
369{-
370 return
never executed: return new QNonContiguousByteDeviceRingBufferImpl(ringBuffer);
new QNonContiguousByteDeviceRingBufferImpl(ringBuffer);
never executed: return new QNonContiguousByteDeviceRingBufferImpl(ringBuffer);
0
371}-
372-
373-
374-
375-
376-
377-
378QSharedPointer<QNonContiguousByteDevice> QNonContiguousByteDeviceFactory::createShared(QSharedPointer<QRingBuffer> ringBuffer)-
379{-
380 return
executed 99 times by 1 test: return QSharedPointer<QNonContiguousByteDeviceRingBufferImpl>::create(std::move(ringBuffer));
Executed by:
  • tst_QNetworkReply
QSharedPointer<QNonContiguousByteDeviceRingBufferImpl>::create(std::move(ringBuffer));
executed 99 times by 1 test: return QSharedPointer<QNonContiguousByteDeviceRingBufferImpl>::create(std::move(ringBuffer));
Executed by:
  • tst_QNetworkReply
99
381}-
382QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QByteArray *byteArray)-
383{-
384 return
executed 5 times by 1 test: return new QNonContiguousByteDeviceByteArrayImpl(byteArray);
Executed by:
  • tst_QHttpNetworkConnection
new QNonContiguousByteDeviceByteArrayImpl(byteArray);
executed 5 times by 1 test: return new QNonContiguousByteDeviceByteArrayImpl(byteArray);
Executed by:
  • tst_QHttpNetworkConnection
5
385}-
386-
387-
388-
389-
390-
391-
392QSharedPointer<QNonContiguousByteDevice> QNonContiguousByteDeviceFactory::createShared(QByteArray *byteArray)-
393{-
394 return
never executed: return QSharedPointer<QNonContiguousByteDeviceByteArrayImpl>::create(byteArray);
QSharedPointer<QNonContiguousByteDeviceByteArrayImpl>::create(byteArray);
never executed: return QSharedPointer<QNonContiguousByteDeviceByteArrayImpl>::create(byteArray);
0
395}-
396QIODevice* QNonContiguousByteDeviceFactory::wrap(QNonContiguousByteDevice* byteDevice)-
397{-
398-
399-
400-
401-
402-
403 return
executed 13 times by 1 test: return new QByteDeviceWrappingIoDevice(byteDevice);
Executed by:
  • tst_QNetworkReply
new QByteDeviceWrappingIoDevice(byteDevice);
executed 13 times by 1 test: return new QByteDeviceWrappingIoDevice(byteDevice);
Executed by:
  • tst_QNetworkReply
13
404}-
405-
406-
Switch to Source codePreprocessed file

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