Lines Matching refs:bv

28   BitVector bv(kBits, false, Allocator::GetMallocAllocator());  in TEST()  local
29 EXPECT_EQ(1U, bv.GetStorageSize()); in TEST()
30 EXPECT_EQ(sizeof(uint32_t), bv.GetSizeOf()); in TEST()
31 EXPECT_FALSE(bv.IsExpandable()); in TEST()
33 EXPECT_EQ(0U, bv.NumSetBits()); in TEST()
34 EXPECT_EQ(0U, bv.NumSetBits(1)); in TEST()
35 EXPECT_EQ(0U, bv.NumSetBits(kBits)); in TEST()
37 EXPECT_FALSE(bv.IsBitSet(i)); in TEST()
39 EXPECT_EQ(0U, bv.GetRawStorageWord(0)); in TEST()
40 EXPECT_EQ(0U, *bv.GetRawStorage()); in TEST()
42 EXPECT_TRUE(bv.Indexes().begin().Done()); in TEST()
43 EXPECT_TRUE(bv.Indexes().begin() == bv.Indexes().end()); in TEST()
45 bv.SetBit(0); in TEST()
46 bv.SetBit(kBits - 1); in TEST()
47 EXPECT_EQ(2U, bv.NumSetBits()); in TEST()
48 EXPECT_EQ(1U, bv.NumSetBits(1)); in TEST()
49 EXPECT_EQ(2U, bv.NumSetBits(kBits)); in TEST()
50 EXPECT_TRUE(bv.IsBitSet(0)); in TEST()
52 EXPECT_FALSE(bv.IsBitSet(i)); in TEST()
54 EXPECT_TRUE(bv.IsBitSet(kBits - 1)); in TEST()
55 EXPECT_EQ(0x80000001U, bv.GetRawStorageWord(0)); in TEST()
56 EXPECT_EQ(0x80000001U, *bv.GetRawStorage()); in TEST()
58 BitVector::IndexIterator iterator = bv.Indexes().begin(); in TEST()
59 EXPECT_TRUE(iterator != bv.Indexes().end()); in TEST()
62 EXPECT_TRUE(iterator != bv.Indexes().end()); in TEST()
65 EXPECT_TRUE(iterator == bv.Indexes().end()); in TEST()
74 BitVector bv(false, Allocator::GetNoopAllocator(), kWords, bits); in TEST() local
75 EXPECT_EQ(kWords, bv.GetStorageSize()); in TEST()
76 EXPECT_EQ(kWords * sizeof(uint32_t), bv.GetSizeOf()); in TEST()
77 EXPECT_EQ(bits, bv.GetRawStorage()); in TEST()
78 EXPECT_EQ(0U, bv.NumSetBits()); in TEST()
80 bv.SetBit(8); in TEST()
81 EXPECT_EQ(1U, bv.NumSetBits()); in TEST()
82 EXPECT_EQ(0x00000100U, bv.GetRawStorageWord(0)); in TEST()
83 EXPECT_EQ(0x00000000U, bv.GetRawStorageWord(1)); in TEST()
84 EXPECT_EQ(1U, bv.NumSetBits()); in TEST()
86 bv.SetBit(16); in TEST()
87 EXPECT_EQ(2U, bv.NumSetBits()); in TEST()
88 EXPECT_EQ(0x00010100U, bv.GetRawStorageWord(0)); in TEST()
89 EXPECT_EQ(0x00000000U, bv.GetRawStorageWord(1)); in TEST()
90 EXPECT_EQ(2U, bv.NumSetBits()); in TEST()
92 bv.SetBit(32); in TEST()
93 EXPECT_EQ(3U, bv.NumSetBits()); in TEST()
94 EXPECT_EQ(0x00010100U, bv.GetRawStorageWord(0)); in TEST()
95 EXPECT_EQ(0x00000001U, bv.GetRawStorageWord(1)); in TEST()
96 EXPECT_EQ(3U, bv.NumSetBits()); in TEST()
98 bv.SetBit(48); in TEST()
99 EXPECT_EQ(4U, bv.NumSetBits()); in TEST()
100 EXPECT_EQ(0x00010100U, bv.GetRawStorageWord(0)); in TEST()
101 EXPECT_EQ(0x00010001U, bv.GetRawStorageWord(1)); in TEST()
102 EXPECT_EQ(4U, bv.NumSetBits()); in TEST()
104 EXPECT_EQ(0U, bv.NumSetBits(1)); in TEST()
106 EXPECT_EQ(0U, bv.NumSetBits(8)); in TEST()
107 EXPECT_EQ(1U, bv.NumSetBits(9)); in TEST()
108 EXPECT_EQ(1U, bv.NumSetBits(10)); in TEST()
110 EXPECT_EQ(1U, bv.NumSetBits(16)); in TEST()
111 EXPECT_EQ(2U, bv.NumSetBits(17)); in TEST()
112 EXPECT_EQ(2U, bv.NumSetBits(18)); in TEST()
114 EXPECT_EQ(2U, bv.NumSetBits(32)); in TEST()
115 EXPECT_EQ(3U, bv.NumSetBits(33)); in TEST()
116 EXPECT_EQ(3U, bv.NumSetBits(34)); in TEST()
118 EXPECT_EQ(3U, bv.NumSetBits(48)); in TEST()
119 EXPECT_EQ(4U, bv.NumSetBits(49)); in TEST()
120 EXPECT_EQ(4U, bv.NumSetBits(50)); in TEST()
122 EXPECT_EQ(4U, bv.NumSetBits(64)); in TEST()
131 BitVector bv(false, Allocator::GetNoopAllocator(), kWords, bits); in TEST() local
132 bv.SetInitialBits(0u); in TEST()
133 EXPECT_EQ(0u, bv.NumSetBits()); in TEST()
134 bv.SetInitialBits(1u); in TEST()
135 EXPECT_EQ(1u, bv.NumSetBits()); in TEST()
136 bv.SetInitialBits(32u); in TEST()
137 EXPECT_EQ(32u, bv.NumSetBits()); in TEST()
138 bv.SetInitialBits(63u); in TEST()
139 EXPECT_EQ(63u, bv.NumSetBits()); in TEST()
140 bv.SetInitialBits(64u); in TEST()
141 EXPECT_EQ(64u, bv.NumSetBits()); in TEST()
217 BitVector bv(0, true, Allocator::GetMallocAllocator()); in TEST() local
220 bv.CopyTo(&buf, sizeof(buf)); in TEST()
221 EXPECT_EQ(0u, bv.GetSizeOf()); in TEST()
227 BitVector bv(0, true, Allocator::GetMallocAllocator()); in TEST() local
230 bv.SetBit(0); in TEST()
231 bv.SetBit(17); in TEST()
232 bv.SetBit(26); in TEST()
233 EXPECT_EQ(sizeof(buf), bv.GetSizeOf()); in TEST()
235 bv.CopyTo(&buf, sizeof(buf)); in TEST()
242 BitVector bv(0, true, Allocator::GetMallocAllocator()); in TEST() local
245 bv.SetBit(18); in TEST()
246 bv.SetBit(39); in TEST()
247 EXPECT_LT(sizeof(buf), bv.GetSizeOf()); in TEST()
249 bv.CopyTo(buf, sizeof(buf)); in TEST()
259 BitVector bv(0, true, Allocator::GetMallocAllocator()); in TEST() local
262 bv.SetBit(18); in TEST()
263 bv.SetBit(31); in TEST()
264 EXPECT_GT(sizeof(buf), bv.GetSizeOf()); in TEST()
266 bv.CopyTo(buf, sizeof(buf)); in TEST()