Run the decode check over a battery of chunk sizes and output offsets.
| 453 | |
| 454 | /// Run the decode check over a battery of chunk sizes and output offsets. |
| 455 | void CheckRleBitPackedToBitmap(const std::vector<uint8_t>& bytes, |
| 456 | const std::vector<bool>& expected) { |
| 457 | const auto n_vals = static_cast<rle_size_t>(expected.size()); |
| 458 | ASSERT_GT(n_vals, 0); |
| 459 | for (const rle_size_t chunk_size : |
| 460 | {rle_size_t{1}, rle_size_t{3}, rle_size_t{7}, rle_size_t{8}, rle_size_t{9}, |
| 461 | rle_size_t{33}, n_vals, n_vals + 1}) { |
| 462 | CheckRleBitPackedDecode(bytes, expected, chunk_size); |
| 463 | // A non-zero output offset forces the first run to start at a non-byte |
| 464 | // aligned output position. |
| 465 | for (rle_size_t out_offset = 1; out_offset < 8; ++out_offset) { |
| 466 | CheckRleBitPackedDecode(bytes, expected, chunk_size, out_offset); |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | } // namespace |
| 472 |
no test coverage detected