1 /*
2   ISWCTYPE: int iswctype (wint_t wc, wctype_t desc);
3 */
4 
5 #define TST_FUNCTION iswctype
6 
7 #include "tsp_common.c"
8 #include "dat_iswctype.c"
9 
10 
11 int
tst_iswctype(FILE * fp,int debug_flg)12 tst_iswctype (FILE *fp, int debug_flg)
13 {
14   TST_DECL_VARS (int);
15   wint_t wc;
16   const char *ts;
17 
18   TST_DO_TEST (iswctype)
19     {
20       TST_HEAD_LOCALE (iswctype, S_ISWCTYPE);
21       TST_DO_REC (iswctype)
22 	{
23 	  TST_GET_ERRET (iswctype);
24 	  wc = TST_INPUT (iswctype).wc;
25 	  ts = TST_INPUT (iswctype).ts;
26 	  ret = iswctype (wc, wctype (ts));
27 	  TST_SAVE_ERRNO;
28 	  if (debug_flg)
29 	    {
30 	      fprintf (stdout, "iswctype() [ %s : %d ] ret = %d\n",
31 		       locale, rec+1, ret);
32 	    }
33 
34 	  TST_IF_RETURN (S_ISWCTYPE)
35 	    {
36 	      if (ret != 0)
37 		{
38 		  result (fp, C_SUCCESS, S_ISWCTYPE, locale, rec+1,
39 			  seq_num+1, 3, MS_PASSED);
40 		}
41 	      else
42 		{
43 		  err_count++;
44 		  result (fp, C_FAILURE, S_ISWCTYPE, locale, rec+1,
45 			  seq_num+1, 3,
46 			  "the function returned 0, but should be non-zero");
47 		}
48 	    }
49 	}
50     }
51 
52   return err_count;
53 }
54