source: trunk/libs/newlib/src/newlib/libm/test/test.h @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 2.1 KB
Line 
1#define HAVE_FLOAT 1
2#define X(x) (char *)x
3
4#include <_ansi.h>
5#include <math.h>
6#include <float.h>
7#include <ieeefp.h>
8#include <stdio.h>
9
10void checkf();
11void enter();
12
13
14double translate_from();
15
16typedef struct 
17{
18  long msw, lsw;
19} question_struct_type;
20
21
22typedef struct 
23{
24  char error_bit;
25  char errno_val;
26  char merror;
27  int line;
28 
29  question_struct_type qs[3];
30} one_line_type;
31
32
33#define MVEC_START(x) one_line_type x[] =  {
34#define MVEC_END    0,};
35
36
37int mag_of_error (double, double);
38
39
40#define ERROR_PERFECT 20
41#define ERROR_FAIL -1
42
43#define AAAA 15
44#define AAA 10
45#define AA  6
46#define A   5
47#define B   3
48#define C   1
49#define VECOPEN(x,f) \
50{\
51  char buffer[100];\
52   sprintf(buffer,"%s_vec.c",x);\
53    f = fopen(buffer,"w");\
54     fprintf(f,"#include \"test.h\"\n");\
55      fprintf(f," one_line_type %s_vec[] = {\n", x);\
56}
57
58#define VECCLOSE(f,name,args)\
59{\
60  fprintf(f,"0,};\n");      \
61   fprintf(f,"test_%s(m)   {run_vector_1(m,%s_vec,(char *)(%s),\"%s\",\"%s\");   }      \n",\
62           name,\
63           name,name,name,args);\
64            fclose(f);\
65}
66
67
68
69typedef struct 
70{
71  int line;
72 
73  char *string;
74  double value;
75  int endscan;
76} double_type;
77
78
79typedef struct {
80  long int value;
81  char end;
82  char errno_val;
83} int_scan_type;
84
85typedef struct 
86{
87  int line;
88  int_scan_type octal;
89  int_scan_type decimal;
90  int_scan_type hex;
91  int_scan_type normal;
92  int_scan_type alphabetical;
93  char *string;
94} int_type;
95
96
97typedef struct 
98{
99  int line;
100  double value;
101  char *estring;
102  int e1;
103  int e2;
104  int e3;
105  char *fstring;
106  int f1;
107  int f2;
108  int f3;
109  char *gstring;
110  int g1;
111} ddouble_type;
112
113typedef struct
114{
115  int line;
116  double value;
117  char *result;
118  char *format_string;
119} sprint_double_type;
120
121
122typedef struct
123{
124  int line;
125  int value;
126  char *result;
127  char *format_string;
128} sprint_int_type;
129
130
131void test_ieee (void);
132void test_math2 (void);
133void test_math (void);
134void test_string (void);
135void test_is (void);
136void test_cvt (void);
137
138void line (int);
139
140void test_mok (double, double, int);
141void test_iok (int, int);
142void test_eok (int, int);
143void test_sok (char *, char*);
144void test_scok (char *, char*, int);
145void newfunc (const char *);
Note: See TracBrowser for help on using the repository browser.