3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #if (!GSL_RANGE_CHECK) && defined(HAVE_INLINE)
23 #undef GSL_RANGE_CHECK
24 #define GSL_RANGE_CHECK 1
30 #include <gsl/gsl_math.h>
31 #include <gsl/gsl_vector.h>
32 #include <gsl/gsl_test.h>
33 #include <gsl/gsl_ieee_utils.h>
42 #define BASE_GSL_COMPLEX_LONG
43 #include "templates_on.h"
44 #include "test_complex_source.c"
45 #include "templates_off.h"
46 #undef BASE_GSL_COMPLEX_LONG
49 #define BASE_GSL_COMPLEX
50 #include "templates_on.h"
51 #include "test_complex_source.c"
52 #include "templates_off.h"
53 #undef BASE_GSL_COMPLEX
55 #define BASE_GSL_COMPLEX_FLOAT
56 #include "templates_on.h"
57 #include "test_complex_source.c"
58 #include "templates_off.h"
59 #undef BASE_GSL_COMPLEX_FLOAT
61 #define BASE_LONG_DOUBLE
62 #include "templates_on.h"
63 #include "test_source.c"
64 #include "templates_off.h"
65 #undef BASE_LONG_DOUBLE
68 #include "templates_on.h"
69 #include "test_source.c"
70 #include "templates_off.h"
74 #include "templates_on.h"
75 #include "test_source.c"
76 #include "templates_off.h"
80 #include "templates_on.h"
81 #include "test_source.c"
82 #include "templates_off.h"
86 #include "templates_on.h"
87 #include "test_source.c"
88 #include "templates_off.h"
92 #include "templates_on.h"
93 #include "test_source.c"
94 #include "templates_off.h"
98 #include "templates_on.h"
99 #include "test_source.c"
100 #include "templates_off.h"
104 #include "templates_on.h"
105 #include "test_source.c"
106 #include "templates_off.h"
110 #include "templates_on.h"
111 #include "test_source.c"
112 #include "templates_off.h"
116 #include "templates_on.h"
117 #include "test_source.c"
118 #include "templates_off.h"
122 #include "templates_on.h"
123 #include "test_source.c"
124 #include "templates_off.h"
127 void my_error_handler (const char *reason, const char *file,
133 size_t stride, ostride, N;
135 gsl_ieee_env_setup ();
137 for (N = 10; N < 1024; N = 2*N + 1)
139 for (stride = 1; stride < 5 ; stride++)
141 test_func (stride, N);
142 test_float_func (stride, N);
143 test_long_double_func (stride, N);
144 test_ulong_func (stride, N);
145 test_long_func (stride, N);
146 test_uint_func (stride, N);
147 test_int_func (stride, N);
148 test_ushort_func (stride, N);
149 test_short_func (stride, N);
150 test_uchar_func (stride, N);
151 test_char_func (stride, N);
153 test_complex_func (stride, N);
154 test_complex_float_func (stride, N);
155 test_complex_long_double_func (stride, N);
157 for (ostride = 1; ostride < 5 ; ostride++)
159 test_ops (stride, ostride, N);
160 test_float_ops (stride, ostride, N);
161 test_long_double_ops (stride, ostride, N);
162 test_ulong_ops (stride, ostride, N);
163 test_long_ops (stride, ostride, N);
164 test_uint_ops (stride, ostride, N);
165 test_int_ops (stride, ostride, N);
166 test_ushort_ops (stride, ostride, N);
167 test_short_ops (stride, ostride, N);
168 test_uchar_ops (stride, ostride, N);
169 test_char_ops (stride, ostride, N);
172 test_text (stride, N);
173 test_float_text (stride, N);
174 #if HAVE_PRINTF_LONGDOUBLE
175 test_long_double_text (stride, N);
177 test_ulong_text (stride, N);
178 test_long_text (stride, N);
179 test_uint_text (stride, N);
180 test_int_text (stride, N);
181 test_ushort_text (stride, N);
182 test_short_text (stride, N);
183 test_uchar_text (stride, N);
184 test_char_text (stride, N);
186 test_complex_text (stride, N);
187 test_complex_float_text (stride, N);
188 #if HAVE_PRINTF_LONGDOUBLE
189 test_complex_long_double_text (stride, N);
192 test_file (stride, N);
193 test_float_file (stride, N);
194 test_long_double_file (stride, N);
195 test_ulong_file (stride, N);
196 test_long_file (stride, N);
197 test_uint_file (stride, N);
198 test_int_file (stride, N);
199 test_ushort_file (stride, N);
200 test_short_file (stride, N);
201 test_uchar_file (stride, N);
202 test_char_file (stride, N);
203 test_complex_file (stride, N);
204 test_complex_float_file (stride, N);
205 test_complex_long_double_file (stride, N);
210 gsl_set_error_handler (&my_error_handler);
212 for (N = 1; N < 1024; N *=2)
214 for (stride = 1; stride < 5 ; stride++)
216 test_trap (stride, N);
217 test_float_trap (stride, N);
218 test_long_double_trap (stride, N);
219 test_ulong_trap (stride, N);
220 test_long_trap (stride, N);
221 test_uint_trap (stride, N);
222 test_int_trap (stride, N);
223 test_ushort_trap (stride, N);
224 test_short_trap (stride, N);
225 test_uchar_trap (stride, N);
226 test_char_trap (stride, N);
227 test_complex_trap (stride, N);
228 test_complex_float_trap (stride, N);
229 test_complex_long_double_trap (stride, N);
234 exit (gsl_test_summary ());
238 my_error_handler (const char *reason, const char *file, int line, int err)
241 printf ("(caught [%s:%d: %s (%d)])\n", file, line, reason, err);