diff options
Diffstat (limited to 'testutil/strerror-bad.c')
-rw-r--r-- | testutil/strerror-bad.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testutil/strerror-bad.c b/testutil/strerror-bad.c new file mode 100644 index 0000000..23d8836 --- /dev/null +++ b/testutil/strerror-bad.c @@ -0,0 +1,25 @@ +/* See LICENSE file for copyright and license details. */ +#include "../libsyscalls.h" + +#include <stddef.h> +#include <stdio.h> + + +int +main(void) +{ + size_t count; + +#define X(...) 1 + count = (LIBSYSCALLS_LIST_ERRORS(X, +)); +#undef X + + printf("%s\n", libsyscalls_strerror((enum libsyscalls_error)-1)); + printf("%s\n", libsyscalls_strerror((enum libsyscalls_error)count)); + + if (fflush(stdout) || fclose(stdout)) { + perror(NULL); + return 1; + } + return 0; +} |