qringbuffer.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qringbuffer.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Copyright (C) 2015 Alex Trotsenko <alex1973tr@gmail.com>-
5** Contact: https://www.qt.io/licensing/-
6**-
7** This file is part of the QtCore module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41#include "private/qringbuffer_p.h"-
42#include "private/qbytearray_p.h"-
43#include <string.h>-
44-
45QT_BEGIN_NAMESPACE-
46-
47/*!-
48 \internal-
49-
50 Access the bytes at a specified position the out-variable length will-
51 contain the amount of bytes readable from there, e.g. the amount still-
52 the same QByteArray-
53*/-
54const char *QRingBuffer::readPointerAtPosition(qint64 pos, qint64 &length) const-
55{-
56 if (pos >= 0) {
pos >= 0Description
TRUEevaluated 904 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QRingBuffer
FALSEnever evaluated
0-904
57 pos += head;-
58 for (int i = 0; i < buffers.size(); ++i) {
i < buffers.size()Description
TRUEevaluated 924 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QRingBuffer
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QRingBuffer
3-924
59 length = (i == tailBuffer ? tail : buffers[i].size());
i == tailBufferDescription
TRUEevaluated 180 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QRingBuffer
FALSEevaluated 744 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QRingBuffer
180-744
60 if (length > pos) {
length > posDescription
TRUEevaluated 901 times by 2 tests
Evaluated by:
  • tst_QNetworkReply
  • tst_QRingBuffer
FALSEevaluated 23 times by 1 test
Evaluated by:
  • tst_QRingBuffer
23-901
61 length -= pos;-
62 return buffers[i].constData() + pos;
executed 901 times by 2 tests: return buffers[i].constData() + pos;
Executed by:
  • tst_QNetworkReply
  • tst_QRingBuffer
901
63 }-
64 pos -= length;-
65 }
executed 23 times by 1 test: end of block
Executed by:
  • tst_QRingBuffer
23
66 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QRingBuffer
3
67-
68 length = 0;-
69 return 0;
executed 3 times by 1 test: return 0;
Executed by:
  • tst_QRingBuffer
3
70}-
71-
72void QRingBuffer::free(qint64 bytes)-
73{-
74 Q_ASSERT(bytes <= bufferSize);-
75-
76 while (bytes > 0) {
bytes > 0Description
TRUEevaluated 43978893 times by 157 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 35028 times by 42 tests
Evaluated by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QBitArray
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDate
  • tst_QFile
  • tst_QFileInfo
  • tst_QFtp
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QKeyEvent
  • tst_QLocalSocket
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkCacheMetaData
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPoint
  • tst_QPointF
  • ...
35028-43978893
77 const qint64 blockSize = buffers.constFirst().size() - head;-
78-
79 if (tailBuffer == 0 || blockSize > bytes) {
tailBuffer == 0Description
TRUEevaluated 43975027 times by 157 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 3866 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_rcc
blockSize > bytesDescription
TRUEevaluated 855 times by 3 tests
Evaluated by:
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
FALSEevaluated 3011 times by 12 tests
Evaluated by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_rcc
855-43975027
80 // keep a single block around if it does not exceed-
81 // the basic block size, to avoid repeated allocations-
82 // between uses of the buffer-
83 if (bufferSize <= bytes) {
bufferSize <= bytesDescription
TRUEevaluated 126580 times by 156 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 43849302 times by 111 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
  • ...
126580-43849302
84 if (buffers.constFirst().size() <= basicBlockSize) {
buffers.constF...basicBlockSizeDescription
TRUEevaluated 121102 times by 156 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 5478 times by 14 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
5478-121102
85 bufferSize = 0;-
86 head = tail = 0;-
87 } else {
executed 121102 times by 156 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
  • ...
121102
88 clear(); // try to minify/squeeze us-
89 }
executed 5478 times by 14 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
5478
90 } else {-
91 Q_ASSERT(bytes < MaxByteArraySize);-
92 head += int(bytes);-
93 bufferSize -= bytes;-
94 }
executed 43849302 times by 111 tests: end of block
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
  • ...
43849302
95 return;
executed 43975882 times by 157 tests: return;
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
  • ...
43975882
96 }-
97-
98 bufferSize -= blockSize;-
99 bytes -= blockSize;-
100 buffers.removeFirst();-
101 --tailBuffer;-
102 head = 0;-
103 }
executed 3011 times by 12 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSharedPointer
  • tst_QTcpSocket
  • tst_Selftests
  • tst_Spdy
  • tst_qdbuscpp2xml
  • tst_rcc
3011
104}
executed 35028 times by 42 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_QAbstractFileEngine
  • tst_QAbstractNetworkCache
  • tst_QBitArray
  • tst_QBuffer
  • tst_QDataStream
  • tst_QDate
  • tst_QFile
  • tst_QFileInfo
  • tst_QFtp
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QKeyEvent
  • tst_QLocalSocket
  • tst_QMetaType
  • tst_QMimeDatabase
  • tst_QNetworkCacheMetaData
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QPixmap
  • tst_QPoint
  • tst_QPointF
  • ...
35028
105-
106char *QRingBuffer::reserve(qint64 bytes)-
107{-
108 if (bytes <= 0 || bytes >= MaxByteArraySize)
bytes <= 0Description
TRUEevaluated 27 times by 8 tests
Evaluated by:
  • tst_QFile
  • tst_QHttpSocketEngine
  • tst_QNetworkReply
  • tst_QSharedPointer
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qmakelib
  • tst_qnetworkreply - unknown status
FALSEevaluated 397944 times by 165 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
bytes >= MaxByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 397944 times by 165 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
0-397944
109 return 0;
executed 27 times by 8 tests: return 0;
Executed by:
  • tst_QFile
  • tst_QHttpSocketEngine
  • tst_QNetworkReply
  • tst_QSharedPointer
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qmakelib
  • tst_qnetworkreply - unknown status
27
110-
111 if (buffers.isEmpty()) {
buffers.isEmpty()Description
TRUEevaluated 48462 times by 165 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
FALSEevaluated 349482 times by 133 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_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
48462-349482
112 buffers.append(QByteArray());-
113 buffers.first().resize(qMax(basicBlockSize, int(bytes)));-
114 } else {
executed 48462 times by 165 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
48462
115 const qint64 newSize = bytes + tail;-
116 // if need buffer reallocation-
117 if (newSize > buffers.constLast().size()) {
newSize > buff...tLast().size()Description
TRUEevaluated 58432 times by 96 tests
Evaluated by:
  • tst_LargeFile
  • 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_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
FALSEevaluated 291050 times by 78 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QColorDialog
  • tst_QCryptographicHash
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFiledialog
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • ...
58432-291050
118 if (newSize > buffers.constLast().capacity() && (tail >= basicBlockSize
newSize > buff...t().capacity()Description
TRUEevaluated 45290 times by 96 tests
Evaluated by:
  • tst_LargeFile
  • 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_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
FALSEevaluated 13142 times by 10 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Selftests
  • tst_qmake
tail >= basicBlockSizeDescription
TRUEevaluated 1476 times by 13 tests
Evaluated by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qmake
  • tst_rcc
FALSEevaluated 43814 times by 94 tests
Evaluated by:
  • tst_LargeFile
  • 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_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
1476-45290
119 || newSize >= MaxByteArraySize)) {
newSize >= MaxByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 43814 times by 94 tests
Evaluated by:
  • tst_LargeFile
  • 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_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
0-43814
120 // shrink this buffer to its current size-
121 buffers.last().resize(tail);-
122-
123 // create a new QByteArray-
124 buffers.append(QByteArray());-
125 ++tailBuffer;-
126 tail = 0;-
127 }
executed 1476 times by 13 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qmake
  • tst_rcc
1476
128 buffers.last().resize(qMax(basicBlockSize, tail + int(bytes)));-
129 }
executed 58432 times by 96 tests: end of block
Executed by:
  • tst_LargeFile
  • 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_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFocusEvent
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QFrame
  • ...
58432
130 }
executed 349482 times by 133 tests: end of block
Executed 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_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTimeEdit
  • tst_QDialog
  • ...
349482
131-
132 char *writePtr = buffers.last().data() + tail;-
133 bufferSize += bytes;-
134 Q_ASSERT(bytes < MaxByteArraySize);-
135 tail += int(bytes);-
136 return writePtr;
executed 397944 times by 165 tests: return writePtr;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
397944
137}-
138-
139/*!-
140 \internal-
141-
142 Allocate data at buffer head-
143*/-
144char *QRingBuffer::reserveFront(qint64 bytes)-
145{-
146 if (bytes <= 0 || bytes >= MaxByteArraySize)
bytes <= 0Description
TRUEnever evaluated
FALSEevaluated 33198 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
bytes >= MaxByteArraySizeDescription
TRUEnever evaluated
FALSEevaluated 33198 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
0-33198
147 return 0;
never executed: return 0;
0
148-
149 if (head < bytes) {
head < bytesDescription
TRUEevaluated 32952 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
FALSEevaluated 246 times by 1 test
Evaluated by:
  • tst_QRingBuffer
246-32952
150 if (buffers.isEmpty()) {
buffers.isEmpty()Description
TRUEevaluated 7 times by 4 tests
Evaluated by:
  • tst_QBuffer
  • tst_QIODevice
  • tst_QImageReader
  • tst_QRingBuffer
FALSEevaluated 32945 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
7-32945
151 buffers.append(QByteArray());-
152 } else {
executed 7 times by 4 tests: end of block
Executed by:
  • tst_QBuffer
  • tst_QIODevice
  • tst_QImageReader
  • tst_QRingBuffer
7
153 buffers.first().remove(0, head);-
154 if (tailBuffer == 0)
tailBuffer == 0Description
TRUEevaluated 32938 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QRingBuffer
7-32938
155 tail -= head;
executed 32938 times by 7 tests: tail -= head;
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
32938
156 }
executed 32945 times by 7 tests: end of block
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
32945
157-
158 head = qMax(basicBlockSize, int(bytes));-
159 if (bufferSize == 0) {
bufferSize == 0Description
TRUEevaluated 32943 times by 7 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_QRingBuffer
9-32943
160 tail = head;-
161 } else {
executed 32943 times by 7 tests: end of block
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
32943
162 buffers.prepend(QByteArray());-
163 ++tailBuffer;-
164 }
executed 9 times by 1 test: end of block
Executed by:
  • tst_QRingBuffer
9
165 buffers.first().resize(head);-
166 }
executed 32952 times by 7 tests: end of block
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
32952
167-
168 head -= int(bytes);-
169 bufferSize += bytes;-
170 return buffers.first().data() + head;
executed 33198 times by 7 tests: return buffers.first().data() + head;
Executed by:
  • tst_QBuffer
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QProcess
  • tst_QRingBuffer
33198
171}-
172-
173void QRingBuffer::chop(qint64 bytes)-
174{-
175 Q_ASSERT(bytes <= bufferSize);-
176-
177 while (bytes > 0) {
bytes > 0Description
TRUEevaluated 151026 times by 155 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
FALSEevaluated 76732 times by 63 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileInfo
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • ...
76732-151026
178 if (tailBuffer == 0 || tail > bytes) {
tailBuffer == 0Description
TRUEevaluated 150895 times by 155 tests
Evaluated by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
FALSEevaluated 131 times by 11 tests
Evaluated by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qmake
  • tst_rcc
tail > bytesDescription
TRUEevaluated 96 times by 8 tests
Evaluated by:
  • tst_QFtp
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSharedPointer
  • tst_Selftests
  • tst_qdbuscpp2xml
  • tst_qmake
  • tst_rcc
FALSEevaluated 35 times by 7 tests
Evaluated by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
35-150895
179 // keep a single block around if it does not exceed-
180 // the basic block size, to avoid repeated allocations-
181 // between uses of the buffer-
182 if (bufferSize <= bytes) {
bufferSize <= bytesDescription
TRUEevaluated 80811 times by 64 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCryptographicHash
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
FALSEevaluated 70180 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_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
70180-80811
183 if (buffers.constFirst().size() <= basicBlockSize) {
buffers.constF...basicBlockSizeDescription
TRUEevaluated 80810 times by 63 tests
Evaluated by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCryptographicHash
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QRingBuffer
1-80810
184 bufferSize = 0;-
185 head = tail = 0;-
186 } else {
executed 80810 times by 63 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QCryptographicHash
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDir
  • tst_QFile
  • tst_QFont
  • tst_QFtp
  • tst_QGraphicsScene
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLabel
  • ...
80810
187 clear(); // try to minify/squeeze us-
188 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QRingBuffer
1
189 } else {-
190 Q_ASSERT(bytes < MaxByteArraySize);-
191 tail -= int(bytes);-
192 bufferSize -= bytes;-
193 }
executed 70180 times by 143 tests: end of block
Executed 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_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QDateTime
  • tst_QDateTimeEdit
  • tst_QDebug
  • ...
70180
194 return;
executed 150991 times by 155 tests: return;
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAccessibility
  • tst_QApplication
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QChar
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QCryptographicHash
  • tst_QCssParser
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • ...
150991
195 }-
196-
197 bufferSize -= tail;-
198 bytes -= tail;-
199 buffers.removeLast();-
200 --tailBuffer;-
201 tail = buffers.constLast().size();-
202 }
executed 35 times by 7 tests: end of block
Executed by:
  • tst_QFtp
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_Selftests
35
203}
executed 76732 times by 63 tests: end of block
Executed by:
  • tst_Lancelot
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QChar
  • tst_QDBusAbstractAdaptor
  • tst_QDBusAbstractInterface
  • tst_QDBusConnection
  • tst_QDBusConnection_SpyHook
  • tst_QDBusInterface
  • tst_QDBusMarshall
  • tst_QDataStream
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileInfo
  • tst_QFont
  • tst_QFtp
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • ...
76732
204-
205void QRingBuffer::clear()-
206{-
207 if (buffers.isEmpty())
buffers.isEmpty()Description
TRUEevaluated 229385 times by 71 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • ...
FALSEevaluated 110619 times by 114 tests
Evaluated by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • 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_QDir
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
110619-229385
208 return;
executed 229385 times by 71 tests: return;
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractFileEngine
  • tst_QAuthenticator
  • tst_QBitArray
  • tst_QBrush
  • tst_QBuffer
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDate
  • tst_QDir
  • tst_QDirIterator
  • tst_QDirModel
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFont
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiVariant
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • ...
229385
209-
210 buffers.erase(buffers.begin() + 1, buffers.end());-
211 buffers.first().clear();-
212-
213 head = tail = 0;-
214 tailBuffer = 0;-
215 bufferSize = 0;-
216}
executed 110619 times by 114 tests: end of block
Executed by:
  • tst_LargeFile
  • tst_NetworkSelfTest
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • 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_QDir
  • tst_QDoubleSpinBox
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • ...
110619
217-
218qint64 QRingBuffer::indexOf(char c, qint64 maxLength, qint64 pos) const-
219{-
220 if (maxLength <= 0 || pos < 0)
maxLength <= 0Description
TRUEevaluated 5159 times by 11 tests
Evaluated by:
  • tst_QBuffer
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QXmlSimpleReader
FALSEevaluated 107226 times by 42 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
  • ...
pos < 0Description
TRUEnever evaluated
FALSEevaluated 107226 times by 42 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
  • ...
0-107226
221 return -1;
executed 5159 times by 11 tests: return -1;
Executed by:
  • tst_QBuffer
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QLocalSocket
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QXmlSimpleReader
5159
222-
223 qint64 index = -(pos + head);-
224 for (int i = 0; i < buffers.size(); ++i) {
i < buffers.size()Description
TRUEevaluated 116771 times by 42 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 619 times by 9 tests
Evaluated by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QRingBuffer
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
619-116771
225 const qint64 nextBlockIndex = qMin(index + (i == tailBuffer ? tail : buffers[i].size()),-
226 maxLength);-
227-
228 if (nextBlockIndex > 0) {
nextBlockIndex > 0Description
TRUEevaluated 113954 times by 42 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 2817 times by 1 test
Evaluated by:
  • tst_QRingBuffer
2817-113954
229 const char *ptr = buffers[i].constData();-
230 if (index < 0) {
index < 0Description
TRUEevaluated 97225 times by 42 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 16729 times by 10 tests
Evaluated by:
  • tst_QFtp
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QRingBuffer
  • tst_QSocks5SocketEngine
  • tst_QTcpSocket
  • tst_QXmlInputSource
16729-97225
231 ptr -= index;-
232 index = 0;-
233 }
executed 97225 times by 42 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
  • ...
97225
234-
235 const char *findPtr = reinterpret_cast<const char *>(memchr(ptr, c,-
236 nextBlockIndex - index));-
237 if (findPtr)
findPtrDescription
TRUEevaluated 106220 times by 42 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 7734 times by 11 tests
Evaluated by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QTcpSocket
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
7734-106220
238 return qint64(findPtr - ptr) + index + pos;
executed 106220 times by 42 tests: return qint64(findPtr - ptr) + index + pos;
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
  • ...
106220
239-
240 if (nextBlockIndex == maxLength)
nextBlockIndex == maxLengthDescription
TRUEevaluated 387 times by 5 tests
Evaluated by:
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QTcpSocket
FALSEevaluated 7347 times by 10 tests
Evaluated by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
387-7347
241 return -1;
executed 387 times by 5 tests: return -1;
Executed by:
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QTcpSocket
387
242 }
executed 7347 times by 10 tests: end of block
Executed by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
7347
243 index = nextBlockIndex;-
244 }
executed 10164 times by 10 tests: end of block
Executed by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
10164
245 return -1;
executed 619 times by 9 tests: return -1;
Executed by:
  • tst_QChar
  • tst_QFile
  • tst_QIODevice
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QRingBuffer
  • tst_QTextBoundaryFinder
  • tst_QTextStream
  • tst_QXmlInputSource
619
246}-
247-
248qint64 QRingBuffer::read(char *data, qint64 maxLength)-
249{-
250 const qint64 bytesToRead = qMin(size(), maxLength);-
251 qint64 readSoFar = 0;-
252 while (readSoFar < bytesToRead) {
readSoFar < bytesToReadDescription
TRUEevaluated 929541 times by 145 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 7877124 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
  • ...
929541-7877124
253 const qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar,-
254 nextDataBlockSize());-
255 if (data)
dataDescription
TRUEevaluated 929541 times by 145 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
  • ...
FALSEnever evaluated
0-929541
256 memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock);
executed 929541 times by 145 tests: memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock);
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
  • ...
929541
257 readSoFar += bytesToReadFromThisBlock;-
258 free(bytesToReadFromThisBlock);-
259 }
executed 929541 times by 145 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
  • ...
929541
260 return readSoFar;
executed 7877124 times by 192 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
  • ...
7877124
261}-
262-
263/*!-
264 \internal-
265-
266 Read an unspecified amount (will read the first buffer)-
267*/-
268QByteArray QRingBuffer::read()-
269{-
270 if (bufferSize == 0)
bufferSize == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QRingBuffer
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QRingBuffer
1-3
271 return QByteArray();
executed 1 time by 1 test: return QByteArray();
Executed by:
  • tst_QRingBuffer
1
272-
273 QByteArray qba(buffers.takeFirst());-
274-
275 qba.reserve(0); // avoid that resizing needlessly reallocates-
276 if (tailBuffer == 0) {
tailBuffer == 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QRingBuffer
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QRingBuffer
1-2
277 qba.resize(tail);-
278 tail = 0;-
279 } else {
executed 1 time by 1 test: end of block
Executed by:
  • tst_QRingBuffer
1
280 --tailBuffer;-
281 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QRingBuffer
2
282 qba.remove(0, head); // does nothing if head is 0-
283 head = 0;-
284 bufferSize -= qba.size();-
285 return qba;
executed 3 times by 1 test: return qba;
Executed by:
  • tst_QRingBuffer
3
286}-
287-
288/*!-
289 \internal-
290-
291 Peek the bytes from a specified position-
292*/-
293qint64 QRingBuffer::peek(char *data, qint64 maxLength, qint64 pos) const-
294{-
295 qint64 readSoFar = 0;-
296-
297 if (pos >= 0) {
pos >= 0Description
TRUEevaluated 15861 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEnever evaluated
0-15861
298 pos += head;-
299 for (int i = 0; readSoFar < maxLength && i < buffers.size(); ++i) {
readSoFar < maxLengthDescription
TRUEevaluated 20554 times by 15 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 11132 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_Spdy
i < buffers.size()Description
TRUEevaluated 15825 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 4729 times by 12 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
4729-20554
300 qint64 blockLength = (i == tailBuffer ? tail : buffers[i].size());
i == tailBufferDescription
TRUEevaluated 15031 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 794 times by 3 tests
Evaluated by:
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
794-15031
301-
302 if (pos < blockLength) {
pos < blockLengthDescription
TRUEevaluated 12255 times by 14 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
FALSEevaluated 3570 times by 8 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_Spdy
3570-12255
303 blockLength = qMin(blockLength - pos, maxLength - readSoFar);-
304 memcpy(data + readSoFar, buffers[i].constData() + pos, blockLength);-
305 readSoFar += blockLength;-
306 pos = 0;-
307 } else {
executed 12255 times by 14 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
12255
308 pos -= blockLength;-
309 }
executed 3570 times by 8 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QIODevice
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_Spdy
3570
310 }-
311 }
executed 15861 times by 15 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
15861
312-
313 return readSoFar;
executed 15861 times by 15 tests: return readSoFar;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QDataStream
  • tst_QHttpNetworkConnection
  • tst_QIODevice
  • tst_QImageReader
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QSslSocket_onDemandCertificates_static
  • tst_QTcpServer
  • tst_QTcpSocket
  • tst_Spdy
15861
314}-
315-
316/*!-
317 \internal-
318-
319 Append bytes from data to the end-
320*/-
321void QRingBuffer::append(const char *data, qint64 size)-
322{-
323 char *writePointer = reserve(size);-
324 if (size == 1)
size == 1Description
TRUEevaluated 69869 times by 17 tests
Evaluated by:
  • tst_QDataStream
  • tst_QFile
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QXmlStream
  • tst_Spdy
FALSEevaluated 96356 times by 62 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
69869-96356
325 *writePointer = *data;
executed 69869 times by 17 tests: *writePointer = *data;
Executed by:
  • tst_QDataStream
  • tst_QFile
  • tst_QHttpSocketEngine
  • tst_QLocalSocket
  • tst_QNetworkDiskCache
  • tst_QNetworkReply
  • tst_QProcess
  • tst_QProcess_and_GuiEventLoop
  • tst_QSaveFile
  • tst_QSettings
  • tst_QSocketNotifier
  • tst_QSocks5SocketEngine
  • tst_QSslSocket
  • tst_QTcpSocket
  • tst_QTextStream
  • tst_QXmlStream
  • tst_Spdy
69869
326 else if (size)
sizeDescription
TRUEevaluated 96329 times by 62 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
FALSEevaluated 27 times by 8 tests
Evaluated by:
  • tst_QFile
  • tst_QHttpSocketEngine
  • tst_QNetworkReply
  • tst_QSharedPointer
  • tst_QTextStream
  • tst_qdbusxml2cpp
  • tst_qmakelib
  • tst_qnetworkreply - unknown status
27-96329
327 ::memcpy(writePointer, data, size);
executed 96329 times by 62 tests: ::memcpy(writePointer, data, size);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
96329
328}
executed 166225 times by 63 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QColorDialog
  • tst_QDataStream
  • tst_QDir
  • tst_QEventLoop
  • tst_QFile
  • tst_QFileDialog2
  • tst_QFileInfo
  • tst_QFileSystemModel
  • tst_QFileSystemWatcher
  • tst_QFiledialog
  • tst_QFtp
  • tst_QGraphicsProxyWidget
  • tst_QGuiEventLoop
  • tst_QHttpNetworkConnection
  • tst_QHttpSocketEngine
  • tst_QIODevice
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QImageWriter
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • ...
166225
329-
330/*!-
331 \internal-
332-
333 Append a new buffer to the end-
334*/-
335void QRingBuffer::append(const QByteArray &qba)-
336{-
337 if (tail == 0) {
tail == 0Description
TRUEevaluated 685 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_Spdy
FALSEevaluated 6470 times by 4 tests
Evaluated by:
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_Spdy
685-6470
338 if (buffers.isEmpty())
buffers.isEmpty()Description
TRUEevaluated 465 times by 5 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_Spdy
FALSEevaluated 220 times by 1 test
Evaluated by:
  • tst_QNetworkReply
220-465
339 buffers.append(qba);
executed 465 times by 5 tests: buffers.append(qba);
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_Spdy
465
340 else-
341 buffers.last() = qba;
executed 220 times by 1 test: buffers.last() = qba;
Executed by:
  • tst_QNetworkReply
220
342 } else {-
343 buffers.last().resize(tail);-
344 buffers.append(qba);-
345 ++tailBuffer;-
346 }
executed 6470 times by 4 tests: end of block
Executed by:
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_Spdy
6470
347 tail = qba.size();-
348 bufferSize += tail;-
349}
executed 7155 times by 5 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkReply
  • tst_QRingBuffer
  • tst_Spdy
7155
350-
351qint64 QRingBuffer::readLine(char *data, qint64 maxLength)-
352{-
353 if (!data || --maxLength <= 0)
!dataDescription
TRUEnever evaluated
FALSEevaluated 101034 times by 42 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
  • ...
--maxLength <= 0Description
TRUEnever evaluated
FALSEevaluated 101034 times by 42 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
  • ...
0-101034
354 return -1;
never executed: return -1;
0
355-
356 qint64 i = indexOf('\n', maxLength);-
357 i = read(data, i >= 0 ? (i + 1) : maxLength);-
358-
359 // Terminate it.-
360 data[i] = '\0';-
361 return i;
executed 101034 times by 42 tests: return i;
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
  • ...
101034
362}-
363-
364QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

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