1/*
2 WCTRANS: wctrans_t wctrans (const char *charclass);
3*/
4
5#define TST_FUNCTION wctrans
6
7#include "tsp_common.c"
8#include "dat_wctrans.c"
9
10int
11tst_wctrans (FILE * fp, int debug_flg)
12{
13 TST_DECL_VARS (wctrans_t);
14 char *class;
15
16 TST_DO_TEST (wctrans)
17 {
18 TST_HEAD_LOCALE (wctrans, S_WCTRANS);
19 TST_DO_REC (wctrans)
20 {
21 TST_GET_ERRET (wctrans);
22 class = TST_INPUT (wctrans).class;
23
24 TST_CLEAR_ERRNO;
25 ret = wctrans (property: class);
26 TST_SAVE_ERRNO;
27
28 if (debug_flg)
29 {
30 fprintf (stderr, "tst_wctrans : [ %d ] ret = %ld\n", rec + 1,
31 (long int) ret);
32 fprintf (stderr, " errno = %d\n", errno_save);
33 }
34
35 TST_IF_RETURN (S_WCTRANS)
36 {
37 if (ret != 0)
38 {
39 Result (C_SUCCESS, S_WCTYPE, CASE_3, MS_PASSED);
40 }
41 else
42 {
43 err_count++;
44 Result (C_FAILURE, S_WCTYPE, CASE_3,
45 "should return non-0, but returned 0");
46 }
47 }
48 }
49 }
50
51 return err_count;
52}
53

source code of glibc/localedata/tests-mbwc/tst_wctrans.c