summaryrefslogtreecommitdiff
path: root/minix/tests/test45.c
blob: c12513c757c264aa75c09ef76b06997b10c948fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wtautological-compare"
#endif

int max_error = 4;
#include "common.h"


/* test strtol */
#define	TYPE        long
#define	TYPEU       unsigned long
#define	TYPE_FUNC	strtol
#include "test45.h"
#undef	TYPE
#undef	TYPEU
#undef	TYPE_FUNC

/* test strtoul */
#define	TYPE        unsigned long
#define	TYPEU       unsigned long
#define	TYPE_FUNC	strtoul
#include "test45.h"
#undef	TYPE
#undef	TYPEU
#undef	TYPE_FUNC

/* test strtoll */
#define	TYPE        long long
#define	TYPEU       unsigned long long
#define	TYPE_FUNC	strtoll
#include "test45.h"
#undef	TYPE
#undef	TYPEU
#undef	TYPE_FUNC

/* test strtoull */
#define	TYPE        long long
#define	TYPEU       unsigned long long
#define	TYPE_FUNC	strtoull
#include "test45.h"
#undef	TYPE
#undef	TYPEU
#undef	TYPE_FUNC

int main(int argc, char **argv)
{
	start(45);

	/* run long/unsigned long tests */
	test_strtol();
	test_strtoul();

	/* run long long/unsigned long long tests */
	test_strtoll();
	test_strtoull();

	quit();
	return -1; /* never happens */
}