qbitarray.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qbitarray.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4QBitArray::QBitArray(int size, bool value)-
5 : d(size <= 0 ? 0 : 1 + (size + 7)/8, Qt::Uninitialized)-
6{-
7 ((!(size >= 0)) ? qt_assert_x("QBitArray::QBitArray", "Size must be greater than or equal to 0.",__FILE__,150) : qt_noop());-
8 if (size <= 0
size <= 0Description
TRUEevaluated 303 times by 6 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QGraphicsGridLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsWidget
  • tst_QVariant
FALSEevaluated 16995 times by 30 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QBitArray
  • tst_QCalendarWidget
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFormLayout
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QLCDNumber
  • tst_QMetaType
  • tst_QRegExp
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QStyleSheetStyle
  • ...
)
303-16995
9 return;
executed 303 times by 6 tests: return;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QGraphicsGridLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsWidget
  • tst_QVariant
303
10-
11 uchar* c = reinterpret_cast<uchar*>(d.data());-
12 memset(c + 1, value ? 0xff : 0, d.size() - 1);-
13 *c = d.size()*8 - size;-
14 if (value
valueDescription
TRUEevaluated 4039 times by 5 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QMetaType
  • tst_QVariant
FALSEevaluated 12956 times by 28 tests
Evaluated by:
  • tst_Collections
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QBitArray
  • tst_QCalendarWidget
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFormLayout
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QLCDNumber
  • tst_QRegExp
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • ...
&& size
sizeDescription
TRUEevaluated 4039 times by 5 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QMetaType
  • tst_QVariant
FALSEnever evaluated
&& size % 8
size % 8Description
TRUEevaluated 3532 times by 4 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QVariant
FALSEevaluated 507 times by 3 tests
Evaluated by:
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QMetaType
)
0-12956
15 *(
executed 3532 times by 4 tests: *(c+1+size/8) &= (1 << (size%8)) - 1;
Executed by:
  • tst_Collections
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QVariant
c+1+size/8) &= (1 << (size%8)) - 1;
executed 3532 times by 4 tests: *(c+1+size/8) &= (1 << (size%8)) - 1;
Executed by:
  • tst_Collections
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QVariant
3532
16}
executed 16995 times by 30 tests: end of block
Executed by:
  • tst_Collections
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QBitArray
  • tst_QCalendarWidget
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFormLayout
  • tst_QGraphicsGridLayout
  • tst_QGraphicsItem
  • tst_QGraphicsLayout
  • tst_QGraphicsLinearLayout
  • tst_QGraphicsProxyWidget
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QLCDNumber
  • tst_QMetaType
  • tst_QRegExp
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QStyleSheetStyle
  • ...
16995
17int QBitArray::count(bool on) const-
18{-
19 int numBits = 0;-
20 const quint8 *bits = reinterpret_cast<const quint8 *>(d.data()) + 1;-
21-
22-
23-
24 const quint8 *const end = reinterpret_cast<const quint8 *>(d.end());-
25-
26 while (bits + 7 <= end
bits + 7 <= endDescription
TRUEevaluated 499980 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 16147 times by 2 tests
Evaluated by:
  • tst_QBitArray
  • tst_QFormLayout
) {
16147-499980
27 quint64 v = qFromUnaligned<quint64>(bits);-
28 bits += 8;-
29 numBits += int(qPopulationCount(v));-
30 }
executed 499980 times by 1 test: end of block
Executed by:
  • tst_QBitArray
499980
31 if (bits + 3 <= end
bits + 3 <= endDescription
TRUEevaluated 8106 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 8041 times by 2 tests
Evaluated by:
  • tst_QBitArray
  • tst_QFormLayout
) {
8041-8106
32 quint32 v = qFromUnaligned<quint32>(bits);-
33 bits += 4;-
34 numBits += int(qPopulationCount(v));-
35 }
executed 8106 times by 1 test: end of block
Executed by:
  • tst_QBitArray
8106
36 if (bits + 1 < end
bits + 1 < endDescription
TRUEevaluated 4038 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 12109 times by 2 tests
Evaluated by:
  • tst_QBitArray
  • tst_QFormLayout
) {
4038-12109
37 quint16 v = qFromUnaligned<quint16>(bits);-
38 bits += 2;-
39 numBits += int(qPopulationCount(v));-
40 }
executed 4038 times by 1 test: end of block
Executed by:
  • tst_QBitArray
4038
41 if (bits < end
bits < endDescription
TRUEevaluated 4069 times by 2 tests
Evaluated by:
  • tst_QBitArray
  • tst_QFormLayout
FALSEevaluated 12078 times by 1 test
Evaluated by:
  • tst_QBitArray
)
4069-12078
42 numBits += int(qPopulationCount(bits[0]));
executed 4069 times by 2 tests: numBits += int(qPopulationCount(bits[0]));
Executed by:
  • tst_QBitArray
  • tst_QFormLayout
4069
43-
44 return
executed 16147 times by 2 tests: return on ? numBits : size() - numBits;
Executed by:
  • tst_QBitArray
  • tst_QFormLayout
on ? numBits : size() - numBits;
executed 16147 times by 2 tests: return on ? numBits : size() - numBits;
Executed by:
  • tst_QBitArray
  • tst_QFormLayout
16147
45}-
46void QBitArray::resize(int size)-
47{-
48 if (!size
!sizeDescription
TRUEevaluated 52 times by 3 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QLCDNumber
FALSEevaluated 4482 times by 11 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QLCDNumber
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
) {
52-4482
49 d.resize(0);-
50 }
executed 52 times by 3 tests: end of block
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QLCDNumber
else {
52
51 int s = d.size();-
52 d.resize(1 + (size+7)/8);-
53 uchar* c = reinterpret_cast<uchar*>(d.data());-
54 if (size > (s << 3)
size > (s << 3)Description
TRUEevaluated 405 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QLCDNumber
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
FALSEevaluated 4077 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
)
405-4077
55 memset(c + s, 0, d.size() - s);
executed 405 times by 10 tests: memset(c + s, 0, d.size() - s);
Executed by:
  • tst_QAbstractItemView
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QLCDNumber
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
405
56 else if ( size % 8
size % 8Description
TRUEevaluated 3563 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
FALSEevaluated 514 times by 2 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QBitArray
)
514-3563
57 *(
executed 3563 times by 7 tests: *(c+1+size/8) &= (1 << (size%8)) - 1;
Executed by:
  • tst_QAbstractItemModel
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
c+1+size/8) &= (1 << (size%8)) - 1;
executed 3563 times by 7 tests: *(c+1+size/8) &= (1 << (size%8)) - 1;
Executed by:
  • tst_QAbstractItemModel
  • tst_QBitArray
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
3563
58 *c = d.size()*8 - size;-
59 }
executed 4482 times by 11 tests: end of block
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHashFunctions
  • tst_QHeaderView
  • tst_QLCDNumber
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableWidget
4482
60}-
61void QBitArray::fill(bool value, int begin, int end)-
62{-
63 while (begin < end
begin < endDescription
TRUEevaluated 492 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 56 times by 1 test
Evaluated by:
  • tst_QBitArray
&& begin & 0x7
begin & 0x7Description
TRUEevaluated 390 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 102 times by 1 test
Evaluated by:
  • tst_QBitArray
)
56-492
64 setBit(begin++, value);
executed 390 times by 1 test: setBit(begin++, value);
Executed by:
  • tst_QBitArray
390
65 int len = end - begin;-
66 if (len <= 0
len <= 0Description
TRUEevaluated 56 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 102 times by 1 test
Evaluated by:
  • tst_QBitArray
)
56-102
67 return;
executed 56 times by 1 test: return;
Executed by:
  • tst_QBitArray
56
68 int s = len & ~0x7;-
69 uchar *c = reinterpret_cast<uchar*>(d.data());-
70 memset(c + (begin >> 3) + 1, value ? 0xff : 0, s >> 3);-
71 begin += s;-
72 while (begin < end
begin < endDescription
TRUEevaluated 344 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 102 times by 1 test
Evaluated by:
  • tst_QBitArray
)
102-344
73 setBit(begin++, value);
executed 344 times by 1 test: setBit(begin++, value);
Executed by:
  • tst_QBitArray
344
74}
executed 102 times by 1 test: end of block
Executed by:
  • tst_QBitArray
102
75QBitArray &QBitArray::operator&=(const QBitArray &other)-
76{-
77 resize(qMax(size(), other.size()));-
78 uchar *a1 = reinterpret_cast<uchar*>(d.data()) + 1;-
79 const uchar *a2 = reinterpret_cast<const uchar*>(other.d.constData()) + 1;-
80 int n = other.d.size() -1 ;-
81 int p = d.size() - 1 - n;-
82 while (n-- > 0
n-- > 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QBitArray
)
8-9
83 *
executed 9 times by 1 test: *a1++ &= *a2++;
Executed by:
  • tst_QBitArray
a1++ &= *a2++;
executed 9 times by 1 test: *a1++ &= *a2++;
Executed by:
  • tst_QBitArray
9
84 while (p-- > 0
p-- > 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QBitArray
)
4-8
85 *
executed 4 times by 1 test: *a1++ = 0;
Executed by:
  • tst_QBitArray
a1++ = 0;
executed 4 times by 1 test: *a1++ = 0;
Executed by:
  • tst_QBitArray
4
86 return
executed 8 times by 1 test: return *this;
Executed by:
  • tst_QBitArray
*this;
executed 8 times by 1 test: return *this;
Executed by:
  • tst_QBitArray
8
87}-
88QBitArray &QBitArray::operator|=(const QBitArray &other)-
89{-
90 resize(qMax(size(), other.size()));-
91 uchar *a1 = reinterpret_cast<uchar*>(d.data()) + 1;-
92 const uchar *a2 = reinterpret_cast<const uchar *>(other.d.constData()) + 1;-
93 int n = other.d.size() - 1;-
94 while (n-- > 0
n-- > 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QBitArray
)
8
95 *
executed 8 times by 1 test: *a1++ |= *a2++;
Executed by:
  • tst_QBitArray
a1++ |= *a2++;
executed 8 times by 1 test: *a1++ |= *a2++;
Executed by:
  • tst_QBitArray
8
96 return
executed 8 times by 1 test: return *this;
Executed by:
  • tst_QBitArray
*this;
executed 8 times by 1 test: return *this;
Executed by:
  • tst_QBitArray
8
97}-
98QBitArray &QBitArray::operator^=(const QBitArray &other)-
99{-
100 resize(qMax(size(), other.size()));-
101 uchar *a1 = reinterpret_cast<uchar*>(d.data()) + 1;-
102 const uchar *a2 = reinterpret_cast<const uchar *>(other.d.constData()) + 1;-
103 int n = other.d.size() - 1;-
104 while (n-- > 0
n-- > 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QBitArray
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QBitArray
)
8-9
105 *
executed 9 times by 1 test: *a1++ ^= *a2++;
Executed by:
  • tst_QBitArray
a1++ ^= *a2++;
executed 9 times by 1 test: *a1++ ^= *a2++;
Executed by:
  • tst_QBitArray
9
106 return
executed 8 times by 1 test: return *this;
Executed by:
  • tst_QBitArray
*this;
executed 8 times by 1 test: return *this;
Executed by:
  • tst_QBitArray
8
107}-
108QBitArray QBitArray::operator~() const-
109{-
110 int sz = size();-
111 QBitArray a(sz);-
112 const uchar *a1 = reinterpret_cast<const uchar *>(d.constData()) + 1;-
113 uchar *a2 = reinterpret_cast<uchar*>(a.d.data()) + 1;-
114 int n = d.size() - 1;-
115-
116 while (n-- > 0
n-- > 0Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
)
13
117 *
executed 13 times by 2 tests: *a2++ = ~*a1++;
Executed by:
  • tst_Collections
  • tst_QBitArray
a2++ = ~*a1++;
executed 13 times by 2 tests: *a2++ = ~*a1++;
Executed by:
  • tst_Collections
  • tst_QBitArray
13
118-
119 if (sz
szDescription
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QBitArray
&& sz%8
sz%8Description
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_Collections
  • tst_QBitArray
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QBitArray
)
2-11
120 *(
executed 6 times by 2 tests: *(a2-1) &= (1 << (sz%8)) - 1;
Executed by:
  • tst_Collections
  • tst_QBitArray
a2-1) &= (1 << (sz%8)) - 1;
executed 6 times by 2 tests: *(a2-1) &= (1 << (sz%8)) - 1;
Executed by:
  • tst_Collections
  • tst_QBitArray
6
121 return
executed 13 times by 2 tests: return a;
Executed by:
  • tst_Collections
  • tst_QBitArray
a;
executed 13 times by 2 tests: return a;
Executed by:
  • tst_Collections
  • tst_QBitArray
13
122}-
123QBitArray operator&(const QBitArray &a1, const QBitArray &a2)-
124{-
125 QBitArray tmp = a1;-
126 tmp &= a2;-
127 return
never executed: return tmp;
tmp;
never executed: return tmp;
0
128}-
129QBitArray operator|(const QBitArray &a1, const QBitArray &a2)-
130{-
131 QBitArray tmp = a1;-
132 tmp |= a2;-
133 return
never executed: return tmp;
tmp;
never executed: return tmp;
0
134}-
135QBitArray operator^(const QBitArray &a1, const QBitArray &a2)-
136{-
137 QBitArray tmp = a1;-
138 tmp ^= a2;-
139 return
never executed: return tmp;
tmp;
never executed: return tmp;
0
140}-
141QDataStream &operator<<(QDataStream &out, const QBitArray &ba)-
142{-
143 quint32 len = ba.size();-
144 out << len;-
145 if (len > 0
len > 0Description
TRUEevaluated 140 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
FALSEevaluated 258 times by 9 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QMetaType
  • tst_QVariant
  • tst_languageChange
)
140-258
146 out.writeRawData(ba.d.constData() + 1, ba.d.size() - 1);
executed 140 times by 4 tests: out.writeRawData(ba.d.constData() + 1, ba.d.size() - 1);
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
140
147 return
executed 398 times by 9 tests: return out;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QMetaType
  • tst_QVariant
  • tst_languageChange
out;
executed 398 times by 9 tests: return out;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QMetaType
  • tst_QVariant
  • tst_languageChange
398
148}-
149QDataStream &operator>>(QDataStream &in, QBitArray &ba)-
150{-
151 ba.clear();-
152 quint32 len;-
153 in >> len;-
154 if (len == 0
len == 0Description
TRUEevaluated 285 times by 9 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QMetaType
  • tst_QVariant
  • tst_languageChange
FALSEevaluated 181 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
) {
181-285
155 ba.clear();-
156 return
executed 285 times by 9 tests: return in;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QMetaType
  • tst_QVariant
  • tst_languageChange
in;
executed 285 times by 9 tests: return in;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QMetaType
  • tst_QVariant
  • tst_languageChange
285
157 }-
158-
159 const quint32 Step = 8 * 1024 * 1024;-
160 quint32 totalBytes = (len + 7) / 8;-
161 quint32 allocated = 0;-
162-
163 while (allocated < totalBytes
allocated < totalBytesDescription
TRUEevaluated 181 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
FALSEevaluated 171 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
) {
171-181
164 int blockSize = qMin(Step, totalBytes - allocated);-
165 ba.d.resize(allocated + blockSize + 1);-
166 if (in.readRawData(ba.d.data() + 1 + allocated, blockSize) != blockSize
in.readRawData...) != blockSizeDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_QDataStream
FALSEevaluated 171 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
) {
10-171
167 ba.clear();-
168 in.setStatus(QDataStream::ReadPastEnd);-
169 return
executed 10 times by 1 test: return in;
Executed by:
  • tst_QDataStream
in;
executed 10 times by 1 test: return in;
Executed by:
  • tst_QDataStream
10
170 }-
171 allocated += blockSize;-
172 }
executed 171 times by 4 tests: end of block
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
171
173-
174 int paddingMask = ~((0x1 << (len & 0x7)) - 1);-
175 if (paddingMask != ~0x0
paddingMask != ~0x0Description
TRUEevaluated 114 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
FALSEevaluated 57 times by 2 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
&& (
(ba.d.constDat...& paddingMask)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_QDataStream
FALSEevaluated 101 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
ba.d.constData()[ba.d.size() - 1] & paddingMask)
(ba.d.constDat...& paddingMask)Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_QDataStream
FALSEevaluated 101 times by 4 tests
Evaluated by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
) {
13-114
176 ba.clear();-
177 in.setStatus(QDataStream::ReadCorruptData);-
178 return
executed 13 times by 1 test: return in;
Executed by:
  • tst_QDataStream
in;
executed 13 times by 1 test: return in;
Executed by:
  • tst_QDataStream
13
179 }-
180-
181 *ba.d.data() = ba.d.size() * 8 - len;-
182 return
executed 158 times by 4 tests: return in;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
in;
executed 158 times by 4 tests: return in;
Executed by:
  • tst_QBitArray
  • tst_QDataStream
  • tst_QHeaderView
  • tst_QVariant
158
183}-
184-
185-
186-
187QDebug operator<<(QDebug dbg, const QBitArray &array)-
188{-
189 QDebugStateSaver saver(dbg);-
190 dbg.nospace() << "QBitArray(";-
191 for (int i = 0; i < array.size()
i < array.size()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QVariant
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QVariant
;) {
2-3
192 if (array.testBit(i)
array.testBit(i)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QVariant
FALSEnever evaluated
)
0-3
193 dbg << '1';
executed 3 times by 1 test: dbg << '1';
Executed by:
  • tst_QVariant
3
194 else-
195 dbg << '0';
never executed: dbg << '0';
0
196 i += 1;-
197 if (!(i % 4)
!(i % 4)Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QVariant
&& (
(i < array.size())Description
TRUEnever evaluated
FALSEnever evaluated
i < array.size())
(i < array.size())Description
TRUEnever evaluated
FALSEnever evaluated
)
0-3
198 dbg << ' ';
never executed: dbg << ' ';
0
199 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QVariant
3
200 dbg << ')';-
201 return
executed 2 times by 1 test: return dbg;
Executed by:
  • tst_QVariant
dbg;
executed 2 times by 1 test: return dbg;
Executed by:
  • tst_QVariant
2
202}-
203-
Switch to Source codePreprocessed file

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