add swifi to the build/install.
[minix.git] / test / test45.c
blobc7a2f0837f23fd86a737faac923cc6b91f07aabc
1 #include <errno.h>
2 #include <stdint.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <unistd.h>
7 #define MAX_ERROR 4
8 static int errct;
10 /* test strtol */
11 #define TYPE long
12 #define TYPEU unsigned long
13 #define TYPE_FUNC strtol
14 #include "test45.h"
15 #undef TYPE
16 #undef TYPEU
17 #undef TYPE_FUNC
19 /* test strtoul */
20 #define TYPE unsigned long
21 #define TYPEU unsigned long
22 #define TYPE_FUNC strtoul
23 #include "test45.h"
24 #undef TYPE
25 #undef TYPEU
26 #undef TYPE_FUNC
28 #ifdef __LONG_LONG_SUPPORTED
30 /* test strtoll */
31 #define TYPE long long
32 #define TYPEU unsigned long long
33 #define TYPE_FUNC strtoll
34 #include "test45.h"
35 #undef TYPE
36 #undef TYPEU
37 #undef TYPE_FUNC
39 /* test strtoull */
40 #define TYPE long long
41 #define TYPEU unsigned long long
42 #define TYPE_FUNC strtoull
43 #include "test45.h"
44 #undef TYPE
45 #undef TYPEU
46 #undef TYPE_FUNC
48 #endif /* defined(__LONG_LONG_SUPPORTED) */
50 static void quit(void)
52 if (errct == 0)
54 printf("ok\n");
55 exit(0);
57 else
59 printf("%d errors\n", errct);
60 exit(1);
64 int main(int argc, char **argv)
66 #ifdef __LONG_LONG_SUPPORTED
67 printf("Test 45 (GCC) ");
68 #else
69 printf("Test 45 (ACK) ");
70 #endif
71 fflush(stdout);
73 /* run long/unsigned long tests */
74 test_strtol();
75 test_strtoul();
77 /* run long long/unsigned long long tests (GCC only) */
78 #ifdef __LONG_LONG_SUPPORTED
79 test_strtoll();
80 test_strtoull();
81 #endif /* defined(__LONG_LONG_SUPPORTED) */
83 quit();
84 return -1; /* never happens */