summaryrefslogblamecommitdiffstats
path: root/testutil/strerror-bad.c
blob: 0436d294201fa87039f9a4c1f9c95a5ff398b10c (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                         
                           


                     






                                                 












                                                                            
/* 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) argv;

	if (argc != 1) {
		fprintf(stderr, "usage error\n");
		return 3;
	}

#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;
}