mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-16 08:00:05 +00:00
ec7956d922
(TST_DECL_VARS): Don't declare err_flg. (TST_GET_ERRET): Don't set err_flg. (TST_GET_ERRET_SEQ): Likewise. (TST_IF_RETURN): Don't use err_flg, check err_exp directly. * tests-mbwc/dat_swscanf.c: Don't set err_flg. * tests-mbwc/dat_iswalnum.c: Likewise. * tests-mbwc/dat_iswalpha.c: Likewise. * tests-mbwc/dat_iswcntrl.c: Likewise. * tests-mbwc/dat_iswctype.c: Likewise. * tests-mbwc/dat_iswdigit.c: Likewise. * tests-mbwc/dat_iswgraph.c: Likewise. * tests-mbwc/dat_iswlower.c: Likewise. * tests-mbwc/dat_iswprint.c: Likewise. * tests-mbwc/dat_iswpunct.c: Likewise. * tests-mbwc/dat_iswspace.c: Likewise. * tests-mbwc/dat_iswupper.c: Likewise. * tests-mbwc/dat_iswxdigit.c: Likewise. * tests-mbwc/dat_mblen.c: Likewise. * tests-mbwc/dat_mbrlen.c: Likewise. * tests-mbwc/dat_mbrtowc.c: Likewise. * tests-mbwc/dat_mbsrtowcs.c: Likewise. * tests-mbwc/dat_mbstowcs.c: Likewise. * tests-mbwc/dat_mbtowc.c: Likewise. * tests-mbwc/dat_strcoll.c: Likewise. * tests-mbwc/dat_strfmon.c: Likewise. * tests-mbwc/dat_strxfrm.c: Likewise. * tests-mbwc/dat_swscanf.c: Likewise. * tests-mbwc/dat_towctrans.c: Likewise. * tests-mbwc/dat_towlower.c: Likewise. * tests-mbwc/dat_towupper.c: Likewise. * tests-mbwc/dat_wcrtomb.c: Likewise. * tests-mbwc/dat_wcscat.c: Likewise. * tests-mbwc/dat_wcschr.c: Likewise. * tests-mbwc/dat_wcscmp.c: Likewise. * tests-mbwc/dat_wcscoll.c: Likewise. * tests-mbwc/dat_wcscpy.c: Likewise. * tests-mbwc/dat_wcscspn.c: Likewise. * tests-mbwc/dat_wcslen.c: Likewise. * tests-mbwc/dat_wcsncat.c: Likewise. * tests-mbwc/dat_wcsncmp.c: Likewise. * tests-mbwc/dat_wcsncpy.c: Likewise. * tests-mbwc/dat_wcspbrk.c: Likewise. * tests-mbwc/dat_wcsrtombs.c: Likewise. * tests-mbwc/dat_wcsspn.c: Likewise. * tests-mbwc/dat_wcsstr.c: Likewise. * tests-mbwc/dat_wcstod.c: Likewise. * tests-mbwc/dat_wcstok.c: Likewise. * tests-mbwc/dat_wcstombs.c: Likewise. * tests-mbwc/dat_wcswidth.c: Likewise. * tests-mbwc/dat_wcsxfrm.c: Likewise. * tests-mbwc/dat_wctob.c: Likewise. * tests-mbwc/dat_wctomb.c: Likewise. * tests-mbwc/dat_wctrans.c: Likewise. * tests-mbwc/dat_wctype.c: Likewise. * tests-mbwc/dat_wcwidth.c: Likewise. * tests-mbwc/dat_isw-funcs.h: Fix comment. 2000-08-18 Andreas Jaeger <aj@suse.de> * tests-mbwc/tst_funcs.h (TMD_ERRET): Don't declare err_flg. (TST_DECL_VARS): Don't declare err_flg. (TST_GET_ERRET): Don't set err_flg. (TST_GET_ERRET_SEQ): Likewise. (TST_IF_RETURN): Don't use err_flg, check err_exp directly. * tests-mbwc/dat_swscanf.c: Don't set err_flg. * tests-mbwc/dat_iswalnum.c: Likewise. * tests-mbwc/dat_iswalpha.c: Likewise. * tests-mbwc/dat_iswcntrl.c: Likewise. * tests-mbwc/dat_iswctype.c: Likewise. * tests-mbwc/dat_iswdigit.c: Likewise. * tests-mbwc/dat_iswgraph.c: Likewise. * tests-mbwc/dat_iswlower.c: Likewise. * tests-mbwc/dat_iswprint.c: Likewise. * tests-mbwc/dat_iswpunct.c: Likewise. * tests-mbwc/dat_iswspace.c: Likewise. * tests-mbwc/dat_iswupper.c: Likewise. * tests-mbwc/dat_iswxdigit.c: Likewise. * tests-mbwc/dat_mblen.c: Likewise. * tests-mbwc/dat_mbrlen.c: Likewise. * tests-mbwc/dat_mbrtowc.c: Likewise. * tests-mbwc/dat_mbsrtowcs.c: Likewise. * tests-mbwc/dat_mbstowcs.c: Likewise. * tests-mbwc/dat_mbtowc.c: Likewise. * tests-mbwc/dat_strcoll.c: Likewise. * tests-mbwc/dat_strfmon.c: Likewise. * tests-mbwc/dat_strxfrm.c: Likewise. * tests-mbwc/dat_swscanf.c: Likewise. * tests-mbwc/dat_towctrans.c: Likewise. * tests-mbwc/dat_towlower.c: Likewise. * tests-mbwc/dat_towupper.c: Likewise. * tests-mbwc/dat_wcrtomb.c: Likewise. * tests-mbwc/dat_wcscat.c: Likewise. * tests-mbwc/dat_wcschr.c: Likewise. * tests-mbwc/dat_wcscmp.c: Likewise. * tests-mbwc/dat_wcscoll.c: Likewise. * tests-mbwc/dat_wcscpy.c: Likewise. * tests-mbwc/dat_wcscspn.c: Likewise. * tests-mbwc/dat_wcslen.c: Likewise. * tests-mbwc/dat_wcsncat.c: Likewise. * tests-mbwc/dat_wcsncmp.c: Likewise. * tests-mbwc/dat_wcsncpy.c: Likewise. * tests-mbwc/dat_wcspbrk.c: Likewise. * tests-mbwc/dat_wcsrtombs.c: Likewise. * tests-mbwc/dat_wcsspn.c: Likewise. * tests-mbwc/dat_wcsstr.c: Likewise. * tests-mbwc/dat_wcstod.c: Likewise. * tests-mbwc/dat_wcstok.c: Likewise. * tests-mbwc/dat_wcstombs.c: Likewise. * tests-mbwc/dat_wcswidth.c: Likewise. * tests-mbwc/dat_wcsxfrm.c: Likewise. * tests-mbwc/dat_wctob.c: Likewise. * tests-mbwc/dat_wctomb.c: Likewise. * tests-mbwc/dat_wctrans.c: Likewise. * tests-mbwc/dat_wctype.c: Likewise. * tests-mbwc/dat_wcwidth.c: Likewise. * tests-mbwc/dat_isw-funcs.h: Fix comment.
182 lines
4.0 KiB
C
182 lines
4.0 KiB
C
/*
|
|
* TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY
|
|
*
|
|
* FILE: dat_swscanf.c
|
|
*
|
|
* SWSCANF: int swscanf (const wchar_t *s, const wchar_t *fmt, ...);
|
|
*/
|
|
|
|
|
|
#include <errno.h>
|
|
#include <stdlib.h>
|
|
#include "tst_types.h"
|
|
#include "tgn_locdef.h"
|
|
|
|
|
|
TST_SWSCANF tst_swscanf_loc [] =
|
|
{
|
|
{
|
|
{ Tswscanf, TST_LOC_de },
|
|
{
|
|
/*------------------------ 01 -----------------------*/
|
|
{ { {
|
|
0x002D, 0x0031, 0x003A, /* %d: -1 */
|
|
0x0032, 0x003A, /* %u: 2 */
|
|
0x0033, 0x002C, 0x0033, 0x003A, /* %f: 3.3 */
|
|
0x00E4, 0x003A, /* %c: 'ä' */
|
|
0x00C4, 0x00DC, 0x0000, 0x0000, /* %s: "ÄÜ" */
|
|
},
|
|
L"%d:%u:%f:%c:%s", 0
|
|
},
|
|
{ /* The fields are: err_val, ret_flag, ret_val,
|
|
val_int, val_uns, val_flt, val_c, val_s, val_S. */
|
|
0,1,5,
|
|
-1, 2, 3.3, 'ä', "ÄÜ", { 0x0000, },
|
|
},
|
|
},
|
|
/*------------------------ 02 -----------------------*/
|
|
{ { {
|
|
0x00E4, 0x00C4, 0x0000 /* "äÄ" */
|
|
},
|
|
L"%lc", 'C'
|
|
},
|
|
{ 0,1,1,
|
|
0,0,0,0,"", { 0x00E4, 0x0000 },
|
|
},
|
|
},
|
|
/*------------------------ 03 -----------------------*/
|
|
{ { {
|
|
0x00E4, 0x00C4, 0x0000 /* "äÄ" */
|
|
},
|
|
L"%ls", 'S'
|
|
},
|
|
{ 0,1,1,
|
|
0,0,0,0,"", { 0x00E4, 0x00C4, 0x0000 },
|
|
},
|
|
},
|
|
/*------------------------ 04 -----------------------*/
|
|
/* <NO_WAIVER> x 2 */
|
|
{ { {
|
|
0x00E4, 0x00C4, 0x0000 /* "äÄ" */
|
|
},
|
|
L"1%d:2%d:3%d:4%d:5%d:6%d:7%d:8%d:9%d", 0
|
|
},
|
|
#ifdef SHOJI_IS_RIGHT
|
|
{ 1,EINVAL,1,WEOF,
|
|
0,0,0,0,"", { 0x0000 },
|
|
#else
|
|
{ 0,1,0,
|
|
0,0,0,0,"", { 0x0000 },
|
|
#endif
|
|
},
|
|
},
|
|
/*---------------------------------------------------*/
|
|
{ is_last: 1} /* Last element. */
|
|
}
|
|
},
|
|
{
|
|
{ Tswscanf, TST_LOC_enUS },
|
|
{
|
|
/*------------------------ 01 -----------------------*/
|
|
{ { { 0x002D, 0x0031, 0x003A,
|
|
0x0032, 0x003A,
|
|
0x0035, 0x0034, 0x002E, 0x0033, 0x0045, 0x002D, 0x0031, 0x003A,
|
|
0x0041, 0x003A,
|
|
0x0061, 0x0062, 0x0000, 0x0000,
|
|
},
|
|
L"%d:%u:%f:%c:%s", 0
|
|
},
|
|
{ 0,1,5,
|
|
-1, 2, 5.43, 'A', "ab", { 0x0000 },
|
|
},
|
|
},
|
|
/*------------------------ 02 -----------------------*/
|
|
/* <NO_WAIVER> x 2 */
|
|
{ { {
|
|
0x0063, 0x0064, 0x0000
|
|
},
|
|
L"%C", 'C'
|
|
},
|
|
{ 0,1,1,
|
|
0,0,0,0,"", { 0x0063, 0x0000 },
|
|
},
|
|
},
|
|
/*------------------------ 03 -----------------------*/
|
|
{ { {
|
|
0x0063, 0x0064, 0x0000
|
|
},
|
|
L"%S", 'S'
|
|
},
|
|
{ 0,1,1,
|
|
0,0,0,0,"", { 0x0063, 0x0064, 0x0000 },
|
|
},
|
|
},
|
|
/*---------------------------------------------------*/
|
|
{ is_last: 1} /* Last element. */
|
|
}
|
|
},
|
|
{
|
|
{ Tswscanf, TST_LOC_eucJP },
|
|
{
|
|
/*------------------------ 01 -----------------------*/
|
|
{ { { 0x002D, 0x0031, 0x003A,
|
|
0x0032, 0x003A,
|
|
0x0033, 0x002E, 0x0033, 0x003A,
|
|
0x0062, 0x003A,
|
|
0x0061, 0x0062, 0x0000, 0x0000,
|
|
},
|
|
L"%d:%u:%f:%c:%s", 0
|
|
},
|
|
{ 0,1,5,
|
|
-1, 2, 3.3, 'b', "ab", { 0x0000 }
|
|
},
|
|
},
|
|
/*------------------------ 02 -----------------------*/
|
|
{ { {
|
|
0x30A2, 0x30A4, 0x0000
|
|
},
|
|
L"%ls", 'S'
|
|
},
|
|
{ 0,1,1,
|
|
0,0,0,0,"", { 0x30A2, 0x30A4, 0x0000 }
|
|
},
|
|
},
|
|
/*------------------------ 03 -----------------------*/
|
|
{ { {
|
|
0x0031, 0x003A,
|
|
0x0030, 0x003A,
|
|
0x0033, 0x002E, 0x0039, 0x003A,
|
|
0x0061, 0x003A,
|
|
0x0063, 0x0064, 0x0000, 0x0000,
|
|
},
|
|
L"%2$d:%1$u:%3$f:%4$c:%5$s", 0
|
|
},
|
|
{ 0,1,5,
|
|
0, 1, 3.9, 'a', "cd", { 0x0000 }
|
|
},
|
|
},
|
|
#ifdef SHOJI_IS_RIGHT
|
|
/* XXX This test does not make sense. The format string is
|
|
L"\x1\x2\x25\x53" and it is supposed to match the words
|
|
0x30A2, 0x30A4, 0x0001. */
|
|
/*------------------------ 04 -----------------------*/
|
|
/* <NO_WAIVER> x 2 */
|
|
{ { {
|
|
0x30A2, 0x30A4, 0x0001, 0x0000
|
|
},
|
|
{ 0x0001,0x0002,0x0025,0x0053,0x0000 }, 'S'
|
|
},
|
|
{ EILSEQ,1,EOF,
|
|
0,0,0,0,"", { 0x0000 }
|
|
},
|
|
},
|
|
#endif
|
|
/*---------------------------------------------------*/
|
|
{ is_last: 1} /* Last element. */
|
|
}
|
|
},
|
|
{
|
|
{ Tswscanf, TST_LOC_end }
|
|
}
|
|
};
|