Back to index

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