Norman James | 6a58a27 | 2015-10-07 14:34:16 -0500 | [diff] [blame] | 1 | #include <ccan/check_type/check_type.h>
|
| 2 | #include <ccan/tap/tap.h>
|
| 3 |
|
| 4 | int main(int argc, char *argv[])
|
| 5 | {
|
| 6 | int x = 0, y = 0;
|
| 7 |
|
| 8 | plan_tests(9);
|
| 9 |
|
| 10 | ok1(check_type(argc, int) == 0);
|
| 11 | ok1(check_type(&argc, int *) == 0);
|
| 12 | ok1(check_types_match(argc, argc) == 0);
|
| 13 | ok1(check_types_match(argc, x) == 0);
|
| 14 | ok1(check_types_match(&argc, &x) == 0);
|
| 15 |
|
| 16 | ok1(check_type(x++, int) == 0);
|
| 17 | ok(x == 0, "check_type does not evaluate expression");
|
| 18 | ok1(check_types_match(x++, y++) == 0);
|
| 19 | ok(x == 0 && y == 0, "check_types_match does not evaluate expressions");
|
| 20 |
|
| 21 | return exit_status();
|
| 22 | }
|