1 /*-------------------------------------------------------------------------------------*/
2 /* WCSCPY: wchar_t *wcscpy( wchar_t *ws1, const wchar_t *ws2 ) */
3 /*-------------------------------------------------------------------------------------*/
4 #define TST_FUNCTION wcscpy
6 #include "tsp_common.c"
7 #include "dat_wcscpy.c"
10 tst_wcscpy (FILE * fp, int debug_flg)
12 TST_DECL_VARS (wchar_t *);
13 wchar_t ws1[WCSSIZE], *ws2, *ws_ex;
18 TST_HEAD_LOCALE (wcscpy, S_WCSCPY);
21 TST_GET_ERRET (wcscpy);
22 ws2 = TST_INPUT (wcscpy).ws; /* external value: size WCSSIZE */
23 ret = wcscpy (ws1, ws2);
25 TST_IF_RETURN (S_WCSCPY)
29 Result (C_SUCCESS, S_WCSCPY, CASE_3, MS_PASSED);
34 Result (C_FAILURE, S_WCSCPY, CASE_3,
35 "the return address may not be correct");
41 ws_ex = TST_EXPECT (wcscpy).ws;
44 i < WCSSIZE && (ws1[i] != 0L || ws_ex[i] != 0L); i++)
49 "ws1[ %d ] = 0x%lx <-> wx_ex[ %d ] = 0x%lx\n", i,
50 (unsigned long int) ws1[i], i,
51 (unsigned long int) ws_ex[i]);
54 if (ws1[i] != ws_ex[i])
58 Result (C_FAILURE, S_WCSCPY, CASE_4,
59 "copied string is different from an"
67 Result (C_SUCCESS, S_WCSCPY, CASE_4, MS_PASSED);
72 Result (C_SUCCESS, S_WCSCPY, CASE_5, MS_PASSED);
77 Result (C_FAILURE, S_WCSCPY, CASE_5,
78 "copied string is not null-terminated");