|
Last change
on this file since 2036 was 2036, checked in by bird, 20 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | WCSCHR: wchar_t *wcschr (wchar_t *ws, wchar_t wc);
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | #define TST_FUNCTION wcschr
|
|---|
| 6 |
|
|---|
| 7 | #include "tsp_common.c"
|
|---|
| 8 | #include "dat_wcschr.c"
|
|---|
| 9 |
|
|---|
| 10 | int
|
|---|
| 11 | tst_wcschr (FILE * fp, int debug_flg)
|
|---|
| 12 | {
|
|---|
| 13 | TST_DECL_VARS (wchar_t *);
|
|---|
| 14 | wchar_t *ws, wc;
|
|---|
| 15 |
|
|---|
| 16 | TST_DO_TEST (wcschr)
|
|---|
| 17 | {
|
|---|
| 18 | TST_HEAD_LOCALE (wcschr, S_WCSCHR);
|
|---|
| 19 | TST_DO_REC (wcschr)
|
|---|
| 20 | {
|
|---|
| 21 | TST_GET_ERRET (wcschr);
|
|---|
| 22 | ws = TST_INPUT (wcschr).ws; /* external value: size WCSSIZE */
|
|---|
| 23 | wc = TST_INPUT (wcschr).wc;
|
|---|
| 24 | ret = wcschr (ws, wc);
|
|---|
| 25 |
|
|---|
| 26 | if (debug_flg)
|
|---|
| 27 | {
|
|---|
| 28 | if (ret)
|
|---|
| 29 | {
|
|---|
| 30 | fprintf (stderr, "wcschr: ret = 0x%lx\n",
|
|---|
| 31 | (unsigned long int) *ret);
|
|---|
| 32 | }
|
|---|
| 33 | else
|
|---|
| 34 | {
|
|---|
| 35 | fprintf (stderr, "wcschr: ret = NULL pointer\n");
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | TST_IF_RETURN (S_WCSCHR)
|
|---|
| 40 | {
|
|---|
| 41 | if (ret == NULL)
|
|---|
| 42 | {
|
|---|
| 43 | if (debug_flg)
|
|---|
| 44 | {
|
|---|
| 45 | fprintf (stderr, "*** Warning *** tst_wcschr: "
|
|---|
| 46 | "set ret_flg=1 to check NULL return value\n");
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | warn_count++;
|
|---|
| 50 | Result (C_INVALID, S_WCSCHR, CASE_3, "(check the test data) "
|
|---|
| 51 | "set ret_flg=1 to check NULL return value");
|
|---|
| 52 | continue;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | if (*ret == wc)
|
|---|
| 56 | {
|
|---|
| 57 | Result (C_SUCCESS, S_WCSCHR, CASE_3, MS_PASSED);
|
|---|
| 58 | }
|
|---|
| 59 | else
|
|---|
| 60 | {
|
|---|
| 61 | err_count++;
|
|---|
| 62 | Result (C_FAILURE, S_WCSCHR, CASE_3,
|
|---|
| 63 | "the returned address of the string seems to be wrong");
|
|---|
| 64 | }
|
|---|
| 65 | }
|
|---|
| 66 | }
|
|---|
| 67 | }
|
|---|
| 68 |
|
|---|
| 69 | return err_count;
|
|---|
| 70 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.