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