summaryrefslogtreecommitdiffstats
path: root/testutil/perror-bad.c
diff options
context:
space:
mode:
Diffstat (limited to 'testutil/perror-bad.c')
-rw-r--r--testutil/perror-bad.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/testutil/perror-bad.c b/testutil/perror-bad.c
new file mode 100644
index 0000000..55d36d3
--- /dev/null
+++ b/testutil/perror-bad.c
@@ -0,0 +1,23 @@
+/* See LICENSE file for copyright and license details. */
+#include "../libsyscalls.h"
+
+#include <stddef.h>
+#include <stdio.h>
+
+
+int
+main(int argc, char *argv[])
+{
+ size_t count;
+
+ (void) argc;
+
+#define X(...) 1
+ count = (LIBSYSCALLS_LIST_ERRORS(X, +));
+#undef X
+
+ libsyscalls_perror(argv[1], (enum libsyscalls_error)-1);
+ libsyscalls_perror(argv[1], (enum libsyscalls_error)count);
+
+ return fflush(stderr) || fclose(stderr);
+}