| 464 | } |
| 465 | |
| 466 | void TestRleBitPackedParserError(std::span<const uint8_t> bytes, rle_size_t bit_width) { |
| 467 | auto parser = |
| 468 | RleBitPackedParser(bytes.data(), static_cast<rle_size_t>(bytes.size()), bit_width); |
| 469 | EXPECT_FALSE(parser.exhausted()); |
| 470 | |
| 471 | struct { |
| 472 | auto OnRleRun(RleRun run) { return RleBitPackedParser::ControlFlow::Continue; } |
| 473 | auto OnBitPackedRun(BitPackedRun run) { |
| 474 | return RleBitPackedParser::ControlFlow::Continue; |
| 475 | } |
| 476 | } handler; |
| 477 | |
| 478 | // Iterate over all runs |
| 479 | parser.Parse(handler); |
| 480 | // Non-exhaustion despite ControlFlow::Continue signals an error occurred. |
| 481 | EXPECT_FALSE(parser.exhausted()); |
| 482 | } |
| 483 | |
| 484 | void TestRleBitPackedParserError(const std::vector<uint8_t>& bytes, |
| 485 | rle_size_t bit_width) { |