Back to index

glibc  2.9
tst_iswctype.c
Go to the documentation of this file.
00001 /*
00002   ISWCTYPE: int iswctype (wint_t wc, wctype_t desc);
00003 */
00004 
00005 #define TST_FUNCTION iswctype
00006 
00007 #include "tsp_common.c"
00008 #include "dat_iswctype.c"
00009 
00010 
00011 int
00012 tst_iswctype (FILE *fp, int debug_flg)
00013 {
00014   TST_DECL_VARS (int);
00015   wint_t wc;
00016   const char *ts;
00017 
00018   TST_DO_TEST (iswctype)
00019     {
00020       TST_HEAD_LOCALE (iswctype, S_ISWCTYPE);
00021       TST_DO_REC (iswctype)
00022        {
00023          TST_GET_ERRET (iswctype);
00024          wc = TST_INPUT (iswctype).wc;
00025          ts = TST_INPUT (iswctype).ts;
00026          ret = iswctype (wc, wctype (ts));
00027          TST_SAVE_ERRNO;
00028          if (debug_flg)
00029            {
00030              fprintf (stdout, "iswctype() [ %s : %d ] ret = %d\n",
00031                      locale, rec+1, ret);
00032            }
00033 
00034          TST_IF_RETURN (S_ISWCTYPE)
00035            {
00036              if (ret != 0)
00037               {
00038                 result (fp, C_SUCCESS, S_ISWCTYPE, locale, rec+1,
00039                        seq_num+1, 3, MS_PASSED);
00040               }
00041              else
00042               {
00043                 err_count++;
00044                 result (fp, C_FAILURE, S_ISWCTYPE, locale, rec+1,
00045                        seq_num+1, 3,
00046                        "the function returned 0, but should be non-zero");
00047               }
00048            }
00049        }
00050     }
00051 
00052   return err_count;
00053 }