xref: /minix3/minix/tests/test45.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #include <errno.h>
2 #include <stdint.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <unistd.h>
6 
7 #if defined(__clang__)
8 #pragma clang diagnostic ignored "-Wtautological-compare"
9 #endif
10 
11 int max_error = 4;
12 #include "common.h"
13 
14 
15 /* test strtol */
16 #define	TYPE        long
17 #define	TYPEU       unsigned long
18 #define	TYPE_FUNC	strtol
19 #include "test45.h"
20 #undef	TYPE
21 #undef	TYPEU
22 #undef	TYPE_FUNC
23 
24 /* test strtoul */
25 #define	TYPE        unsigned long
26 #define	TYPEU       unsigned long
27 #define	TYPE_FUNC	strtoul
28 #include "test45.h"
29 #undef	TYPE
30 #undef	TYPEU
31 #undef	TYPE_FUNC
32 
33 /* test strtoll */
34 #define	TYPE        long long
35 #define	TYPEU       unsigned long long
36 #define	TYPE_FUNC	strtoll
37 #include "test45.h"
38 #undef	TYPE
39 #undef	TYPEU
40 #undef	TYPE_FUNC
41 
42 /* test strtoull */
43 #define	TYPE        long long
44 #define	TYPEU       unsigned long long
45 #define	TYPE_FUNC	strtoull
46 #include "test45.h"
47 #undef	TYPE
48 #undef	TYPEU
49 #undef	TYPE_FUNC
50 
main(int argc,char ** argv)51 int main(int argc, char **argv)
52 {
53 	start(45);
54 
55 	/* run long/unsigned long tests */
56 	test_strtol();
57 	test_strtoul();
58 
59 	/* run long long/unsigned long long tests */
60 	test_strtoll();
61 	test_strtoull();
62 
63 	quit();
64 	return -1; /* never happens */
65 }
66