| 10 | }; |
| 11 | |
| 12 | int main(void) |
| 13 | { |
| 14 | int i; |
| 15 | |
| 16 | /* This is how many tests you plan to run */ |
| 17 | plan_tests(2 * ARRAY_SIZE(testvals)); |
| 18 | |
| 19 | for (i = 0; i < ARRAY_SIZE(testvals); i++) { |
| 20 | ptrdiff_t val = testvals[i]; |
| 21 | void *ptr = int2ptr(val); |
| 22 | |
| 23 | ok1(ptr2int(ptr) == val); |
| 24 | ok1(!val == !ptr); |
| 25 | } |
| 26 | |
| 27 | /* This exits depending on whether all tests passed */ |
| 28 | return exit_status(); |
| 29 | } |