| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | QDataStream::QDataStream() | - |
| 9 | { | - |
| 10 | dev = 0; | - |
| 11 | owndev = false; | - |
| 12 | byteorder = BigEndian; | - |
| 13 | ver = Qt_DefaultCompiledVersion; | - |
| 14 | noswap = QSysInfo::ByteOrder == QSysInfo::BigEndian; | - |
| 15 | q_status = Ok; | - |
| 16 | } | - |
| 17 | | - |
| 18 | | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | | - |
| 23 | | - |
| 24 | QDataStream::QDataStream(QIODevice *d) | - |
| 25 | { | - |
| 26 | dev = d; | - |
| 27 | owndev = false; | - |
| 28 | byteorder = BigEndian; | - |
| 29 | ver = Qt_DefaultCompiledVersion; | - |
| 30 | noswap = QSysInfo::ByteOrder == QSysInfo::BigEndian; | - |
| 31 | q_status = Ok; | - |
| 32 | } | - |
| 33 | QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode flags) | - |
| 34 | { | - |
| 35 | QBuffer *buf = new QBuffer(a); | - |
| 36 | | - |
| 37 | buf->blockSignals(true); | - |
| 38 | | - |
| 39 | buf->open(flags); | - |
| 40 | dev = buf; | - |
| 41 | owndev = true; | - |
| 42 | byteorder = BigEndian; | - |
| 43 | ver = Qt_DefaultCompiledVersion; | - |
| 44 | noswap = QSysInfo::ByteOrder == QSysInfo::BigEndian; | - |
| 45 | q_status = Ok; | - |
| 46 | } | - |
| 47 | QDataStream::QDataStream(const QByteArray &a) | - |
| 48 | { | - |
| 49 | QBuffer *buf = new QBuffer; | - |
| 50 | | - |
| 51 | buf->blockSignals(true); | - |
| 52 | | - |
| 53 | buf->setData(a); | - |
| 54 | buf->open(QIODevice::ReadOnly); | - |
| 55 | dev = buf; | - |
| 56 | owndev = true; | - |
| 57 | byteorder = BigEndian; | - |
| 58 | ver = Qt_DefaultCompiledVersion; | - |
| 59 | noswap = QSysInfo::ByteOrder == QSysInfo::BigEndian; | - |
| 60 | q_status = Ok; | - |
| 61 | } | - |
| 62 | QDataStream::~QDataStream() | - |
| 63 | { | - |
| 64 | if (owndev) | - |
| 65 | delete dev; | - |
| 66 | } | - |
| 67 | void QDataStream::setDevice(QIODevice *d) | - |
| 68 | { | - |
| 69 | if (owndev) { | - |
| 70 | delete dev; | - |
| 71 | owndev = false; | - |
| 72 | } | - |
| 73 | dev = d; | - |
| 74 | } | - |
| 75 | | - |
| 76 | | - |
| 77 | | - |
| 78 | | - |
| 79 | | - |
| 80 | | - |
| 81 | | - |
| 82 | void QDataStream::unsetDevice() | - |
| 83 | { | - |
| 84 | setDevice(0); | - |
| 85 | } | - |
| 86 | bool QDataStream::atEnd() const | - |
| 87 | { | - |
| 88 | return dev ? dev->atEnd() : true; | - |
| 89 | } | - |
| 90 | QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const | - |
| 91 | { | - |
| 92 | return d == 0 ? QDataStream::DoublePrecision : d->floatingPointPrecision; | - |
| 93 | } | - |
| 94 | void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision) | - |
| 95 | { | - |
| 96 | if (d == 0) | - |
| 97 | d.reset(new QDataStreamPrivate()); | - |
| 98 | d->floatingPointPrecision = precision; | - |
| 99 | } | - |
| 100 | | - |
| 101 | | - |
| 102 | | - |
| 103 | | - |
| 104 | | - |
| 105 | | - |
| 106 | | - |
| 107 | QDataStream::Status QDataStream::status() const | - |
| 108 | { | - |
| 109 | return q_status; | - |
| 110 | } | - |
| 111 | | - |
| 112 | | - |
| 113 | | - |
| 114 | | - |
| 115 | | - |
| 116 | | - |
| 117 | void QDataStream::resetStatus() | - |
| 118 | { | - |
| 119 | q_status = Ok; | - |
| 120 | } | - |
| 121 | void QDataStream::setStatus(Status status) | - |
| 122 | { | - |
| 123 | if (q_status == Ok) | - |
| 124 | q_status = status; | - |
| 125 | } | - |
| 126 | void QDataStream::setByteOrder(ByteOrder bo) | - |
| 127 | { | - |
| 128 | byteorder = bo; | - |
| 129 | if (QSysInfo::ByteOrder == QSysInfo::BigEndian) | - |
| 130 | noswap = (byteorder == BigEndian); | - |
| 131 | else | - |
| 132 | noswap = (byteorder == LittleEndian); | - |
| 133 | } | - |
| 134 | void QDataStream::startTransaction() | - |
| 135 | { | - |
| 136 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 719 times by 1 test |
) { QMessageLogger(__FILE__, 630, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return ; ;never executed: return ; } | 0-719 |
| 137 | | - |
| 138 | if (d == 0| TRUE | evaluated 409 times by 1 test | | FALSE | evaluated 310 times by 1 test |
) | 310-409 |
| 139 | d.reset(new QDataStreamPrivate());executed 409 times by 1 test: d.reset(new QDataStreamPrivate()); | 409 |
| 140 | | - |
| 141 | if (++| TRUE | evaluated 701 times by 1 test | | FALSE | evaluated 18 times by 1 test |
d->transactionDepth == 1| TRUE | evaluated 701 times by 1 test | | FALSE | evaluated 18 times by 1 test |
) { | 18-701 |
| 142 | dev->startTransaction(); | - |
| 143 | resetStatus(); | - |
| 144 | }executed 701 times by 1 test: end of block | 701 |
| 145 | }executed 719 times by 1 test: end of block | 719 |
| 146 | bool QDataStream::commitTransaction() | - |
| 147 | { | - |
| 148 | if (!d| TRUE | never evaluated | | FALSE | evaluated 707 times by 1 test |
|| d->transactionDepth == 0| TRUE | never evaluated | | FALSE | evaluated 707 times by 1 test |
) { QMessageLogger(__FILE__, 663, __PRETTY_FUNCTION__).warning("QDataStream: No transaction in progress"); returnnever executed: return false; false;never executed: return false; } | 0-707 |
| 149 | if (--| TRUE | evaluated 701 times by 1 test | | FALSE | evaluated 6 times by 1 test |
d->transactionDepth == 0| TRUE | evaluated 701 times by 1 test | | FALSE | evaluated 6 times by 1 test |
) { | 6-701 |
| 150 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 701 times by 1 test |
) { QMessageLogger(__FILE__, 665, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return false; false;never executed: return false; } | 0-701 |
| 151 | | - |
| 152 | if (q_status == ReadPastEnd| TRUE | evaluated 370 times by 1 test | | FALSE | evaluated 331 times by 1 test |
) { | 331-370 |
| 153 | dev->rollbackTransaction(); | - |
| 154 | returnexecuted 370 times by 1 test: return false; false;executed 370 times by 1 test: return false; | 370 |
| 155 | } | - |
| 156 | dev->commitTransaction(); | - |
| 157 | }executed 331 times by 1 test: end of block | 331 |
| 158 | returnexecuted 337 times by 1 test: return q_status == Ok; q_status == Ok;executed 337 times by 1 test: return q_status == Ok; | 337 |
| 159 | } | - |
| 160 | void QDataStream::rollbackTransaction() | - |
| 161 | { | - |
| 162 | setStatus(ReadPastEnd); | - |
| 163 | | - |
| 164 | if (!d| TRUE | never evaluated | | FALSE | evaluated 6 times by 1 test |
|| d->transactionDepth == 0| TRUE | never evaluated | | FALSE | evaluated 6 times by 1 test |
) { QMessageLogger(__FILE__, 703, __PRETTY_FUNCTION__).warning("QDataStream: No transaction in progress"); returnnever executed: return ; ;never executed: return ; } | 0-6 |
| 165 | if (--| TRUE | evaluated 6 times by 1 test | | FALSE | never evaluated |
d->transactionDepth != 0| TRUE | evaluated 6 times by 1 test | | FALSE | never evaluated |
) | 0-6 |
| 166 | return;executed 6 times by 1 test: return; | 6 |
| 167 | | - |
| 168 | if (!dev| TRUE | never evaluated | | FALSE | never evaluated |
) { QMessageLogger(__FILE__, 707, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return ; ;never executed: return ; } | 0 |
| 169 | if (q_status == ReadPastEnd| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 170 | dev->rollbackTransaction(); never executed: dev->rollbackTransaction(); | 0 |
| 171 | else | - |
| 172 | dev->commitTransaction(); never executed: dev->commitTransaction(); | 0 |
| 173 | } | - |
| 174 | void QDataStream::abortTransaction() | - |
| 175 | { | - |
| 176 | q_status = ReadCorruptData; | - |
| 177 | | - |
| 178 | if (!d| TRUE | never evaluated | | FALSE | evaluated 6 times by 1 test |
|| d->transactionDepth == 0| TRUE | never evaluated | | FALSE | evaluated 6 times by 1 test |
) { QMessageLogger(__FILE__, 739, __PRETTY_FUNCTION__).warning("QDataStream: No transaction in progress"); returnnever executed: return ; ;never executed: return ; } | 0-6 |
| 179 | if (--| TRUE | evaluated 6 times by 1 test | | FALSE | never evaluated |
d->transactionDepth != 0| TRUE | evaluated 6 times by 1 test | | FALSE | never evaluated |
) | 0-6 |
| 180 | return;executed 6 times by 1 test: return; | 6 |
| 181 | | - |
| 182 | if (!dev| TRUE | never evaluated | | FALSE | never evaluated |
) { QMessageLogger(__FILE__, 743, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return ; ;never executed: return ; } | 0 |
| 183 | dev->commitTransaction(); | - |
| 184 | } never executed: end of block | 0 |
| 185 | int QDataStream::readBlock(char *data, int len) | - |
| 186 | { | - |
| 187 | | - |
| 188 | if (q_status != Ok| TRUE | evaluated 1246 times by 8 testsEvaluated by:- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
| | FALSE | evaluated 338953 times by 62 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- ...
|
&& dev->isTransactionStarted()| TRUE | evaluated 1075 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
| | FALSE | evaluated 171 times by 7 testsEvaluated by:- tst_QDataStream
- tst_QHeaderView
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
|
) | 171-338953 |
| 189 | returnexecuted 1075 times by 2 tests: return -1;Executed by:- tst_QDataStream
- tst_QIODevice
-1;executed 1075 times by 2 tests: return -1;Executed by:- tst_QDataStream
- tst_QIODevice
| 1075 |
| 190 | | - |
| 191 | const int readResult = dev->read(data, len); | - |
| 192 | if (readResult != len| TRUE | evaluated 1217 times by 12 testsEvaluated by:- tst_QAsn1Element
- tst_QDataStream
- tst_QDockWidget
- tst_QHeaderView
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
- tst_QPixmap
- tst_languageChange
| | FALSE | evaluated 337907 times by 62 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- ...
|
) | 1217-337907 |
| 193 | setStatus(ReadPastEnd);executed 1217 times by 12 tests: setStatus(ReadPastEnd);Executed by:- tst_QAsn1Element
- tst_QDataStream
- tst_QDockWidget
- tst_QHeaderView
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
- tst_QPixmap
- tst_languageChange
| 1217 |
| 194 | returnexecuted 339124 times by 62 tests: return readResult;Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- ...
readResult;executed 339124 times by 62 tests: return readResult;Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- ...
| 339124 |
| 195 | } | - |
| 196 | QDataStream &QDataStream::operator>>(qint8 &i) | - |
| 197 | { | - |
| 198 | i = 0; | - |
| 199 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 133653 times by 39 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
|
) { QMessageLogger(__FILE__, 589783, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-133653 |
| 200 | char c; | - |
| 201 | if (!dev->getChar(&c)) | 183-133470 |
| setStatusreadBlock| TRUE | evaluated 133470 times by 39 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| | FALSE | evaluated 183 times by 5 testsEvaluated by:- tst_QAsn1Element
- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QMetaType
|
(ReadPastEnd);| TRUE | evaluated 133470 times by 39 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| | FALSE | evaluated 183 times by 5 testsEvaluated by:- tst_QAsn1Element
- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QMetaType
|
| |
| else| TRUE | evaluated 133470 times by 39 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| | FALSE | evaluated 183 times by 5 testsEvaluated by:- tst_QAsn1Element
- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QMetaType
|
| TRUE | evaluated 133470 times by 39 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| | FALSE | evaluated 183 times by 5 testsEvaluated by:- tst_QAsn1Element
- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QMetaType
|
&c, 1) == 1| TRUE | evaluated 133470 times by 39 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| | FALSE | evaluated 183 times by 5 testsEvaluated by:- tst_QAsn1Element
- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QMetaType
|
) | |
| 202 | i = qint8(c);executed 133470 times by 39 tests: i = qint8(c);Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| 133470 |
| 203 | returnexecuted 133653 times by 39 tests: return *this;Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
*this;executed 133653 times by 39 tests: return *this;Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QBrush
- tst_QBuffer
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFile
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- ...
| 133653 |
| 204 | } | - |
| 205 | QDataStream &QDataStream::operator>>(qint16 &i) | - |
| 206 | { | - |
| 207 | i = 0; | - |
| 208 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 11603 times by 19 testsEvaluated by:- tst_QAuthenticator
- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPixmap
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
|
) { QMessageLogger(__FILE__, 617809, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-11603 |
| 209 | if (dev->read((readBlock(reinterpret_cast<| TRUE | evaluated 87 times by 5 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMetaType
| | FALSE | evaluated 11516 times by 19 testsEvaluated by:- tst_QAuthenticator
- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPixmap
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
|
char *)*>(&i,), 2) != 2| TRUE | evaluated 87 times by 5 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMetaType
| | FALSE | evaluated 11516 times by 19 testsEvaluated by:- tst_QAuthenticator
- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPixmap
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
|
) { | 87-11516 |
| 210 | i = 0; | - |
| 211 | setStatus(ReadPastEnd);}executed 87 times by 5 tests: end of blockExecuted by:- tst_QDataStream
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMetaType
else { | 87 |
| 212 | if (!noswap| TRUE | evaluated 9998 times by 15 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
| | FALSE | evaluated 1518 times by 6 testsEvaluated by:- tst_QAuthenticator
- tst_QDataStream
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QPixmap
|
) { | 1518-9998 |
| 213 | i = qbswap(i); | - |
| 214 | }executed 9998 times by 15 tests: end of blockExecuted by:- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
| 9998 |
| 215 | }executed 11516 times by 19 tests: end of blockExecuted by:- tst_QAuthenticator
- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPixmap
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
| 11516 |
| 216 | returnexecuted 11603 times by 19 tests: return *this;Executed by:- tst_QAuthenticator
- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPixmap
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
*this;executed 11603 times by 19 tests: return *this;Executed by:- tst_QAuthenticator
- tst_QBrush
- tst_QDataStream
- tst_QDockWidget
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QMetaType
- tst_QPen
- tst_QPicture
- tst_QPixmap
- tst_QPrinter
- tst_QSettings
- tst_QStandardItem
- tst_QVariant
- tst_QWidget
| 11603 |
| 217 | } | - |
| 218 | QDataStream &QDataStream::operator>>(qint32 &i) | - |
| 219 | { | - |
| 220 | i = 0; | - |
| 221 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 123863 times by 57 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- ...
|
) { QMessageLogger(__FILE__, 648839, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-123863 |
| 222 | if (dev->read((readBlock(reinterpret_cast<| TRUE | evaluated 728 times by 10 testsEvaluated by:- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
- tst_QPixmap
- tst_languageChange
| | FALSE | evaluated 123135 times by 57 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- ...
|
char *)*>(&i,), 4) != 4| TRUE | evaluated 728 times by 10 testsEvaluated by:- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
- tst_QPixmap
- tst_languageChange
| | FALSE | evaluated 123135 times by 57 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- ...
|
) { | 728-123135 |
| 223 | i = 0; | - |
| 224 | setStatus(ReadPastEnd);}executed 728 times by 10 tests: end of blockExecuted by:- tst_QDataStream
- tst_QHeaderView
- tst_QIODevice
- tst_QImage
- tst_QImageReader
- tst_QMainWindow
- tst_QMetaType
- tst_QNetworkDiskCache
- tst_QPixmap
- tst_languageChange
else { | 728 |
| 225 | if (!noswap| TRUE | evaluated 119399 times by 54 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMargins
- tst_QMetaObjectBuilder
- tst_QMetaType
- ...
| | FALSE | evaluated 3736 times by 6 testsEvaluated by:- tst_QAuthenticator
- tst_QDataStream
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QPixmap
|
) { | 3736-119399 |
| 226 | i = qbswap(i); | - |
| 227 | }executed 119399 times by 54 tests: end of blockExecuted by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- tst_QMargins
- tst_QMetaObjectBuilder
- tst_QMetaType
- ...
| 119399 |
| 228 | }executed 123135 times by 57 tests: end of blockExecuted by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- ...
| 123135 |
| 229 | returnexecuted 123863 times by 57 tests: return *this;Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- ...
*this;executed 123863 times by 57 tests: return *this;Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAuthenticator
- tst_QBitArray
- tst_QBrush
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFiledialog
- tst_QFont
- tst_QGraphicsProxyWidget
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIODevice
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QKeySequence
- tst_QListWidget
- tst_QLocalSocket
- tst_QMainWindow
- ...
| 123863 |
| 230 | } | - |
| 231 | QDataStream &QDataStream::operator>>(qint64 &i) | - |
| 232 | { | - |
| 233 | i = qint64(0); | - |
| 234 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 35987 times by 13 testsEvaluated by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
|
) { QMessageLogger(__FILE__, 678868, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-35987 |
| 235 | if (version() < 6| TRUE | never evaluated | | FALSE | evaluated 35987 times by 13 testsEvaluated by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
|
) { | 0-35987 |
| 236 | quint32 i1, i2; | - |
| 237 | *this >> i2 >> i1; | - |
| 238 | i = ((quint64)i1 << 32) + i2; | - |
| 239 | } never executed: end of block else { | 0 |
| 240 | if (dev->read((readBlock(reinterpret_cast<| TRUE | evaluated 185 times by 3 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
| | FALSE | evaluated 35802 times by 13 testsEvaluated by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
|
char *)*>(&i,), 8) != 8| TRUE | evaluated 185 times by 3 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
| | FALSE | evaluated 35802 times by 13 testsEvaluated by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
|
) { | 185-35802 |
| 241 | i = qint64(0); | - |
| setStatus(ReadPastEnd); | |
| 242 | }executed 185 times by 3 tests: end of blockExecuted by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
else { | 185 |
| 243 | if (!noswap| TRUE | evaluated 35790 times by 13 testsEvaluated by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
| | FALSE | evaluated 12 times by 1 test |
) { | 12-35790 |
| 244 | i = qbswap(i); | - |
| 245 | }executed 35790 times by 13 tests: end of blockExecuted by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
| 35790 |
| 246 | }executed 35802 times by 13 tests: end of blockExecuted by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
| 35802 |
| 247 | } | - |
| 248 | returnexecuted 35987 times by 13 tests: return *this;Executed by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
*this;executed 35987 times by 13 tests: return *this;Executed by:- tst_QAbstractNetworkCache
- tst_QDataStream
- tst_QDate
- tst_QDateTime
- tst_QIODevice
- tst_QLocalSocket
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QSettings
- tst_QTimeZone
- tst_QVariant
| 35987 |
| 249 | } | - |
| 250 | | - |
| 251 | | - |
| 252 | | - |
| 253 | | - |
| 254 | | - |
| 255 | QDataStream &QDataStream::operator>>(bool &i) | - |
| 256 | { | - |
| 257 | qint8 v; | - |
| 258 | *this >> v; | - |
| 259 | i = !!v; | - |
| 260 | return *this; | - |
| 261 | } | - |
| 262 | QDataStream &QDataStream::operator>>(float &f) | - |
| 263 | { | - |
| 264 | if (version() >= QDataStream::Qt_4_6| TRUE | evaluated 1263 times by 4 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
- tst_QVariant
| | FALSE | never evaluated |
| 0-1263 |
| 265 | && floatingPointPrecision() == QDataStream::DoublePrecision| TRUE | evaluated 1237 times by 4 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
- tst_QVariant
| | FALSE | evaluated 26 times by 1 test |
) { | 26-1237 |
| 266 | double d; | - |
| 267 | *this >> d; | - |
| 268 | f = d; | - |
| 269 | returnexecuted 1237 times by 4 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
- tst_QVariant
*this;executed 1237 times by 4 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
- tst_QVariant
| 1237 |
| 270 | } | - |
| 271 | | - |
| 272 | f = 0.0f; | - |
| 273 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 26 times by 1 test |
) { QMessageLogger(__FILE__, 729918, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-26 |
| 274 | if (dev->read((readBlock(reinterpret_cast<| TRUE | evaluated 10 times by 1 test | | FALSE | evaluated 16 times by 1 test |
char *)*>(&f,), 4) != 4| TRUE | evaluated 10 times by 1 test | | FALSE | evaluated 16 times by 1 test |
) { | 10-16 |
| 275 | f = 0.0f; | - |
| 276 | setStatus(ReadPastEnd);}executed 10 times by 1 test: end of block else { | 10 |
| 277 | if (!noswap| TRUE | evaluated 10 times by 1 test | | FALSE | evaluated 6 times by 1 test |
) { | 6-10 |
| 278 | union { | - |
| 279 | float val1; | - |
| 280 | quint32 val2; | - |
| 281 | } x; | - |
| 282 | x.val2 = qbswap(*reinterpret_cast<quint32 *>(&f)); | - |
| 283 | f = x.val1; | - |
| 284 | }executed 10 times by 1 test: end of block | 10 |
| 285 | }executed 16 times by 1 test: end of block | 16 |
| 286 | returnexecuted 26 times by 1 test: return *this; *this;executed 26 times by 1 test: return *this; | 26 |
| 287 | } | - |
| 288 | QDataStream &QDataStream::operator>>(double &f) | - |
| 289 | { | - |
| 290 | if (version() >= QDataStream::Qt_4_6| TRUE | evaluated 11776 times by 14 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
| | FALSE | evaluated 3248 times by 2 tests |
| 3248-11776 |
| 291 | && floatingPointPrecision() == QDataStream::SinglePrecision| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 11775 times by 14 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
|
) { | 1-11775 |
| 292 | float d; | - |
| 293 | *this >> d; | - |
| 294 | f = d; | - |
| 295 | returnexecuted 1 time by 1 test: return *this; *this;executed 1 time by 1 test: return *this; | 1 |
| 296 | } | - |
| 297 | | - |
| 298 | f = 0.0; | - |
| 299 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 15023 times by 14 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
|
) { QMessageLogger(__FILE__, 767955, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-15023 |
| 300 | if (dev->read((readBlock(reinterpret_cast<| TRUE | evaluated 550 times by 3 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
| | FALSE | evaluated 14473 times by 14 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
|
char *)*>(&f,), 8) != 8| TRUE | evaluated 550 times by 3 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
| | FALSE | evaluated 14473 times by 14 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
|
) { | 550-14473 |
| 301 | f = 0.0; | - |
| 302 | setStatus(ReadPastEnd);}executed 550 times by 3 tests: end of blockExecuted by:- tst_QDataStream
- tst_QIODevice
- tst_QMetaType
else { | 550 |
| 303 | if (!noswap| TRUE | evaluated 14466 times by 14 testsEvaluated by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
| | FALSE | evaluated 7 times by 1 test |
) { | 7-14466 |
| 304 | union { | - |
| 305 | double val1; | - |
| 306 | quint64 val2; | - |
| 307 | } x; | - |
| 308 | x.val2 = qbswap(*reinterpret_cast<quint64 *>(&f)); | - |
| 309 | f = x.val1; | - |
| 310 | }executed 14466 times by 14 tests: end of blockExecuted by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
| 14466 |
| 311 | }executed 14473 times by 14 tests: end of blockExecuted by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
| 14473 |
| 312 | returnexecuted 15023 times by 14 tests: return *this;Executed by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
*this;executed 15023 times by 14 tests: return *this;Executed by:- tst_QBrush
- tst_QDataStream
- tst_QFont
- tst_QGuiVariant
- tst_QIODevice
- tst_QMargins
- tst_QMetaType
- tst_QPainterPath
- tst_QPen
- tst_QPicture
- tst_QPointF
- tst_QPrinter
- tst_QStandardItem
- tst_QVariant
| 15023 |
| 313 | } | - |
| 314 | QDataStream &QDataStream::operator>>(char *&s) | - |
| 315 | { | - |
| 316 | uint len = 0; | - |
| 317 | return readBytes(s, len); | - |
| 318 | } | - |
| 319 | QDataStream &QDataStream::readBytes(char *&s, uint &l) | - |
| 320 | { | - |
| 321 | s = 0; | - |
| 322 | l = 0; | - |
| 323 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 1281 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
|
) { QMessageLogger(__FILE__, 8271014, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return *this; *this;never executed: return *this; } | 0-1281 |
| 324 | | - |
| 325 | quint32 len; | - |
| 326 | *this >> len; | - |
| 327 | if (len == 0| TRUE | evaluated 334 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
| | FALSE | evaluated 947 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
|
) | 334-947 |
| 328 | returnexecuted 334 times by 2 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
*this;executed 334 times by 2 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
| 334 |
| 329 | | - |
| 330 | const quint32 Step = 1024 * 1024; | - |
| 331 | quint32 allocated = 0; | - |
| 332 | char *prevBuf = 0; | - |
| 333 | char *curBuf = 0; | - |
| 334 | | - |
| 335 | do { | - |
| 336 | int blockSize = qMin(Step, len - allocated); | - |
| 337 | prevBuf = curBuf; | - |
| 338 | curBuf = new char[allocated + blockSize + 1]; | - |
| 339 | if (prevBuf| TRUE | evaluated 28 times by 1 test | | FALSE | evaluated 947 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
|
) { | 28-947 |
| 340 | memcpy(curBuf, prevBuf, allocated); | - |
| 341 | delete [] prevBuf; | - |
| 342 | }executed 28 times by 1 test: end of block | 28 |
| 343 | if (dev->readreadBlock| TRUE | evaluated 180 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
| | FALSE | evaluated 795 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
|
(curBuf + allocated, blockSize) != blockSize| TRUE | evaluated 180 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
| | FALSE | evaluated 795 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
|
) { | 180-795 |
| 344 | delete [] curBuf; | - |
| 345 | setStatus(ReadPastEnd);returnexecuted 180 times by 2 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
*this;executed 180 times by 2 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
| 180 |
| 346 | } | - |
| 347 | allocated += blockSize; | - |
| 348 | }executed 795 times by 2 tests: end of blockExecuted by:- tst_QDataStream
- tst_QIODevice
while (allocated < len| TRUE | evaluated 28 times by 1 test | | FALSE | evaluated 767 times by 2 testsEvaluated by:- tst_QDataStream
- tst_QIODevice
|
); | 28-795 |
| 349 | | - |
| 350 | s = curBuf; | - |
| 351 | s[len] = '\0'; | - |
| 352 | l = (uint)len; | - |
| 353 | returnexecuted 767 times by 2 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
*this;executed 767 times by 2 tests: return *this;Executed by:- tst_QDataStream
- tst_QIODevice
| 767 |
| 354 | } | - |
| 355 | int QDataStream::readRawData(char *s, int len) | - |
| 356 | { | - |
| 357 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 19060 times by 41 testsEvaluated by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFont
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QListWidget
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPicture
- ...
|
) { QMessageLogger(__FILE__, 8721058, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return -1; -1;never executed: return -1; } | 0-19060 |
| 358 | returnexecuted 19060 times by 41 tests: return readBlock(s, len);Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFont
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QListWidget
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPicture
- ...
dev->readreadBlock(s, len);executed 19060 times by 41 tests: return readBlock(s, len);Executed by:- tst_QAbstractItemModel
- tst_QAbstractNetworkCache
- tst_QAsn1Element
- tst_QAuthenticator
- tst_QBitArray
- tst_QDataStream
- tst_QDateTime
- tst_QDockWidget
- tst_QFileDialog2
- tst_QFont
- tst_QGuiVariant
- tst_QHeaderView
- tst_QHostAddress
- tst_QIcon
- tst_QImage
- tst_QImageReader
- tst_QImageWriter
- tst_QListWidget
- tst_QMainWindow
- tst_QMetaObjectBuilder
- tst_QMetaType
- tst_QNetworkCacheMetaData
- tst_QNetworkDiskCache
- tst_QNetworkReply
- tst_QPicture
- ...
| 19060 |
| 359 | } | - |
| 360 | QDataStream &QDataStream::operator<<(qint8 i) | - |
| 361 | { | - |
| 362 | if (!dev) { QMessageLogger(__FILE__, 8971083, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 363 | if (!dev->putChar(i)) | - |
| 364 | q_status = WriteFailed; | - |
| 365 | return *this; | - |
| 366 | } | - |
| 367 | QDataStream &QDataStream::operator<<(qint16 i) | - |
| 368 | { | - |
| 369 | if (!dev) { QMessageLogger(__FILE__, 9211107, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 370 | if (!noswap) { | - |
| 371 | i = qbswap(i); | - |
| 372 | } | - |
| 373 | if (dev->write((char *)&i, sizeof(qint16)) != sizeof(qint16)) | - |
| 374 | q_status = WriteFailed; | - |
| 375 | return *this; | - |
| 376 | } | - |
| 377 | QDataStream &QDataStream::operator<<(qint32 i) | - |
| 378 | { | - |
| 379 | if (!dev) { QMessageLogger(__FILE__, 9391125, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 380 | if (!noswap) { | - |
| 381 | i = qbswap(i); | - |
| 382 | } | - |
| 383 | if (dev->write((char *)&i, sizeof(qint32)) != sizeof(qint32)) | - |
| 384 | q_status = WriteFailed; | - |
| 385 | return *this; | - |
| 386 | } | - |
| 387 | QDataStream &QDataStream::operator<<(qint64 i) | - |
| 388 | { | - |
| 389 | if (!dev) { QMessageLogger(__FILE__, 9651151, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 390 | if (version() < 6) { | - |
| 391 | quint32 i1 = i & 0xffffffff; | - |
| 392 | quint32 i2 = i >> 32; | - |
| 393 | *this << i2 << i1; | - |
| 394 | } else { | - |
| 395 | if (!noswap) { | - |
| 396 | i = qbswap(i); | - |
| 397 | } | - |
| 398 | if (dev->write((char *)&i, sizeof(qint64)) != sizeof(qint64)) | - |
| 399 | q_status = WriteFailed; | - |
| 400 | } | - |
| 401 | return *this; | - |
| 402 | } | - |
| 403 | QDataStream &QDataStream::operator<<(bool i) | - |
| 404 | { | - |
| 405 | if (!dev) { QMessageLogger(__FILE__, 9951181, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 406 | if (!dev->putChar(qint8(i))) | - |
| 407 | q_status = WriteFailed; | - |
| 408 | return *this; | - |
| 409 | } | - |
| 410 | QDataStream &QDataStream::operator<<(float f) | - |
| 411 | { | - |
| 412 | if (version() >= QDataStream::Qt_4_6 | - |
| 413 | && floatingPointPrecision() == QDataStream::DoublePrecision) { | - |
| 414 | *this << double(f); | - |
| 415 | return *this; | - |
| 416 | } | - |
| 417 | | - |
| 418 | if (!dev) { QMessageLogger(__FILE__, 10181204, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 419 | float g = f; | - |
| 420 | if (!noswap) { | - |
| 421 | union { | - |
| 422 | float val1; | - |
| 423 | quint32 val2; | - |
| 424 | } x; | - |
| 425 | x.val1 = g; | - |
| 426 | x.val2 = qbswap(x.val2); | - |
| 427 | | - |
| 428 | if (dev->write((char *)&x.val2, sizeof(float)) != sizeof(float)) | - |
| 429 | q_status = WriteFailed; | - |
| 430 | return *this; | - |
| 431 | } | - |
| 432 | | - |
| 433 | if (dev->write((char *)&g, sizeof(float)) != sizeof(float)) | - |
| 434 | q_status = WriteFailed; | - |
| 435 | return *this; | - |
| 436 | } | - |
| 437 | QDataStream &QDataStream::operator<<(double f) | - |
| 438 | { | - |
| 439 | if (version() >= QDataStream::Qt_4_6 | - |
| 440 | && floatingPointPrecision() == QDataStream::SinglePrecision) { | - |
| 441 | *this << float(f); | - |
| 442 | return *this; | - |
| 443 | } | - |
| 444 | | - |
| 445 | if (!dev) { QMessageLogger(__FILE__, 10561242, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 446 | if (noswap) { | - |
| 447 | if (dev->write((char *)&f, sizeof(double)) != sizeof(double)) | - |
| 448 | q_status = WriteFailed; | - |
| 449 | } else { | - |
| 450 | union { | - |
| 451 | double val1; | - |
| 452 | quint64 val2; | - |
| 453 | } x; | - |
| 454 | x.val1 = f; | - |
| 455 | x.val2 = qbswap(x.val2); | - |
| 456 | if (dev->write((char *)&x.val2, sizeof(double)) != sizeof(double)) | - |
| 457 | q_status = WriteFailed; | - |
| 458 | } | - |
| 459 | return *this; | - |
| 460 | } | - |
| 461 | QDataStream &QDataStream::operator<<(const char *s) | - |
| 462 | { | - |
| 463 | if (!s) { | - |
| 464 | *this << (quint32)0; | - |
| 465 | return *this; | - |
| 466 | } | - |
| 467 | uint len = qstrlen(s) + 1; | - |
| 468 | *this << (quint32)len; | - |
| 469 | writeRawData(s, len); | - |
| 470 | return *this; | - |
| 471 | } | - |
| 472 | QDataStream &QDataStream::writeBytes(const char *s, uint len) | - |
| 473 | { | - |
| 474 | if (!dev) { QMessageLogger(__FILE__, 11101296, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return *this; } if (q_status != Ok) return *this; | - |
| 475 | *this << (quint32)len; | - |
| 476 | if (len) | - |
| 477 | writeRawData(s, len); | - |
| 478 | return *this; | - |
| 479 | } | - |
| 480 | int QDataStream::writeRawData(const char *s, int len) | - |
| 481 | { | - |
| 482 | if (!dev) { QMessageLogger(__FILE__, 11281314, __PRETTY_FUNCTION__).warning("QDataStream: No device"); return -1; } if (q_status != Ok) return -1; | - |
| 483 | int ret = dev->write(s, len); | - |
| 484 | if (ret != len) | - |
| 485 | q_status = WriteFailed; | - |
| 486 | return ret; | - |
| 487 | } | - |
| 488 | int QDataStream::skipRawData(int len) | - |
| 489 | { | - |
| 490 | if (!dev| TRUE | never evaluated | | FALSE | evaluated 24 times by 2 testsEvaluated by:- tst_QAuthenticator
- tst_QDataStream
|
) { QMessageLogger(__FILE__, 11481334, __PRETTY_FUNCTION__).warning("QDataStream: No device"); returnnever executed: return -1; -1;never executed: return -1; } | 0-24 |
| 491 | | - |
| 492 | if (dev->isSequential()| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 21 times by 2 testsEvaluated by:- tst_QAuthenticator
- tst_QDataStream
|
) { | 3-21 |
| 493 | char buf[4096]; | - |
| 494 | int sumRead = 0; | - |
| 495 | | - |
| 496 | while (len > 0| TRUE | evaluated 9 times by 1 test | | FALSE | evaluated 3 times by 1 test |
) { | 3-9 |
| 497 | int blockSize = qMin(len, (int)sizeof(buf)); | - |
| 498 | int n = dev->readreadBlock(buf, blockSize); | - |
| 499 | if (n == -1| TRUE | never evaluated | | FALSE | evaluated 9 times by 1 test |
) | 0-9 |
| 500 | return never executed: return -1; -1;never executed: return -1; | 0 |
| 501 | if (n == 0| TRUE | never evaluated | | FALSE | evaluated 9 times by 1 test |
) | 0-9 |
| 502 | return never executed: return sumRead; sumRead;never executed: return sumRead; | 0 |
| 503 | | - |
| 504 | sumRead += n; | - |
| 505 | len -= blockSize; | - |
| 506 | }executed 9 times by 1 test: end of block | 9 |
| 507 | returnexecuted 3 times by 1 test: return sumRead; sumRead;executed 3 times by 1 test: return sumRead; | 3 |
| 508 | } else { | - |
| 509 | qint64 pos = dev->pos(); | - |
| 510 | qint64 size = dev->size(); | - |
| 511 | if (pos + len > size| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 20 times by 2 testsEvaluated by:- tst_QAuthenticator
- tst_QDataStream
|
) | 1-20 |
| 512 | len = size - pos;executed 1 time by 1 test: len = size - pos; | 1 |
| 513 | if (!dev->seek(pos + len)| TRUE | never evaluated | | FALSE | evaluated 21 times by 2 testsEvaluated by:- tst_QAuthenticator
- tst_QDataStream
|
) | 0-21 |
| 514 | return never executed: return -1; -1;never executed: return -1; | 0 |
| 515 | returnexecuted 21 times by 2 tests: return len;Executed by:- tst_QAuthenticator
- tst_QDataStream
len;executed 21 times by 2 tests: return len;Executed by:- tst_QAuthenticator
- tst_QDataStream
| 21 |
| 516 | } | - |
| 517 | } | - |
| 518 | | - |
| 519 | | - |
| | |