| 394 | } |
| 395 | |
| 396 | void AppendBitPackedRun(std::vector<uint8_t>& bytes, std::vector<bool>& expected, |
| 397 | const std::vector<uint8_t>& packed) { |
| 398 | const auto groups = static_cast<rle_size_t>(packed.size()); |
| 399 | AppendLeb128(bytes, (static_cast<uint32_t>(groups) << 1) | 1); // low bit 1 => packed |
| 400 | bytes.insert(bytes.end(), packed.begin(), packed.end()); |
| 401 | for (rle_size_t i = 0; i < groups * 8; ++i) { |
| 402 | expected.push_back(bit_util::GetBit(packed.data(), i)); |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | /// Decode the whole `bytes` into a bitmap and check it against `expected`. |
| 407 | /// |