Linux: Assume and consolidate bind wire-up syscall
[glibc.git] / localedata / tests-mbwc / tst_towctrans.c
blob47bab2cf6553d4f09e6d2c4433bbf77d6189da36
1 /*
2 TOWCTRANS: wint_t towctrans (wint_t wc, wctrans_t desc);
3 */
5 #define TST_FUNCTION towctrans
7 #include "tsp_common.c"
8 #include "dat_towctrans.c"
11 int
12 tst_towctrans (FILE *fp, int debug_flg)
14 TST_DECL_VARS (wint_t);
15 wint_t wc;
16 const char *ts;
17 wctrans_t wto;
19 TST_DO_TEST (towctrans)
21 TST_HEAD_LOCALE (towctrans, S_TOWCTRANS);
22 TST_DO_REC (towctrans)
24 TST_GET_ERRET (towctrans);
25 wc = TST_INPUT (towctrans).wc;
26 ts = TST_INPUT (towctrans).ts;
28 wto = wctrans (ts);
30 TST_CLEAR_ERRNO;
31 ret = towctrans (wc, wto);
32 TST_SAVE_ERRNO;
34 if (debug_flg)
36 fprintf (stdout, "towctrans() [ %s : %d ] ret = 0x%x\n",
37 locale, rec+1, ret);
38 fprintf (stdout, " errno = %d\n",
39 errno_save);
42 TST_IF_RETURN (S_TOWCTRANS)
44 if (ret != 0)
46 result (fp, C_SUCCESS, S_TOWCTRANS, locale, rec+1,
47 seq_num+1, 3, MS_PASSED);
49 else
51 err_count++;
52 result (fp, C_FAILURE, S_TOWCTRANS, locale, rec+1,
53 seq_num+1, 3,
54 "the function returned 0, but should be non-zero");
60 return err_count;