Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | #include "private/qringbuffer_p.h" | - |
36 | #include "private/qbytearray_p.h" | - |
37 | #include <string.h> | - |
38 | | - |
39 | QT_BEGIN_NAMESPACE | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | const char *QRingBuffer::readPointerAtPosition(qint64 pos, qint64 &length) const | - |
49 | { | - |
50 | if (pos >= 0) {TRUE | evaluated 904 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | never evaluated |
| 0-904 |
51 | pos += head; | - |
52 | for (int i = 0; i < buffers.size(); ++i) {TRUE | evaluated 926 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 3 times by 1 test |
| 3-926 |
53 | length = (i == tailBuffer ? tail : buffers[i].size());TRUE | evaluated 182 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 744 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
|
| 182-744 |
54 | if (length > pos) {TRUE | evaluated 901 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 25 times by 1 test |
| 25-901 |
55 | length -= pos; | - |
56 | return buffers[i].constData() + pos;executed 901 times by 2 tests: return buffers[i].constData() + pos; Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 901 |
57 | } | - |
58 | pos -= length; | - |
59 | }executed 25 times by 1 test: end of block | 25 |
60 | }executed 3 times by 1 test: end of block | 3 |
61 | | - |
62 | length = 0; | - |
63 | return 0;executed 3 times by 1 test: return 0; | 3 |
64 | } | - |
65 | | - |
66 | void QRingBuffer::free(qint64 bytes) | - |
67 | { | - |
68 | while (bytes > 0) {TRUE | evaluated 49496 times by 73 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- ...
| FALSE | evaluated 1283 times by 12 testsEvaluated by:- tst_QHttpSocketEngine
- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QSslSocket
- tst_QTcpSocket
- tst_Selftests
- tst_Spdy
- tst_qdbuscpp2xml
- tst_rcc
|
| 1283-49496 |
69 | const qint64 blockSize = buffers.first().size() - head; | - |
70 | | - |
71 | if (tailBuffer == 0 || blockSize > bytes) {TRUE | evaluated 48497 times by 73 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- ...
| FALSE | evaluated 999 times by 8 testsEvaluated by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_rcc
|
TRUE | evaluated 527 times by 4 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_Selftests
| FALSE | evaluated 472 times by 8 testsEvaluated by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_rcc
|
| 472-48497 |
72 | | - |
73 | | - |
74 | | - |
75 | if (bufferSize <= bytes) {TRUE | evaluated 47992 times by 73 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- ...
| FALSE | evaluated 1032 times by 7 testsEvaluated by:- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QSslSocket
- tst_QTcpSocket
- tst_Selftests
|
| 1032-47992 |
76 | if (buffers.first().size() <= basicBlockSize) {TRUE | evaluated 47590 times by 73 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- ...
| FALSE | evaluated 402 times by 8 testsEvaluated by:- tst_QImageReader
- tst_QNetworkReply
- tst_QProcess
- tst_QSharedPointer
- tst_QSslSocket
- tst_QTcpSocket
- tst_Selftests
- tst_Spdy
|
| 402-47590 |
77 | bufferSize = 0; | - |
78 | head = tail = 0; | - |
79 | } else {executed 47590 times by 73 tests: end of block Executed by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- ...
| 47590 |
80 | clear(); | - |
81 | }executed 402 times by 8 tests: end of block Executed by:- tst_QImageReader
- tst_QNetworkReply
- tst_QProcess
- tst_QSharedPointer
- tst_QSslSocket
- tst_QTcpSocket
- tst_Selftests
- tst_Spdy
| 402 |
82 | } else { | - |
83 | Q_ASSERT(bytes < MaxByteArraySize); | - |
84 | head += int(bytes); | - |
85 | bufferSize -= bytes; | - |
86 | }executed 1032 times by 7 tests: end of block Executed by:- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QSslSocket
- tst_QTcpSocket
- tst_Selftests
| 1032 |
87 | return;executed 49024 times by 73 tests: return; Executed by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- ...
| 49024 |
88 | } | - |
89 | | - |
90 | bufferSize -= blockSize; | - |
91 | bytes -= blockSize; | - |
92 | buffers.removeFirst(); | - |
93 | --tailBuffer; | - |
94 | head = 0; | - |
95 | }executed 472 times by 8 tests: end of block Executed by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_rcc
| 472 |
96 | }executed 1283 times by 12 tests: end of block Executed by:- tst_QHttpSocketEngine
- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QSslSocket
- tst_QTcpSocket
- tst_Selftests
- tst_Spdy
- tst_qdbuscpp2xml
- tst_rcc
| 1283 |
97 | | - |
98 | char *QRingBuffer::reserve(qint64 bytes) | - |
99 | { | - |
100 | if (bytes <= 0 || bytes >= MaxByteArraySize)TRUE | evaluated 27 times by 8 testsEvaluated by:- tst_QFile
- tst_QHttpSocketEngine
- tst_QNetworkReply
- tst_QSharedPointer
- tst_QTextStream
- tst_qdbusxml2cpp
- tst_qmakelib
- tst_qnetworkreply - unknown status
| FALSE | evaluated 202012 times by 83 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
|
TRUE | never evaluated | FALSE | evaluated 202012 times by 83 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
|
| 0-202012 |
101 | 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 |
102 | | - |
103 | const qint64 newSize = bytes + tail; | - |
104 | | - |
105 | if (newSize > buffers.last().size()) {TRUE | evaluated 23888 times by 83 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
| FALSE | evaluated 178124 times by 65 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QColorDialog
- 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_QHttpNetworkConnection
- tst_QHttpSocketEngine
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QLocalSocket
- ...
|
| 23888-178124 |
106 | if (newSize > buffers.last().capacity() && (tail >= basicBlockSizeTRUE | evaluated 11033 times by 83 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
| FALSE | evaluated 12855 times by 7 testsEvaluated by:- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QSslSocket
- tst_Selftests
- tst_qmake
|
TRUE | evaluated 661 times by 9 testsEvaluated by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qmake
- tst_rcc
| FALSE | evaluated 10372 times by 83 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
|
| 661-12855 |
107 | || newSize >= MaxByteArraySize)) {TRUE | never evaluated | FALSE | evaluated 10372 times by 83 testsEvaluated by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
|
| 0-10372 |
108 | | - |
109 | buffers.last().resize(tail); | - |
110 | | - |
111 | | - |
112 | buffers.append(QByteArray()); | - |
113 | ++tailBuffer; | - |
114 | tail = 0; | - |
115 | }executed 661 times by 9 tests: end of block Executed by:- tst_QLocalSocket
- tst_QNetworkReply
- tst_QProcess
- tst_QRingBuffer
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qmake
- tst_rcc
| 661 |
116 | buffers.last().resize(qMax(basicBlockSize, tail + int(bytes))); | - |
117 | }executed 23888 times by 83 tests: end of block Executed by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
| 23888 |
118 | | - |
119 | char *writePtr = buffers.last().data() + tail; | - |
120 | bufferSize += bytes; | - |
121 | Q_ASSERT(bytes < MaxByteArraySize); | - |
122 | tail += int(bytes); | - |
123 | return writePtr;executed 202012 times by 83 tests: return writePtr; Executed by:- tst_Lancelot
- tst_NetworkSelfTest
- tst_QAbstractNetworkCache
- tst_QApplication
- tst_QColorDialog
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDataStream
- tst_QDir
- tst_QEventLoop
- tst_QFile
- tst_QFileDialog2
- tst_QFileInfo
- tst_QFileSystemModel
- tst_QFileSystemWatcher
- tst_QFiledialog
- tst_QFont
- tst_QFtp
- tst_QGraphicsProxyWidget
- tst_QGuiEventLoop
- tst_QHttpNetworkConnection
- ...
| 202012 |
124 | } | - |
125 | | - |
126 | | - |
127 | | - |
128 | | - |
129 | | - |
130 | | - |
131 | char *QRingBuffer::reserveFront(qint64 bytes) | - |
132 | { | - |
133 | if (bytes <= 0 || bytes >= MaxByteArraySize)TRUE | never evaluated | FALSE | evaluated 265 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
|
TRUE | never evaluated | FALSE | evaluated 265 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
|
| 0-265 |
134 | return 0; never executed: return 0; | 0 |
135 | | - |
136 | if (head < bytes) {TRUE | evaluated 19 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
| FALSE | evaluated 246 times by 1 test |
| 19-246 |
137 | buffers.first().remove(0, head); | - |
138 | if (tailBuffer == 0)TRUE | evaluated 12 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
| FALSE | evaluated 7 times by 1 test |
| 7-12 |
139 | tail -= head;executed 12 times by 2 tests: tail -= head; Executed by:- tst_QProcess
- tst_QRingBuffer
| 12 |
140 | | - |
141 | head = qMax(basicBlockSize, int(bytes)); | - |
142 | if (bufferSize == 0) {TRUE | evaluated 10 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
| FALSE | evaluated 9 times by 1 test |
| 9-10 |
143 | tail = head; | - |
144 | } else {executed 10 times by 2 tests: end of block Executed by:- tst_QProcess
- tst_QRingBuffer
| 10 |
145 | buffers.prepend(QByteArray()); | - |
146 | ++tailBuffer; | - |
147 | }executed 9 times by 1 test: end of block | 9 |
148 | buffers.first().resize(head); | - |
149 | }executed 19 times by 2 tests: end of block Executed by:- tst_QProcess
- tst_QRingBuffer
| 19 |
150 | | - |
151 | head -= int(bytes); | - |
152 | bufferSize += bytes; | - |
153 | return buffers.first().data() + head;executed 265 times by 2 tests: return buffers.first().data() + head; Executed by:- tst_QProcess
- tst_QRingBuffer
| 265 |
154 | } | - |
155 | | - |
156 | void QRingBuffer::chop(qint64 bytes) | - |
157 | { | - |
158 | while (bytes > 0) {TRUE | evaluated 3660 times by 30 testsEvaluated by:- tst_Lancelot
- tst_QApplication
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDir
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QRingBuffer
- tst_QSharedMemory
- tst_QSharedPointer
- tst_QSystemSemaphore
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- ...
| FALSE | evaluated 34687 times by 25 testsEvaluated by:- tst_Lancelot
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QSharedPointer
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- tst_qmakelib
- tst_qmessagehandler
- tst_qprocess - unknown status
- tst_rcc
- tst_uic
|
| 3660-34687 |
159 | if (tailBuffer == 0 || tail > bytes) {TRUE | evaluated 3574 times by 30 testsEvaluated by:- tst_Lancelot
- tst_QApplication
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDir
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QRingBuffer
- tst_QSharedMemory
- tst_QSharedPointer
- tst_QSystemSemaphore
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- ...
| FALSE | evaluated 86 times by 6 testsEvaluated by:- tst_QProcess
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qmake
- tst_rcc
|
TRUE | evaluated 79 times by 6 testsEvaluated by:- tst_QProcess
- tst_QSharedPointer
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qmake
- tst_rcc
| FALSE | evaluated 7 times by 2 testsEvaluated by:- tst_QProcess
- tst_Selftests
|
| 7-3574 |
160 | | - |
161 | | - |
162 | | - |
163 | if (bufferSize <= bytes) {TRUE | evaluated 2635 times by 30 testsEvaluated by:- tst_Lancelot
- tst_QApplication
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDir
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QRingBuffer
- tst_QSharedMemory
- tst_QSharedPointer
- tst_QSystemSemaphore
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- ...
| FALSE | evaluated 1018 times by 24 testsEvaluated by:- tst_Lancelot
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- tst_qmakelib
- tst_qmessagehandler
- tst_qprocess - unknown status
- tst_rcc
- tst_uic
|
| 1018-2635 |
164 | if (buffers.first().size() <= basicBlockSize) {TRUE | evaluated 2634 times by 29 testsEvaluated by:- tst_Lancelot
- tst_QApplication
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDir
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QSharedMemory
- tst_QSharedPointer
- tst_QSystemSemaphore
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- tst_qmakelib
- ...
| FALSE | evaluated 1 time by 1 test |
| 1-2634 |
165 | bufferSize = 0; | - |
166 | head = tail = 0; | - |
167 | } else {executed 2634 times by 29 tests: end of block Executed by:- tst_Lancelot
- tst_QApplication
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDir
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QSharedMemory
- tst_QSharedPointer
- tst_QSystemSemaphore
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- tst_qmakelib
- ...
| 2634 |
168 | clear(); | - |
169 | }executed 1 time by 1 test: end of block | 1 |
170 | } else { | - |
171 | Q_ASSERT(bytes < MaxByteArraySize); | - |
172 | tail -= int(bytes); | - |
173 | bufferSize -= bytes; | - |
174 | }executed 1018 times by 24 tests: end of block Executed by:- tst_Lancelot
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QRingBuffer
- tst_QSharedPointer
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- tst_qmakelib
- tst_qmessagehandler
- tst_qprocess - unknown status
- tst_rcc
- tst_uic
| 1018 |
175 | return;executed 3653 times by 30 tests: return; Executed by:- tst_Lancelot
- tst_QApplication
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QDir
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QRingBuffer
- tst_QSharedMemory
- tst_QSharedPointer
- tst_QSystemSemaphore
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- ...
| 3653 |
176 | } | - |
177 | | - |
178 | bufferSize -= tail; | - |
179 | bytes -= tail; | - |
180 | buffers.removeLast(); | - |
181 | --tailBuffer; | - |
182 | tail = buffers.last().size(); | - |
183 | }executed 7 times by 2 tests: end of block Executed by:- tst_QProcess
- tst_Selftests
| 7 |
184 | }executed 34687 times by 25 tests: end of block Executed by:- tst_Lancelot
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_SpyHook
- tst_QDBusInterface
- tst_QDBusMarshall
- tst_QFont
- tst_QMimeDatabase
- tst_QNetworkReply
- tst_QNetworkSession
- tst_QObject
- tst_QProcess
- tst_QProcess_and_GuiEventLoop
- tst_QSharedPointer
- tst_QUuid
- tst_Selftests
- tst_qdbuscpp2xml
- tst_qdbusxml2cpp
- tst_qmake
- tst_qmakelib
- tst_qmessagehandler
- tst_qprocess - unknown status
- tst_rcc
- tst_uic
| 34687 |
185 | | - |
186 | void QRingBuffer::clear() | - |
187 | { | - |
188 | buffers.erase(buffers.begin() + 1, buffers.end()); | - |
189 | buffers.first().clear(); | - |
190 | | - |
191 | head = tail = 0; | - |
192 | tailBuffer = 0; | - |
193 | bufferSize = 0; | - |
194 | }executed 72606 times by 210 tests: end of block Executed by:- tst_Lancelot
- tst_LargeFile
- tst_NetworkSelfTest
- tst_QAbstractFileEngine
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractScrollArea
- tst_QAccessibility
- tst_QApplication
- tst_QBrush
- tst_QButtonGroup
- tst_QByteArray
- tst_QCalendarWidget
- tst_QChar
- tst_QColorDialog
- tst_QColumnView
- tst_QComboBox
- tst_QCommandLineParser
- tst_QCommandLinkButton
- tst_QCompleter
- tst_QCryptographicHash
- tst_QCssParser
- tst_QDBusAbstractAdaptor
- tst_QDBusAbstractInterface
- ...
| 72606 |
195 | | - |
196 | qint64 QRingBuffer::indexOf(char c, qint64 maxLength) const | - |
197 | { | - |
198 | qint64 index = 0; | - |
199 | qint64 j = head; | - |
200 | for (int i = 0; index < maxLength && i < buffers.size(); ++i) {TRUE | evaluated 6467 times by 1 test | FALSE | evaluated 256 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
|
TRUE | evaluated 6467 times by 1 test | FALSE | never evaluated |
| 0-6467 |
201 | const char *ptr = buffers[i].constData() + j; | - |
202 | j = qMin(index + (i == tailBuffer ? tail : buffers[i].size()) - j, maxLength); | - |
203 | | - |
204 | while (index < j) {TRUE | evaluated 97702 times by 1 test | FALSE | evaluated 5954 times by 1 test |
| 5954-97702 |
205 | if (*ptr++ == c)TRUE | evaluated 513 times by 1 test | FALSE | evaluated 97189 times by 1 test |
| 513-97189 |
206 | return index;executed 513 times by 1 test: return index; | 513 |
207 | ++index; | - |
208 | }executed 97189 times by 1 test: end of block | 97189 |
209 | j = 0; | - |
210 | }executed 5954 times by 1 test: end of block | 5954 |
211 | return -1;executed 256 times by 2 tests: return -1; Executed by:- tst_QProcess
- tst_QRingBuffer
| 256 |
212 | } | - |
213 | | - |
214 | qint64 QRingBuffer::read(char *data, qint64 maxLength) | - |
215 | { | - |
216 | const qint64 bytesToRead = qMin(size(), maxLength); | - |
217 | qint64 readSoFar = 0; | - |
218 | while (readSoFar < bytesToRead) {TRUE | evaluated 513 times by 1 test | FALSE | evaluated 513 times by 1 test |
| 513 |
219 | const qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar, | - |
220 | nextDataBlockSize()); | - |
221 | if (data)TRUE | evaluated 513 times by 1 test | FALSE | never evaluated |
| 0-513 |
222 | memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock);executed 513 times by 1 test: memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock); | 513 |
223 | readSoFar += bytesToReadFromThisBlock; | - |
224 | free(bytesToReadFromThisBlock); | - |
225 | }executed 513 times by 1 test: end of block | 513 |
226 | return readSoFar;executed 513 times by 1 test: return readSoFar; | 513 |
227 | } | - |
228 | | - |
229 | | - |
230 | | - |
231 | | - |
232 | | - |
233 | | - |
234 | QByteArray QRingBuffer::read() | - |
235 | { | - |
236 | if (bufferSize == 0)TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
| 0-3 |
237 | return QByteArray(); never executed: return QByteArray(); | 0 |
238 | | - |
239 | QByteArray qba(buffers.takeFirst()); | - |
240 | | - |
241 | qba.reserve(0); | - |
242 | if (tailBuffer == 0) {TRUE | evaluated 1 time by 1 test | FALSE | evaluated 2 times by 1 test |
| 1-2 |
243 | qba.resize(tail); | - |
244 | tail = 0; | - |
245 | buffers.append(QByteArray()); | - |
246 | } else {executed 1 time by 1 test: end of block | 1 |
247 | --tailBuffer; | - |
248 | }executed 2 times by 1 test: end of block | 2 |
249 | qba.remove(0, head); | - |
250 | head = 0; | - |
251 | bufferSize -= qba.size(); | - |
252 | return qba;executed 3 times by 1 test: return qba; | 3 |
253 | } | - |
254 | | - |
255 | | - |
256 | | - |
257 | | - |
258 | | - |
259 | | - |
260 | qint64 QRingBuffer::peek(char *data, qint64 maxLength, qint64 pos) const | - |
261 | { | - |
262 | qint64 readSoFar = 0; | - |
263 | | - |
264 | if (pos >= 0) {TRUE | evaluated 255 times by 1 test | FALSE | never evaluated |
| 0-255 |
265 | pos += head; | - |
266 | for (int i = 0; readSoFar < maxLength && i < buffers.size(); ++i) {TRUE | evaluated 809 times by 1 test | FALSE | evaluated 255 times by 1 test |
TRUE | evaluated 809 times by 1 test | FALSE | never evaluated |
| 0-809 |
267 | qint64 blockLength = (i == tailBuffer ? tail : buffers[i].size());TRUE | evaluated 23 times by 1 test | FALSE | evaluated 786 times by 1 test |
| 23-786 |
268 | | - |
269 | if (pos < blockLength) {TRUE | evaluated 259 times by 1 test | FALSE | evaluated 550 times by 1 test |
| 259-550 |
270 | blockLength = qMin(blockLength - pos, maxLength - readSoFar); | - |
271 | memcpy(data + readSoFar, buffers[i].constData() + pos, blockLength); | - |
272 | readSoFar += blockLength; | - |
273 | pos = 0; | - |
274 | } else {executed 259 times by 1 test: end of block | 259 |
275 | pos -= blockLength; | - |
276 | }executed 550 times by 1 test: end of block | 550 |
277 | } | - |
278 | }executed 255 times by 1 test: end of block | 255 |
279 | | - |
280 | return readSoFar;executed 255 times by 1 test: return readSoFar; | 255 |
281 | } | - |
282 | | - |
283 | | - |
284 | | - |
285 | | - |
286 | | - |
287 | | - |
288 | void QRingBuffer::append(const QByteArray &qba) | - |
289 | { | - |
290 | if (tail == 0) {TRUE | evaluated 44 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 42 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
|
| 42-44 |
291 | buffers.last() = qba; | - |
292 | } else {executed 44 times by 2 tests: end of block Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 44 |
293 | buffers.last().resize(tail); | - |
294 | buffers.append(qba); | - |
295 | ++tailBuffer; | - |
296 | }executed 42 times by 2 tests: end of block Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 42 |
297 | tail = qba.size(); | - |
298 | bufferSize += tail; | - |
299 | }executed 86 times by 2 tests: end of block Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 86 |
300 | | - |
301 | qint64 QRingBuffer::readLine(char *data, qint64 maxLength) | - |
302 | { | - |
303 | if (!data || --maxLength <= 0)TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
| 0-3 |
304 | return -1; never executed: return -1; | 0 |
305 | | - |
306 | qint64 i = indexOf('\n', maxLength); | - |
307 | i = read(data, i >= 0 ? (i + 1) : maxLength); | - |
308 | | - |
309 | | - |
310 | data[i] = '\0'; | - |
311 | return i;executed 3 times by 1 test: return i; | 3 |
312 | } | - |
313 | | - |
314 | QT_END_NAMESPACE | - |
| | |