2 WCSNCAT: wchar_t *wcsncat (wchar_t *ws1, const wchar_t *ws2, size_t n);
5 #define TST_FUNCTION wcsncat
7 #include "tsp_common.c"
8 #include "dat_wcsncat.c"
11 tst_wcsncat (FILE * fp
, int debug_flg
)
13 TST_DECL_VARS (wchar_t *);
14 wchar_t *ws1
, *ws2
, *ws_ex
;
19 TST_HEAD_LOCALE (wcsncat
, S_WCSNCAT
);
22 TST_GET_ERRET (wcsncat
);
23 ws1
= TST_INPUT (wcsncat
).ws1
; /* external value: size WCSSIZE */
24 ws2
= TST_INPUT (wcsncat
).ws2
;
25 n
= TST_INPUT (wcsncat
).n
;
26 ret
= wcsncat (ws1
, ws2
, n
);
28 TST_IF_RETURN (S_WCSNCAT
)
32 Result (C_SUCCESS
, S_WCSNCAT
, CASE_3
, MS_PASSED
);
37 Result (C_FAILURE
, S_WCSNCAT
, CASE_3
,
38 "the return address may not be correct");
44 ws_ex
= TST_EXPECT (wcsncat
).ws
;
47 (ws1
[i
] != 0L || ws_ex
[i
] != 0L) && i
< WCSSIZE
; i
++)
51 fprintf (stderr
, "ws1[%d] = 0x%lx\n", i
,
52 (unsigned long int) ws1
[i
]);
55 if (ws1
[i
] != ws_ex
[i
])
59 Result (C_FAILURE
, S_WCSNCAT
, CASE_4
,
60 "the concatinated string has "
61 "different value from an expected string");
68 Result (C_SUCCESS
, S_WCSNCAT
, CASE_4
, MS_PASSED
);