| 333 | } |
| 334 | |
| 335 | void AssertVisitTwoBitRuns(const uint8_t* left_data, int64_t left_offset, |
| 336 | const uint8_t* right_data, int64_t right_offset, |
| 337 | int64_t length, |
| 338 | const std::vector<int64_t>& expected_positions, |
| 339 | const std::vector<BitRun>& expected_runs, |
| 340 | const std::vector<SetBitRun>& expected_set_runs) { |
| 341 | std::vector<int64_t> positions; |
| 342 | std::vector<BitRun> runs; |
| 343 | ASSERT_OK(VisitTwoBitRuns(left_data, left_offset, right_data, right_offset, length, |
| 344 | [&](int64_t position, int64_t run_length, bool set) { |
| 345 | positions.push_back(position); |
| 346 | runs.push_back({run_length, set}); |
| 347 | return Status::OK(); |
| 348 | })); |
| 349 | ASSERT_THAT(positions, ElementsAreArray(expected_positions)); |
| 350 | ASSERT_THAT(runs, ElementsAreArray(expected_runs)); |
| 351 | |
| 352 | positions.clear(); |
| 353 | runs.clear(); |
| 354 | VisitTwoBitRunsVoid(left_data, left_offset, right_data, right_offset, length, |
| 355 | [&](int64_t position, int64_t run_length, bool set) { |
| 356 | positions.push_back(position); |
| 357 | runs.push_back({run_length, set}); |
| 358 | }); |
| 359 | ASSERT_THAT(positions, ElementsAreArray(expected_positions)); |
| 360 | ASSERT_THAT(runs, ElementsAreArray(expected_runs)); |
| 361 | |
| 362 | std::vector<SetBitRun> set_runs; |
| 363 | ASSERT_OK(VisitTwoSetBitRuns(left_data, left_offset, right_data, right_offset, length, |
| 364 | [&](int64_t position, int64_t run_length) { |
| 365 | set_runs.push_back({position, run_length}); |
| 366 | return Status::OK(); |
| 367 | })); |
| 368 | ASSERT_THAT(set_runs, ElementsAreArray(expected_set_runs)); |
| 369 | |
| 370 | set_runs.clear(); |
| 371 | VisitTwoSetBitRunsVoid(left_data, left_offset, right_data, right_offset, length, |
| 372 | [&](int64_t position, int64_t run_length) { |
| 373 | set_runs.push_back({position, run_length}); |
| 374 | }); |
| 375 | ASSERT_THAT(set_runs, ElementsAreArray(expected_set_runs)); |
| 376 | } |
| 377 | |
| 378 | struct Range { |
| 379 | int64_t offset; |
nothing calls this directly
no test coverage detected