qiodevice.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qiodevice.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//#define QIODEVICE_DEBUG-
41-
42#include "qbytearray.h"-
43#include "qdebug.h"-
44#include "qiodevice_p.h"-
45#include "qfile.h"-
46#include "qstringlist.h"-
47#include "qdir.h"-
48#include "private/qbytearray_p.h"-
49-
50#include <algorithm>-
51-
52#ifdef QIODEVICE_DEBUG-
53# include <ctype.h>-
54#endif-
55-
56QT_BEGIN_NAMESPACE-
57-
58#ifdef QIODEVICE_DEBUG-
59void debugBinaryString(const QByteArray &input)-
60{-
61 QByteArray tmp;-
62 int startOffset = 0;-
63 for (int i = 0; i < input.size(); ++i) {-
64 tmp += input[i];-
65-
66 if ((i % 16) == 15 || i == (input.size() - 1)) {-
67 printf("\n%15d:", startOffset);-
68 startOffset += tmp.size();-
69-
70 for (int j = 0; j < tmp.size(); ++j)-
71 printf(" %02x", int(uchar(tmp[j])));-
72 for (int j = tmp.size(); j < 16 + 1; ++j)-
73 printf(" ");-
74 for (int j = 0; j < tmp.size(); ++j)-
75 printf("%c", isprint(int(uchar(tmp[j]))) ? tmp[j] : '.');-
76 tmp.clear();-
77 }-
78 }-
79 printf("\n\n");-
80}-
81-
82void debugBinaryString(const char *data, qint64 maxlen)-
83{-
84 debugBinaryString(QByteArray(data, maxlen));-
85}-
86#endif-
87-
88#define Q_VOID-
89-
90static void checkWarnMessage(const QIODevice *device, const char *function, const char *what)-
91{-
92#ifndef QT_NO_WARNING_OUTPUT-
93 QDebug d = qWarning();-
94 d.noquote();-
95 d.nospace();-
96 d << "QIODevice::" << function;-
97#ifndef QT_NO_QOBJECT-
98 d << " (" << device->metaObject()->className();-
99 if (!device->objectName().isEmpty())
!device->objec...me().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 168 times by 9 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
  • tst_QUdpSocket
0-168
100 d << ", \"" << device->objectName() << '"';
never executed: d << ", \"" << device->objectName() << '"';
0
101 if (const QFile *f = qobject_cast<const QFile *>(device))
const QFile *f...ile *>(device)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QString
FALSEevaluated 165 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
3-165
102 d << ", \"" << QDir::toNativeSeparators(f->fileName()) << '"';
executed 3 times by 2 tests: d << ", \"" << QDir::toNativeSeparators(f->fileName()) << '"';
Executed by:
  • tst_QFile
  • tst_QString
3
103 d << ')';-
104#else-
105 Q_UNUSED(device)-
106#endif // !QT_NO_QOBJECT-
107 d << ": " << what;-
108#else-
109 Q_UNUSED(device);-
110 Q_UNUSED(function);-
111 Q_UNUSED(what);-
112#endif // QT_NO_WARNING_OUTPUT-
113}
executed 168 times by 9 tests: end of block
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
  • tst_QUdpSocket
168
114-
115#define CHECK_MAXLEN(function, returnType) \-
116 do { \-
117 if (maxSize < 0) { \-
118 checkWarnMessage(this, #function, "Called with maxSize < 0"); \-
119 return returnType; \-
120 } \-
121 } while (0)-
122-
123#define CHECK_MAXBYTEARRAYSIZE(function) \-
124 do { \-
125 if (maxSize >= MaxByteArraySize) { \-
126 checkWarnMessage(this, #function, "maxSize argument exceeds QByteArray size limit"); \-
127 maxSize = MaxByteArraySize - 1; \-
128 } \-
129 } while (0)-
130-
131#define CHECK_WRITABLE(function, returnType) \-
132 do { \-
133 if ((d->openMode & WriteOnly) == 0) { \-
134 if (d->openMode == NotOpen) { \-
135 checkWarnMessage(this, #function, "device not open"); \-
136 return returnType; \-
137 } \-
138 checkWarnMessage(this, #function, "ReadOnly device"); \-
139 return returnType; \-
140 } \-
141 } while (0)-
142-
143#define CHECK_READABLE(function, returnType) \-
144 do { \-
145 if ((d->openMode & ReadOnly) == 0) { \-
146 if (d->openMode == NotOpen) { \-
147 checkWarnMessage(this, #function, "device not open"); \-
148 return returnType; \-
149 } \-
150 checkWarnMessage(this, #function, "WriteOnly device"); \-
151 return returnType; \-
152 } \-
153 } while (0)-
154-
155/*!-
156 \internal-
157 */-
158QIODevicePrivate::QIODevicePrivate()-
159 : openMode(QIODevice::NotOpen),-
160 pos(0), devicePos(0),-
161 readChannelCount(0),-
162 writeChannelCount(0),-
163 currentReadChannel(0),-
164 currentWriteChannel(0),-
165 readBufferChunkSize(QIODEVICE_BUFFERSIZE),-
166 writeBufferChunkSize(0),-
167 transactionPos(0),-
168 transactionStarted(false)-
169 , baseReadLineDataCalled(false)-
170 , accessMode(Unset)-
171#ifdef QT_NO_QOBJECT-
172 , q_ptr(0)-
173#endif-
174{-
175}
executed 89060 times by 265 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSocket
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • ...
89060
176-
177/*!-
178 \internal-
179 */-
180QIODevicePrivate::~QIODevicePrivate()-
181{-
182}-
183-
184/*!-
185 \class QIODevice-
186 \inmodule QtCore-
187 \reentrant-
188-
189 \brief The QIODevice class is the base interface class of all I/O-
190 devices in Qt.-
191-
192 \ingroup io-
193-
194 QIODevice provides both a common implementation and an abstract-
195 interface for devices that support reading and writing of blocks-
196 of data, such as QFile, QBuffer and QTcpSocket. QIODevice is-
197 abstract and can not be instantiated, but it is common to use the-
198 interface it defines to provide device-independent I/O features.-
199 For example, Qt's XML classes operate on a QIODevice pointer,-
200 allowing them to be used with various devices (such as files and-
201 buffers).-
202-
203 Before accessing the device, open() must be called to set the-
204 correct OpenMode (such as ReadOnly or ReadWrite). You can then-
205 write to the device with write() or putChar(), and read by calling-
206 either read(), readLine(), or readAll(). Call close() when you are-
207 done with the device.-
208-
209 QIODevice distinguishes between two types of devices:-
210 random-access devices and sequential devices.-
211-
212 \list-
213 \li Random-access devices support seeking to arbitrary-
214 positions using seek(). The current position in the file is-
215 available by calling pos(). QFile and QBuffer are examples of-
216 random-access devices.-
217-
218 \li Sequential devices don't support seeking to arbitrary-
219 positions. The data must be read in one pass. The functions-
220 pos() and size() don't work for sequential devices.-
221 QTcpSocket and QProcess are examples of sequential devices.-
222 \endlist-
223-
224 You can use isSequential() to determine the type of device.-
225-
226 QIODevice emits readyRead() when new data is available for-
227 reading; for example, if new data has arrived on the network or if-
228 additional data is appended to a file that you are reading-
229 from. You can call bytesAvailable() to determine the number of-
230 bytes that are currently available for reading. It's common to use-
231 bytesAvailable() together with the readyRead() signal when-
232 programming with asynchronous devices such as QTcpSocket, where-
233 fragments of data can arrive at arbitrary points in-
234 time. QIODevice emits the bytesWritten() signal every time a-
235 payload of data has been written to the device. Use bytesToWrite()-
236 to determine the current amount of data waiting to be written.-
237-
238 Certain subclasses of QIODevice, such as QTcpSocket and QProcess,-
239 are asynchronous. This means that I/O functions such as write()-
240 or read() always return immediately, while communication with the-
241 device itself may happen when control goes back to the event loop.-
242 QIODevice provides functions that allow you to force these-
243 operations to be performed immediately, while blocking the-
244 calling thread and without entering the event loop. This allows-
245 QIODevice subclasses to be used without an event loop, or in-
246 a separate thread:-
247-
248 \list-
249 \li waitForReadyRead() - This function suspends operation in the-
250 calling thread until new data is available for reading.-
251-
252 \li waitForBytesWritten() - This function suspends operation in the-
253 calling thread until one payload of data has been written to the-
254 device.-
255-
256 \li waitFor....() - Subclasses of QIODevice implement blocking-
257 functions for device-specific operations. For example, QProcess-
258 has a function called \l {QProcess::}{waitForStarted()} which suspends operation in-
259 the calling thread until the process has started.-
260 \endlist-
261-
262 Calling these functions from the main, GUI thread, may cause your-
263 user interface to freeze. Example:-
264-
265 \snippet code/src_corelib_io_qiodevice.cpp 0-
266-
267 By subclassing QIODevice, you can provide the same interface to-
268 your own I/O devices. Subclasses of QIODevice are only required to-
269 implement the protected readData() and writeData() functions.-
270 QIODevice uses these functions to implement all its convenience-
271 functions, such as getChar(), readLine() and write(). QIODevice-
272 also handles access control for you, so you can safely assume that-
273 the device is opened in write mode if writeData() is called.-
274-
275 Some subclasses, such as QFile and QTcpSocket, are implemented-
276 using a memory buffer for intermediate storing of data. This-
277 reduces the number of required device accessing calls, which are-
278 often very slow. Buffering makes functions like getChar() and-
279 putChar() fast, as they can operate on the memory buffer instead-
280 of directly on the device itself. Certain I/O operations, however,-
281 don't work well with a buffer. For example, if several users open-
282 the same device and read it character by character, they may end-
283 up reading the same data when they meant to read a separate chunk-
284 each. For this reason, QIODevice allows you to bypass any-
285 buffering by passing the Unbuffered flag to open(). When-
286 subclassing QIODevice, remember to bypass any buffer you may use-
287 when the device is open in Unbuffered mode.-
288-
289 Usually, the incoming data stream from an asynchronous device is-
290 fragmented, and chunks of data can arrive at arbitrary points in time.-
291 To handle incomplete reads of data structures, use the transaction-
292 mechanism implemented by QIODevice. See startTransaction() and related-
293 functions for more details.-
294-
295 Some sequential devices support communicating via multiple channels. These-
296 channels represent separate streams of data that have the property of-
297 independently sequenced delivery. Once the device is opened, you can-
298 determine the number of channels by calling the readChannelCount() and-
299 writeChannelCount() functions. To switch between channels, call-
300 setCurrentReadChannel() and setCurrentWriteChannel(), respectively.-
301 QIODevice also provides additional signals to handle asynchronous-
302 communication on a per-channel basis.-
303-
304 \sa QBuffer, QFile, QTcpSocket-
305*/-
306-
307/*!-
308 \enum QIODevice::OpenModeFlag-
309-
310 This enum is used with open() to describe the mode in which a device-
311 is opened. It is also returned by openMode().-
312-
313 \value NotOpen The device is not open.-
314 \value ReadOnly The device is open for reading.-
315 \value WriteOnly The device is open for writing. Note that this mode implies-
316 Truncate.-
317 \value ReadWrite The device is open for reading and writing.-
318 \value Append The device is opened in append mode so that all data is-
319 written to the end of the file.-
320 \value Truncate If possible, the device is truncated before it is opened.-
321 All earlier contents of the device are lost.-
322 \value Text When reading, the end-of-line terminators are-
323 translated to '\\n'. When writing, the end-of-line-
324 terminators are translated to the local encoding, for-
325 example '\\r\\n' for Win32.-
326 \value Unbuffered Any buffer in the device is bypassed.-
327-
328 Certain flags, such as \c Unbuffered and \c Truncate, are-
329 meaningless when used with some subclasses. Some of these-
330 restrictions are implied by the type of device that is represented-
331 by a subclass. In other cases, the restriction may be due to the-
332 implementation, or may be imposed by the underlying platform; for-
333 example, QTcpSocket does not support \c Unbuffered mode, and-
334 limitations in the native API prevent QFile from supporting \c-
335 Unbuffered on Windows.-
336*/-
337-
338/*! \fn QIODevice::bytesWritten(qint64 bytes)-
339-
340 This signal is emitted every time a payload of data has been-
341 written to the device's current write channel. The \a bytes argument is-
342 set to the number of bytes that were written in this payload.-
343-
344 bytesWritten() is not emitted recursively; if you reenter the event loop-
345 or call waitForBytesWritten() inside a slot connected to the-
346 bytesWritten() signal, the signal will not be reemitted (although-
347 waitForBytesWritten() may still return true).-
348-
349 \sa readyRead()-
350*/-
351-
352/*!-
353 \fn QIODevice::channelBytesWritten(int channel, qint64 bytes)-
354 \since 5.7-
355-
356 This signal is emitted every time a payload of data has been written to-
357 the device. The \a bytes argument is set to the number of bytes that were-
358 written in this payload, while \a channel is the channel they were written-
359 to. Unlike bytesWritten(), it is emitted regardless of the-
360 \l{currentWriteChannel()}{current write channel}.-
361-
362 channelBytesWritten() can be emitted recursively - even for the same-
363 channel.-
364-
365 \sa bytesWritten(), channelReadyRead()-
366*/-
367-
368/*!-
369 \fn QIODevice::readyRead()-
370-
371 This signal is emitted once every time new data is available for-
372 reading from the device's current read channel. It will only be emitted-
373 again once new data is available, such as when a new payload of network-
374 data has arrived on your network socket, or when a new block of data has-
375 been appended to your device.-
376-
377 readyRead() is not emitted recursively; if you reenter the event loop or-
378 call waitForReadyRead() inside a slot connected to the readyRead() signal,-
379 the signal will not be reemitted (although waitForReadyRead() may still-
380 return true).-
381-
382 Note for developers implementing classes derived from QIODevice:-
383 you should always emit readyRead() when new data has arrived (do not-
384 emit it only because there's data still to be read in your-
385 buffers). Do not emit readyRead() in other conditions.-
386-
387 \sa bytesWritten()-
388*/-
389-
390/*!-
391 \fn QIODevice::channelReadyRead(int channel)-
392 \since 5.7-
393-
394 This signal is emitted when new data is available for reading from the-
395 device. The \a channel argument is set to the index of the read channel on-
396 which the data has arrived. Unlike readyRead(), it is emitted regardless of-
397 the \l{currentReadChannel()}{current read channel}.-
398-
399 channelReadyRead() can be emitted recursively - even for the same channel.-
400-
401 \sa readyRead(), channelBytesWritten()-
402*/-
403-
404/*! \fn QIODevice::aboutToClose()-
405-
406 This signal is emitted when the device is about to close. Connect-
407 this signal if you have operations that need to be performed-
408 before the device closes (e.g., if you have data in a separate-
409 buffer that needs to be written to the device).-
410*/-
411-
412/*!-
413 \fn QIODevice::readChannelFinished()-
414 \since 4.4-
415-
416 This signal is emitted when the input (reading) stream is closed-
417 in this device. It is emitted as soon as the closing is detected,-
418 which means that there might still be data available for reading-
419 with read().-
420-
421 \sa atEnd(), read()-
422*/-
423-
424#ifdef QT_NO_QOBJECT-
425QIODevice::QIODevice()-
426 : d_ptr(new QIODevicePrivate)-
427{-
428 d_ptr->q_ptr = this;-
429}-
430-
431/*!-
432 \internal-
433*/-
434QIODevice::QIODevice(QIODevicePrivate &dd)-
435 : d_ptr(&dd)-
436{-
437 d_ptr->q_ptr = this;-
438}-
439#else-
440-
441/*!-
442 Constructs a QIODevice object.-
443*/-
444-
445QIODevice::QIODevice()-
446 : QObject(*new QIODevicePrivate, 0)-
447{-
448#if defined QIODEVICE_DEBUG-
449 QFile *file = qobject_cast<QFile *>(this);-
450 printf("%p QIODevice::QIODevice(\"%s\") %s\n", this, metaObject()->className(),-
451 qPrintable(file ? file->fileName() : QString()));-
452#endif-
453}
executed 199 times by 4 tests: end of block
Executed by:
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QTextStream
  • tst_Spdy
199
454-
455/*!-
456 Constructs a QIODevice object with the given \a parent.-
457*/-
458-
459QIODevice::QIODevice(QObject *parent)-
460 : QObject(*new QIODevicePrivate, parent)-
461{-
462#if defined QIODEVICE_DEBUG-
463 printf("%p QIODevice::QIODevice(%p \"%s\")\n", this, parent, metaObject()->className());-
464#endif-
465}
executed 13 times by 1 test: end of block
Executed by:
  • tst_QNetworkReply
13
466-
467/*!-
468 \internal-
469*/-
470QIODevice::QIODevice(QIODevicePrivate &dd, QObject *parent)-
471 : QObject(dd, parent)-
472{-
473}
executed 88848 times by 265 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAbstractSocket
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • ...
88848
474#endif-
475-
476-
477/*!-
478 The destructor is virtual, and QIODevice is an abstract base-
479 class. This destructor does not call close(), but the subclass-
480 destructor might. If you are in doubt, call close() before-
481 destroying the QIODevice.-
482*/-
483QIODevice::~QIODevice()-
484{-
485#if defined QIODEVICE_DEBUG-
486 printf("%p QIODevice::~QIODevice()\n", this);-
487#endif-
488}-
489-
490/*!-
491 Returns \c true if this device is sequential; otherwise returns-
492 false.-
493-
494 Sequential devices, as opposed to a random-access devices, have no-
495 concept of a start, an end, a size, or a current position, and they-
496 do not support seeking. You can only read from the device when it-
497 reports that data is available. The most common example of a-
498 sequential device is a network socket. On Unix, special files such-
499 as /dev/zero and fifo pipes are sequential.-
500-
501 Regular files, on the other hand, do support random access. They-
502 have both a size and a current position, and they also support-
503 seeking backwards and forwards in the data stream. Regular files-
504 are non-sequential.-
505-
506 \sa bytesAvailable()-
507*/-
508bool QIODevice::isSequential() const-
509{-
510 return false;
executed 12405 times by 79 tests: return false;
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QHeaderView
  • tst_QHostAddress
  • tst_QHttpNetworkReply
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • ...
12405
511}-
512-
513/*!-
514 Returns the mode in which the device has been opened;-
515 i.e. ReadOnly or WriteOnly.-
516-
517 \sa OpenMode-
518*/-
519QIODevice::OpenMode QIODevice::openMode() const-
520{-
521 return d_func()->openMode;
executed 205379 times by 236 tests: return d_func()->openMode;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
205379
522}-
523-
524/*!-
525 Sets the OpenMode of the device to \a openMode. Call this-
526 function to set the open mode if the flags change after the device-
527 has been opened.-
528-
529 \sa openMode(), OpenMode-
530*/-
531void QIODevice::setOpenMode(OpenMode openMode)-
532{-
533 Q_D(QIODevice);-
534#if defined QIODEVICE_DEBUG-
535 printf("%p QIODevice::setOpenMode(0x%x)\n", this, int(openMode));-
536#endif-
537 d->openMode = openMode;-
538 d->accessMode = QIODevicePrivate::Unset;-
539 d->setReadChannelCount(isReadable() ? qMax(d->readChannelCount, 1) : 0);-
540 d->setWriteChannelCount(isWritable() ? qMax(d->writeChannelCount, 1) : 0);-
541}
executed 770 times by 12 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QFileDialog2
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTemporaryFile
  • tst_Spdy
770
542-
543/*!-
544 If \a enabled is true, this function sets the \l Text flag on the device;-
545 otherwise the \l Text flag is removed. This feature is useful for classes-
546 that provide custom end-of-line handling on a QIODevice.-
547-
548 The IO device should be opened before calling this function.-
549-
550 \sa open(), setOpenMode()-
551 */-
552void QIODevice::setTextModeEnabled(bool enabled)-
553{-
554 Q_D(QIODevice);-
555 if (!isOpen()) {
!isOpen()Description
TRUEnever evaluated
FALSEevaluated 82080469 times by 7 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QTextStream
  • tst_QXmlSimpleReader
  • tst_QXmlStream
0-82080469
556 checkWarnMessage(this, "setTextModeEnabled", "The device is not open");-
557 return;
never executed: return;
0
558 }-
559 if (enabled)
enabledDescription
TRUEevaluated 41040053 times by 6 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QTextStream
  • tst_QXmlSimpleReader
FALSEevaluated 41040416 times by 7 tests
Evaluated by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QTextStream
  • tst_QXmlSimpleReader
  • tst_QXmlStream
41040053-41040416
560 d->openMode |= Text;
executed 41040053 times by 6 tests: d->openMode |= Text;
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QTextStream
  • tst_QXmlSimpleReader
41040053
561 else-
562 d->openMode &= ~Text;
executed 41040416 times by 7 tests: d->openMode &= ~Text;
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QLayout
  • tst_QLoggingRegistry
  • tst_QTextStream
  • tst_QXmlSimpleReader
  • tst_QXmlStream
41040416
563}-
564-
565/*!-
566 Returns \c true if the \l Text flag is enabled; otherwise returns \c false.-
567-
568 \sa setTextModeEnabled()-
569*/-
570bool QIODevice::isTextModeEnabled() const-
571{-
572 return d_func()->openMode & Text;
executed 41042623 times by 18 tests: return d_func()->openMode & Text;
Executed by:
  • tst_QFile
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QLayout
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QProcess
  • tst_QSettings
  • tst_QSplitter
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
  • tst_QTemporaryDir
  • tst_QTextStream
  • tst_QTimeZone
  • tst_QXmlSimpleReader
  • tst_qmakelib
  • tst_qstandardpaths
41042623
573}-
574-
575/*!-
576 Returns \c true if the device is open; otherwise returns \c false. A-
577 device is open if it can be read from and/or written to. By-
578 default, this function returns \c false if openMode() returns-
579 \c NotOpen.-
580-
581 \sa openMode(), OpenMode-
582*/-
583bool QIODevice::isOpen() const-
584{-
585 return d_func()->openMode != NotOpen;
executed 82532409 times by 265 tests: return d_func()->openMode != NotOpen;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QCryptographicHash
  • ...
82532409
586}-
587-
588/*!-
589 Returns \c true if data can be read from the device; otherwise returns-
590 false. Use bytesAvailable() to determine how many bytes can be read.-
591-
592 This is a convenience function which checks if the OpenMode of the-
593 device contains the ReadOnly flag.-
594-
595 \sa openMode(), OpenMode-
596*/-
597bool QIODevice::isReadable() const-
598{-
599 return (openMode() & ReadOnly) != 0;
executed 126507 times by 236 tests: return (openMode() & ReadOnly) != 0;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
126507
600}-
601-
602/*!-
603 Returns \c true if data can be written to the device; otherwise returns-
604 false.-
605-
606 This is a convenience function which checks if the OpenMode of the-
607 device contains the WriteOnly flag.-
608-
609 \sa openMode(), OpenMode-
610*/-
611bool QIODevice::isWritable() const-
612{-
613 return (openMode() & WriteOnly) != 0;
executed 78711 times by 235 tests: return (openMode() & WriteOnly) != 0;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
78711
614}-
615-
616/*!-
617 \since 5.7-
618-
619 Returns the number of available read channels if the device is open;-
620 otherwise returns 0.-
621-
622 \sa writeChannelCount(), QProcess-
623*/-
624int QIODevice::readChannelCount() const-
625{-
626 return d_func()->readChannelCount;
executed 776 times by 9 tests: return d_func()->readChannelCount;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_Spdy
776
627}-
628-
629/*!-
630 \since 5.7-
631-
632 Returns the number of available write channels if the device is open;-
633 otherwise returns 0.-
634-
635 \sa readChannelCount()-
636*/-
637int QIODevice::writeChannelCount() const-
638{-
639 return d_func()->writeChannelCount;
executed 776 times by 9 tests: return d_func()->writeChannelCount;
Executed by:
  • tst_NetworkSelfTest
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_Spdy
776
640}-
641-
642/*!-
643 \since 5.7-
644-
645 Returns the index of the current read channel.-
646-
647 \sa setCurrentReadChannel(), readChannelCount(), QProcess-
648*/-
649int QIODevice::currentReadChannel() const-
650{-
651 return d_func()->currentReadChannel;
never executed: return d_func()->currentReadChannel;
0
652}-
653-
654/*!-
655 \since 5.7-
656-
657 Sets the current read channel of the QIODevice to the given \a-
658 channel. The current input channel is used by the functions-
659 read(), readAll(), readLine(), and getChar(). It also determines-
660 which channel triggers QIODevice to emit readyRead().-
661-
662 \sa currentReadChannel(), readChannelCount(), QProcess-
663*/-
664void QIODevice::setCurrentReadChannel(int channel)-
665{-
666 Q_D(QIODevice);-
667-
668 if (d->transactionStarted) {
d->transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 5181 times by 18 tests
Evaluated by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
0-5181
669 checkWarnMessage(this, "setReadChannel", "Failed due to read transaction being in progress");-
670 return;
never executed: return;
0
671 }-
672-
673#if defined QIODEVICE_DEBUG-
674 qDebug("%p QIODevice::setCurrentReadChannel(%d), d->currentReadChannel = %d, d->readChannelCount = %d\n",-
675 this, channel, d->currentReadChannel, d->readChannelCount);-
676#endif-
677-
678 d->setCurrentReadChannel(channel);-
679}
executed 5181 times by 18 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
5181
680-
681/*!-
682 \internal-
683*/-
684void QIODevicePrivate::setReadChannelCount(int count)-
685{-
686 if (count > readBuffers.size()) {
count > readBuffers.size()Description
TRUEevaluated 66663 times by 233 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
FALSEevaluated 77495 times by 253 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
66663-77495
687 readBuffers.insert(readBuffers.end(), count - readBuffers.size(),-
688 QRingBuffer(readBufferChunkSize));-
689 } else {
executed 66663 times by 233 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
66663
690 readBuffers.resize(count);-
691 }
executed 77495 times by 253 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • ...
77495
692 readChannelCount = count;-
693 setCurrentReadChannel(currentReadChannel);-
694}
executed 144158 times by 273 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
144158
695-
696/*!-
697 \since 5.7-
698-
699 Returns the the index of the current write channel.-
700-
701 \sa setCurrentWriteChannel(), writeChannelCount()-
702*/-
703int QIODevice::currentWriteChannel() const-
704{-
705 return d_func()->currentWriteChannel;
never executed: return d_func()->currentWriteChannel;
0
706}-
707-
708/*!-
709 \since 5.7-
710-
711 Sets the current write channel of the QIODevice to the given \a-
712 channel. The current output channel is used by the functions-
713 write(), putChar(). It also determines which channel triggers-
714 QIODevice to emit bytesWritten().-
715-
716 \sa currentWriteChannel(), writeChannelCount()-
717*/-
718void QIODevice::setCurrentWriteChannel(int channel)-
719{-
720 Q_D(QIODevice);-
721-
722#if defined QIODEVICE_DEBUG-
723 qDebug("%p QIODevice::setCurrentWriteChannel(%d), d->currentWriteChannel = %d, d->writeChannelCount = %d\n",-
724 this, channel, d->currentWriteChannel, d->writeChannelCount);-
725#endif-
726-
727 d->setCurrentWriteChannel(channel);-
728}
never executed: end of block
0
729-
730/*!-
731 \internal-
732*/-
733void QIODevicePrivate::setWriteChannelCount(int count)-
734{-
735 if (count > writeBuffers.size()) {
count > writeBuffers.size()Description
TRUEevaluated 24805 times by 144 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDirIterator
  • ...
FALSEevaluated 74019 times by 210 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • ...
24805-74019
736 // If writeBufferChunkSize is zero (default value), we don't use-
737 // QIODevice's write buffers.-
738 if (writeBufferChunkSize != 0) {
writeBufferChunkSize != 0Description
TRUEevaluated 17771 times by 100 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
FALSEevaluated 7034 times by 70 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QHeaderView
  • tst_QHostAddress
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
7034-17771
739 writeBuffers.insert(writeBuffers.end(), count - writeBuffers.size(),-
740 QRingBuffer(writeBufferChunkSize));-
741 }
executed 17771 times by 100 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • ...
17771
742 } else {
executed 24805 times by 144 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDirIterator
  • ...
24805
743 writeBuffers.resize(count);-
744 }
executed 74019 times by 210 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • ...
74019
745 writeChannelCount = count;-
746 setCurrentWriteChannel(currentWriteChannel);-
747}
executed 98824 times by 237 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
98824
748-
749/*!-
750 Opens the device and sets its OpenMode to \a mode. Returns \c true if successful;-
751 otherwise returns \c false. This function should be called from any-
752 reimplementations of open() or other functions that open the device.-
753-
754 \sa openMode(), OpenMode-
755*/-
756bool QIODevice::open(OpenMode mode)-
757{-
758 Q_D(QIODevice);-
759 d->openMode = mode;-
760 d->pos = (mode & Append) ? size() : qint64(0);
(mode & Append)Description
TRUEevaluated 285 times by 10 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QBuffer
  • tst_QFile
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QLocalSocket
  • tst_QMetaObjectBuilder
  • tst_QPrinter
  • tst_qfileopenevent
  • tst_qmakelib
FALSEevaluated 70920 times by 235 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
285-70920
761 d->accessMode = QIODevicePrivate::Unset;-
762 d->readBuffers.clear();-
763 d->writeBuffers.clear();-
764 d->setReadChannelCount(isReadable() ? 1 : 0);-
765 d->setWriteChannelCount(isWritable() ? 1 : 0);-
766#if defined QIODEVICE_DEBUG-
767 printf("%p QIODevice::open(0x%x)\n", this, quint32(mode));-
768#endif-
769 return true;
executed 71205 times by 235 tests: return true;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCommandLinkButton
  • ...
71205
770}-
771-
772/*!-
773 First emits aboutToClose(), then closes the device and sets its-
774 OpenMode to NotOpen. The error string is also reset.-
775-
776 \sa setOpenMode(), OpenMode-
777*/-
778void QIODevice::close()-
779{-
780 Q_D(QIODevice);-
781 if (d->openMode == NotOpen)
d->openMode == NotOpenDescription
TRUEevaluated 1937 times by 18 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QTextEdit
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
FALSEevaluated 55374 times by 233 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • ...
1937-55374
782 return;
executed 1937 times by 18 tests: return;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QTextEdit
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_Spdy
1937
783-
784#if defined QIODEVICE_DEBUG-
785 printf("%p QIODevice::close()\n", this);-
786#endif-
787-
788#ifndef QT_NO_QOBJECT-
789 emit aboutToClose();-
790#endif-
791 d->openMode = NotOpen;-
792 d->errorString.clear();-
793 d->pos = 0;-
794 d->transactionStarted = false;-
795 d->transactionPos = 0;-
796 d->setReadChannelCount(0);-
797 // Do not clear write buffers to allow delayed close in sockets-
798 d->writeChannelCount = 0;-
799}
executed 55374 times by 233 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • ...
55374
800-
801/*!-
802 For random-access devices, this function returns the position that-
803 data is written to or read from. For sequential devices or closed-
804 devices, where there is no concept of a "current position", 0 is-
805 returned.-
806-
807 The current read/write position of the device is maintained internally by-
808 QIODevice, so reimplementing this function is not necessary. When-
809 subclassing QIODevice, use QIODevice::seek() to notify QIODevice about-
810 changes in the device position.-
811-
812 \sa isSequential(), seek()-
813*/-
814qint64 QIODevice::pos() const-
815{-
816 Q_D(const QIODevice);-
817#if defined QIODEVICE_DEBUG-
818 printf("%p QIODevice::pos() == %lld\n", this, d->pos);-
819#endif-
820 return d->pos;
executed 10231566 times by 151 tests: return d->pos;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • ...
10231566
821}-
822-
823/*!-
824 For open random-access devices, this function returns the size of the-
825 device. For open sequential devices, bytesAvailable() is returned.-
826-
827 If the device is closed, the size returned will not reflect the actual-
828 size of the device.-
829-
830 \sa isSequential(), pos()-
831*/-
832qint64 QIODevice::size() const-
833{-
834 return d_func()->isSequential() ? bytesAvailable() : qint64(0);
executed 74 times by 4 tests: return d_func()->isSequential() ? bytesAvailable() : qint64(0);
Executed by:
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
74
835}-
836-
837/*!-
838 For random-access devices, this function sets the current position-
839 to \a pos, returning true on success, or false if an error occurred.-
840 For sequential devices, the default behavior is to produce a warning-
841 and return false.-
842-
843 When subclassing QIODevice, you must call QIODevice::seek() at the-
844 start of your function to ensure integrity with QIODevice's-
845 built-in buffer.-
846-
847 \sa pos(), isSequential()-
848*/-
849bool QIODevice::seek(qint64 pos)-
850{-
851 Q_D(QIODevice);-
852 if (d->isSequential()) {
d->isSequential()Description
TRUEevaluated 12 times by 3 tests
Evaluated by:
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QSslSocket
FALSEevaluated 297795 times by 108 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
12-297795
853 checkWarnMessage(this, "seek", "Cannot call seek on a sequential device");-
854 return false;
executed 12 times by 3 tests: return false;
Executed by:
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QSslSocket
12
855 }-
856 if (d->openMode == NotOpen) {
d->openMode == NotOpenDescription
TRUEnever evaluated
FALSEevaluated 297795 times by 108 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
0-297795
857 checkWarnMessage(this, "seek", "The device is not open");-
858 return false;
never executed: return false;
0
859 }-
860 if (pos < 0) {
pos < 0Description
TRUEnever evaluated
FALSEevaluated 297795 times by 108 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
0-297795
861 qWarning("QIODevice::seek: Invalid pos: %lld", pos);-
862 return false;
never executed: return false;
0
863 }-
864-
865#if defined QIODEVICE_DEBUG-
866 printf("%p QIODevice::seek(%lld), before: d->pos = %lld, d->buffer.size() = %lld\n",-
867 this, pos, d->pos, d->buffer.size());-
868#endif-
869-
870 d->devicePos = pos;-
871 d->seekBuffer(pos);-
872-
873#if defined QIODEVICE_DEBUG-
874 printf("%p \tafter: d->pos == %lld, d->buffer.size() == %lld\n", this, d->pos,-
875 d->buffer.size());-
876#endif-
877 return true;
executed 297795 times by 108 tests: return true;
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
297795
878}-
879-
880/*!-
881 \internal-
882*/-
883void QIODevicePrivate::seekBuffer(qint64 newPos)-
884{-
885 const qint64 offset = newPos - pos;-
886 pos = newPos;-
887-
888 if (offset < 0 || offset >= buffer.size()) {
offset < 0Description
TRUEevaluated 163179 times by 96 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • ...
FALSEevaluated 168725 times by 99 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
offset >= buffer.size()Description
TRUEevaluated 168244 times by 99 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
FALSEevaluated 481 times by 8 tests
Evaluated by:
  • tst_LargeFile
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QTextStream
481-168725
889 // When seeking backwards, an operation that is only allowed for-
890 // random-access devices, the buffer is cleared. The next read-
891 // operation will then refill the buffer.-
892 buffer.clear();-
893 } else {
executed 331423 times by 109 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • ...
331423
894 buffer.free(offset);-
895 }
executed 481 times by 8 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QTextStream
481
896}-
897-
898/*!-
899 Returns \c true if the current read and write position is at the end-
900 of the device (i.e. there is no more data available for reading on-
901 the device); otherwise returns \c false.-
902-
903 For some devices, atEnd() can return true even though there is more data-
904 to read. This special case only applies to devices that generate data in-
905 direct response to you calling read() (e.g., \c /dev or \c /proc files on-
906 Unix and \macos, or console input / \c stdin on all platforms).-
907-
908 \sa bytesAvailable(), read(), isSequential()-
909*/-
910bool QIODevice::atEnd() const-
911{-
912 Q_D(const QIODevice);-
913 const bool result = (d->openMode == NotOpen || (d->isBufferEmpty()
d->openMode == NotOpenDescription
TRUEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QBuffer
  • tst_QProcess
  • tst_QSslSocket
FALSEevaluated 6887 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QKeySequence
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMainWindow
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPicture
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QStandardItemModel
  • ...
d->isBufferEmpty()Description
TRUEevaluated 6188 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QKeySequence
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMainWindow
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPicture
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QStandardItemModel
  • ...
FALSEevaluated 699 times by 5 tests
Evaluated by:
  • tst_QDataStream
  • tst_QIODevice
  • tst_QImageReader
  • tst_QProcess
  • tst_QTcpSocket
7-6887
914 && bytesAvailable() == 0));
bytesAvailable() == 0Description
TRUEevaluated 2201 times by 25 tests
Evaluated by:
  • tst_Lancelot
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMainWindow
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QProcess
  • tst_QStandardItemModel
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QTranslator
  • tst_QXmlStream
  • tst_qmakelib
FALSEevaluated 3987 times by 24 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QKeySequence
  • tst_QLoggingRegistry
  • tst_QMainWindow
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPicture
  • tst_QPixmap
  • tst_QPrinter
  • tst_QStandardItemModel
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QTranslator
  • tst_qmakelib
2201-3987
915#if defined QIODEVICE_DEBUG-
916 printf("%p QIODevice::atEnd() returns %s, d->openMode == %d, d->pos == %lld\n", this,-
917 result ? "true" : "false", int(d->openMode), d->pos);-
918#endif-
919 return result;
executed 6894 times by 31 tests: return result;
Executed by:
  • tst_Lancelot
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QKeySequence
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMainWindow
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPicture
  • tst_QPixmap
  • tst_QPrinter
  • tst_QProcess
  • tst_QSslSocket
  • ...
6894
920}-
921-
922/*!-
923 Seeks to the start of input for random-access devices. Returns-
924 true on success; otherwise returns \c false (for example, if the-
925 device is not open).-
926-
927 Note that when using a QTextStream on a QFile, calling reset() on-
928 the QFile will not have the expected result because QTextStream-
929 buffers the file. Use the QTextStream::seek() function instead.-
930-
931 \sa seek()-
932*/-
933bool QIODevice::reset()-
934{-
935#if defined QIODEVICE_DEBUG-
936 printf("%p QIODevice::reset()\n", this);-
937#endif-
938 return seek(0);
executed 384 times by 10 tests: return seek(0);
Executed by:
  • tst_QDate
  • tst_QFile
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QPrinter
  • tst_QRingBuffer
  • tst_QSslKey
  • tst_QSslSocket
  • tst_QTemporaryFile
  • tst_QTextStream
384
939}-
940-
941/*!-
942 Returns the number of bytes that are available for reading. This-
943 function is commonly used with sequential devices to determine the-
944 number of bytes to allocate in a buffer before reading.-
945-
946 Subclasses that reimplement this function must call the base-
947 implementation in order to include the size of the buffer of QIODevice. Example:-
948-
949 \snippet code/src_corelib_io_qiodevice.cpp 1-
950-
951 \sa bytesToWrite(), readyRead(), isSequential()-
952*/-
953qint64 QIODevice::bytesAvailable() const-
954{-
955 Q_D(const QIODevice);-
956 if (!d->isSequential())
!d->isSequential()Description
TRUEevaluated 9984 times by 58 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • ...
FALSEevaluated 106572 times by 28 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QFile
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • ...
9984-106572
957 return qMax(size() - d->pos, qint64(0));
executed 9984 times by 58 tests: return qMax(size() - d->pos, qint64(0));
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • ...
9984
958 return d->buffer.size() - d->transactionPos;
executed 106572 times by 28 tests: return d->buffer.size() - d->transactionPos;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QFile
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
  • tst_QXmlStream
  • ...
106572
959}-
960-
961/*! For buffered devices, this function returns the number of bytes-
962 waiting to be written. For devices with no buffer, this function-
963 returns 0.-
964-
965 Subclasses that reimplement this function must call the base-
966 implementation in order to include the size of the buffer of QIODevice.-
967-
968 \sa bytesAvailable(), bytesWritten(), isSequential()-
969*/-
970qint64 QIODevice::bytesToWrite() const-
971{-
972 return d_func()->writeBuffer.size();
executed 41893 times by 17 tests: return d_func()->writeBuffer.size();
Executed by:
  • tst_NetworkSelfTest
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_qdbusxml2cpp
  • tst_spdy - unknown status
41893
973}-
974-
975/*!-
976 Reads at most \a maxSize bytes from the device into \a data, and-
977 returns the number of bytes read. If an error occurs, such as when-
978 attempting to read from a device opened in WriteOnly mode, this-
979 function returns -1.-
980-
981 0 is returned when no more data is available for reading. However,-
982 reading past the end of the stream is considered an error, so this-
983 function returns -1 in those cases (that is, reading on a closed-
984 socket or after a process has died).-
985-
986 \sa readData(), readLine(), write()-
987*/-
988qint64 QIODevice::read(char *data, qint64 maxSize)-
989{-
990 Q_D(QIODevice);-
991-
992#if defined QIODEVICE_DEBUG-
993 printf("%p QIODevice::read(%p, %lld), d->pos = %lld, d->buffer.size() = %lld\n",-
994 this, data, maxSize, d->pos, d->buffer.size());-
995#endif-
996-
997 const bool sequential = d->isSequential();-
998 const bool keepDataInBuffer = sequential && d->transactionStarted;
sequentialDescription
TRUEevaluated 622589 times by 51 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QRawFont
  • tst_QSharedPointer
  • ...
FALSEevaluated 48080659 times by 168 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • ...
d->transactionStartedDescription
TRUEevaluated 11432 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 611157 times by 51 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QRawFont
  • tst_QSharedPointer
  • ...
11432-48080659
999-
1000 // Short circuit for getChar()-
1001 if (maxSize == 1 && !keepDataInBuffer) {
maxSize == 1Description
TRUEevaluated 47672997 times by 86 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontComboBox
  • ...
FALSEevaluated 1030251 times by 186 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnection
  • ...
!keepDataInBufferDescription
TRUEevaluated 47671065 times by 86 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontComboBox
  • ...
FALSEevaluated 1932 times by 7 tests
Evaluated by:
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSslSocket
1932-47672997
1002 int chint;-
1003 while ((chint = d->buffer.getChar()) != -1) {
(chint = d->bu...tChar()) != -1Description
TRUEevaluated 42998528 times by 56 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • ...
FALSEevaluated 4672538 times by 80 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • ...
4672538-42998528
1004 if (!sequential)
!sequentialDescription
TRUEevaluated 42599224 times by 47 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • ...
FALSEevaluated 399304 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QXmlSimpleReader
  • tst_Spdy
399304-42599224
1005 ++d->pos;
executed 42599224 times by 47 tests: ++d->pos;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • ...
42599224
1006-
1007 char c = char(uchar(chint));-
1008 if (c == '\r' && (d->openMode & Text))
c == '\r'Description
TRUEevaluated 27926 times by 15 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDateTime
  • tst_QFile
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QTimeZone
  • tst_QXmlSimpleReader
  • tst_Spdy
FALSEevaluated 42970602 times by 56 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • ...
27926-42970602
1009 continue;
executed 1 time by 1 test: continue;
Executed by:
  • tst_QFile
1
1010 *data = c;-
1011#if defined QIODEVICE_DEBUG-
1012 printf("%p \tread 0x%hhx (%c) returning 1 (shortcut)\n", this,-
1013 int(c), isprint(c) ? c : '?');-
1014#endif-
1015 if (d->buffer.isEmpty())
d->buffer.isEmpty()Description
TRUEevaluated 3665 times by 22 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDateTime
  • tst_QFile
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QProcess
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QTimeZone
  • tst_QVariant
  • tst_QXmlSimpleReader
  • tst_Spdy
FALSEevaluated 42994862 times by 55 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • ...
3665-42994862
1016 readData(data, 0);
executed 3665 times by 22 tests: readData(data, 0);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDateTime
  • tst_QFile
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QProcess
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QTimeZone
  • tst_QVariant
  • tst_QXmlSimpleReader
  • tst_Spdy
3665
1017 return qint64(1);
executed 42998527 times by 56 tests: return qint64(1);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • ...
42998527
1018 }-
1019 }
executed 4672538 times by 80 tests: end of block
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • ...
4672538
1020-
1021 CHECK_MAXLEN(read, qint64(-1));
never executed: return qint64(-1);
maxSize < 0Description
TRUEnever evaluated
FALSEevaluated 5704721 times by 192 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
0-5704721
1022 qint64 readSoFar = 0;-
1023 bool madeBufferReadsOnly = true;-
1024 bool deviceAtEof = false;-
1025 char *readPtr = data;-
1026 forever {-
1027 // Try reading from the buffer.-
1028 qint64 bufferReadChunkSize = keepDataInBuffer
keepDataInBufferDescription
TRUEevaluated 15488 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 7775691 times by 192 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
15488-7775691
1029 ? d->buffer.peek(data, maxSize, d->transactionPos)-
1030 : d->buffer.read(data, maxSize);-
1031 if (bufferReadChunkSize > 0) {
bufferReadChunkSize > 0Description
TRUEevaluated 837056 times by 143 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • ...
FALSEevaluated 6954123 times by 192 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
837056-6954123
1032 if (keepDataInBuffer)
keepDataInBufferDescription
TRUEevaluated 11882 times by 13 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 825174 times by 143 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • ...
11882-825174
1033 d->transactionPos += bufferReadChunkSize;
executed 11882 times by 13 tests: d->transactionPos += bufferReadChunkSize;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
11882
1034 else if (!sequential)
!sequentialDescription
TRUEevaluated 774216 times by 122 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
FALSEevaluated 50958 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • ...
50958-774216
1035 d->pos += bufferReadChunkSize;
executed 774216 times by 122 tests: d->pos += bufferReadChunkSize;
Executed by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
774216
1036 readSoFar += bufferReadChunkSize;-
1037 data += bufferReadChunkSize;-
1038 maxSize -= bufferReadChunkSize;-
1039#if defined QIODEVICE_DEBUG-
1040 printf("%p \treading %lld bytes from buffer into position %lld\n", this,-
1041 bufferReadChunkSize, readSoFar - bufferReadChunkSize);-
1042#endif-
1043 } else {
executed 837056 times by 143 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • ...
837056
1044 CHECK_READABLE(read, qint64(-1));
executed 109 times by 6 tests: return qint64(-1);
Executed by:
  • tst_QBuffer
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
executed 2 times by 2 tests: return qint64(-1);
Executed by:
  • tst_QBuffer
  • tst_QFile
(d->openMode & ReadOnly) == 0Description
TRUEevaluated 111 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
FALSEevaluated 6954012 times by 192 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
d->openMode == NotOpenDescription
TRUEevaluated 109 times by 6 tests
Evaluated by:
  • tst_QBuffer
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
2-6954012
1045 }
executed 6954012 times by 192 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
6954012
1046-
1047 if (maxSize > 0 && !deviceAtEof) {
maxSize > 0Description
TRUEevaluated 4975009 times by 192 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
FALSEevaluated 2816059 times by 136 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • ...
!deviceAtEofDescription
TRUEevaluated 4969329 times by 192 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
FALSEevaluated 5680 times by 41 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QMimeDatabase
  • tst_QMovie
  • ...
5680-4975009
1048 qint64 readFromDevice = 0;-
1049 // Make sure the device is positioned correctly.-
1050 if (sequential || d->pos == d->devicePos || seek(d->pos)) {
sequentialDescription
TRUEevaluated 178186 times by 51 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpNetworkReply
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QRawFont
  • tst_QSharedPointer
  • ...
FALSEevaluated 4791143 times by 168 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • ...
d->pos == d->devicePosDescription
TRUEevaluated 4768137 times by 168 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDate
  • ...
FALSEevaluated 23006 times by 86 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBitArray
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFont
  • tst_QFontComboBox
  • tst_QFontDialog
  • ...
seek(d->pos)Description
TRUEevaluated 23006 times by 86 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBitArray
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFont
  • tst_QFontComboBox
  • tst_QFontDialog
  • ...
FALSEnever evaluated
0-4791143
1051 madeBufferReadsOnly = false; // fix readData attempt-
1052 if ((maxSize >= d->readBufferChunkSize || (d->openMode & Unbuffered))
maxSize >= d->...ufferChunkSizeDescription
TRUEevaluated 32516 times by 91 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • ...
FALSEevaluated 4936813 times by 182 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnection
  • ...
32516-4936813
1053 && !keepDataInBuffer) {
!keepDataInBufferDescription
TRUEevaluated 4809281 times by 136 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • ...
FALSEevaluated 3970 times by 9 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
3970-4809281
1054 // Read big chunk directly to output buffer-
1055 readFromDevice = readData(data, maxSize);-
1056 deviceAtEof = (readFromDevice != maxSize);-
1057#if defined QIODEVICE_DEBUG-
1058 printf("%p \treading %lld bytes from device (total %lld)\n", this,-
1059 readFromDevice, readSoFar);-
1060#endif-
1061 if (readFromDevice > 0) {
readFromDevice > 0Description
TRUEevaluated 4788007 times by 120 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • ...
FALSEevaluated 21274 times by 56 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QBuffer
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHeaderView
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPrinterInfo
  • ...
21274-4788007
1062 readSoFar += readFromDevice;-
1063 data += readFromDevice;-
1064 maxSize -= readFromDevice;-
1065 if (!sequential) {
!sequentialDescription
TRUEevaluated 4650749 times by 110 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • ...
FALSEevaluated 137258 times by 18 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkReply
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QRawFont
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUuid
  • tst_Spdy
  • tst_qdbusxml2cpp - unknown status
  • tst_qnetworkreply - unknown status
  • tst_quuid - unknown status
137258-4650749
1066 d->pos += readFromDevice;-
1067 d->devicePos += readFromDevice;-
1068 }
executed 4650749 times by 110 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • ...
4650749
1069 }
executed 4788007 times by 120 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • ...
4788007
1070 } else {
executed 4809281 times by 136 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • ...
4809281
1071 // Do not read more than maxSize on unbuffered devices-
1072 const qint64 bytesToBuffer = (d->openMode & Unbuffered)
(d->openMode & Unbuffered)Description
TRUEevaluated 3959 times by 7 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_Spdy
FALSEevaluated 156089 times by 143 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • ...
3959-156089
1073 ? qMin(maxSize, qint64(d->readBufferChunkSize))-
1074 : qint64(d->readBufferChunkSize);-
1075 // Try to fill QIODevice buffer by single read-
1076 readFromDevice = readData(d->buffer.reserve(bytesToBuffer), bytesToBuffer);-
1077 deviceAtEof = (readFromDevice != bytesToBuffer);-
1078 d->buffer.chop(bytesToBuffer - qMax(Q_INT64_C(0), readFromDevice));-
1079 if (readFromDevice > 0) {
readFromDevice > 0Description
TRUEevaluated 84201 times by 124 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
FALSEevaluated 75847 times by 50 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QCryptographicHash
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
75847-84201
1080 if (!sequential)
!sequentialDescription
TRUEevaluated 77630 times by 121 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • ...
FALSEevaluated 6571 times by 11 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QXmlStream
  • tst_Spdy
6571-77630
1081 d->devicePos += readFromDevice;
executed 77630 times by 121 tests: d->devicePos += readFromDevice;
Executed by:
  • tst_LargeFile
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • ...
77630
1082#if defined QIODEVICE_DEBUG-
1083 printf("%p \treading %lld from device into buffer\n", this,-
1084 readFromDevice);-
1085#endif-
1086 continue;
executed 84201 times by 124 tests: continue;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • ...
84201
1087 }-
1088 }
executed 75847 times by 50 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QCryptographicHash
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QMovie
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • ...
75847
1089 } else {-
1090 readFromDevice = -1;-
1091 }
never executed: end of block
0
1092-
1093 if (readFromDevice < 0 && readSoFar == 0) {
readFromDevice < 0Description
TRUEevaluated 7792 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 4877336 times by 135 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • tst_QFile
  • ...
readSoFar == 0Description
TRUEevaluated 6695 times by 30 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
FALSEevaluated 1097 times by 20 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFont
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_QUuid
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qmessagehandler
  • tst_uic
1097-4877336
1094 // error and we haven't read anything: return immediately-
1095 return qint64(-1);
executed 6695 times by 30 tests: return qint64(-1);
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QFont
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QUuid
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • ...
6695
1096 }-
1097 }
executed 4878433 times by 141 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDockWidget
  • tst_QErrorMessage
  • ...
4878433
1098-
1099 if ((d->openMode & Text) && readPtr < data) {
readPtr < dataDescription
TRUEevaluated 2002257 times by 14 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
FALSEevaluated 2002126 times by 14 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
2002126-2002257
1100 const char *endPtr = data;-
1101-
1102 // optimization to avoid initial self-assignment-
1103 while (*readPtr != '\r') {
*readPtr != '\r'Description
TRUEevaluated 43209181 times by 14 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
FALSEevaluated 315 times by 3 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QSslCertificate
315-43209181
1104 if (++readPtr == endPtr)
++readPtr == endPtrDescription
TRUEevaluated 2001942 times by 14 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
FALSEevaluated 41207239 times by 13 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
2001942-41207239
1105 break;
executed 2001942 times by 14 tests: break;
Executed by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
2001942
1106 }
executed 41207239 times by 13 tests: end of block
Executed by:
  • tst_QCssParser
  • tst_QFile
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
41207239
1107-
1108 char *writePtr = readPtr;-
1109-
1110 while (readPtr < endPtr) {
readPtr < endPtrDescription
TRUEevaluated 5790 times by 3 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QSslCertificate
FALSEevaluated 2002257 times by 14 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
5790-2002257
1111 char ch = *readPtr++;-
1112 if (ch != '\r')
ch != '\r'Description
TRUEevaluated 5408 times by 2 tests
Evaluated by:
  • tst_QFile
  • tst_QSslCertificate
FALSEevaluated 382 times by 3 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QSslCertificate
382-5408
1113 *writePtr++ = ch;
executed 5408 times by 2 tests: *writePtr++ = ch;
Executed by:
  • tst_QFile
  • tst_QSslCertificate
5408
1114 else {-
1115 --readSoFar;-
1116 --data;-
1117 ++maxSize;-
1118 }
executed 382 times by 3 tests: end of block
Executed by:
  • tst_QFile
  • tst_QIODevice
  • tst_QSslCertificate
382
1119 }-
1120-
1121 // Make sure we get more data if there is room for more. This-
1122 // is very important for when someone seeks to the start of a-
1123 // '\r\n' and reads one character - they should get the '\n'.-
1124 readPtr = data;-
1125 continue;
executed 2002257 times by 14 tests: continue;
Executed by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QMimeDatabase
  • tst_QNetworkCookieJar
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QXmlStream
  • tst_qmakelib
  • tst_rcc
  • tst_uic
2002257
1126 }-
1127-
1128 break;
executed 5697915 times by 191 tests: break;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
5697915
1129 }-
1130-
1131#if defined QIODEVICE_DEBUG-
1132 printf("%p \treturning %lld, d->pos == %lld, d->buffer.size() == %lld\n", this,-
1133 readSoFar, d->pos, d->buffer.size());-
1134 debugBinaryString(data - readSoFar, readSoFar);-
1135#endif-
1136-
1137 if (madeBufferReadsOnly && d->isBufferEmpty())
madeBufferReadsOnlyDescription
TRUEevaluated 735577 times by 110 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • ...
FALSEevaluated 4962338 times by 191 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
d->isBufferEmpty()Description
TRUEevaluated 36654 times by 102 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 698923 times by 96 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • ...
36654-4962338
1138 readData(data, 0);
executed 36654 times by 102 tests: readData(data, 0);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
36654
1139-
1140 return readSoFar;
executed 5697915 times by 191 tests: return readSoFar;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • ...
5697915
1141}-
1142-
1143/*!-
1144 \overload-
1145-
1146 Reads at most \a maxSize bytes from the device, and returns the-
1147 data read as a QByteArray.-
1148-
1149 This function has no way of reporting errors; returning an empty-
1150 QByteArray can mean either that no data was currently available-
1151 for reading, or that an error occurred.-
1152*/-
1153-
1154QByteArray QIODevice::read(qint64 maxSize)-
1155{-
1156 Q_D(QIODevice);-
1157 QByteArray result;-
1158-
1159 CHECK_MAXLEN(read, result);
never executed: return result;
maxSize < 0Description
TRUEnever evaluated
FALSEevaluated 69121 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
0-69121
1160 CHECK_MAXBYTEARRAYSIZE(read);
never executed: end of block
maxSize >= MaxByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 69121 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
0-69121
1161-
1162#if defined QIODEVICE_DEBUG-
1163 printf("%p QIODevice::read(%lld), d->pos = %lld, d->buffer.size() = %lld\n",-
1164 this, maxSize, d->pos, d->buffer.size());-
1165#endif-
1166-
1167 qint64 readBytes = 0;-
1168 if (maxSize) {
maxSizeDescription
TRUEevaluated 69120 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QIODevice
1-69120
1169 result.resize(int(maxSize));-
1170 if (!result.size()) {
!result.size()Description
TRUEnever evaluated
FALSEevaluated 69120 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
0-69120
1171 // If resize fails, read incrementally.-
1172 qint64 readResult;-
1173 do {-
1174 result.resize(int(qMin(maxSize, qint64(result.size() + d->readBufferChunkSize))));-
1175 readResult = read(result.data() + readBytes, result.size() - readBytes);-
1176 if (readResult > 0 || readBytes == 0)
readResult > 0Description
TRUEnever evaluated
FALSEnever evaluated
readBytes == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1177 readBytes += readResult;
never executed: readBytes += readResult;
0
1178 } while (readResult == d->readBufferChunkSize);
never executed: end of block
readResult == ...ufferChunkSizeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1179 } else {
never executed: end of block
0
1180 readBytes = read(result.data(), result.size());-
1181 }
executed 69120 times by 92 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
69120
1182 }-
1183-
1184 if (readBytes <= 0)
readBytes <= 0Description
TRUEevaluated 98 times by 7 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLabel
  • tst_QMovie
  • tst_QPixmap
  • tst_QSslSocket
FALSEevaluated 69023 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
98-69023
1185 result.clear();
executed 98 times by 7 tests: result.clear();
Executed by:
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLabel
  • tst_QMovie
  • tst_QPixmap
  • tst_QSslSocket
98
1186 else-
1187 result.resize(int(readBytes));
executed 69023 times by 92 tests: result.resize(int(readBytes));
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
69023
1188-
1189 return result;
executed 69121 times by 92 tests: return result;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • ...
69121
1190}-
1191-
1192/*!-
1193 Reads all remaining data from the device, and returns it as a-
1194 byte array.-
1195-
1196 This function has no way of reporting errors; returning an empty-
1197 QByteArray can mean either that no data was currently available-
1198 for reading, or that an error occurred.-
1199*/-
1200QByteArray QIODevice::readAll()-
1201{-
1202 Q_D(QIODevice);-
1203#if defined QIODEVICE_DEBUG-
1204 printf("%p QIODevice::readAll(), d->pos = %lld, d->buffer.size() = %lld\n",-
1205 this, d->pos, d->buffer.size());-
1206#endif-
1207-
1208 QByteArray result;-
1209 qint64 readBytes = (d->isSequential() ? Q_INT64_C(0) : size());
d->isSequential()Description
TRUEevaluated 14488 times by 37 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUuid
  • ...
FALSEevaluated 16656 times by 75 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFtp
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • ...
14488-16656
1210 if (readBytes == 0) {
readBytes == 0Description
TRUEevaluated 14508 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
FALSEevaluated 16636 times by 75 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFtp
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • ...
14508-16636
1211 // Size is unknown, read incrementally.-
1212 qint64 readChunkSize = qMax(qint64(d->readBufferChunkSize),-
1213 d->isSequential() ? (d->buffer.size() - d->transactionPos)-
1214 : d->buffer.size());-
1215 qint64 readResult;-
1216 do {-
1217 if (readBytes + readChunkSize >= MaxByteArraySize) {
readBytes + re...xByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 27495 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
0-27495
1218 // If resize would fail, don't read more, return what we have.-
1219 break;
never executed: break;
0
1220 }-
1221 result.resize(readBytes + readChunkSize);-
1222 readResult = read(result.data() + readBytes, readChunkSize);-
1223 if (readResult > 0 || readBytes == 0) {
readResult > 0Description
TRUEevaluated 12987 times by 35 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUuid
  • tst_Selftests
  • ...
FALSEevaluated 14508 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
readBytes == 0Description
TRUEevaluated 2477 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qnetworkreply - unknown status
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 12031 times by 35 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUuid
  • tst_Selftests
  • ...
2477-14508
1224 readBytes += readResult;-
1225 readChunkSize = d->readBufferChunkSize;-
1226 }
executed 15464 times by 39 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
15464
1227 } while (readResult > 0);
executed 27495 times by 39 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
readResult > 0Description
TRUEevaluated 12987 times by 35 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QUuid
  • tst_Selftests
  • ...
FALSEevaluated 14508 times by 39 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
12987-27495
1228 } else {
executed 14508 times by 39 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSharedPointer
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QUdpSocket
  • ...
14508
1229 // Read it all in one go.-
1230 // If resize fails, don't read anything.-
1231 readBytes -= d->pos;-
1232 if (readBytes >= MaxByteArraySize)
readBytes >= MaxByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 16636 times by 75 tests
Evaluated by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFtp
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • ...
0-16636
1233 return QByteArray();
never executed: return QByteArray();
0
1234 result.resize(readBytes);-
1235 readBytes = read(result.data(), readBytes);-
1236 }
executed 16636 times by 75 tests: end of block
Executed by:
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDatabase
  • tst_QFontDialog
  • tst_QFontMetrics
  • tst_QFtp
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QIcon
  • ...
16636
1237-
1238 if (readBytes <= 0)
readBytes <= 0Description
TRUEevaluated 3698 times by 25 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qnetworkreply - unknown status
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
FALSEevaluated 27446 times by 97 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontDatabase
  • tst_QFontDialog
  • ...
3698-27446
1239 result.clear();
executed 3698 times by 25 tests: result.clear();
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QFile
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QNetworkReply
  • tst_QPrinterInfo
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpSocket
  • tst_QXmlStream
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_qdbusxml2cpp
  • tst_qmake
  • tst_qmakelib
  • tst_qnetworkreply - unknown status
  • tst_qprocess - unknown status
  • tst_rcc
  • tst_uic
3698
1240 else-
1241 result.resize(int(readBytes));
executed 27446 times by 97 tests: result.resize(int(readBytes));
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontDatabase
  • tst_QFontDialog
  • ...
27446
1242-
1243 return result;
executed 31144 times by 98 tests: return result;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QByteArray
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDateTimeEdit
  • tst_QErrorMessage
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFont
  • tst_QFontDatabase
  • tst_QFontDialog
  • ...
31144
1244}-
1245-
1246/*!-
1247 This function reads a line of ASCII characters from the device, up-
1248 to a maximum of \a maxSize - 1 bytes, stores the characters in \a-
1249 data, and returns the number of bytes read. If a line could not be-
1250 read but no error ocurred, this function returns 0. If an error-
1251 occurs, this function returns the length of what could be read, or-
1252 -1 if nothing was read.-
1253-
1254 A terminating '\\0' byte is always appended to \a data, so \a-
1255 maxSize must be larger than 1.-
1256-
1257 Data is read until either of the following conditions are met:-
1258-
1259 \list-
1260 \li The first '\\n' character is read.-
1261 \li \a maxSize - 1 bytes are read.-
1262 \li The end of the device data is detected.-
1263 \endlist-
1264-
1265 For example, the following code reads a line of characters from a-
1266 file:-
1267-
1268 \snippet code/src_corelib_io_qiodevice.cpp 2-
1269-
1270 The newline character ('\\n') is included in the buffer. If a-
1271 newline is not encountered before maxSize - 1 bytes are read, a-
1272 newline will not be inserted into the buffer. On windows newline-
1273 characters are replaced with '\\n'.-
1274-
1275 This function calls readLineData(), which is implemented using-
1276 repeated calls to getChar(). You can provide a more efficient-
1277 implementation by reimplementing readLineData() in your own-
1278 subclass.-
1279-
1280 \sa getChar(), read(), write()-
1281*/-
1282qint64 QIODevice::readLine(char *data, qint64 maxSize)-
1283{-
1284 Q_D(QIODevice);-
1285 if (maxSize < 2) {
maxSize < 2Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QIODevice
  • tst_QSslSocket
FALSEevaluated 107424 times by 46 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • ...
10-107424
1286 checkWarnMessage(this, "readLine", "Called with maxSize < 2");-
1287 return qint64(-1);
executed 10 times by 2 tests: return qint64(-1);
Executed by:
  • tst_QIODevice
  • tst_QSslSocket
10
1288 }-
1289-
1290#if defined QIODEVICE_DEBUG-
1291 printf("%p QIODevice::readLine(%p, %lld), d->pos = %lld, d->buffer.size() = %lld\n",-
1292 this, data, maxSize, d->pos, d->buffer.size());-
1293#endif-
1294-
1295 // Leave room for a '\0'-
1296 --maxSize;-
1297-
1298 const bool sequential = d->isSequential();-
1299 const bool keepDataInBuffer = sequential && d->transactionStarted;
sequentialDescription
TRUEevaluated 5971 times by 12 tests
Evaluated by:
  • tst_QFile
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
FALSEevaluated 101453 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
d->transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 5971 times by 12 tests
Evaluated by:
  • tst_QFile
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
0-101453
1300-
1301 qint64 readSoFar = 0;-
1302 if (keepDataInBuffer) {
keepDataInBufferDescription
TRUEnever evaluated
FALSEevaluated 107424 times by 46 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • ...
0-107424
1303 if (d->transactionPos < d->buffer.size()) {
d->transaction...>buffer.size()Description
TRUEnever evaluated
FALSEnever evaluated
0
1304 // Peek line from the specified position-
1305 const qint64 i = d->buffer.indexOf('\n', maxSize, d->transactionPos);-
1306 readSoFar = d->buffer.peek(data, i >= 0 ? (i - d->transactionPos + 1) : maxSize,-
1307 d->transactionPos);-
1308 d->transactionPos += readSoFar;-
1309 if (d->transactionPos == d->buffer.size())
d->transaction...>buffer.size()Description
TRUEnever evaluated
FALSEnever evaluated
0
1310 readData(data, 0);
never executed: readData(data, 0);
0
1311 }
never executed: end of block
0
1312 } else if (!d->buffer.isEmpty()) {
never executed: end of block
!d->buffer.isEmpty()Description
TRUEevaluated 101031 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 6393 times by 42 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
0-101031
1313 // QRingBuffer::readLine() terminates the line with '\0'-
1314 readSoFar = d->buffer.readLine(data, maxSize + 1);-
1315 if (d->buffer.isEmpty())
d->buffer.isEmpty()Description
TRUEevaluated 5236 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 95795 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
5236-95795
1316 readData(data,0);
executed 5236 times by 41 tests: readData(data,0);
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
5236
1317 if (!sequential)
!sequentialDescription
TRUEevaluated 95165 times by 35 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • ...
FALSEevaluated 5866 times by 9 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QTcpSocket
  • tst_QXmlInputSource
5866-95165
1318 d->pos += readSoFar;
executed 95165 times by 35 tests: d->pos += readSoFar;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • ...
95165
1319 }
executed 101031 times by 41 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
101031
1320-
1321 if (readSoFar) {
readSoFarDescription
TRUEevaluated 101031 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 6393 times by 42 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
6393-101031
1322#if defined QIODEVICE_DEBUG-
1323 printf("%p \tread from buffer: %lld bytes, last character read: %hhx\n", this,-
1324 readSoFar, data[readSoFar - 1]);-
1325 debugBinaryString(data, int(readSoFar));-
1326#endif-
1327 if (data[readSoFar - 1] == '\n') {
data[readSoFar - 1] == '\n'Description
TRUEevaluated 100535 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
FALSEevaluated 496 times by 10 tests
Evaluated by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QTcpSocket
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
496-100535
1328 if (d->openMode & Text) {
d->openMode & TextDescription
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QProcess
FALSEevaluated 100499 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
36-100499
1329 // QRingBuffer::readLine() isn't Text aware.-
1330 if (readSoFar > 1 && data[readSoFar - 2] == '\r') {
readSoFar > 1Description
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QProcess
FALSEnever evaluated
data[readSoFar - 2] == '\r'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QProcess
0-36
1331 --readSoFar;-
1332 data[readSoFar - 1] = '\n';-
1333 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QFile
1
1334 }
executed 36 times by 3 tests: end of block
Executed by:
  • tst_QCssParser
  • tst_QFile
  • tst_QProcess
36
1335 data[readSoFar] = '\0';-
1336 return readSoFar;
executed 100535 times by 41 tests: return readSoFar;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • ...
100535
1337 }-
1338 }
executed 496 times by 10 tests: end of block
Executed by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QTcpSocket
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
496
1339-
1340 if (d->pos != d->devicePos && !sequential && !seek(d->pos))
d->pos != d->devicePosDescription
TRUEevaluated 112 times by 3 tests
Evaluated by:
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
FALSEevaluated 6777 times by 43 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
!sequentialDescription
TRUEevaluated 112 times by 3 tests
Evaluated by:
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
FALSEnever evaluated
!seek(d->pos)Description
TRUEnever evaluated
FALSEevaluated 112 times by 3 tests
Evaluated by:
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
0-6777
1341 return qint64(-1);
never executed: return qint64(-1);
0
1342 d->baseReadLineDataCalled = false;-
1343 // Force base implementation for transaction on sequential device-
1344 // as it stores the data in internal buffer automatically.-
1345 qint64 readBytes = keepDataInBuffer
keepDataInBufferDescription
TRUEnever evaluated
FALSEevaluated 6889 times by 43 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
0-6889
1346 ? QIODevice::readLineData(data + readSoFar, maxSize - readSoFar)-
1347 : readLineData(data + readSoFar, maxSize - readSoFar);-
1348#if defined QIODEVICE_DEBUG-
1349 printf("%p \tread from readLineData: %lld bytes, readSoFar = %lld bytes\n", this,-
1350 readBytes, readSoFar);-
1351 if (readBytes > 0) {-
1352 debugBinaryString(data, int(readSoFar + readBytes));-
1353 }-
1354#endif-
1355 if (readBytes < 0) {
readBytes < 0Description
TRUEevaluated 354 times by 10 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
FALSEevaluated 6535 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
354-6535
1356 data[readSoFar] = '\0';-
1357 return readSoFar ? readSoFar : -1;
executed 354 times by 10 tests: return readSoFar ? readSoFar : -1;
Executed by:
  • tst_QFile
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
354
1358 }-
1359 readSoFar += readBytes;-
1360 if (!d->baseReadLineDataCalled && !sequential) {
!d->baseReadLineDataCalledDescription
TRUEnever evaluated
FALSEevaluated 6535 times by 41 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
!sequentialDescription
TRUEnever evaluated
FALSEnever evaluated
0-6535
1361 d->pos += readBytes;-
1362 // If the base implementation was not called, then we must-
1363 // assume the device position is invalid and force a seek.-
1364 d->devicePos = qint64(-1);-
1365 }
never executed: end of block
0
1366 data[readSoFar] = '\0';-
1367-
1368 if (d->openMode & Text) {
d->openMode & TextDescription
TRUEevaluated 411 times by 4 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QProcess
FALSEevaluated 6124 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • tst_QMimeDatabase
  • ...
411-6124
1369 if (readSoFar > 1 && data[readSoFar - 1] == '\n' && data[readSoFar - 2] == '\r') {
readSoFar > 1Description
TRUEevaluated 333 times by 4 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QProcess
FALSEevaluated 78 times by 1 test
Evaluated by:
  • tst_QIODevice
data[readSoFar - 1] == '\n'Description
TRUEevaluated 227 times by 4 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QProcess
FALSEevaluated 106 times by 1 test
Evaluated by:
  • tst_QIODevice
data[readSoFar - 2] == '\r'Description
TRUEnever evaluated
FALSEevaluated 227 times by 4 tests
Evaluated by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QProcess
0-333
1370 data[readSoFar - 2] = '\n';-
1371 data[readSoFar - 1] = '\0';-
1372 --readSoFar;-
1373 }
never executed: end of block
0
1374 }
executed 411 times by 4 tests: end of block
Executed by:
  • tst_QCssParser
  • tst_QFile
  • tst_QIODevice
  • tst_QProcess
411
1375-
1376#if defined QIODEVICE_DEBUG-
1377 printf("%p \treturning %lld, d->pos = %lld, d->buffer.size() = %lld, size() = %lld\n",-
1378 this, readSoFar, d->pos, d->buffer.size(), size());-
1379 debugBinaryString(data, int(readSoFar));-
1380#endif-
1381 return readSoFar;
executed 6535 times by 41 tests: return readSoFar;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
6535
1382}-
1383-
1384/*!-
1385 \overload-
1386-
1387 Reads a line from the device, but no more than \a maxSize characters,-
1388 and returns the result as a byte array.-
1389-
1390 This function has no way of reporting errors; returning an empty-
1391 QByteArray can mean either that no data was currently available-
1392 for reading, or that an error occurred.-
1393*/-
1394QByteArray QIODevice::readLine(qint64 maxSize)-
1395{-
1396 Q_D(QIODevice);-
1397 QByteArray result;-
1398-
1399 CHECK_MAXLEN(readLine, result);
never executed: return result;
maxSize < 0Description
TRUEnever evaluated
FALSEevaluated 50903 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
0-50903
1400 CHECK_MAXBYTEARRAYSIZE(readLine);
never executed: end of block
maxSize >= MaxByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 50903 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
0-50903
1401-
1402#if defined QIODEVICE_DEBUG-
1403 printf("%p QIODevice::readLine(%lld), d->pos = %lld, d->buffer.size() = %lld\n",-
1404 this, maxSize, d->pos, d->buffer.size());-
1405#endif-
1406-
1407 result.resize(int(maxSize));-
1408 qint64 readBytes = 0;-
1409 if (!result.size()) {
!result.size()Description
TRUEevaluated 50894 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QIODevice
9-50894
1410 // If resize fails or maxSize == 0, read incrementally-
1411 if (maxSize == 0)
maxSize == 0Description
TRUEevaluated 50894 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
FALSEnever evaluated
0-50894
1412 maxSize = MaxByteArraySize - 1;
executed 50894 times by 40 tests: maxSize = MaxByteArraySize - 1;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
50894
1413-
1414 // The first iteration needs to leave an extra byte for the terminating null-
1415 result.resize(1);-
1416-
1417 qint64 readResult;-
1418 do {-
1419 result.resize(int(qMin(maxSize, qint64(result.size() + d->readBufferChunkSize))));-
1420 readResult = readLine(result.data() + readBytes, result.size() - readBytes);-
1421 if (readResult > 0 || readBytes == 0)
readResult > 0Description
TRUEevaluated 50855 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
FALSEevaluated 111 times by 6 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QTcpSocket
  • tst_QUdpSocket
readBytes == 0Description
TRUEevaluated 111 times by 6 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QTcpSocket
  • tst_QUdpSocket
FALSEnever evaluated
0-50855
1422 readBytes += readResult;
executed 50966 times by 40 tests: readBytes += readResult;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
50966
1423 } while (readResult == d->readBufferChunkSize
executed 50966 times by 40 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
readResult == ...ufferChunkSizeDescription
TRUEevaluated 80 times by 2 tests
Evaluated by:
  • tst_QIODevice
  • tst_QNetworkReply
FALSEevaluated 50886 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
80-50966
1424 && result[int(readBytes - 1)] != '\n');
result[int(rea... - 1)] != '\n'Description
TRUEevaluated 72 times by 2 tests
Evaluated by:
  • tst_QIODevice
  • tst_QNetworkReply
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QIODevice
8-72
1425 } else
executed 50894 times by 40 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
50894
1426 readBytes = readLine(result.data(), result.size());
executed 9 times by 1 test: readBytes = readLine(result.data(), result.size());
Executed by:
  • tst_QIODevice
9
1427-
1428 if (readBytes <= 0)
readBytes <= 0Description
TRUEevaluated 111 times by 6 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QTcpSocket
  • tst_QUdpSocket
FALSEevaluated 50792 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
111-50792
1429 result.clear();
executed 111 times by 6 tests: result.clear();
Executed by:
  • tst_QFile
  • tst_QIODevice
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QTcpSocket
  • tst_QUdpSocket
111
1430 else-
1431 result.resize(readBytes);
executed 50792 times by 39 tests: result.resize(readBytes);
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
50792
1432-
1433 return result;
executed 50903 times by 40 tests: return result;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLockFile
  • tst_QMimeDatabase
  • tst_QNetworkReply
  • ...
50903
1434}-
1435-
1436/*!-
1437 Reads up to \a maxSize characters into \a data and returns the-
1438 number of characters read.-
1439-
1440 This function is called by readLine(), and provides its base-
1441 implementation, using getChar(). Buffered devices can improve the-
1442 performance of readLine() by reimplementing this function.-
1443-
1444 readLine() appends a '\\0' byte to \a data; readLineData() does not-
1445 need to do this.-
1446-
1447 If you reimplement this function, be careful to return the correct-
1448 value: it should return the number of bytes read in this line,-
1449 including the terminating newline, or 0 if there is no line to be-
1450 read at this point. If an error occurs, it should return -1 if and-
1451 only if no bytes were read. Reading past EOF is considered an error.-
1452*/-
1453qint64 QIODevice::readLineData(char *data, qint64 maxSize)-
1454{-
1455 Q_D(QIODevice);-
1456 qint64 readSoFar = 0;-
1457 char c;-
1458 int lastReadReturn = 0;-
1459 d->baseReadLineDataCalled = true;-
1460-
1461 while (readSoFar < maxSize && (lastReadReturn = read(&c, 1)) == 1) {
readSoFar < maxSizeDescription
TRUEevaluated 4511454 times by 43 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
FALSEevaluated 213 times by 5 tests
Evaluated by:
  • tst_QBuffer
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QTcpSocket
(lastReadRetur...d(&c, 1)) == 1Description
TRUEevaluated 4511057 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
FALSEevaluated 397 times by 12 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
213-4511454
1462 *data++ = c;-
1463 ++readSoFar;-
1464 if (c == '\n')
c == '\n'Description
TRUEevaluated 6271 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
FALSEevaluated 4504786 times by 40 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
6271-4504786
1465 break;
executed 6271 times by 39 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
6271
1466 }
executed 4504786 times by 40 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
4504786
1467-
1468#if defined QIODEVICE_DEBUG-
1469 printf("%p QIODevice::readLineData(%p, %lld), d->pos = %lld, d->buffer.size() = %lld, "-
1470 "returns %lld\n", this, data, maxSize, d->pos, d->buffer.size(), readSoFar);-
1471#endif-
1472 if (lastReadReturn != 1 && readSoFar == 0)
lastReadReturn != 1Description
TRUEevaluated 529 times by 12 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
FALSEevaluated 6352 times by 39 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
readSoFar == 0Description
TRUEevaluated 379 times by 11 tests
Evaluated by:
  • tst_QFile
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
FALSEevaluated 150 times by 3 tests
Evaluated by:
  • tst_QBuffer
  • tst_QIODevice
  • tst_QPixmap
150-6352
1473 return isSequential() ? lastReadReturn : -1;
executed 379 times by 11 tests: return isSequential() ? lastReadReturn : -1;
Executed by:
  • tst_QFile
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QLockFile
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlInputSource
379
1474 return readSoFar;
executed 6502 times by 40 tests: return readSoFar;
Executed by:
  • tst_QAccessibility
  • tst_QBuffer
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QComboBox
  • tst_QCompleter
  • tst_QCssParser
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLockFile
  • ...
6502
1475}-
1476-
1477/*!-
1478 Returns \c true if a complete line of data can be read from the device;-
1479 otherwise returns \c false.-
1480-
1481 Note that unbuffered devices, which have no way of determining what-
1482 can be read, always return false.-
1483-
1484 This function is often called in conjunction with the readyRead()-
1485 signal.-
1486-
1487 Subclasses that reimplement this function must call the base-
1488 implementation in order to include the contents of the QIODevice's buffer. Example:-
1489-
1490 \snippet code/src_corelib_io_qiodevice.cpp 3-
1491-
1492 \sa readyRead(), readLine()-
1493*/-
1494bool QIODevice::canReadLine() const-
1495{-
1496 Q_D(const QIODevice);-
1497 return d->buffer.indexOf('\n', d->buffer.size(),
executed 10381 times by 12 tests: return d->buffer.indexOf('\n', d->buffer.size(), d->isSequential() ? d->transactionPos : static_cast<long long>(0LL)) >= 0;
Executed by:
  • tst_QBuffer
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlSimpleReader
10381
1498 d->isSequential() ? d->transactionPos : Q_INT64_C(0)) >= 0;
executed 10381 times by 12 tests: return d->buffer.indexOf('\n', d->buffer.size(), d->isSequential() ? d->transactionPos : static_cast<long long>(0LL)) >= 0;
Executed by:
  • tst_QBuffer
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QUdpSocket
  • tst_QXmlSimpleReader
10381
1499}-
1500-
1501/*!-
1502 \since 5.7-
1503-
1504 Starts a new read transaction on the device.-
1505-
1506 Defines a restorable point within the sequence of read operations. For-
1507 sequential devices, read data will be duplicated internally to allow-
1508 recovery in case of incomplete reads. For random-access devices,-
1509 this function saves the current position. Call commitTransaction() or-
1510 rollbackTransaction() to finish the transaction.-
1511-
1512 \note Nesting transactions is not supported.-
1513-
1514 \sa commitTransaction(), rollbackTransaction()-
1515*/-
1516void QIODevice::startTransaction()-
1517{-
1518 Q_D(QIODevice);-
1519 if (d->transactionStarted) {
d->transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 38871 times by 85 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
0-38871
1520 checkWarnMessage(this, "startTransaction", "Called while transaction already in progress");-
1521 return;
never executed: return;
0
1522 }-
1523 d->transactionPos = d->pos;-
1524 d->transactionStarted = true;-
1525}
executed 38871 times by 85 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
38871
1526-
1527/*!-
1528 \since 5.7-
1529-
1530 Completes a read transaction.-
1531-
1532 For sequential devices, all data recorded in the internal buffer during-
1533 the transaction will be discarded.-
1534-
1535 \sa startTransaction(), rollbackTransaction()-
1536*/-
1537void QIODevice::commitTransaction()-
1538{-
1539 Q_D(QIODevice);-
1540 if (!d->transactionStarted) {
!d->transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 653 times by 2 tests
Evaluated by:
  • tst_QDataStream
  • tst_QIODevice
0-653
1541 checkWarnMessage(this, "commitTransaction", "Called while no transaction in progress");-
1542 return;
never executed: return;
0
1543 }-
1544 if (d->isSequential())
d->isSequential()Description
TRUEevaluated 456 times by 2 tests
Evaluated by:
  • tst_QDataStream
  • tst_QIODevice
FALSEevaluated 197 times by 2 tests
Evaluated by:
  • tst_QDataStream
  • tst_QIODevice
197-456
1545 d->buffer.free(d->transactionPos);
executed 456 times by 2 tests: d->buffer.free(d->transactionPos);
Executed by:
  • tst_QDataStream
  • tst_QIODevice
456
1546 d->transactionStarted = false;-
1547 d->transactionPos = 0;-
1548}
executed 653 times by 2 tests: end of block
Executed by:
  • tst_QDataStream
  • tst_QIODevice
653
1549-
1550/*!-
1551 \since 5.7-
1552-
1553 Rolls back a read transaction.-
1554-
1555 Restores the input stream to the point of the startTransaction() call.-
1556 This function is commonly used to rollback the transaction when an-
1557 incomplete read was detected prior to committing the transaction.-
1558-
1559 \sa startTransaction(), commitTransaction()-
1560*/-
1561void QIODevice::rollbackTransaction()-
1562{-
1563 Q_D(QIODevice);-
1564 if (!d->transactionStarted) {
!d->transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 38218 times by 85 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
0-38218
1565 checkWarnMessage(this, "rollbackTransaction", "Called while no transaction in progress");-
1566 return;
never executed: return;
0
1567 }-
1568 if (!d->isSequential())
!d->isSequential()Description
TRUEevaluated 34109 times by 75 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • ...
FALSEevaluated 4109 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
4109-34109
1569 d->seekBuffer(d->transactionPos);
executed 34109 times by 75 tests: d->seekBuffer(d->transactionPos);
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • ...
34109
1570 d->transactionStarted = false;-
1571 d->transactionPos = 0;-
1572}
executed 38218 times by 85 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
38218
1573-
1574/*!-
1575 \since 5.7-
1576-
1577 Returns \c true if a transaction is in progress on the device, otherwise-
1578 \c false.-
1579-
1580 \sa startTransaction()-
1581*/-
1582bool QIODevice::isTransactionStarted() const-
1583{-
1584 return d_func()->transactionStarted;
executed 5030 times by 29 tests: return d_func()->transactionStarted;
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QBrush
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QHeaderView
  • tst_QIODevice
  • tst_QImage
  • tst_QImageReader
  • tst_QListWidget
  • tst_QMainWindow
  • tst_QMetaObjectBuilder
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPen
  • tst_QSettings
  • tst_QSplitter
  • tst_QStandardItem
  • tst_QStandardItemModel
  • tst_QTableWidget
  • ...
5030
1585}-
1586-
1587/*!-
1588 Writes at most \a maxSize bytes of data from \a data to the-
1589 device. Returns the number of bytes that were actually written, or-
1590 -1 if an error occurred.-
1591-
1592 \sa read(), writeData()-
1593*/-
1594qint64 QIODevice::write(const char *data, qint64 maxSize)-
1595{-
1596 Q_D(QIODevice);-
1597 CHECK_WRITABLE(write, qint64(-1));
executed 34 times by 4 tests: return qint64(-1);
Executed by:
  • tst_QProcess
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
executed 1 time by 1 test: return qint64(-1);
Executed by:
  • tst_QFile
(d->openMode & WriteOnly) == 0Description
TRUEevaluated 35 times by 5 tests
Evaluated by:
  • tst_QFile
  • tst_QProcess
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
FALSEevaluated 1012161 times by 117 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • ...
d->openMode == NotOpenDescription
TRUEevaluated 34 times by 4 tests
Evaluated by:
  • tst_QProcess
  • tst_QSslSocket
  • tst_QString
  • tst_QTcpSocket
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QFile
1-1012161
1598 CHECK_MAXLEN(write, qint64(-1));
never executed: return qint64(-1);
maxSize < 0Description
TRUEnever evaluated
FALSEevaluated 1012161 times by 117 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • ...
0-1012161
1599-
1600 const bool sequential = d->isSequential();-
1601 // Make sure the device is positioned correctly.-
1602 if (d->pos != d->devicePos && !sequential && !seek(d->pos))
d->pos != d->devicePosDescription
TRUEevaluated 54 times by 7 tests
Evaluated by:
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedPointer
  • tst_qmakelib
FALSEevaluated 1012107 times by 117 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • ...
!sequentialDescription
TRUEevaluated 54 times by 7 tests
Evaluated by:
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedPointer
  • tst_qmakelib
FALSEnever evaluated
!seek(d->pos)Description
TRUEnever evaluated
FALSEevaluated 54 times by 7 tests
Evaluated by:
  • tst_QFile
  • tst_QFileSystemWatcher
  • tst_QIODevice
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedPointer
  • tst_qmakelib
0-1012107
1603 return qint64(-1);
never executed: return qint64(-1);
0
1604-
1605#ifdef Q_OS_WIN-
1606 if (d->openMode & Text) {-
1607 const char *endOfData = data + maxSize;-
1608 const char *startOfBlock = data;-
1609-
1610 qint64 writtenSoFar = 0;-
1611 const qint64 savedPos = d->pos;-
1612-
1613 forever {-
1614 const char *endOfBlock = startOfBlock;-
1615 while (endOfBlock < endOfData && *endOfBlock != '\n')-
1616 ++endOfBlock;-
1617-
1618 qint64 blockSize = endOfBlock - startOfBlock;-
1619 if (blockSize > 0) {-
1620 qint64 ret = writeData(startOfBlock, blockSize);-
1621 if (ret <= 0) {-
1622 if (writtenSoFar && !sequential)-
1623 d->buffer.skip(d->pos - savedPos);-
1624 return writtenSoFar ? writtenSoFar : ret;-
1625 }-
1626 if (!sequential) {-
1627 d->pos += ret;-
1628 d->devicePos += ret;-
1629 }-
1630 writtenSoFar += ret;-
1631 }-
1632-
1633 if (endOfBlock == endOfData)-
1634 break;-
1635-
1636 qint64 ret = writeData("\r\n", 2);-
1637 if (ret <= 0) {-
1638 if (writtenSoFar && !sequential)-
1639 d->buffer.skip(d->pos - savedPos);-
1640 return writtenSoFar ? writtenSoFar : ret;-
1641 }-
1642 if (!sequential) {-
1643 d->pos += ret;-
1644 d->devicePos += ret;-
1645 }-
1646 ++writtenSoFar;-
1647-
1648 startOfBlock = endOfBlock + 1;-
1649 }-
1650-
1651 if (writtenSoFar && !sequential)-
1652 d->buffer.skip(d->pos - savedPos);-
1653 return writtenSoFar;-
1654 }-
1655#endif-
1656-
1657 qint64 written = writeData(data, maxSize);-
1658 if (!sequential && written > 0) {
!sequentialDescription
TRUEevaluated 349534 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • ...
FALSEevaluated 662627 times by 36 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QEventLoop
  • tst_QFile
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • ...
written > 0Description
TRUEevaluated 347302 times by 92 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • ...
FALSEevaluated 2232 times by 12 tests
Evaluated by:
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBuffer
  • tst_QDataStream
  • tst_QFile
  • tst_QNetworkReply
  • tst_QPlainTextEdit
  • tst_QSharedPointer
  • tst_QTextEdit
  • tst_QTextStream
  • tst_QXmlStream
  • tst_qmakelib
2232-662627
1659 d->pos += written;-
1660 d->devicePos += written;-
1661 d->buffer.skip(written);-
1662 }
executed 347302 times by 92 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • ...
347302
1663 return written;
executed 1012161 times by 117 tests: return written;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDateTime
  • tst_QDir
  • tst_QDockWidget
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • ...
1012161
1664}-
1665-
1666/*!-
1667 \since 4.5-
1668-
1669 \overload-
1670-
1671 Writes data from a zero-terminated string of 8-bit characters to the-
1672 device. Returns the number of bytes that were actually written, or-
1673 -1 if an error occurred. This is equivalent to-
1674 \code-
1675 ...-
1676 QIODevice::write(data, qstrlen(data));-
1677 ...-
1678 \endcode-
1679-
1680 \sa read(), writeData()-
1681*/-
1682qint64 QIODevice::write(const char *data)-
1683{-
1684 return write(data, qstrlen(data));
executed 3488 times by 29 tests: return write(data, qstrlen(data));
Executed by:
  • tst_QBuffer
  • tst_QDir
  • tst_QFile
  • tst_QFileInfo
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkDiskCache
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QRingBuffer
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSharedPointer
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QTemporaryDir
  • tst_QTemporaryFile
  • tst_QTextStream
  • ...
3488
1685}-
1686-
1687/*! \fn qint64 QIODevice::write(const QByteArray &byteArray)-
1688-
1689 \overload-
1690-
1691 Writes the content of \a byteArray to the device. Returns the number of-
1692 bytes that were actually written, or -1 if an error occurred.-
1693-
1694 \sa read(), writeData()-
1695*/-
1696-
1697/*!-
1698 Puts the character \a c back into the device, and decrements the-
1699 current position unless the position is 0. This function is-
1700 usually called to "undo" a getChar() operation, such as when-
1701 writing a backtracking parser.-
1702-
1703 If \a c was not previously read from the device, the behavior is-
1704 undefined.-
1705-
1706 \note This function is not available while a transaction is in progress.-
1707*/-
1708void QIODevice::ungetChar(char c)-
1709{-
1710 Q_D(QIODevice);-
1711 CHECK_READABLE(read, Q_VOID);
never executed: return ;
never executed: return ;
(d->openMode & ReadOnly) == 0Description
TRUEnever evaluated
FALSEevaluated 36238 times by 8 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QTcpSocket
d->openMode == NotOpenDescription
TRUEnever evaluated
FALSEnever evaluated
0-36238
1712-
1713 if (d->transactionStarted) {
d->transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 36238 times by 8 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QTcpSocket
0-36238
1714 checkWarnMessage(this, "ungetChar", "Called while transaction is in progress");-
1715 return;
never executed: return;
0
1716 }-
1717-
1718#if defined QIODEVICE_DEBUG-
1719 printf("%p QIODevice::ungetChar(0x%hhx '%c')\n", this, c, isprint(c) ? c : '?');-
1720#endif-
1721-
1722 d->buffer.ungetChar(c);-
1723 if (!d->isSequential())
!d->isSequential()Description
TRUEevaluated 35727 times by 5 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
FALSEevaluated 511 times by 5 tests
Evaluated by:
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QProcess
  • tst_QTcpSocket
511-35727
1724 --d->pos;
executed 35727 times by 5 tests: --d->pos;
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
35727
1725}
executed 36238 times by 8 tests: end of block
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QTcpSocket
36238
1726-
1727/*! \fn bool QIODevice::putChar(char c)-
1728-
1729 Writes the character \a c to the device. Returns \c true on success;-
1730 otherwise returns \c false.-
1731-
1732 \sa write(), getChar(), ungetChar()-
1733*/-
1734bool QIODevice::putChar(char c)-
1735{-
1736 return d_func()->putCharHelper(c);
executed 29711 times by 46 tests: return d_func()->putCharHelper(c);
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractNetworkCache
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDockWidget
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QHeaderView
  • tst_QHostAddress
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QListWidget
  • tst_QLocalSocket
  • tst_QMainWindow
  • tst_QMetaObjectBuilder
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • ...
29711
1737}-
1738-
1739/*!-
1740 \internal-
1741*/-
1742bool QIODevicePrivate::putCharHelper(char c)-
1743{-
1744 return q_func()->write(&c, 1) == 1;
executed 27567 times by 42 tests: return q_func()->write(&c, 1) == 1;
Executed by:
  • tst_QAbstractItemModel
  • tst_QAsn1Element
  • tst_QAuthenticator
  • tst_QBrush
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDockWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsProxyWidget
  • tst_QGuiVariant
  • tst_QHeaderView
  • tst_QHostAddress
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QListWidget
  • tst_QLocalSocket
  • tst_QMainWindow
  • tst_QMetaObjectBuilder
  • tst_QMetaType
  • tst_QNetworkCacheMetaData
  • tst_QPen
  • tst_QPicture
  • ...
27567
1745}-
1746-
1747/*!-
1748 \internal-
1749*/-
1750qint64 QIODevicePrivate::peek(char *data, qint64 maxSize)-
1751{-
1752 Q_Q(QIODevice);-
1753-
1754 if (transactionStarted) {
transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 17550 times by 82 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
0-17550
1755 const qint64 savedTransactionPos = transactionPos;-
1756 const qint64 savedPos = pos;-
1757-
1758 qint64 readBytes = q->read(data, maxSize);-
1759-
1760 // Restore initial position-
1761 if (isSequential())
isSequential()Description
TRUEnever evaluated
FALSEnever evaluated
0
1762 transactionPos = savedTransactionPos;
never executed: transactionPos = savedTransactionPos;
0
1763 else-
1764 seekBuffer(savedPos);
never executed: seekBuffer(savedPos);
0
1765 return readBytes;
never executed: return readBytes;
0
1766 }-
1767-
1768 q->startTransaction();-
1769 qint64 readBytes = q->read(data, maxSize);-
1770 q->rollbackTransaction();-
1771-
1772 return readBytes;
executed 17550 times by 82 tests: return readBytes;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • ...
17550
1773}-
1774-
1775/*!-
1776 \internal-
1777*/-
1778QByteArray QIODevicePrivate::peek(qint64 maxSize)-
1779{-
1780 Q_Q(QIODevice);-
1781-
1782 if (transactionStarted) {
transactionStartedDescription
TRUEnever evaluated
FALSEevaluated 19982 times by 77 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • ...
0-19982
1783 const qint64 savedTransactionPos = transactionPos;-
1784 const qint64 savedPos = pos;-
1785-
1786 QByteArray result = q->read(maxSize);-
1787-
1788 // Restore initial position-
1789 if (isSequential())
isSequential()Description
TRUEnever evaluated
FALSEnever evaluated
0
1790 transactionPos = savedTransactionPos;
never executed: transactionPos = savedTransactionPos;
0
1791 else-
1792 seekBuffer(savedPos);
never executed: seekBuffer(savedPos);
0
1793 return result;
never executed: return result;
0
1794 }-
1795-
1796 q->startTransaction();-
1797 QByteArray result = q->read(maxSize);-
1798 q->rollbackTransaction();-
1799-
1800 return result;
executed 19982 times by 77 tests: return result;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • tst_QGraphicsItem
  • ...
19982
1801}-
1802-
1803/*! \fn bool QIODevice::getChar(char *c)-
1804-
1805 Reads one character from the device and stores it in \a c. If \a c-
1806 is 0, the character is discarded. Returns \c true on success;-
1807 otherwise returns \c false.-
1808-
1809 \sa read(), putChar(), ungetChar()-
1810*/-
1811bool QIODevice::getChar(char *c)-
1812{-
1813 // readability checked in read()-
1814 char ch;-
1815 return (1 == read(c ? c : &ch, 1));
executed 1453579 times by 10 tests: return (1 == read(c ? c : &ch, 1));
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QXmlSimpleReader
  • tst_qfileopenevent
1453579
1816}-
1817-
1818/*!-
1819 \since 4.1-
1820-
1821 Reads at most \a maxSize bytes from the device into \a data, without side-
1822 effects (i.e., if you call read() after peek(), you will get the same-
1823 data). Returns the number of bytes read. If an error occurs, such as-
1824 when attempting to peek a device opened in WriteOnly mode, this function-
1825 returns -1.-
1826-
1827 0 is returned when no more data is available for reading.-
1828-
1829 Example:-
1830-
1831 \snippet code/src_corelib_io_qiodevice.cpp 4-
1832-
1833 \sa read()-
1834*/-
1835qint64 QIODevice::peek(char *data, qint64 maxSize)-
1836{-
1837 return d_func()->peek(data, maxSize);
executed 19085 times by 86 tests: return d_func()->peek(data, maxSize);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
19085
1838}-
1839-
1840/*!-
1841 \since 4.1-
1842 \overload-
1843-
1844 Peeks at most \a maxSize bytes from the device, returning the data peeked-
1845 as a QByteArray.-
1846-
1847 Example:-
1848-
1849 \snippet code/src_corelib_io_qiodevice.cpp 5-
1850-
1851 This function has no way of reporting errors; returning an empty-
1852 QByteArray can mean either that no data was currently available-
1853 for peeking, or that an error occurred.-
1854-
1855 \sa read()-
1856*/-
1857QByteArray QIODevice::peek(qint64 maxSize)-
1858{-
1859 return d_func()->peek(maxSize);
executed 20207 times by 81 tests: return d_func()->peek(maxSize);
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QBrush
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • tst_QGraphicsEffect
  • tst_QGraphicsEffectSource
  • ...
20207
1860}-
1861-
1862/*!-
1863 Blocks until new data is available for reading and the readyRead()-
1864 signal has been emitted, or until \a msecs milliseconds have-
1865 passed. If msecs is -1, this function will not time out.-
1866-
1867 Returns \c true if new data is available for reading; otherwise returns-
1868 false (if the operation timed out or if an error occurred).-
1869-
1870 This function can operate without an event loop. It is-
1871 useful when writing non-GUI applications and when performing-
1872 I/O operations in a non-GUI thread.-
1873-
1874 If called from within a slot connected to the readyRead() signal,-
1875 readyRead() will not be reemitted.-
1876-
1877 Reimplement this function to provide a blocking API for a custom-
1878 device. The default implementation does nothing, and returns \c false.-
1879-
1880 \warning Calling this function from the main (GUI) thread-
1881 might cause your user interface to freeze.-
1882-
1883 \sa waitForBytesWritten()-
1884*/-
1885bool QIODevice::waitForReadyRead(int msecs)-
1886{-
1887 Q_UNUSED(msecs);-
1888 return false;
executed 223 times by 3 tests: return false;
Executed by:
  • tst_QXmlInputSource
  • tst_QXmlSimpleReader
  • tst_QXmlStream
223
1889}-
1890-
1891/*!-
1892 For buffered devices, this function waits until a payload of-
1893 buffered written data has been written to the device and the-
1894 bytesWritten() signal has been emitted, or until \a msecs-
1895 milliseconds have passed. If msecs is -1, this function will-
1896 not time out. For unbuffered devices, it returns immediately.-
1897-
1898 Returns \c true if a payload of data was written to the device;-
1899 otherwise returns \c false (i.e. if the operation timed out, or if an-
1900 error occurred).-
1901-
1902 This function can operate without an event loop. It is-
1903 useful when writing non-GUI applications and when performing-
1904 I/O operations in a non-GUI thread.-
1905-
1906 If called from within a slot connected to the bytesWritten() signal,-
1907 bytesWritten() will not be reemitted.-
1908-
1909 Reimplement this function to provide a blocking API for a custom-
1910 device. The default implementation does nothing, and returns \c false.-
1911-
1912 \warning Calling this function from the main (GUI) thread-
1913 might cause your user interface to freeze.-
1914-
1915 \sa waitForReadyRead()-
1916*/-
1917bool QIODevice::waitForBytesWritten(int msecs)-
1918{-
1919 Q_UNUSED(msecs);-
1920 return false;
never executed: return false;
0
1921}-
1922-
1923/*!-
1924 Sets the human readable description of the last device error that-
1925 occurred to \a str.-
1926-
1927 \sa errorString()-
1928*/-
1929void QIODevice::setErrorString(const QString &str)-
1930{-
1931 d_func()->errorString = str;-
1932}
executed 187 times by 8 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QHttpNetworkConnection
  • tst_QLocalSocket
  • tst_QNetworkAccessManager
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_Spdy
187
1933-
1934/*!-
1935 Returns a human-readable description of the last device error that-
1936 occurred.-
1937-
1938 \sa setErrorString()-
1939*/-
1940QString QIODevice::errorString() const-
1941{-
1942 Q_D(const QIODevice);-
1943 if (d->errorString.isEmpty()) {
d->errorString.isEmpty()Description
TRUEevaluated 5355 times by 42 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • ...
FALSEevaluated 741 times by 22 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QDir
  • tst_QFile
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QTemporaryFile
  • tst_QUdpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qmakelib
741-5355
1944#ifdef QT_NO_QOBJECT-
1945 return QLatin1String(QT_TRANSLATE_NOOP(QIODevice, "Unknown error"));-
1946#else-
1947 return tr("Unknown error");
executed 5355 times by 42 tests: return tr("Unknown error");
Executed by:
  • tst_NetworkSelfTest
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • ...
5355
1948#endif-
1949 }-
1950 return d->errorString;
executed 741 times by 22 tests: return d->errorString;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QDir
  • tst_QFile
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QLockFile
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_QTemporaryFile
  • tst_QUdpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qmakelib
741
1951}-
1952-
1953/*!-
1954 \fn qint64 QIODevice::readData(char *data, qint64 maxSize)-
1955-
1956 Reads up to \a maxSize bytes from the device into \a data, and-
1957 returns the number of bytes read or -1 if an error occurred.-
1958-
1959 If there are no bytes to be read and there can never be more bytes-
1960 available (examples include socket closed, pipe closed, sub-process-
1961 finished), this function returns -1.-
1962-
1963 This function is called by QIODevice. Reimplement this function-
1964 when creating a subclass of QIODevice.-
1965-
1966 When reimplementing this function it is important that this function-
1967 reads all the required data before returning. This is required in order-
1968 for QDataStream to be able to operate on the class. QDataStream assumes-
1969 all the requested information was read and therefore does not retry reading-
1970 if there was a problem.-
1971-
1972 This function might be called with a maxSize of 0, which can be used to-
1973 perform post-reading operations.-
1974-
1975 \sa read(), readLine(), writeData()-
1976*/-
1977-
1978/*!-
1979 \fn qint64 QIODevice::writeData(const char *data, qint64 maxSize)-
1980-
1981 Writes up to \a maxSize bytes from \a data to the device. Returns-
1982 the number of bytes written, or -1 if an error occurred.-
1983-
1984 This function is called by QIODevice. Reimplement this function-
1985 when creating a subclass of QIODevice.-
1986-
1987 When reimplementing this function it is important that this function-
1988 writes all the data available before returning. This is required in order-
1989 for QDataStream to be able to operate on the class. QDataStream assumes-
1990 all the information was written and therefore does not retry writing if-
1991 there was a problem.-
1992-
1993 \sa read(), write()-
1994*/-
1995-
1996/*!-
1997 \internal-
1998 \fn int qt_subtract_from_timeout(int timeout, int elapsed)-
1999-
2000 Reduces the \a timeout by \a elapsed, taking into account that -1 is a-
2001 special value for timeouts.-
2002*/-
2003-
2004int qt_subtract_from_timeout(int timeout, int elapsed)-
2005{-
2006 if (timeout == -1)
timeout == -1Description
TRUEevaluated 756 times by 8 tests
Evaluated by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
FALSEevaluated 65846 times by 47 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • ...
756-65846
2007 return -1;
executed 756 times by 8 tests: return -1;
Executed by:
  • tst_QEventLoop
  • tst_QGuiEventLoop
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QXmlSimpleReader
  • tst_qmake
  • tst_qmakelib
756
2008-
2009 timeout = timeout - elapsed;-
2010 return timeout < 0 ? 0 : timeout;
executed 65846 times by 47 tests: return timeout < 0 ? 0 : timeout;
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QApplication
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDir
  • tst_QEventLoop
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QLocalSocket
  • tst_QMimeDatabase
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QNetworkSession
  • tst_QObject
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • ...
65846
2011}-
2012-
2013-
2014#if !defined(QT_NO_DEBUG_STREAM)-
2015QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)-
2016{-
2017 debug << "OpenMode(";-
2018 QStringList modeList;-
2019 if (modes == QIODevice::NotOpen) {
modes == QIODevice::NotOpenDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QFile
0-16
2020 modeList << QLatin1String("NotOpen");-
2021 } else {
never executed: end of block
0
2022 if (modes & QIODevice::ReadOnly)
modes & QIODevice::ReadOnlyDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QFile
FALSEnever evaluated
0-16
2023 modeList << QLatin1String("ReadOnly");
executed 16 times by 1 test: modeList << QLatin1String("ReadOnly");
Executed by:
  • tst_QFile
16
2024 if (modes & QIODevice::WriteOnly)
modes & QIODevice::WriteOnlyDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QFile
5-11
2025 modeList << QLatin1String("WriteOnly");
executed 5 times by 1 test: modeList << QLatin1String("WriteOnly");
Executed by:
  • tst_QFile
5
2026 if (modes & QIODevice::Append)
modes & QIODevice::AppendDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QFile
0-16
2027 modeList << QLatin1String("Append");
never executed: modeList << QLatin1String("Append");
0
2028 if (modes & QIODevice::Truncate)
modes & QIODevice::TruncateDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QFile
0-16
2029 modeList << QLatin1String("Truncate");
never executed: modeList << QLatin1String("Truncate");
0
2030 if (modes & QIODevice::Text)
modes & QIODevice::TextDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_QFile
3-13
2031 modeList << QLatin1String("Text");
executed 3 times by 1 test: modeList << QLatin1String("Text");
Executed by:
  • tst_QFile
3
2032 if (modes & QIODevice::Unbuffered)
modes & QIODevice::UnbufferedDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QFile
FALSEevaluated 13 times by 1 test
Evaluated by:
  • tst_QFile
3-13
2033 modeList << QLatin1String("Unbuffered");
executed 3 times by 1 test: modeList << QLatin1String("Unbuffered");
Executed by:
  • tst_QFile
3
2034 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_QFile
16
2035 std::sort(modeList.begin(), modeList.end());-
2036 debug << modeList.join(QLatin1Char('|'));-
2037 debug << ')';-
2038 return debug;
executed 16 times by 1 test: return debug;
Executed by:
  • tst_QFile
16
2039}-
2040#endif-
2041-
2042QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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