Lines Matching refs:BitString
24 constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity];
25 constexpr size_t BitString::kCapacity;
33 std::string Stringify(BitString bit_string) { in Stringify()
40 return BitStringChar(val, BitString::MaybeGetBitLengthAtPosition(idx)); in MakeBitStringChar()
47 BitString MakeBitString(std::initializer_list<size_t> values = {}) { in MakeBitString()
48 CHECK_GE(BitString::kCapacity, values.size());
50 BitString bs{};
69 template <size_t kCount = BitString::kCapacity>
70 BitString MakeBitStringMax() { in MakeBitStringMax()
71 BitString bs{}; in MakeBitStringMax()
75 … MakeBitStringChar(i, MaxInt<BitStringChar::StorageType>(BitString::kBitSizeAtPosition[i]))); in MakeBitStringMax()
81 BitString SetBitStringCharAt(BitString bit_string, size_t i, size_t val) { in SetBitStringCharAt()
82 BitString bs = bit_string; in SetBitStringCharAt()
92 ASSERT_LE(3u, BitString::kCapacity); in TEST()
94 EXPECT_EQ(0u, BitString::GetLsbForPosition(0u)); in TEST()
95 EXPECT_EQ(BitString::kBitSizeAtPosition[0u], BitString::GetLsbForPosition(1u)); in TEST()
96 EXPECT_EQ(BitString::kBitSizeAtPosition[0u] + BitString::kBitSizeAtPosition[1u], in TEST()
97 BitString::GetLsbForPosition(2u)); in TEST()
107 BitString bs = MakeBitString(); in TEST()
110 ASSERT_EQ(BitString::kCapacity, 3u); in TEST()
134 ASSERT_EQ(MinimumBitsToStore(max_bitstring_ints[i]), BitString::kBitSizeAtPosition[i]) << i; in TEST()
137 BitString bs_max = MakeBitStringMax(); in TEST()
143 EXPECT_EQ(MaskLeastSignificant(BitString::GetBitLengthTotalAtPosition(BitString::kCapacity)), in TEST()
149 return MaxInt<BitString::StorageType>(BitString::kBitSizeAtPosition[kPos]); in MaxForPos()
154 BitString bs = MakeBitString({MaxForPos<0>(), MaxForPos<1>()}); in TEST()
155 BitString::StorageType as_int = static_cast<BitString::StorageType>(bs); in TEST()
158 ASSERT_LE(3u, BitString::kCapacity); in TEST()
159 EXPECT_EQ((MaxForPos<0>() << 0) | (MaxForPos<1>() << BitString::kBitSizeAtPosition[0]), in TEST()