diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-10 10:30:28 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-10 10:30:28 +0000 |
commit | bb9231c8402e9ae99f98a868429e73c6340da304 (patch) | |
tree | d7ed637099fba4ab6db1cc4c009cad8485dcdb66 /test/locale-mbwc/dat_mbrtowc.c | |
parent | a691312d8794d5516402bb6bb0d3e90c40ba188b (diff) |
Added missing tests for locale with multibyte encoding
Diffstat (limited to 'test/locale-mbwc/dat_mbrtowc.c')
-rw-r--r-- | test/locale-mbwc/dat_mbrtowc.c | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/test/locale-mbwc/dat_mbrtowc.c b/test/locale-mbwc/dat_mbrtowc.c new file mode 100644 index 000000000..b8eb3dd21 --- /dev/null +++ b/test/locale-mbwc/dat_mbrtowc.c @@ -0,0 +1,140 @@ +/* + * TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY + * + * FILE: dat_mbrtowc.c + * + * MBTOWC: size_t mbrtowc (wchar_t *pwc, char *s, size_t n, + * mbstate_t *ps); + */ + +#include <limits.h> + +/* Note: + assumes en_US = en_US.ascii +*/ + + + + +TST_MBRTOWC tst_mbrtowc_loc [] = { + { + { Tmbrtowc, TST_LOC_de }, + { + { /*----------------- #01 -----------------*/ + { + { + { 1, 1, "ÄÖÜ", 1, 0, 0 }, + { 1, 1, "ÄÖÜ", 2, 0, 0 }, + { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, + } + }, + { + { + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + } + } + }, + { /*----------------- #02 -----------------*/ + { + { + { 1, 1, "ÄÖÜ", 1, 0, 0 }, + { 1, 1, "ÄÖÜ", 2, 0, 0 }, + { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, + } + }, + { + { + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + } + } + }, + { .is_last = 1 } + } + }, +#if 0 + /* XXX: These tests don't make sense to me. */ + { + { Tmbrtowc, TST_LOC_enUS }, + { + { /*----------------- #01 -----------------*/ + { + { + { 1, 1, "ÄÖÜ", 1, 0, 0 }, + { 1, 1, "ÄÖÜ", 2, 0, 0 }, + { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, + } + }, + { + { + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + } + } + }, + { /*----------------- #02 -----------------*/ + { + { + { 1, 1, "ÄÖÜ", 1, 0, 0 }, + { 1, 1, "ÄÖÜ", 2, 0, 0 }, + { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, + } + }, + { + { + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + } + } + }, + { .is_last = 1 } + } + }, + { + { Tmbrtowc, TST_LOC_eucJP }, + { + { /*----------------- #01 -----------------*/ + { + { + { 1, 1, "ÄÖÜ", 1, 0, 0 }, + { 1, 1, "ÄÖÜ", 2, 0, 0 }, + { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, + } + }, + { + { + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + } + } + }, + { /*----------------- #02 -----------------*/ + { + { + { 1, 1, "ÄÖÜ", 1, 0, 0 }, + { 1, 1, "ÄÖÜ", 2, 0, 0 }, + { 1, 1, "ÄÖÜ", USE_MBCURMAX, 0, 0 }, + } + }, + { + { + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + { 0, 1, 1, 0x00C4 }, + } + } + }, + { .is_last = 1 } + } + }, +#endif + { + { Tmbrtowc, TST_LOC_end } + } +}; |