mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
0e16ecfa1e
* locale/programs/ld-ctype.c (ctype_finish): Take all characters from the input charset into account when generating the hash table. (allocate_arrays): Correct setting default width. Not all empty slots in the table are filled, only those not covert explicitly by the locale description and in the charset. * stdio-common/vfscanf.c: Make sure to always return WEOF and EOF for wide character version. For %C handling, test correct pointer variable for NULL. * wcsmbs/wctob.c: Handle WEOF special. * wcsmbs/wcwidth.h: 0xff in width array means invalid character. * wctype/wctype.h: Protect gcc-isms with __extension__. Avoid always-true test to avoid warning.
111 lines
2.3 KiB
C
111 lines
2.3 KiB
C
/*
|
|
* TEST SUITE FOR MB/WC FUNCTIONS IN C LIBRARY
|
|
*
|
|
* FILE: dat_wcwidth.c
|
|
*
|
|
* WCWIDTH: int wcwidth (wchar_t wc);
|
|
*/
|
|
|
|
TST_WCWIDTH tst_wcwidth_loc [] = {
|
|
{
|
|
{ Twcwidth, TST_LOC_de },
|
|
{
|
|
{ /*inp*/ { 0x0000 }, /* #01 */
|
|
/*exp*/ { 0,0, 1,0, },
|
|
},
|
|
{ /*inp*/ { 0x0020 }, /* #02 */
|
|
/*exp*/ { 0,0, 1,1, },
|
|
},
|
|
{ /*inp*/ { 0x007F }, /* #03 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x0080 }, /* #04 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x00A1 }, /* #05 */
|
|
/*exp*/ { 0,0, 1,1, },
|
|
},
|
|
{ /*inp*/ { 0x00C1 }, /* #06 */
|
|
/*exp*/ { 0,0, 1,1, },
|
|
},
|
|
#ifdef SHOJI_IS_RIGHT
|
|
/* <WAIVER> */ /* CHECK : wint_t */
|
|
{ /*inp*/ { 0x3041 }, /* #07 */
|
|
/*exp*/ { 0,0, 1,0, },
|
|
},
|
|
#else
|
|
{ /*inp*/ { 0x3041 }, /* #07 */
|
|
/*exp*/ { 0,0, 1,EOF, },
|
|
},
|
|
#endif
|
|
{ is_last: 1 }
|
|
}
|
|
},
|
|
{
|
|
{ Twcwidth, TST_LOC_enUS },
|
|
{
|
|
{ /*inp*/ { 0x0000 }, /* #01 */
|
|
/*exp*/ { 0,0, 1,0, },
|
|
},
|
|
{ /*inp*/ { 0x0020 }, /* #02 */
|
|
/*exp*/ { 0,0, 1,1, },
|
|
},
|
|
{ /*inp*/ { 0x007F }, /* #03 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x0080 }, /* #04 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x00A1 }, /* #05 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x00C1 }, /* #06 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x3041 }, /* #07 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ is_last: 1 }
|
|
}
|
|
},
|
|
{
|
|
{ Twcwidth, TST_LOC_eucJP },
|
|
{
|
|
{ /*inp*/ { 0x0000 }, /* #01 */
|
|
/*exp*/ { 0,0, 1,0, },
|
|
},
|
|
{ /*inp*/ { 0x0020 }, /* #02 */
|
|
/*exp*/ { 0,0, 1,1, },
|
|
},
|
|
{ /*inp*/ { 0x007F }, /* #03 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
{ /*inp*/ { 0x0080 }, /* #04 */
|
|
/*exp*/ { 0,0, 1,-1, },
|
|
},
|
|
#ifdef SHOJI_IS_RIGHT
|
|
/* <NO_WAIVER> */
|
|
{ /*inp*/ { 0x00A1 }, /* #05 */
|
|
/*exp*/ { 0,0, 1,0, },
|
|
},
|
|
#else
|
|
/* XXX U00A1 is a valid character in EUC-JP. */
|
|
{ /*inp*/ { 0x00A1 }, /* #05 */
|
|
/*exp*/ { 0,0, 1,2, },
|
|
},
|
|
#endif
|
|
/* jisx0212 */
|
|
{ /*inp*/ { 0x00C1 }, /* #06 */
|
|
/*exp*/ { 0,0, 1,2, },
|
|
},
|
|
{ /*inp*/ { 0x3041 }, /* #07 */
|
|
/*exp*/ { 0,0, 1,2, },
|
|
},
|
|
{ is_last: 1 }
|
|
}
|
|
},
|
|
{
|
|
{ Twcwidth, TST_LOC_end }
|
|
}
|
|
};
|