[BZ #3427]
[glibc.git] / localedata / tests-mbwc / tst_wctrans.c
blobb422d6ff940c39f549c01648fbfb26553137875c
1 /*
2 WCTRANS: wctrans_t wctrans (const char *charclass);
3 */
5 #define TST_FUNCTION wctrans
7 #include "tsp_common.c"
8 #include "dat_wctrans.c"
10 int
11 tst_wctrans (FILE * fp, int debug_flg)
13 TST_DECL_VARS (wctrans_t);
14 char *class;
16 TST_DO_TEST (wctrans)
18 TST_HEAD_LOCALE (wctrans, S_WCTRANS);
19 TST_DO_REC (wctrans)
21 TST_GET_ERRET (wctrans);
22 class = TST_INPUT (wctrans).class;
24 TST_CLEAR_ERRNO;
25 ret = wctrans (class);
26 TST_SAVE_ERRNO;
28 if (debug_flg)
30 fprintf (stderr, "tst_wctrans : [ %d ] ret = %ld\n", rec + 1,
31 (long int) ret);
32 fprintf (stderr, " errno = %d\n", errno_save);
35 TST_IF_RETURN (S_WCTRANS)
37 if (ret != 0)
39 Result (C_SUCCESS, S_WCTYPE, CASE_3, MS_PASSED);
41 else
43 err_count++;
44 Result (C_FAILURE, S_WCTYPE, CASE_3,
45 "should return non-0, but returned 0");
51 return err_count;