| 5 | #include <sys/mman.h> |
| 6 | |
| 7 | static bool check_batch(char *p, unsigned int num, bool expect) |
| 8 | { |
| 9 | struct ptr_valid_batch batch; |
| 10 | unsigned int i; |
| 11 | |
| 12 | if (!ptr_valid_batch_start(&batch)) |
| 13 | return false; |
| 14 | for (i = 0; i < num; i++) { |
| 15 | if (ptr_valid_batch(&batch, p + i, 1, 1, false) != expect) |
| 16 | return false; |
| 17 | if (ptr_valid_batch(&batch, p + i, 1, 1, true) != expect) |
| 18 | return false; |
| 19 | } |
| 20 | ptr_valid_batch_end(&batch); |
| 21 | return true; |
| 22 | } |
| 23 | |
| 24 | int main(void) |
| 25 | { |
no test coverage detected