Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | const char *QRingBuffer::readPointerAtPosition(qint64 pos, qint64 &length) const | - |
5 | { | - |
6 | if (pos >= 0TRUE | evaluated 904 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | never evaluated |
) { | 0-904 |
7 | pos += head; | - |
8 | for (int i = 0; i < buffers.size()TRUE | evaluated 926 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 3 times by 1 test |
; ++i) { | 3-926 |
9 | length = (i == tailBufferTRUE | evaluated 182 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 744 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
|
? tail : buffers[i].size()); | 182-744 |
10 | if (length > posTRUE | evaluated 901 times by 2 testsEvaluated by:- tst_QNetworkReply
- tst_QRingBuffer
| FALSE | evaluated 25 times by 1 test |
) { | 25-901 |
11 | length -= pos; | - |
12 | returnexecuted 901 times by 2 tests: return buffers[i].constData() + pos; Executed by:- tst_QNetworkReply
- tst_QRingBuffer
buffers[i].constData() + pos;executed 901 times by 2 tests: return buffers[i].constData() + pos; Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 901 |
13 | } | - |
14 | pos -= length; | - |
15 | }executed 25 times by 1 test: end of block | 25 |
16 | }executed 3 times by 1 test: end of block | 3 |
17 | | - |
18 | length = 0; | - |
19 | returnexecuted 3 times by 1 test: return 0; 0;executed 3 times by 1 test: return 0; | 3 |
20 | } | - |
21 | | - |
22 | void QRingBuffer::free(qint64 bytes) | - |
23 | { | - |
24 | while (bytes > 0TRUE | 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 |
25 | const qint64 blockSize = buffers.first().size() - head; | - |
26 | | - |
27 | if (tailBuffer == 0TRUE | 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
|
|| blockSize > bytesTRUE | 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 |
28 | | - |
29 | | - |
30 | | - |
31 | if (bufferSize <= bytesTRUE | 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 |
32 | if (buffers.first().size() <= basicBlockSizeTRUE | 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 |
33 | bufferSize = 0; | - |
34 | head = tail = 0; | - |
35 | }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
- ...
else { | 47590 |
36 | clear(); | - |
37 | }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 |
38 | } else { | - |
39 | ((!(bytes < MaxByteArraySize)) ? qt_assert("bytes < MaxByteArraySize",__FILE__,83) : qt_noop()); | - |
40 | head += int(bytes); | - |
41 | bufferSize -= bytes; | - |
42 | }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 |
43 | 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 |
44 | } | - |
45 | | - |
46 | bufferSize -= blockSize; | - |
47 | bytes -= blockSize; | - |
48 | buffers.removeFirst(); | - |
49 | --tailBuffer; | - |
50 | head = 0; | - |
51 | }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 |
52 | }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 |
53 | | - |
54 | char *QRingBuffer::reserve(qint64 bytes) | - |
55 | { | - |
56 | if (bytes <= 0TRUE | 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
- ...
|
|| bytes >= MaxByteArraySizeTRUE | 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 |
57 | returnexecuted 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
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 |
58 | | - |
59 | const qint64 newSize = bytes + tail; | - |
60 | | - |
61 | 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 |
62 | if (newSize > buffers.last().capacity()TRUE | 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
|
&& (tail >= basicBlockSizeTRUE | 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 |
63 | || newSize >= MaxByteArraySizeTRUE | 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 |
64 | | - |
65 | buffers.last().resize(tail); | - |
66 | | - |
67 | | - |
68 | buffers.append(QByteArray()); | - |
69 | ++tailBuffer; | - |
70 | tail = 0; | - |
71 | }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 |
72 | buffers.last().resize(qMax(basicBlockSize, tail + int(bytes))); | - |
73 | }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 |
74 | | - |
75 | char *writePtr = buffers.last().data() + tail; | - |
76 | bufferSize += bytes; | - |
77 | ((!(bytes < MaxByteArraySize)) ? qt_assert("bytes < MaxByteArraySize",__FILE__,121) : qt_noop()); | - |
78 | tail += int(bytes); | - |
79 | returnexecuted 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
- ...
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 |
80 | } | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | char *QRingBuffer::reserveFront(qint64 bytes) | - |
88 | { | - |
89 | if (bytes <= 0TRUE | never evaluated | FALSE | evaluated 265 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
|
|| bytes >= MaxByteArraySizeTRUE | never evaluated | FALSE | evaluated 265 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
|
) | 0-265 |
90 | return never executed: return 0; 0;never executed: return 0; | 0 |
91 | | - |
92 | if (head < bytesTRUE | evaluated 19 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
| FALSE | evaluated 246 times by 1 test |
) { | 19-246 |
93 | buffers.first().remove(0, head); | - |
94 | if (tailBuffer == 0TRUE | evaluated 12 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
| FALSE | evaluated 7 times by 1 test |
) | 7-12 |
95 | tail -= head;executed 12 times by 2 tests: tail -= head; Executed by:- tst_QProcess
- tst_QRingBuffer
| 12 |
96 | | - |
97 | head = qMax(basicBlockSize, int(bytes)); | - |
98 | if (bufferSize == 0TRUE | evaluated 10 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
| FALSE | evaluated 9 times by 1 test |
) { | 9-10 |
99 | tail = head; | - |
100 | }executed 10 times by 2 tests: end of block Executed by:- tst_QProcess
- tst_QRingBuffer
else { | 10 |
101 | buffers.prepend(QByteArray()); | - |
102 | ++tailBuffer; | - |
103 | }executed 9 times by 1 test: end of block | 9 |
104 | buffers.first().resize(head); | - |
105 | }executed 19 times by 2 tests: end of block Executed by:- tst_QProcess
- tst_QRingBuffer
| 19 |
106 | | - |
107 | head -= int(bytes); | - |
108 | bufferSize += bytes; | - |
109 | returnexecuted 265 times by 2 tests: return buffers.first().data() + head; Executed by:- tst_QProcess
- tst_QRingBuffer
buffers.first().data() + head;executed 265 times by 2 tests: return buffers.first().data() + head; Executed by:- tst_QProcess
- tst_QRingBuffer
| 265 |
110 | } | - |
111 | | - |
112 | void QRingBuffer::chop(qint64 bytes) | - |
113 | { | - |
114 | while (bytes > 0TRUE | 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 |
115 | if (tailBuffer == 0TRUE | 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
|
|| tail > bytesTRUE | 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 |
116 | | - |
117 | | - |
118 | | - |
119 | if (bufferSize <= bytesTRUE | 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 |
120 | if (buffers.first().size() <= basicBlockSizeTRUE | 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 |
121 | bufferSize = 0; | - |
122 | head = tail = 0; | - |
123 | }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
- ...
else { | 2634 |
124 | clear(); | - |
125 | }executed 1 time by 1 test: end of block | 1 |
126 | } else { | - |
127 | ((!(bytes < MaxByteArraySize)) ? qt_assert("bytes < MaxByteArraySize",__FILE__,171) : qt_noop()); | - |
128 | tail -= int(bytes); | - |
129 | bufferSize -= bytes; | - |
130 | }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 |
131 | 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 |
132 | } | - |
133 | | - |
134 | bufferSize -= tail; | - |
135 | bytes -= tail; | - |
136 | buffers.removeLast(); | - |
137 | --tailBuffer; | - |
138 | tail = buffers.last().size(); | - |
139 | }executed 7 times by 2 tests: end of block Executed by:- tst_QProcess
- tst_Selftests
| 7 |
140 | }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 |
141 | | - |
142 | void QRingBuffer::clear() | - |
143 | { | - |
144 | buffers.erase(buffers.begin() + 1, buffers.end()); | - |
145 | buffers.first().clear(); | - |
146 | | - |
147 | head = tail = 0; | - |
148 | tailBuffer = 0; | - |
149 | bufferSize = 0; | - |
150 | }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 |
151 | | - |
152 | qint64 QRingBuffer::indexOf(char c, qint64 maxLength) const | - |
153 | { | - |
154 | qint64 index = 0; | - |
155 | qint64 j = head; | - |
156 | for (int i = 0; index < maxLengthTRUE | evaluated 6467 times by 1 test | FALSE | evaluated 256 times by 2 testsEvaluated by:- tst_QProcess
- tst_QRingBuffer
|
&& i < buffers.size()TRUE | evaluated 6467 times by 1 test | FALSE | never evaluated |
; ++i) { | 0-6467 |
157 | const char *ptr = buffers[i].constData() + j; | - |
158 | j = qMin(index + (i == tailBuffer ? tail : buffers[i].size()) - j, maxLength); | - |
159 | | - |
160 | while (index < jTRUE | evaluated 97702 times by 1 test | FALSE | evaluated 5954 times by 1 test |
) { | 5954-97702 |
161 | if (*TRUE | evaluated 513 times by 1 test | FALSE | evaluated 97189 times by 1 test |
ptr++ == cTRUE | evaluated 513 times by 1 test | FALSE | evaluated 97189 times by 1 test |
) | 513-97189 |
162 | returnexecuted 513 times by 1 test: return index; index;executed 513 times by 1 test: return index; | 513 |
163 | ++index; | - |
164 | }executed 97189 times by 1 test: end of block | 97189 |
165 | j = 0; | - |
166 | }executed 5954 times by 1 test: end of block | 5954 |
167 | returnexecuted 256 times by 2 tests: return -1; Executed by:- tst_QProcess
- tst_QRingBuffer
-1;executed 256 times by 2 tests: return -1; Executed by:- tst_QProcess
- tst_QRingBuffer
| 256 |
168 | } | - |
169 | | - |
170 | qint64 QRingBuffer::read(char *data, qint64 maxLength) | - |
171 | { | - |
172 | const qint64 bytesToRead = qMin(size(), maxLength); | - |
173 | qint64 readSoFar = 0; | - |
174 | while (readSoFar < bytesToReadTRUE | evaluated 513 times by 1 test | FALSE | evaluated 513 times by 1 test |
) { | 513 |
175 | const qint64 bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar, | - |
176 | nextDataBlockSize()); | - |
177 | if (dataTRUE | evaluated 513 times by 1 test | FALSE | never evaluated |
) | 0-513 |
178 | memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock);executed 513 times by 1 test: memcpy(data + readSoFar, readPointer(), bytesToReadFromThisBlock); | 513 |
179 | readSoFar += bytesToReadFromThisBlock; | - |
180 | free(bytesToReadFromThisBlock); | - |
181 | }executed 513 times by 1 test: end of block | 513 |
182 | returnexecuted 513 times by 1 test: return readSoFar; readSoFar;executed 513 times by 1 test: return readSoFar; | 513 |
183 | } | - |
184 | | - |
185 | | - |
186 | | - |
187 | | - |
188 | | - |
189 | | - |
190 | QByteArray QRingBuffer::read() | - |
191 | { | - |
192 | if (bufferSize == 0TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
) | 0-3 |
193 | return never executed: return QByteArray(); QByteArray();never executed: return QByteArray(); | 0 |
194 | | - |
195 | QByteArray qba(buffers.takeFirst()); | - |
196 | | - |
197 | qba.reserve(0); | - |
198 | if (tailBuffer == 0TRUE | evaluated 1 time by 1 test | FALSE | evaluated 2 times by 1 test |
) { | 1-2 |
199 | qba.resize(tail); | - |
200 | tail = 0; | - |
201 | buffers.append(QByteArray()); | - |
202 | }executed 1 time by 1 test: end of block else { | 1 |
203 | --tailBuffer; | - |
204 | }executed 2 times by 1 test: end of block | 2 |
205 | qba.remove(0, head); | - |
206 | head = 0; | - |
207 | bufferSize -= qba.size(); | - |
208 | returnexecuted 3 times by 1 test: return qba; qba;executed 3 times by 1 test: return qba; | 3 |
209 | } | - |
210 | | - |
211 | | - |
212 | | - |
213 | | - |
214 | | - |
215 | | - |
216 | qint64 QRingBuffer::peek(char *data, qint64 maxLength, qint64 pos) const | - |
217 | { | - |
218 | qint64 readSoFar = 0; | - |
219 | | - |
220 | if (pos >= 0TRUE | evaluated 255 times by 1 test | FALSE | never evaluated |
) { | 0-255 |
221 | pos += head; | - |
222 | for (int i = 0; readSoFar < maxLengthTRUE | evaluated 809 times by 1 test | FALSE | evaluated 255 times by 1 test |
&& i < buffers.size()TRUE | evaluated 809 times by 1 test | FALSE | never evaluated |
; ++i) { | 0-809 |
223 | qint64 blockLength = (i == tailBufferTRUE | evaluated 23 times by 1 test | FALSE | evaluated 786 times by 1 test |
? tail : buffers[i].size()); | 23-786 |
224 | | - |
225 | if (pos < blockLengthTRUE | evaluated 259 times by 1 test | FALSE | evaluated 550 times by 1 test |
) { | 259-550 |
226 | blockLength = qMin(blockLength - pos, maxLength - readSoFar); | - |
227 | memcpy(data + readSoFar, buffers[i].constData() + pos, blockLength); | - |
228 | readSoFar += blockLength; | - |
229 | pos = 0; | - |
230 | }executed 259 times by 1 test: end of block else { | 259 |
231 | pos -= blockLength; | - |
232 | }executed 550 times by 1 test: end of block | 550 |
233 | } | - |
234 | }executed 255 times by 1 test: end of block | 255 |
235 | | - |
236 | returnexecuted 255 times by 1 test: return readSoFar; readSoFar;executed 255 times by 1 test: return readSoFar; | 255 |
237 | } | - |
238 | | - |
239 | | - |
240 | | - |
241 | | - |
242 | | - |
243 | | - |
244 | void QRingBuffer::append(const QByteArray &qba) | - |
245 | { | - |
246 | if (tail == 0TRUE | 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 |
247 | buffers.last() = qba; | - |
248 | }executed 44 times by 2 tests: end of block Executed by:- tst_QNetworkReply
- tst_QRingBuffer
else { | 44 |
249 | buffers.last().resize(tail); | - |
250 | buffers.append(qba); | - |
251 | ++tailBuffer; | - |
252 | }executed 42 times by 2 tests: end of block Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 42 |
253 | tail = qba.size(); | - |
254 | bufferSize += tail; | - |
255 | }executed 86 times by 2 tests: end of block Executed by:- tst_QNetworkReply
- tst_QRingBuffer
| 86 |
256 | | - |
257 | qint64 QRingBuffer::readLine(char *data, qint64 maxLength) | - |
258 | { | - |
259 | if (!dataTRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
|| --TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
maxLength <= 0TRUE | never evaluated | FALSE | evaluated 3 times by 1 test |
) | 0-3 |
260 | return never executed: return -1; -1;never executed: return -1; | 0 |
261 | | - |
262 | qint64 i = indexOf('\n', maxLength); | - |
263 | i = read(data, i >= 0 ? (i + 1) : maxLength); | - |
264 | | - |
265 | | - |
266 | data[i] = '\0'; | - |
267 | returnexecuted 3 times by 1 test: return i; i;executed 3 times by 1 test: return i; | 3 |
268 | } | - |
269 | | - |
270 | | - |
| | |