* sysdeps/m68k/fpu/bits/mathinline.h: Don't define log2 as inline.
[glibc/pb-stable.git] / localedata / tests-mbwc / tst_wcstod.c
blob5ee151bd5462013215dad7b12417e4b03e6e5325
1 /*
2 WCSTOD: double wcstod (wchar_t *np, const wchar_t **endp);
3 */
5 #define TST_FUNCTION wcstod
7 #include "tsp_common.c"
8 #include "dat_wcstod.c"
10 int
11 tst_wcstod (FILE * fp, int debug_flg)
13 TST_DECL_VARS (double);
14 wchar_t *np, *endp, fwc;
15 double val;
17 TST_DO_TEST (wcstod)
19 TST_HEAD_LOCALE (wcstod, S_WCSTOD);
20 TST_DO_REC (wcstod)
22 TST_GET_ERRET (wcstod);
23 np = TST_INPUT (wcstod).np;
25 TST_CLEAR_ERRNO;
26 ret = wcstod (np, &endp);
27 TST_SAVE_ERRNO;
29 if (debug_flg)
31 fprintf (stdout, "wcstod() [ %s : %d ] ret = %f\n", locale,
32 rec + 1, ret);
33 fprintf (stdout, " *endp = 0x%lx\n", *endp);
36 TST_IF_RETURN (S_WCSTOD)
38 if (ret != 0)
40 val = ret - TST_EXPECT (wcstod).val;
41 if (TST_ABS (val) < TST_DBL_EPS)
43 Result (C_SUCCESS, S_WCSTOD, CASE_3, MS_PASSED);
45 else
47 err_count++;
48 Result (C_FAILURE, S_WCSTOD, CASE_3, "return value is wrong");
53 fwc = TST_EXPECT (wcstod).fwc;
55 if (fwc == *endp)
57 Result (C_SUCCESS, S_WCSTOD, CASE_4, MS_PASSED);
59 else
61 err_count++;
62 Result (C_FAILURE, S_WCSTOD, CASE_4, "a final wc is wrong.");
67 return err_count;