2 WCSSTR: wchar_t *wcsstr (const wchar_t *ws1, const wchar_t *ws2);
5 #define TST_FUNCTION wcsstr
7 #include "tsp_common.c"
8 #include "dat_wcsstr.c"
11 tst_wcsstr (FILE * fp
, int debug_flg
)
13 TST_DECL_VARS (wchar_t *);
19 TST_HEAD_LOCALE (wcsstr
, S_WCSSTR
);
22 TST_GET_ERRET (wcsstr
);
23 ws1
= TST_INPUT (wcsstr
).ws1
;
24 ws2
= TST_INPUT (wcsstr
).ws2
; /* external value: size WCSSIZE */
25 ret
= wcsstr (ws1
, ws2
);
29 fprintf (stderr
, "wcsstr: %d : ret = %s\n", rec
+ 1,
30 (ret
== NULL
) ? "null" : "not null");
34 " ret[ 0 ] = 0x%lx <-> 0x%lx = ws2[ 0 ]\n",
35 (unsigned long int) ret
[0], (unsigned long int) ws2
[0]);
39 TST_IF_RETURN (S_WCSSTR
)
45 Result (C_SUCCESS
, S_WCSSTR
, CASE_3
, MS_PASSED
);
50 Result (C_FAILURE
, S_WCSSTR
, CASE_3
,
51 "return address is not same address as ws1");
57 for (i
= 0, err
= 0; *(ws2
+ i
) != 0 && i
< WCSSIZE
; i
++)
62 " : ret[ %d ] = 0x%lx <-> 0x%lx = ws2[ %d ]\n",
63 i
, (unsigned long int) ret
[i
],
64 (unsigned long int) ws2
[i
], i
);
71 Result (C_FAILURE
, S_WCSSTR
, CASE_4
, "pointed sub-string is "
72 "different from an expected sub-string");
79 Result (C_SUCCESS
, S_WCSSTR
, CASE_4
, MS_PASSED
);