| 490 | } |
| 491 | |
| 492 | void TestRleBitPackedParserError(std::span<const uint8_t> bytes, rle_size_t bit_width) { |
| 493 | auto parser = |
| 494 | RleBitPackedParser(bytes.data(), static_cast<rle_size_t>(bytes.size()), bit_width); |
| 495 | EXPECT_FALSE(parser.exhausted()); |
| 496 | |
| 497 | struct { |
| 498 | auto OnRleRun(RleRun run) { return RleBitPackedParser::ControlFlow::Continue; } |
| 499 | auto OnBitPackedRun(BitPackedRun run) { |
| 500 | return RleBitPackedParser::ControlFlow::Continue; |
| 501 | } |
| 502 | } handler; |
| 503 | |
| 504 | // Iterate over all runs |
| 505 | parser.Parse(handler); |
| 506 | // Non-exhaustion despite ControlFlow::Continue signals an error occurred. |
| 507 | EXPECT_FALSE(parser.exhausted()); |
| 508 | } |
| 509 | |
| 510 | void TestRleBitPackedParserError(const std::vector<uint8_t>& bytes, |
| 511 | rle_size_t bit_width) { |