| 59 | /* AUTOGENERATED MOCKS END */ |
| 60 | |
| 61 | static void test_block_range(struct seeker *seeker, |
| 62 | u32 blockheight, |
| 63 | u32 first, u32 last, |
| 64 | ...) |
| 65 | { |
| 66 | int start, end, num; |
| 67 | u32 first_blocknum, number_of_blocks; |
| 68 | va_list ap; |
| 69 | |
| 70 | seeker->daemon->current_blockheight = blockheight; |
| 71 | seeker->scid_probe_start = first; |
| 72 | seeker->scid_probe_end = last; |
| 73 | |
| 74 | num = last - first + 1; |
| 75 | va_start(ap, last); |
| 76 | while ((start = va_arg(ap, int)) != -1) { |
| 77 | end = va_arg(ap, int); |
| 78 | if (!next_block_range(seeker, num, |
| 79 | &first_blocknum, &number_of_blocks)) |
| 80 | abort(); |
| 81 | if (first_blocknum != start |
| 82 | || number_of_blocks != end - start + 1) { |
| 83 | errx(1, "Expected %u-%u but got %u-%u", |
| 84 | start, end, |
| 85 | first_blocknum, first_blocknum+number_of_blocks-1); |
| 86 | } |
| 87 | num = end - start + 1; |
| 88 | } |
| 89 | if (next_block_range(seeker, num, &first_blocknum, &number_of_blocks)) |
| 90 | abort(); |
| 91 | va_end(ap); |
| 92 | } |
| 93 | |
| 94 | int main(int argc, char *argv[]) |
| 95 | { |
no test coverage detected