Back to index

glibc  2.9
tst_wctype.c
Go to the documentation of this file.
00001 /*
00002   WCTYPE: wctype_t wctype (const char *class);
00003 */
00004 
00005 
00006 #define TST_FUNCTION wctype
00007 
00008 #include "tsp_common.c"
00009 #include "dat_wctype.c"
00010 
00011 int
00012 tst_wctype (FILE * fp, int debug_flg)
00013 {
00014   TST_DECL_VARS (wctype_t);
00015   char *class;
00016 
00017   TST_DO_TEST (wctype)
00018   {
00019     TST_HEAD_LOCALE (wctype, S_WCTYPE);
00020     TST_DO_REC (wctype)
00021     {
00022       TST_GET_ERRET (wctype);
00023       class = TST_INPUT (wctype).class;
00024       ret = wctype (class);
00025 
00026       if (debug_flg)
00027        {
00028          fprintf (stderr, "tst_wctype : [ %d ] ret = %ld\n", rec + 1, ret);
00029        }
00030 
00031       TST_IF_RETURN (S_WCTYPE)
00032       {
00033        if (ret != 0)
00034          {
00035            Result (C_SUCCESS, S_WCTYPE, CASE_3, MS_PASSED);
00036          }
00037        else
00038          {
00039            err_count++;
00040            Result (C_FAILURE, S_WCTYPE, CASE_3,
00041                   "should return non-0, but returned 0");
00042          }
00043       }
00044     }
00045   }
00046 
00047   return err_count;
00048 }