| 277 | class TestSetBitRunReader : public ::testing::Test { |
| 278 | public: |
| 279 | std::vector<SetBitRun> ReferenceBitRuns(const uint8_t* data, int64_t start_offset, |
| 280 | int64_t length) { |
| 281 | std::vector<SetBitRun> runs; |
| 282 | BitRunReaderLinear reader(data, start_offset, length); |
| 283 | int64_t position = 0; |
| 284 | while (position < length) { |
| 285 | const auto br = reader.NextRun(); |
| 286 | if (br.set) { |
| 287 | runs.push_back({position, br.length}); |
| 288 | } |
| 289 | position += br.length; |
| 290 | } |
| 291 | return runs; |
| 292 | } |
| 293 | |
| 294 | template <typename SetBitRunReaderType> |
| 295 | std::vector<SetBitRun> AllBitRuns(SetBitRunReaderType* reader) { |