2 WCSTOK: wchar_t *wcstok (wchar_t *ws, const wchar_t *dlm, wchar_t **pt);
6 #define TST_FUNCTION wcstok
8 #include "tsp_common.c"
9 #include "dat_wcstok.c"
12 tst_wcstok (FILE * fp
, int debug_flg
)
14 TST_DECL_VARS (wchar_t *);
23 TST_HEAD_LOCALE (wcstok
, S_WCSTOK
);
26 TST_DO_SEQ (WCSTOK_SEQNUM
)
28 TST_GET_ERRET_SEQ (wcstok
);
29 w_flg
= TST_INPUT_SEQ (wcstok
).w_flg
;
30 ws
= (w_flg
) ? TST_INPUT_SEQ (wcstok
).ws
: NULL
;
31 dt
= TST_INPUT_SEQ (wcstok
).dt
;
33 ret
= wcstok (ws
, dt
, &pt
);
37 fprintf (stdout
, "wcstok() [ %s : %d : %d ] *ret = 0x%lx\n",
38 locale
, rec
+ 1, seq_num
+ 1, (unsigned long int) *ret
);
41 fprintf (stdout
, " *pt = 0x%lx\n",
42 (unsigned long int) *pt
);
46 TST_IF_RETURN (S_WCSTOK
)
52 ws_ex
= TST_EXPECT_SEQ (wcstok
).ws
;
54 /* XXX: REVISIT : insufficient conditions */
55 for (err
= 0, i
= 0; i
< WCSSIZE
; i
++)
57 if (ret
[i
] == L
'\0' && ws_ex
[i
] == L
'\0')
65 " ret[%d] = 0x%lx <-> "
66 "0x%lx = ws_ex[%d]\n",
67 i
, (unsigned long int) ret
[i
],
68 (unsigned long int) ws_ex
[i
], i
);
71 if (ret
[i
] != ws_ex
[i
])
75 Result (C_FAILURE
, S_WCSTOK
, CASE_3
,
76 "the token is different from an expected string");
80 if (ret
[i
] == L
'\0' || ws_ex
[i
] == L
'\0')
88 Result (C_SUCCESS
, S_WCSTOK
, CASE_3
, MS_PASSED
);