Home | History | Annotate | Download | only in runtime

Lines Matching refs:BitString

24 constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity];
25 constexpr size_t BitString::kCapacity;
32 // so they are not in the main BitString class.
33 std::string Stringify(BitString bit_string) {
40 return BitStringChar(val, BitString::MaybeGetBitLengthAtPosition(idx));
47 BitString MakeBitString(std::initializer_list<size_t> values = {}) {
48 CHECK_GE(BitString::kCapacity, values.size());
50 BitString bs{};
68 // Make max bistring, e.g. BitString[4095,15,2047] for {12,4,11}
69 template <size_t kCount = BitString::kCapacity>
70 BitString MakeBitStringMax() {
71 BitString bs{};
75 MakeBitStringChar(i, MaxInt<BitStringChar::StorageType>(BitString::kBitSizeAtPosition[i])));
81 BitString SetBitStringCharAt(BitString bit_string, size_t i, size_t val) {
82 BitString bs = bit_string;
96 static SubtypeCheckInfo MakeSubtypeCheckInfo(BitString path_to_root = {},
105 static SubtypeCheckInfo MakeSubtypeCheckInfoInfused(BitString bs = {},
116 static SubtypeCheckInfo MakeSubtypeCheckInfoUnchecked(BitString bs = {},
128 static BitString GetPathToRoot(SubtypeCheckInfo io) {
155 // This test relies on BitString being at least 3 large.
157 ASSERT_LE(3u, BitString::kCapacity);
168 GetExpectedMessageForDeathTest("Bitstring too long for depth"));
209 // Test edge conditions: depth == BitString::kCapacity (No Next value).
214 /*depth*/BitString::kCapacity).GetState());
216 MakeSubtypeCheckInfo(/*path*/MakeBitStringMax<BitString::kCapacity - 1u>(),
219 /*depth*/BitString::kCapacity).GetState());
220 // Test edge conditions: depth > BitString::kCapacity (Must overflow).
225 /*depth*/BitString::kCapacity + 1u).GetState());
229 // Validate "Next" is correctly aliased as the Bitstring[Depth] character.
242 // Test edge conditions: depth == BitString::kCapacity (No Next value).
243 EXPECT_FALSE(HasNext(MakeSubtypeCheckInfoUnchecked(MakeBitStringMax<BitString::kCapacity>(),
245 /*depth*/BitString::kCapacity)));
246 // Anything with depth >= BitString::kCapacity has no next value.
247 EXPECT_FALSE(HasNext(MakeSubtypeCheckInfoUnchecked(MakeBitStringMax<BitString::kCapacity>(),
249 /*depth*/BitString::kCapacity + 1u)));
255 template <size_t kPos = BitString::kCapacity>
256 size_t LenForPos() { return BitString::GetBitLengthTotalAtPosition(kPos); }
259 using StorageType = BitString::StorageType;
265 /*depth*/BitString::kCapacity);
266 // 0b000...111 where LSB == 1, and trailing 1s = the maximum bitstring representation.
271 ASSERT_EQ(3u, BitString::kCapacity);
272 ASSERT_EQ(12u, BitString::kBitSizeAtPosition[0]);
273 ASSERT_EQ(4u, BitString::kBitSizeAtPosition[1]);
274 ASSERT_EQ(11u, BitString::kBitSizeAtPosition[2]);
279 /*depth*/BitString::kCapacity);
283 ((pos1) << BitString::kBitSizeAtPosition[0]) | \
284 ((pos2) << (BitString::kBitSizeAtPosition[0] + BitString::kBitSizeAtPosition[1])))
286 EXPECT_EQ(MAKE_ENCODED_PATH(MaxInt<BitString::StorageType>(12), 0b1111, 0b0),
288 EXPECT_EQ(MAKE_ENCODED_PATH(MaxInt<BitString::StorageType>(12), 0b1111, 0b11111111111),
294 /*depth*/BitString::kCapacity - 1u);
296 EXPECT_EQ(MAKE_ENCODED_PATH(MaxInt<BitString::StorageType>(12), 0b1111, 0b0),
298 EXPECT_EQ(MAKE_ENCODED_PATH(MaxInt<BitString::StorageType>(12), 0b1111, 0b0),
304 /*depth*/BitString::kCapacity - 2u);
307 EXPECT_EQ(MAKE_ENCODED_PATH(MaxInt<BitString::StorageType>(12), 0b0000, 0b0),
371 BitString::kCapacity) {
392 if (cur_next == MaxInt<BitString::StorageType>(BitString::kBitSizeAtPosition[0u])) {