elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.
[glibc.git] / localedata / tests-mbwc / dat_towctrans.c
blob9c01701ec60e5bbd33f7a03fdcecf4f57d17f996
1 /*
2 * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
4 * FILE: dat_towctrans.c
6 * TOWCTRANS: wint_t towctrans (wint_t wc, wctrans_t charclass);
7 */
9 #include <errno.h>
10 #include <stdlib.h>
11 #include <wctype.h>
12 #include "tst_types.h"
13 #include "tgn_locdef.h"
16 * NOTE:
17 * Set ret_flg = 1, when a return value is expected to be 0 (FALSE).
18 * Set ret_flg = 0, when a return value is expected to be non-zero (TRUE).
20 * Since the functions return *non*-zero value for TRUE, can't
21 * compare an actual return value with an expected return value.
22 * Set the ret_flg=0 for TRUE cases and the tst_isw*() will check
23 * the non-zero value.
25 * { { WEOF }, { 0,0,1,0 } },
26 * | |
27 * | ret_val: an expected return value
28 * ret_flg: if 1, compare an actual return value with the
29 * ret_val; if 0, the test program checks
30 * the actual return value.
32 * CAUTION: if a charclass is invalid, the test function gives
33 * towctrans() an invalid wctrans object instead of a return value
34 * from wctrans() which is supposed to be 0.
37 TST_TOWCTRANS tst_towctrans_loc [] = {
39 { Ttowctrans, TST_LOC_C },
41 { { 0x0010, "xxxxxxx" }, { 0, 1,0x0010 } },
42 { { 0x007F, "tolower" }, { 0, 1,0x007F } },
43 { { 0x0061, "toupper" }, { 0, 1,0x0041 } },
44 { { 0x0041, "tolower" }, { 0, 1,0x0061 } },
45 { .is_last = 1 }
49 { Ttowctrans, TST_LOC_de },
51 { { 0x0010, "tojkata" }, { 0, 1,0x0010 } },
52 { { 0x0080, "tolower" }, { 0, 1,0x0080 } },
53 { { 0x00EC, "toupper" }, { 0, 1,0x00CC } },
54 { { 0x00CC, "tolower" }, { 0, 1,0x00EC } },
55 { .is_last = 1 }
59 { Ttowctrans, TST_LOC_enUS },
61 { { 0x0010, "xxxxxxx" }, { 0, 1,0x0010 } },
62 { { 0x007F, "tolower" }, { 0, 1,0x007F } },
63 { { 0x0061, "toupper" }, { 0, 1,0x0041 } },
64 { { 0x0041, "tolower" }, { 0, 1,0x0061 } },
65 { .is_last = 1 }
69 { Ttowctrans, TST_LOC_eucJP },
71 { { 0xFF21, "tolower" }, { 0, 1,0xFF41 } },
72 { { 0xFF41, "toupper" }, { 0, 1,0xFF21 } },
73 { { 0x30A1, "tojhira" }, { 0, 1,0x3041 } },
74 { { 0x3041, "tojkata" }, { 0, 1,0x30A1 } },
75 { .is_last = 1 }
79 { Ttowctrans, TST_LOC_end }