Skip to content

Commit ecca133

Browse files
committed
test: Handle 32-bit double in test-efcvt
Skip tests which require more than 32-bit float precision in this configuration. Signed-off-by: Keith Packard <[email protected]>
1 parent 54e7a56 commit ecca133

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/test-efcvt.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@ const struct test fcvtf_tests[] = {
155155
#define SKIP_LONG_FLOAT 0
156156
#endif
157157

158+
#if (!defined(TINY_STDIO) || !defined(_IO_FLOAT_EXACT)) && __SIZEOF_DOUBLE__ < 8
159+
#undef SKIP_LONG_FLOAT
160+
#define SKIP_LONG_FLOAT 1
161+
#define SKIP_LONGISH_FLOAT 1
162+
#endif
163+
164+
#ifndef SKIP_LONGISH_FLOAT
165+
#define SKIP_LONGISH_FLOAT 0
166+
#endif
167+
158168
#define many_tests(tests, func, n, skip_long) do { \
159169
for (i = 0; i < n; i++) { \
160170
int decpt; \
@@ -188,13 +198,13 @@ main(void)
188198
unsigned i;
189199
static char buf[2048];
190200

191-
many_tests(fcvt_tests, fcvt_r, N_FCVT_TESTS, 0);
201+
many_tests(fcvt_tests, fcvt_r, N_FCVT_TESTS, SKIP_LONGISH_FLOAT);
192202
many_tests(fcvt_extra_tests, fcvt_r, N_FCVT_EXTRA_TESTS, SKIP_LONG_FLOAT);
193-
many_tests(ecvt_tests, ecvt_r, N_ECVT_TESTS, 0);
203+
many_tests(ecvt_tests, ecvt_r, N_ECVT_TESTS, SKIP_LONGISH_FLOAT);
194204
#ifdef __PICOLIBC__
195205
many_tests(fcvt_tests, fcvtf_r, N_FCVT_TESTS, SKIP_LONG_FLOAT);
196206
many_tests(fcvtf_tests, fcvtf_r, N_FCVTF_TESTS, SKIP_LONG_FLOAT);
197-
many_tests(ecvt_tests, ecvtf_r, N_ECVT_TESTS, 0);
207+
many_tests(ecvt_tests, ecvtf_r, N_ECVT_TESTS, SKIP_LONGISH_FLOAT);
198208
#endif
199209
return error;
200210
}

0 commit comments

Comments
 (0)