MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/common/base/tests/BitUtilTest.cpp:115–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 return count;
114}
115
116TEST_F(BitUtilTest, countBits) {
117 uint64_t data[] = {
118 0xff00ff00ffff00ff,
119 0x0f0f0f0f0f0f0f0f,
120 0xfedcba9876543210,
121 0xf0f0f0f0f0f0f0f0,
122 0x0123456789abcdef};
123 // We drop one high bit and one low bit on every round.
124 int32_t totalBits = sizeof(data) * 8;
125 for (int32_t i = 0; i < 10 + (totalBits / 2); ++i) {
126 EXPECT_EQ(
127 countBits(data, i, totalBits - i),
128 simpleCountBits(data, i, totalBits - i));
129 }
130}
131
132TEST_F(BitUtilTest, reverseBits) {

Callers

nothing calls this directly

Calls 15

simpleCountBitsFunction · 0.85
randFunction · 0.85
memcpyFunction · 0.85
reverseBitsFunction · 0.85
fillBitsFunction · 0.85
findFirstBitFunction · 0.85
findLastBitFunction · 0.85
findLastUnsetBitFunction · 0.85
clearBitFunction · 0.85
nbytesFunction · 0.85
nwordsFunction · 0.85
isBitSetFunction · 0.85

Tested by

no test coverage detected