summaryrefslogtreecommitdiffstats
path: root/testutil/perror-all.c
diff options
context:
space:
mode:
Diffstat (limited to 'testutil/perror-all.c')
-rw-r--r--testutil/perror-all.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/testutil/perror-all.c b/testutil/perror-all.c
new file mode 100644
index 0000000..2b37cff
--- /dev/null
+++ b/testutil/perror-all.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 i, count;
+
+ (void) argc;
+
+#define X(...) 1
+ count = (LIBSYSCALLS_LIST_ERRORS(X, +));
+#undef X
+
+ for (i = 0; i < count; i++)
+ libsyscalls_perror(argv[1], (enum libsyscalls_error)i);
+
+ return fflush(stderr) || fclose(stderr);
+}