| 83 | /* AUTOGENERATED MOCKS END */ |
| 84 | |
| 85 | static void test_block_range(struct seeker *seeker, |
| 86 | u32 blockheight, |
| 87 | u32 first, u32 last, |
| 88 | ...) |
| 89 | { |
| 90 | int start, end, num; |
| 91 | u32 first_blocknum, number_of_blocks; |
| 92 | va_list ap; |
| 93 | |
| 94 | seeker->daemon->current_blockheight = blockheight; |
| 95 | seeker->scid_probe_start = first; |
| 96 | seeker->scid_probe_end = last; |
| 97 | |
| 98 | num = last - first + 1; |
| 99 | va_start(ap, last); |
| 100 | while ((start = va_arg(ap, int)) != -1) { |
| 101 | end = va_arg(ap, int); |
| 102 | if (!next_block_range(seeker, num, |
| 103 | &first_blocknum, &number_of_blocks)) |
| 104 | abort(); |
| 105 | if (first_blocknum != start |
| 106 | || number_of_blocks != end - start + 1) { |
| 107 | errx(1, "Expected %u-%u but got %u-%u", |
| 108 | start, end, |
| 109 | first_blocknum, first_blocknum+number_of_blocks-1); |
| 110 | } |
| 111 | num = end - start + 1; |
| 112 | } |
| 113 | if (next_block_range(seeker, num, &first_blocknum, &number_of_blocks)) |
| 114 | abort(); |
| 115 | va_end(ap); |
| 116 | } |
| 117 | |
| 118 | int main(int argc, char *argv[]) |
| 119 | { |
no test coverage detected