Back to index

glibc  2.9
Defines | Functions
tgn_funcdef.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define Tiswalnum   1
#define Tiswalpha   2
#define Tiswcntrl   3
#define Tiswctype   4
#define Tiswdigit   5
#define Tiswgraph   6
#define Tiswlower   7
#define Tiswprint   8
#define Tiswpunct   9
#define Tiswspace   10
#define Tiswupper   11
#define Tiswxdigit   12
#define Tmblen   13
#define Tmbrlen   14
#define Tmbrtowc   15
#define Tmbsrtowcs   16
#define Tmbstowcs   17
#define Tmbtowc   18
#define Tstrcoll   19
#define Tstrfmon   20
#define Tstrxfrm   21
#define Tswscanf   22
#define Ttowctrans   23
#define Ttowlower   24
#define Ttowupper   25
#define Twcrtomb   26
#define Twcscat   27
#define Twcschr   28
#define Twcscmp   29
#define Twcscoll   30
#define Twcscpy   31
#define Twcscspn   32
#define Twcslen   33
#define Twcsncat   34
#define Twcsncmp   35
#define Twcsncpy   36
#define Twcspbrk   37
#define Twcsrtombs   38
#define Twcsspn   39
#define Twcsstr   40
#define Twcstod   41
#define Twcstok   42
#define Twcstombs   43
#define Twcswidth   44
#define Twcsxfrm   45
#define Twctob   46
#define Twctomb   47
#define Twctrans   48
#define Twctype   49
#define Twcwidth   50
#define S_ISWALNUM   "iswalnum"
#define S_ISWALPHA   "iswalpha"
#define S_ISWCNTRL   "iswcntrl"
#define S_ISWCTYPE   "iswctype"
#define S_ISWDIGIT   "iswdigit"
#define S_ISWGRAPH   "iswgraph"
#define S_ISWLOWER   "iswlower"
#define S_ISWPRINT   "iswprint"
#define S_ISWPUNCT   "iswpunct"
#define S_ISWSPACE   "iswspace"
#define S_ISWUPPER   "iswupper"
#define S_ISWXDIGIT   "iswxdigit"
#define S_MBLEN   "mblen"
#define S_MBRLEN   "mbrlen"
#define S_MBRTOWC   "mbrtowc"
#define S_MBSRTOWCS   "mbsrtowcs"
#define S_MBSTOWCS   "mbstowcs"
#define S_MBTOWC   "mbtowc"
#define S_STRCOLL   "strcoll"
#define S_STRFMON   "strfmon"
#define S_STRXFRM   "strxfrm"
#define S_SWSCANF   "swscanf"
#define S_TOWCTRANS   "towctrans"
#define S_TOWLOWER   "towlower"
#define S_TOWUPPER   "towupper"
#define S_WCRTOMB   "wcrtomb"
#define S_WCSCAT   "wcscat"
#define S_WCSCHR   "wcschr"
#define S_WCSCMP   "wcscmp"
#define S_WCSCOLL   "wcscoll"
#define S_WCSCPY   "wcscpy"
#define S_WCSCSPN   "wcscspn"
#define S_WCSLEN   "wcslen"
#define S_WCSNCAT   "wcsncat"
#define S_WCSNCMP   "wcsncmp"
#define S_WCSNCPY   "wcsncpy"
#define S_WCSPBRK   "wcspbrk"
#define S_WCSRTOMBS   "wcsrtombs"
#define S_WCSSPN   "wcsspn"
#define S_WCSSTR   "wcsstr"
#define S_WCSTOD   "wcstod"
#define S_WCSTOK   "wcstok"
#define S_WCSTOMBS   "wcstombs"
#define S_WCSWIDTH   "wcswidth"
#define S_WCSXFRM   "wcsxfrm"
#define S_WCTOB   "wctob"
#define S_WCTOMB   "wctomb"
#define S_WCTRANS   "wctrans"
#define S_WCTYPE   "wctype"
#define S_WCWIDTH   "wcwidth"

Functions

int tst_iswalnum (FILE *, int)
int tst_iswalpha (FILE *, int)
int tst_iswcntrl (FILE *, int)
int tst_iswctype (FILE *, int)
int tst_iswdigit (FILE *, int)
int tst_iswgraph (FILE *, int)
int tst_iswlower (FILE *, int)
int tst_iswprint (FILE *, int)
int tst_iswpunct (FILE *, int)
int tst_iswspace (FILE *, int)
int tst_iswupper (FILE *, int)
int tst_iswxdigit (FILE *, int)
int tst_mblen (FILE *, int)
int tst_mbrlen (FILE *, int)
int tst_mbrtowc (FILE *, int)
int tst_mbsrtowcs (FILE *, int)
int tst_mbstowcs (FILE *, int)
int tst_mbtowc (FILE *, int)
int tst_strcoll (FILE *, int)
int tst_strfmon (FILE *, int)
int tst_strxfrm (FILE *, int)
int tst_swscanf (FILE *, int)
int tst_towctrans (FILE *, int)
int tst_towlower (FILE *, int)
int tst_towupper (FILE *, int)
int tst_wcrtomb (FILE *, int)
int tst_wcscat (FILE *, int)
int tst_wcschr (FILE *, int)
int tst_wcscmp (FILE *, int)
int tst_wcscoll (FILE *, int)
int tst_wcscpy (FILE *, int)
int tst_wcscspn (FILE *, int)
int tst_wcslen (FILE *, int)
int tst_wcsncat (FILE *, int)
int tst_wcsncmp (FILE *, int)
int tst_wcsncpy (FILE *, int)
int tst_wcspbrk (FILE *, int)
int tst_wcsrtombs (FILE *, int)
int tst_wcsspn (FILE *, int)
int tst_wcsstr (FILE *, int)
int tst_wcstod (FILE *, int)
int tst_wcstok (FILE *, int)
int tst_wcstombs (FILE *, int)
int tst_wcswidth (FILE *, int)
int tst_wcsxfrm (FILE *, int)
int tst_wctob (FILE *, int)
int tst_wctomb (FILE *, int)
int tst_wctrans (FILE *, int)
int tst_wctype (FILE *, int)
int tst_wcwidth (FILE *, int)

Define Documentation

#define S_ISWALNUM   "iswalnum"

Definition at line 57 of file tgn_funcdef.h.

#define S_ISWALPHA   "iswalpha"

Definition at line 58 of file tgn_funcdef.h.

#define S_ISWCNTRL   "iswcntrl"

Definition at line 59 of file tgn_funcdef.h.

#define S_ISWCTYPE   "iswctype"

Definition at line 60 of file tgn_funcdef.h.

#define S_ISWDIGIT   "iswdigit"

Definition at line 61 of file tgn_funcdef.h.

#define S_ISWGRAPH   "iswgraph"

Definition at line 62 of file tgn_funcdef.h.

#define S_ISWLOWER   "iswlower"

Definition at line 63 of file tgn_funcdef.h.

#define S_ISWPRINT   "iswprint"

Definition at line 64 of file tgn_funcdef.h.

#define S_ISWPUNCT   "iswpunct"

Definition at line 65 of file tgn_funcdef.h.

#define S_ISWSPACE   "iswspace"

Definition at line 66 of file tgn_funcdef.h.

#define S_ISWUPPER   "iswupper"

Definition at line 67 of file tgn_funcdef.h.

#define S_ISWXDIGIT   "iswxdigit"

Definition at line 68 of file tgn_funcdef.h.

#define S_MBLEN   "mblen"

Definition at line 69 of file tgn_funcdef.h.

#define S_MBRLEN   "mbrlen"

Definition at line 70 of file tgn_funcdef.h.

#define S_MBRTOWC   "mbrtowc"

Definition at line 71 of file tgn_funcdef.h.

#define S_MBSRTOWCS   "mbsrtowcs"

Definition at line 72 of file tgn_funcdef.h.

#define S_MBSTOWCS   "mbstowcs"

Definition at line 73 of file tgn_funcdef.h.

#define S_MBTOWC   "mbtowc"

Definition at line 74 of file tgn_funcdef.h.

#define S_STRCOLL   "strcoll"

Definition at line 75 of file tgn_funcdef.h.

#define S_STRFMON   "strfmon"

Definition at line 76 of file tgn_funcdef.h.

#define S_STRXFRM   "strxfrm"

Definition at line 77 of file tgn_funcdef.h.

#define S_SWSCANF   "swscanf"

Definition at line 78 of file tgn_funcdef.h.

#define S_TOWCTRANS   "towctrans"

Definition at line 79 of file tgn_funcdef.h.

#define S_TOWLOWER   "towlower"

Definition at line 80 of file tgn_funcdef.h.

#define S_TOWUPPER   "towupper"

Definition at line 81 of file tgn_funcdef.h.

#define S_WCRTOMB   "wcrtomb"

Definition at line 82 of file tgn_funcdef.h.

#define S_WCSCAT   "wcscat"

Definition at line 83 of file tgn_funcdef.h.

#define S_WCSCHR   "wcschr"

Definition at line 84 of file tgn_funcdef.h.

#define S_WCSCMP   "wcscmp"

Definition at line 85 of file tgn_funcdef.h.

#define S_WCSCOLL   "wcscoll"

Definition at line 86 of file tgn_funcdef.h.

#define S_WCSCPY   "wcscpy"

Definition at line 87 of file tgn_funcdef.h.

#define S_WCSCSPN   "wcscspn"

Definition at line 88 of file tgn_funcdef.h.

#define S_WCSLEN   "wcslen"

Definition at line 89 of file tgn_funcdef.h.

#define S_WCSNCAT   "wcsncat"

Definition at line 90 of file tgn_funcdef.h.

#define S_WCSNCMP   "wcsncmp"

Definition at line 91 of file tgn_funcdef.h.

#define S_WCSNCPY   "wcsncpy"

Definition at line 92 of file tgn_funcdef.h.

#define S_WCSPBRK   "wcspbrk"

Definition at line 93 of file tgn_funcdef.h.

#define S_WCSRTOMBS   "wcsrtombs"

Definition at line 94 of file tgn_funcdef.h.

#define S_WCSSPN   "wcsspn"

Definition at line 95 of file tgn_funcdef.h.

#define S_WCSSTR   "wcsstr"

Definition at line 96 of file tgn_funcdef.h.

#define S_WCSTOD   "wcstod"

Definition at line 97 of file tgn_funcdef.h.

#define S_WCSTOK   "wcstok"

Definition at line 98 of file tgn_funcdef.h.

#define S_WCSTOMBS   "wcstombs"

Definition at line 99 of file tgn_funcdef.h.

#define S_WCSWIDTH   "wcswidth"

Definition at line 100 of file tgn_funcdef.h.

#define S_WCSXFRM   "wcsxfrm"

Definition at line 101 of file tgn_funcdef.h.

#define S_WCTOB   "wctob"

Definition at line 102 of file tgn_funcdef.h.

#define S_WCTOMB   "wctomb"

Definition at line 103 of file tgn_funcdef.h.

#define S_WCTRANS   "wctrans"

Definition at line 104 of file tgn_funcdef.h.

#define S_WCTYPE   "wctype"

Definition at line 105 of file tgn_funcdef.h.

#define S_WCWIDTH   "wcwidth"

Definition at line 106 of file tgn_funcdef.h.

#define Tiswalnum   1

Definition at line 5 of file tgn_funcdef.h.

#define Tiswalpha   2

Definition at line 6 of file tgn_funcdef.h.

#define Tiswcntrl   3

Definition at line 7 of file tgn_funcdef.h.

#define Tiswctype   4

Definition at line 8 of file tgn_funcdef.h.

#define Tiswdigit   5

Definition at line 9 of file tgn_funcdef.h.

#define Tiswgraph   6

Definition at line 10 of file tgn_funcdef.h.

#define Tiswlower   7

Definition at line 11 of file tgn_funcdef.h.

#define Tiswprint   8

Definition at line 12 of file tgn_funcdef.h.

#define Tiswpunct   9

Definition at line 13 of file tgn_funcdef.h.

#define Tiswspace   10

Definition at line 14 of file tgn_funcdef.h.

#define Tiswupper   11

Definition at line 15 of file tgn_funcdef.h.

#define Tiswxdigit   12

Definition at line 16 of file tgn_funcdef.h.

#define Tmblen   13

Definition at line 17 of file tgn_funcdef.h.

#define Tmbrlen   14

Definition at line 18 of file tgn_funcdef.h.

#define Tmbrtowc   15

Definition at line 19 of file tgn_funcdef.h.

#define Tmbsrtowcs   16

Definition at line 20 of file tgn_funcdef.h.

#define Tmbstowcs   17

Definition at line 21 of file tgn_funcdef.h.

#define Tmbtowc   18

Definition at line 22 of file tgn_funcdef.h.

#define Tstrcoll   19

Definition at line 23 of file tgn_funcdef.h.

#define Tstrfmon   20

Definition at line 24 of file tgn_funcdef.h.

#define Tstrxfrm   21

Definition at line 25 of file tgn_funcdef.h.

#define Tswscanf   22

Definition at line 26 of file tgn_funcdef.h.

#define Ttowctrans   23

Definition at line 27 of file tgn_funcdef.h.

#define Ttowlower   24

Definition at line 28 of file tgn_funcdef.h.

#define Ttowupper   25

Definition at line 29 of file tgn_funcdef.h.

#define Twcrtomb   26

Definition at line 30 of file tgn_funcdef.h.

#define Twcscat   27

Definition at line 31 of file tgn_funcdef.h.

#define Twcschr   28

Definition at line 32 of file tgn_funcdef.h.

#define Twcscmp   29

Definition at line 33 of file tgn_funcdef.h.

#define Twcscoll   30

Definition at line 34 of file tgn_funcdef.h.

#define Twcscpy   31

Definition at line 35 of file tgn_funcdef.h.

#define Twcscspn   32

Definition at line 36 of file tgn_funcdef.h.

#define Twcslen   33

Definition at line 37 of file tgn_funcdef.h.

#define Twcsncat   34

Definition at line 38 of file tgn_funcdef.h.

#define Twcsncmp   35

Definition at line 39 of file tgn_funcdef.h.

#define Twcsncpy   36

Definition at line 40 of file tgn_funcdef.h.

#define Twcspbrk   37

Definition at line 41 of file tgn_funcdef.h.

#define Twcsrtombs   38

Definition at line 42 of file tgn_funcdef.h.

#define Twcsspn   39

Definition at line 43 of file tgn_funcdef.h.

#define Twcsstr   40

Definition at line 44 of file tgn_funcdef.h.

#define Twcstod   41

Definition at line 45 of file tgn_funcdef.h.

#define Twcstok   42

Definition at line 46 of file tgn_funcdef.h.

#define Twcstombs   43

Definition at line 47 of file tgn_funcdef.h.

#define Twcswidth   44

Definition at line 48 of file tgn_funcdef.h.

#define Twcsxfrm   45

Definition at line 49 of file tgn_funcdef.h.

#define Twctob   46

Definition at line 50 of file tgn_funcdef.h.

#define Twctomb   47

Definition at line 51 of file tgn_funcdef.h.

#define Twctrans   48

Definition at line 52 of file tgn_funcdef.h.

#define Twctype   49

Definition at line 53 of file tgn_funcdef.h.

#define Twcwidth   50

Definition at line 54 of file tgn_funcdef.h.


Function Documentation

int tst_iswalnum ( FILE ,
int   
)
int tst_iswalpha ( FILE ,
int   
)
int tst_iswcntrl ( FILE ,
int   
)
int tst_iswctype ( FILE ,
int   
)

Definition at line 12 of file tst_iswctype.c.

{
  TST_DECL_VARS (int);
  wint_t wc;
  const char *ts;

  TST_DO_TEST (iswctype)
    {
      TST_HEAD_LOCALE (iswctype, S_ISWCTYPE);
      TST_DO_REC (iswctype)
       {
         TST_GET_ERRET (iswctype);
         wc = TST_INPUT (iswctype).wc;
         ts = TST_INPUT (iswctype).ts;
         ret = iswctype (wc, wctype (ts));
         TST_SAVE_ERRNO;
         if (debug_flg)
           {
             fprintf (stdout, "iswctype() [ %s : %d ] ret = %d\n",
                     locale, rec+1, ret);
           }

         TST_IF_RETURN (S_ISWCTYPE)
           {
             if (ret != 0)
              {
                result (fp, C_SUCCESS, S_ISWCTYPE, locale, rec+1,
                       seq_num+1, 3, MS_PASSED);
              }
             else
              {
                err_count++;
                result (fp, C_FAILURE, S_ISWCTYPE, locale, rec+1,
                       seq_num+1, 3,
                       "the function returned 0, but should be non-zero");
              }
           }
       }
    }

  return err_count;
}

Here is the call graph for this function:

int tst_iswdigit ( FILE ,
int   
)
int tst_iswgraph ( FILE ,
int   
)
int tst_iswlower ( FILE ,
int   
)
int tst_iswprint ( FILE ,
int   
)
int tst_iswpunct ( FILE ,
int   
)
int tst_iswspace ( FILE ,
int   
)
int tst_iswupper ( FILE ,
int   
)
int tst_iswxdigit ( FILE ,
int   
)
int tst_mblen ( FILE ,
int   
)

Definition at line 11 of file tst_mblen.c.

{
  TST_DECL_VARS (int);
  char s_flg;
  const char *s_in;
  size_t n;

  TST_DO_TEST (mblen)
  {
    TST_HEAD_LOCALE (mblen, S_MBLEN);
    TST_DO_REC (mblen)
    {
      TST_GET_ERRET (mblen);
      s_flg = TST_INPUT (mblen).s_flg;
      s_in = TST_INPUT (mblen).s;
      n = TST_INPUT (mblen).n;

      if (s_flg == 0)
       {
         s_in = NULL;
       }

      if (n == USE_MBCURMAX)
       {
         n = MB_CUR_MAX;
       }

      TST_CLEAR_ERRNO;
      ret = mblen (s_in, n);
      TST_SAVE_ERRNO;

      TST_IF_RETURN (S_MBLEN)
      {
       if (s_in == NULL)
         {                  /* state dependency */
           if (ret_exp == +1)
             {                     /* state-dependent  */
              if (ret != 0)
                {
                  /* non-zero: state-dependent encoding */
                  Result (C_SUCCESS, S_MBLEN, CASE_3, MS_PASSED);
                }
              else
                {
                  err_count++;
                  Result (C_FAILURE, S_MBLEN, CASE_3,
                         "should be state-dependent encoding, "
                         "but the return value shows it is"
                         " state-independent");
                }
             }

           if (ret_exp == 0)
             {                     /* state-independent */
              if (ret == 0)
                {
                  /* non-zero: state-dependent encoding */
                  Result (C_SUCCESS, S_MBLEN, CASE_3, MS_PASSED);
                }
              else
                {
                  err_count++;
                  Result (C_FAILURE, S_MBLEN, CASE_3,
                         "should be state-independent encoding, "
                         "but the return value shows it is"
                         " state-dependent");
                }
             }
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_mbrlen ( FILE ,
int   
)

Definition at line 12 of file tst_mbrlen.c.

{
  TST_DECL_VARS (size_t);
  char s_flg;
  const char *s_in;
  size_t n;
  char t_flg;
  char t_ini;
  static mbstate_t s = { 0 };
  mbstate_t *ps;

  TST_DO_TEST (mbrlen)
  {
    TST_HEAD_LOCALE (mbrlen, S_MBRLEN);
    TST_DO_REC (mbrlen)
    {
      if (mbrlen (NULL, 0, &s) != 0)
       {
         err_count++;
         Result (C_FAILURE, S_MBRLEN, CASE_3,
                "Initialization (external mbstate object) failed "
                "- skipped this test case.");
         continue;
       }

      TST_DO_SEQ (MBRLEN_SEQNUM)
      {
       TST_GET_ERRET_SEQ (mbrlen);
       s_flg = TST_INPUT_SEQ (mbrlen).s_flg;
       s_in = TST_INPUT_SEQ (mbrlen).s;
       n = TST_INPUT_SEQ (mbrlen).n;
       t_flg = TST_INPUT_SEQ (mbrlen).t_flg;
       t_ini = TST_INPUT_SEQ (mbrlen).t_init;
       if (s_flg == 0)
         {
           s_in = NULL;
         }

       if (n == USE_MBCURMAX)      /* rewrite tst_mblen() like this */
         {
           n = MB_CUR_MAX;
         }

       ps = (t_flg == 0) ? NULL : &s;

       if (t_ini != 0)
         {
           memset (&s, 0, sizeof (s));
           mbrlen (NULL, 0, NULL);
         }

       TST_CLEAR_ERRNO;
       ret = mbrlen (s_in, n, ps);
       TST_SAVE_ERRNO;

       if (debug_flg)
         {
           fprintf (stdout, "mbrlen() [ %s : %d : %d ] ret = %zd\n",
                   locale, rec + 1, seq_num + 1, ret);
           fprintf (stdout, "                       errno = %d\n", errno_save);
         }

       TST_IF_RETURN (S_MBRLEN)
       {
       };
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_mbrtowc ( FILE ,
int   
)

Definition at line 13 of file tst_mbrtowc.c.

{
  TST_DECL_VARS (size_t);
  char w_flg, s_flg;
  char *s;
  size_t n;
  char t_flg, t_ini;
  static mbstate_t t = { 0 };
  mbstate_t *pt;
  wchar_t wc, *pwc, wc_ex;

  TST_DO_TEST (mbrtowc)
  {
    TST_HEAD_LOCALE (mbrtowc, S_MBRTOWC);
    TST_DO_REC (mbrtowc)
    {
      if (mbrtowc (NULL, "", 0, &t) != 0)
       {
         err_count++;
         Result (C_FAILURE, S_MBRTOWC, CASE_3,
                "Initialization failed - skipping this test case.");
         continue;
       }

      TST_DO_SEQ (MBRTOWC_SEQNUM)
      {
       TST_GET_ERRET_SEQ (mbrtowc);
       w_flg = TST_INPUT_SEQ (mbrtowc).w_flg;
       s_flg = TST_INPUT_SEQ (mbrtowc).s_flg;
       s = TST_INPUT_SEQ (mbrtowc).s;
       n = TST_INPUT_SEQ (mbrtowc).n;
       t_flg = TST_INPUT_SEQ (mbrtowc).t_flg;
       t_ini = TST_INPUT_SEQ (mbrtowc).t_init;
       pwc = (w_flg == 0) ? NULL : &wc;

       if (s_flg == 0)
         {
           s = NULL;
         }

       if (n == USE_MBCURMAX)
         {
           n = MB_CUR_MAX;
         }

       pt = (t_flg == 0) ? NULL : &t;
#if 0
       if (t_ini != 0)
         {
           memset (&t, 0, sizeof (t));
         }
#endif
       TST_CLEAR_ERRNO;
       ret = mbrtowc (pwc, s, n, pt);
       TST_SAVE_ERRNO;

       if (debug_flg)
         {
           fprintf (stdout, "mbrtowc() [ %s : %d : %d ] ret = %zd\n",
                   locale, rec + 1, seq_num + 1, ret);
           fprintf (stdout, "                        errno = %hd\n",
                   errno_save);
         }

       TST_IF_RETURN (S_MBRTOWC)
       {
       };

       if (pwc == NULL || s == NULL || ret == (size_t) - 1
           || ret == (size_t) - 2)
         {
           continue;
         }

       wc_ex = TST_EXPECT_SEQ (mbrtowc).wc;
       if (wc_ex == wc)
         {
           Result (C_SUCCESS, S_MBRTOWC, CASE_4, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_MBRTOWC, CASE_4,
                  "converted wc is different from an expected wc");
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_mbsrtowcs ( FILE ,
int   
)

Definition at line 12 of file tst_mbsrtowcs.c.

{
  TST_DECL_VARS (size_t);
  char w_flg;
  const char *s, *p;
  size_t n;
  char t_flg, t_ini;
  static mbstate_t t = { 0 };
  mbstate_t *pt;
  wchar_t ws[WCSSIZE], *ws_ex, *wp;
  int err, i;

  TST_DO_TEST (mbsrtowcs)
  {
    TST_HEAD_LOCALE (mbsrtowcs, S_MBSRTOWCS);
    TST_DO_REC (mbsrtowcs)
    {
      s = "";
      if (mbsrtowcs (NULL, &s, 0, &t) != 0)
       {
         err_count++;
         Result (C_FAILURE, S_MBSRTOWCS, CASE_3,
                "Initialization failed - skipping this test case.");
         continue;
       }

      TST_DO_SEQ (MBSRTOWCS_SEQNUM)
      {
       TST_GET_ERRET_SEQ (mbsrtowcs);
       w_flg = TST_INPUT_SEQ (mbsrtowcs).w_flg;
       p = s = TST_INPUT_SEQ (mbsrtowcs).s;
       n = TST_INPUT_SEQ (mbsrtowcs).n;
       t_flg = TST_INPUT_SEQ (mbsrtowcs).t_flg;
       t_ini = TST_INPUT_SEQ (mbsrtowcs).t_init;
       wp = (w_flg == 0) ? NULL : ws;

       if (n == USE_MBCURMAX)
         {
           n = MB_CUR_MAX;
         }

       pt = (t_flg == 0) ? NULL : &t;

       if (t_ini != 0)
         {
           memset (&t, 0, sizeof (t));
         }

       TST_CLEAR_ERRNO;
       ret = mbsrtowcs (wp, &p, n, pt);
       TST_SAVE_ERRNO;

       if (debug_flg)
         {
           fprintf (stderr, "mbsrtowcs: [ %d ] : ret = %zd\n", rec + 1, ret);
         }

       TST_IF_RETURN (S_MBSRTOWCS)
       {
       };

       if (wp == NULL || ret == (size_t) - 1 || ret == (size_t) - 2)
         {
           continue;
         }

       ws_ex = TST_EXPECT_SEQ (mbsrtowcs).ws;
       for (err = 0, i = 0; i < ret; i++)
         {
           if (debug_flg)
             {
              fprintf (stderr,
                      "mbsrtowcs: ws[%d] => 0x%lx : 0x%lx <= ws_ex[%d]\n",
                      i, (unsigned long int) ws[i],
                      (unsigned long int) ws_ex[i], i);
             }

           if (ws[i] != ws_ex[i])
             {
              err++;
              err_count++;
              Result (C_FAILURE, S_MBSRTOWCS, CASE_4,
                     "the converted wc string has "
                     "different value from an expected string");
              break;
             }
         }

       if (!err)
         {
           Result (C_SUCCESS, S_MBSRTOWCS, CASE_4, MS_PASSED);
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_mbstowcs ( FILE ,
int   
)

Definition at line 11 of file tst_mbstowcs.c.

{
  TST_DECL_VARS (size_t);
  char w_flg, s_flg;
  const char *s;
  size_t n;
  wchar_t ws[WCSSIZE], *ws_ex, *wp;
  int err, i;

  TST_DO_TEST (mbstowcs)
  {
    TST_HEAD_LOCALE (mbstowcs, S_MBSTOWCS);
    TST_DO_REC (mbstowcs)
    {
      if (mbstowcs (NULL, "", 0) != 0)
       {
         err_count++;
         Result (C_FAILURE, S_MBSTOWCS, CASE_3,
                "Initialization failed - skipping this test case.");
         continue;
       }

      TST_DO_SEQ (MBSTOWCS_SEQNUM)
      {
       TST_GET_ERRET_SEQ (mbstowcs);
       w_flg = TST_INPUT_SEQ (mbstowcs).w_flg;
       s_flg = TST_INPUT_SEQ (mbstowcs).s_flg;
       n = TST_INPUT_SEQ (mbstowcs).n;

       if (s_flg == 0)
         s = NULL;
       else
         s = TST_INPUT_SEQ (mbstowcs).s;


       wp = (wchar_t *) ((w_flg == 0) ? NULL : ws);

       TST_CLEAR_ERRNO;
       ret = mbstowcs (wp, s, n);
       TST_SAVE_ERRNO;

       if (debug_flg)
         {
           fprintf (stderr, "mbstowcs: ret = %zd\n", ret);
         }

       TST_IF_RETURN (S_MBSTOWCS)
       {
       };

       if (s == NULL || wp == NULL || ret == (size_t) - 1)
         {
           continue;
         }

       ws_ex = TST_EXPECT_SEQ (mbstowcs).ws;

       for (err = 0, i = 0; i < ret; i++)
         {
           if (debug_flg)
             {
              fprintf (stderr,
                      "mbstowcs: ws[%d] => 0x%lx : 0x%lx <= ws_ex[%d]\n",
                      i, (unsigned long int) ws[i],
                      (unsigned long int) ws_ex[i], i);
             }

           if (ws[i] != ws_ex[i])
             {
              err++;
              err_count++;
              Result (C_FAILURE, S_MBSTOWCS, CASE_4,
                     "the converted wc string has "
                     "different value from an expected string");
              break;
             }
         }

       if (!err)
         {
           Result (C_SUCCESS, S_MBSTOWCS, CASE_4, MS_PASSED);
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_mbtowc ( FILE ,
int   
)

Definition at line 12 of file tst_mbtowc.c.

{
  TST_DECL_VARS (int);
  char w_flg, s_flg;
  const char *s_in;
  size_t n;
  wchar_t wc, wc_ex, *wp;

  TST_DO_TEST (mbtowc)
  {
    TST_HEAD_LOCALE (mbtowc, S_MBTOWC);
    TST_DO_REC (mbtowc)
    {
      if (mbstowcs (NULL, "", 0) != 0)
       {
         err_count++;
         Result (C_FAILURE, S_MBSTOWCS, CASE_3,
                "Initialization failed - skipping this test case.");
         continue;
       }

      TST_DO_SEQ (MBTOWC_SEQNUM)
      {
       TST_GET_ERRET_SEQ (mbtowc);
       w_flg = TST_INPUT_SEQ (mbtowc).w_flg;
       s_flg = TST_INPUT_SEQ (mbtowc).s_flg;
       n = TST_INPUT_SEQ (mbtowc).n;

       if (n == USE_MBCURMAX)
         {
           n = MB_CUR_MAX;
         }

       if (s_flg == 0)
         s_in = NULL;
       else
         s_in = TST_INPUT_SEQ (mbtowc).s;

       wp = (wchar_t *) ((w_flg == 0) ? NULL : &wc);

       /* XXX Clear the internal state.  We should probably have
          a flag for this.  */
       mbtowc (NULL, NULL, 0);

       TST_CLEAR_ERRNO;
       ret = mbtowc (wp, s_in, n);
       TST_SAVE_ERRNO;

       if (debug_flg)
         {
           fprintf (stdout, "mbtowc() [ %s : %d ] ret = %d\n", locale,
                   rec + 1, ret);
           fprintf (stdout, "                       errno      = %d\n",
                   errno_save);
         }

       TST_IF_RETURN (S_MBTOWC)
       {
         if (s_in == NULL)
           {                /* state dependency */
             if (ret_exp == +1)
              {             /* state-dependent  */
                if (ret != 0)
                  {
                    /* Non-zero: state-dependent encoding.  */
                    Result (C_SUCCESS, S_MBTOWC, CASE_3, MS_PASSED);
                  }
                else
                  {
                    err_count++;
                    Result (C_FAILURE, S_MBTOWC, CASE_3,
                           "should be state-dependent encoding, "
                           "but a return value shows it is "
                           "state-independent");
                  }
              }

             if (ret_exp == 0)
              {             /* state-independent */
                if (ret == 0)
                  {
                    /* Non-zero: state-dependent encoding.  */
                    Result (C_SUCCESS, S_MBTOWC, CASE_3, MS_PASSED);
                  }
                else
                  {
                    err_count++;
                    Result (C_FAILURE, S_MBTOWC, CASE_3,
                           "should be state-independent encoding, "
                           "but a return value shows it is "
                           "state-dependent");
                  }
              }
           }
       }

       if ((wp == NULL || s_in == NULL || s_in[0] == 0) || ret <= 0)
         {
           continue;
         }

       wc_ex = TST_EXPECT_SEQ (mbtowc).wc;

       if (wc_ex == wc)
         {
           Result (C_SUCCESS, S_MBTOWC, CASE_4, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_MBTOWC, CASE_4,
                  "converted wc is different from an expected wc");
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_strcoll ( FILE ,
int   
)

Definition at line 11 of file tst_strcoll.c.

{
  TST_DECL_VARS (int);
  const char *s1, *s2;

  TST_DO_TEST (strcoll)
  {
    TST_HEAD_LOCALE (strcoll, S_STRCOLL);
    TST_DO_REC (strcoll)
    {
      TST_GET_ERRET (strcoll);
      s1 = TST_INPUT (strcoll).s1;
      s2 = TST_INPUT (strcoll).s2;

      TST_CLEAR_ERRNO;
      ret = strcoll (s1, s2);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stdout, "strcoll() [ %s : %d ] ret = %d\n", locale,
                 rec + 1, ret);
         fprintf (stdout, "                   errno = %d\n",
                 errno_save);
         fprintf (stdout, "                   LC_COLLATE = %s\n",
                 (setlocale (LC_COLLATE, NULL)) ? setlocale (LC_COLLATE,
                                                        NULL) : "");
       }

      TST_IF_RETURN (S_STRCOLL)
      {
       if (ret_exp == +1)
         {
           if (ret > 0)
             {
              Result (C_SUCCESS, S_STRCOLL, CASE_3, MS_PASSED);
             }
           else
             {
              err_count++;
              Result (C_FAILURE, S_STRCOLL, CASE_3,
                     "the return value should be greater than 0,"
                     " but is not ...");
             }
         }
       else if (ret_exp == -1)
         {
           if (ret < 0)
             {
              Result (C_SUCCESS, S_STRCOLL, CASE_3, MS_PASSED);
             }
           else
             {
              err_count++;
              Result (C_FAILURE, S_STRCOLL, CASE_3,
                     "the return value should less than 0, but not ...");
             }
         }
       else if (ret_exp != 0)
         {
           if (debug_flg)
             {
              fprintf (stderr, "*** Warning *** : tst_strcoll : "
                      "(check the test data); should set ret_flg=1"
                      " to check a return value");
             }

           warn_count++;
           Result (C_INVALID, S_WCSCHR, CASE_3, "(check the test data); "
                  "should set ret_flg=1 to check a return value");
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_strfmon ( FILE ,
int   
)

Definition at line 12 of file tst_strfmon.c.

{
  TST_DECL_VARS (size_t);
  char buf[MONSIZE], *mon;
  size_t nbt;
  char *fmt;
  double val;

  TST_DO_TEST (strfmon)
  {
    TST_HEAD_LOCALE (strfmon, S_STRFMON);
    TST_DO_REC (strfmon)
    {
      TST_GET_ERRET (strfmon);
      nbt = TST_INPUT (strfmon).nbytes;
      fmt = TST_INPUT (strfmon).fmt;
      val = TST_INPUT (strfmon).val;
      memset (buf, 0, MONSIZE);
      if (nbt > MONSIZE)
       {
         err_count++;
         Result (C_FAILURE, S_STRFMON, CASE_3, "buffer too small in test");
         continue;
       }

      TST_CLEAR_ERRNO;
      ret = strfmon (buf, nbt, fmt, val, val, val);
      TST_SAVE_ERRNO;

      if (debug_flg)        /* seems fprintf doesn't update the errno */
       {
         fprintf (stdout, "strfmon() [ %s : %d ]\n", locale, rec + 1);
         fprintf (stdout, "   : err = %d | %s\n", errno_save,
                 strerror (errno));
         fprintf (stdout, "   : ret = %zd; \t fmt = |%s|\n", ret, fmt);
         fprintf (stdout, "   : buf = |%s|\n\n", buf);
       }

      TST_IF_RETURN (S_STRFMON)
      {
      };
      if (errno != 0 || ret == -1)
       {
         continue;
       }

      mon = TST_EXPECT (strfmon).mon;

      if (!strcmp (buf, mon))
       {
         Result (C_SUCCESS, S_STRFMON, CASE_3, MS_PASSED);
       }
      else
       {
         err_count++;
         Result (C_FAILURE, S_STRFMON, CASE_3, "the formatted string is "
                "different from an expected result");
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_strxfrm ( FILE ,
int   
)

Definition at line 12 of file tst_strxfrm.c.

{
  TST_DECL_VARS (size_t);
  const char *org1, *org2;
  char frm1[MBSSIZE], frm2[MBSSIZE];
  size_t n1, n2;
  int ret_coll, ret_cmp;

  TST_DO_TEST (strxfrm)
  {
    TST_HEAD_LOCALE (strxfrm, S_STRXFRM);
    TST_DO_REC (strxfrm)
    {
      TST_GET_ERRET (strxfrm);
      org1 = TST_INPUT (strxfrm).org1;
      org2 = TST_INPUT (strxfrm).org2;
      n1 = TST_INPUT (strxfrm).n1;
      n2 = TST_INPUT (strxfrm).n2;

      if (n1 < 0 || sizeof (frm1) < n1 || sizeof (frm2) < n2)
       {
         warn_count++;
         Result (C_IGNORED, S_STRXFRM, CASE_9,
                "input data n1 or n2 is invalid");
         continue;
       }

      /* An errno and a return value are checked
        only for 2nd strxfrm() call.
        A result of 1st call is used for comparing
        those 2 values by using strcmp().
      */

      /*-- First call --*/

      TST_CLEAR_ERRNO;
      ret = strxfrm (frm1, org1, n1);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stdout, "strxfrm() [ %s : %d ] ( 1st call )\n", locale,
                 rec + 1);
         fprintf (stdout, "   : err = %d | %s\n", errno_save,
                 strerror (errno));
         fprintf (stdout, "   : ret = %zu\n", ret);
         fprintf (stdout, "   : org = %s\n", org1);
       }

      if (ret >= n1 || errno != 0)
       {
         warn_count++;
         Result (C_INVALID, S_STRXFRM, CASE_8,
                "got an error in fist strxfrm() call");
         continue;
       }

      /*-- Second call --*/

      TST_CLEAR_ERRNO;
      ret = strxfrm (((n2 == 0) ? NULL : frm2), org2, n2);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stderr, "   ..............( 2nd call )\n");
         fprintf (stdout, "   : err = %d | %s\n", errno,
                 strerror (errno));
         fprintf (stdout, "   : ret = %zu\n", ret);
         fprintf (stdout, "   : org = %s\n", org2);
       }

      TST_IF_RETURN (S_STRXFRM)
      {
      };

      if (n2 == 0 || ret >= n2 || errno != 0)
       {
#if 0
         warn_count++;
         Result (C_IGNORED, S_STRXFRM, CASE_7, "did not get a result");
#endif
         continue;
       }

      /*-- strcoll & strcmp --*/

      TST_CLEAR_ERRNO;
      /* Depends on strcoll() ... not good though ... */
      ret_coll = strcoll (org1, org2);

      if (errno != 0)
       {
         /* bug * bug may get correct results ...         */
         warn_count++;
         Result (C_INVALID, S_STRXFRM, CASE_6,
                "got an error in strcoll() call");
         continue;
       }

      ret_cmp = strcmp (frm1, frm2);

      if ((ret_coll == 0 && ret_cmp == 0)
         || (ret_coll < 0 && ret_cmp < 0) || (ret_coll > 0 && ret_cmp > 0))
       {
         Result (C_SUCCESS, S_STRXFRM, CASE_3,
                MS_PASSED "(depends on strcoll & strcmp)");
       }
      else
       {
         err_count++;
         Result (C_FAILURE, S_STRXFRM, CASE_3,
                "results from strcoll & strcmp() do not match");
       }

      if (debug_flg)
       {
         fprintf (stdout, ".......... strcoll = %d <-> %d = strcmp\n",
                 ret_coll, ret_cmp);
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_swscanf ( FILE ,
int   
)

Definition at line 11 of file tst_swscanf.c.

{
  TST_DECL_VARS (int);
  wchar_t *ws;
  wchar_t *fmt;
  int val_int1;
  unsigned val_int2;
  float val_flt;
  char val_c;
  char val_s[MBSSIZE * 3];
  wchar_t val_S[WCSSIZE * 3], *exp_S;
  int i;

  TST_DO_TEST (swscanf)
  {
    TST_HEAD_LOCALE (swscanf, S_SWSCANF);
    TST_DO_REC (swscanf)
    {
      TST_GET_ERRET (swscanf);
      ws = TST_INPUT (swscanf).ws;
      fmt = TST_INPUT (swscanf).fmt;
      val_int1 = val_int2 = val_flt = val_c = 0;
      memset (val_s, 0, sizeof (val_s));
      memset (val_S, 0, sizeof (val_S));

      TST_CLEAR_ERRNO;

      if (TST_INPUT (swscanf).wch)
       {
         ret = swscanf (ws, fmt, val_S);
       }
      else
       {
         ret =
           swscanf (ws, fmt, &val_int1, &val_int2, &val_flt, &val_c, val_s);
       }

      TST_SAVE_ERRNO;

      if (debug_flg)
       {                    /* seems fprintf doesn't update errno */
         fprintf (stdout, "swscanf() [ %s : %d ] ret = %d\n", locale,
                 rec + 1, ret);
         fprintf (stdout, "                   errno   = %d\n",
                 errno_save);
         fprintf (stdout, "                   collate = %s\n",
                 (setlocale (LC_COLLATE, NULL)) ? setlocale (LC_COLLATE,
                                                        NULL) : "");

         if (TST_INPUT (swscanf).wch)
           {
             fprintf (stdout, "                  val_S[ 0 ] = 0x%lx\n",
                     (unsigned long int) val_S[0]);
           }
         else
           {
             fprintf (stdout, "                  val_int1   = %d\n",
                     val_int1);
             fprintf (stdout, "                  val_int2   = %d\n",
                     val_int2);
             fprintf (stdout, "                  val_flt          = %f\n",
                     val_flt);
             fprintf (stdout, "                  val_c     = %c\n",
                     val_c);
             fprintf (stdout, "                  val_s     = %s\n",
                     val_s);
           }
       }

      TST_IF_RETURN (S_SWSCANF)
      {
      };

      if (errno == 0 && TST_INPUT (swscanf).wch)
       {
         for (exp_S = TST_EXPECT (swscanf).val_S, i = 0; i < WCSSIZE * 3;
              i++)
           {
             if (val_S[i] == L'\0' || exp_S[i] == L'\0')
              {
                if (val_S[i] != exp_S[i] && TST_INPUT (swscanf).wch == 'C')
                  {
                    err_count++;
                    Result (C_FAILURE, S_SWSCANF, CASE_4,
                           "the converted wide-char string is different"
                           " from an expected value.");
                  }
                break;
              }

             if (val_S[i] != exp_S[i])
              {
                err_count++;
                Result (C_FAILURE, S_SWSCANF, CASE_4,
                       "the converted wide-char string is different from"
                       " an expected value.");
                break;
              }
             else
              {
                Result (C_SUCCESS, S_SWSCANF, CASE_4, MS_PASSED);
              }
           }
       }

      if (errno == 0 && !TST_INPUT (swscanf).wch)
       {
         if (val_int1 != TST_EXPECT (swscanf).val_int ||
             val_int2 != TST_EXPECT (swscanf).val_uns ||
             val_flt != TST_EXPECT (swscanf).val_flt ||
             val_c != TST_EXPECT (swscanf).val_c ||
             strcmp (val_s, TST_EXPECT (swscanf).val_s))
           {
             err_count++;
             Result (C_FAILURE, S_SWSCANF, CASE_3,
                    "the converted values are different from expected values.");
           }
         else
           {
             Result (C_SUCCESS, S_SWSCANF, CASE_3, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_towctrans ( FILE ,
int   
)

Definition at line 12 of file tst_towctrans.c.

{
  TST_DECL_VARS (wint_t);
  wint_t wc;
  const char *ts;
#if SHOJI_IS_RIGHT
  int dummy=0;
#endif
  wctrans_t wto;

  TST_DO_TEST (towctrans)
    {
      TST_HEAD_LOCALE (towctrans, S_TOWCTRANS);
      TST_DO_REC (towctrans)
       {
         TST_GET_ERRET (towctrans);
         wc = TST_INPUT (towctrans).wc;
         ts = TST_INPUT (towctrans).ts;

#if SHOJI_IS_RIGHT
         if ((wto = wctrans (ts)) == (wctrans_t) 0)
           {
#if 0
             result (fp, C_IGNORED, S_TOWCTRANS, locale, rec+1, seq_num+1, 3,
                    "Skip this data because the wctrans object is not invalid.");
             warn_count++;
             continue;
#else
             wto = &dummy;  /* not good ... */
#endif
             if (debug_flg)
              {
                fprintf (stdout, "towctrans() ------ wctrans() returnd 0.\n");
              }
           }
#else
         wto = wctrans (ts);
#endif

         TST_CLEAR_ERRNO;
         ret = towctrans (wc, wto);
         TST_SAVE_ERRNO;

         if (debug_flg)
           {
             fprintf (stdout, "towctrans() [ %s : %d ] ret = 0x%x\n",
                     locale, rec+1, ret);
             fprintf (stdout, "                 errno = %d\n",
                     errno_save);
           }

         TST_IF_RETURN (S_TOWCTRANS)
           {
             if (ret != 0)
              {
                result (fp, C_SUCCESS, S_TOWCTRANS, locale, rec+1,
                       seq_num+1, 3, MS_PASSED);
              }
             else
              {
                err_count++;
                result (fp, C_FAILURE, S_TOWCTRANS, locale, rec+1,
                       seq_num+1, 3,
                       "the function returned 0, but should be non-zero");
              }
           }
       }
    }

  return err_count;
}

Here is the call graph for this function:

int tst_towlower ( FILE ,
int   
)
int tst_towupper ( FILE ,
int   
)
int tst_wcrtomb ( FILE ,
int   
)

Definition at line 12 of file tst_wcrtomb.c.

{
  TST_DECL_VARS (wchar_t);
  wchar_t wc;
  char s[MBSSIZE], *s_in, *s_ex;
  char t_flg, t_ini;
  static mbstate_t t = { 0 };
  mbstate_t *pt;
  int err, i;

  TST_DO_TEST (wcrtomb)
  {
    TST_HEAD_LOCALE (wcrtomb, S_WCRTOMB);
    TST_DO_REC (wcrtomb)
    {
      TST_GET_ERRET (wcrtomb);
      s_in = ((TST_INPUT (wcrtomb).s_flg) == 0) ? (char *) NULL : s;
      wc = TST_INPUT (wcrtomb).wc;
      t_flg = TST_INPUT (wcrtomb).t_flg;
      t_ini = TST_INPUT (wcrtomb).t_init;
      pt = (t_flg == 0) ? NULL : &t;

      if (t_ini != 0)
       {
         memset (&t, 0, sizeof (t));
       }

      TST_CLEAR_ERRNO;
      ret = wcrtomb (s_in, wc, pt);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stdout, "wcrtomb() [ %s : %d ] ret = %lu\n", locale,
                 rec + 1, (unsigned long int) ret);
         fprintf (stdout, "               errno = %d\n", errno_save);
       }

      TST_IF_RETURN (S_WCRTOMB)
      {
      };

      s_ex = TST_EXPECT (wcrtomb).s;

      if (s_in)
       {
         for (i = 0, err = 0; *(s_ex + i) != 0 && i < MBSSIZE; i++)
           {
             if (s_in[i] != s_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCRTOMB, CASE_4,
                       "copied string is different from an "
                       "expected string");
                break;
              }
           }
         if (!err)
           {
             Result (C_SUCCESS, S_WCRTOMB, CASE_4, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcscat ( FILE ,
int   
)

Definition at line 11 of file tst_wcscat.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t *ws1, *ws2, *ws_ex;
  int i, err;

  TST_DO_TEST (wcscat)
  {
    TST_HEAD_LOCALE (wcscat, S_WCSCAT);
    TST_DO_REC (wcscat)
    {
      TST_GET_ERRET (wcscat);
      ws1 = TST_INPUT (wcscat).ws1;       /* external value: size WCSSIZE */
      ws2 = TST_INPUT (wcscat).ws2;

      TST_CLEAR_ERRNO;
      ret = wcscat (ws1, ws2);
      TST_SAVE_ERRNO;

      TST_IF_RETURN (S_WCSCAT)
      {
       if (ret == ws1)
         {
           Result (C_SUCCESS, S_WCSCAT, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCSCAT, CASE_3,
                  "the return address may not be correct");
         }
      }

      /* function specific test cases here */

      if (ret == ws1)
       {
         ws_ex = TST_EXPECT (wcscat).ws;
         for (err = 0, i = 0;
              (ws1[i] != 0L || ws_ex[i] != 0L) && i < WCSSIZE; i++)
           {
             if (debug_flg)
              {
                fprintf (stdout, "tst_wcscat() : ws1[%d] = 0x%lx\n", i,
                        (unsigned long int) ws1[i]);
              }

             if (ws1[i] != ws_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCSCAT, CASE_4,
                       "concatinated string is different from an "
                       "expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCSCAT, CASE_4, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcschr ( FILE ,
int   
)

Definition at line 11 of file tst_wcschr.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t *ws, wc;

  TST_DO_TEST (wcschr)
  {
    TST_HEAD_LOCALE (wcschr, S_WCSCHR);
    TST_DO_REC (wcschr)
    {
      TST_GET_ERRET (wcschr);
      ws = TST_INPUT (wcschr).ws;  /* external value: size WCSSIZE */
      wc = TST_INPUT (wcschr).wc;
      ret = wcschr (ws, wc);

      if (debug_flg)
       {
         if (ret)
           {
             fprintf (stderr, "wcschr: ret = 0x%lx\n",
                     (unsigned long int) *ret);
           }
         else
           {
             fprintf (stderr, "wcschr: ret = NULL pointer\n");
           }
       }

      TST_IF_RETURN (S_WCSCHR)
      {
       if (ret == NULL)
         {
           if (debug_flg)
             {
              fprintf (stderr, "*** Warning *** tst_wcschr: "
                      "set ret_flg=1 to check NULL return value\n");
             }

           warn_count++;
           Result (C_INVALID, S_WCSCHR, CASE_3, "(check the test data) "
                  "set ret_flg=1 to check NULL return value");
           continue;
         }

       if (*ret == wc)
         {
           Result (C_SUCCESS, S_WCSCHR, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCSCHR, CASE_3,
                  "the returned address of the string seems to be wrong");
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcscmp ( FILE ,
int   
)

Definition at line 12 of file tst_wcscmp.c.

{
  TST_DECL_VARS (int);
  wchar_t *ws1, *ws2;

  TST_DO_TEST (wcscmp)
  {
    TST_HEAD_LOCALE (wcscmp, S_WCSCMP);
    TST_DO_REC (wcscmp)
    {
      TST_GET_ERRET (wcscmp);
      ws1 = TST_INPUT (wcscmp).ws1;
      ws2 = TST_INPUT (wcscmp).ws2;
      ret = wcscmp (ws1, ws2);
      ret = (ret > 0 ? 1 : ret < 0 ? -1 : 0);

      if (debug_flg)
       {
         fprintf (stderr, "tst_wcscmp: ret = %d\n", ret);
       }

      TST_IF_RETURN (S_WCSCMP)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcscoll ( FILE ,
int   
)

Definition at line 11 of file tst_wcscoll.c.

{
  TST_DECL_VARS (int);
  wchar_t *ws1, *ws2;
  int cmp;

  TST_DO_TEST (wcscoll)
  {
    TST_HEAD_LOCALE (wcscoll, S_WCSCOLL);
    TST_DO_REC (wcscoll)
    {
      TST_GET_ERRET (wcscoll);
      ws1 = TST_INPUT (wcscoll).ws1;      /* external value: size WCSSIZE */
      ws2 = TST_INPUT (wcscoll).ws2;

      TST_CLEAR_ERRNO;
      ret = wcscoll (ws1, ws2);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stderr, "tst_wcscoll: ret = %d\n", ret);
       }

      cmp = TST_EXPECT (wcscoll).cmp_flg;
      TST_IF_RETURN (S_WCSCOLL)
      {
       if (cmp != 0)
         {
           if ((cmp == 1 && ret > 0) || (cmp == -1 && ret < 0))
             {
              Result (C_SUCCESS, S_WCSCOLL, CASE_3, MS_PASSED);
             }
           else
             {
              err_count++;
              if (cmp == 1)
                {
                  if (ret == 0)
                    Result (C_FAILURE, S_WCSCOLL, CASE_3,
                           "the return value should be positive"
                           " but it's zero.");
                  else
                    Result (C_FAILURE, S_WCSCOLL, CASE_3,
                           "the return value should be positive"
                           " but it's negative.");
                }
              else
                {
                  if (ret == 0)
                    Result (C_FAILURE, S_WCSCOLL, CASE_3,
                           "the return value should be negative"
                           " but it's zero.");
                  else
                    Result (C_FAILURE, S_WCSCOLL, CASE_3,
                           "the return value should be negative"
                           " but it's positive.");
                }
             }
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcscpy ( FILE ,
int   
)

Definition at line 10 of file tst_wcscpy.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t ws1[WCSSIZE], *ws2, *ws_ex;
  int err, i;

  TST_DO_TEST (wcscpy)
  {
    TST_HEAD_LOCALE (wcscpy, S_WCSCPY);
    TST_DO_REC (wcscpy)
    {
      TST_GET_ERRET (wcscpy);
      ws2 = TST_INPUT (wcscpy).ws; /* external value: size WCSSIZE */
      ret = wcscpy (ws1, ws2);

      TST_IF_RETURN (S_WCSCPY)
      {
       if (ret == ws1)
         {
           Result (C_SUCCESS, S_WCSCPY, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCSCPY, CASE_3,
                  "the return address may not be correct");
         }
      }

      if (ret == ws1)
       {
         ws_ex = TST_EXPECT (wcscpy).ws;

         for (err = 0, i = 0;
              (ws1[i] != 0L || ws_ex[i] != 0L) && i < WCSSIZE; i++)
           {
             if (debug_flg)
              {
                fprintf (stderr,
                        "ws1[ %d ] = 0x%lx <-> wx_ex[ %d ] = 0x%lx\n", i,
                        (unsigned long int) ws1[i], i,
                        (unsigned long int) ws_ex[i]);
              }

             if (ws1[i] != ws_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCSCPY, CASE_4,
                       "copied string is different from an"
                       " expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCSCPY, CASE_4, MS_PASSED);
           }

         if (ws1[i] == 0L)
           {
             Result (C_SUCCESS, S_WCSCPY, CASE_5, MS_PASSED);
           }
         else
           {
             err_count++;
             Result (C_FAILURE, S_WCSCPY, CASE_5,
                    "copied string is not null-terminated");
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcscspn ( FILE ,
int   
)

Definition at line 11 of file tst_wcscspn.c.

{
  TST_DECL_VARS (size_t);
  wchar_t *ws1, *ws2;

  TST_DO_TEST (wcscspn)
  {
    TST_HEAD_LOCALE (wcscspn, S_WCSCSPN);
    TST_DO_REC (wcscspn)
    {
      TST_GET_ERRET (wcscspn);
      ws1 = TST_INPUT (wcscspn).ws1;
      ws2 = TST_INPUT (wcscspn).ws2;      /* external value: size WCSSIZE */
      ret = wcscspn (ws1, ws2);

      if (debug_flg)
       {
         fprintf (stderr, "wcscspn: ret = %zu\n", ret);
       }

      TST_IF_RETURN (S_WCSCSPN)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcslen ( FILE ,
int   
)

Definition at line 11 of file tst_wcslen.c.

{
  TST_DECL_VARS (size_t);
  wchar_t *ws;

  TST_DO_TEST (wcslen)
  {
    TST_HEAD_LOCALE (wcslen, S_WCSLEN);
    TST_DO_REC (wcslen)
    {
      TST_GET_ERRET (wcslen);
      ws = TST_INPUT (wcslen).ws;
      ret = wcslen (ws);
      TST_IF_RETURN (S_WCSLEN)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsncat ( FILE ,
int   
)

Definition at line 11 of file tst_wcsncat.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t *ws1, *ws2, *ws_ex;
  int n, i, err;

  TST_DO_TEST (wcsncat)
  {
    TST_HEAD_LOCALE (wcsncat, S_WCSNCAT);
    TST_DO_REC (wcsncat)
    {
      TST_GET_ERRET (wcsncat);
      ws1 = TST_INPUT (wcsncat).ws1;      /* external value: size WCSSIZE */
      ws2 = TST_INPUT (wcsncat).ws2;
      n = TST_INPUT (wcsncat).n;
      ret = wcsncat (ws1, ws2, n);

      TST_IF_RETURN (S_WCSNCAT)
      {
       if (ret == ws1)
         {
           Result (C_SUCCESS, S_WCSNCAT, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCSNCAT, CASE_3,
                  "the return address may not be correct");
         }
      }

      if (ret == ws1)
       {
         ws_ex = TST_EXPECT (wcsncat).ws;

         for (err = 0, i = 0;
              (ws1[i] != 0L || ws_ex[i] != 0L) && i < WCSSIZE; i++)
           {
             if (debug_flg)
              {
                fprintf (stderr, "ws1[%d] = 0x%lx\n", i,
                        (unsigned long int) ws1[i]);
              }

             if (ws1[i] != ws_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCSNCAT, CASE_4,
                       "the concatinated string has "
                       "different value from an expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCSNCAT, CASE_4, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsncmp ( FILE ,
int   
)

Definition at line 11 of file tst_wcsncmp.c.

{
  TST_DECL_VARS (int);
  wchar_t *ws1, *ws2;
  size_t n;

  TST_DO_TEST (wcsncmp)
  {
    TST_HEAD_LOCALE (wcsncmp, S_WCSNCMP);
    TST_DO_REC (wcsncmp)
    {
      TST_GET_ERRET (wcsncmp);
      ws1 = TST_INPUT (wcsncmp).ws1;      /* external value: size WCSSIZE */
      ws2 = TST_INPUT (wcsncmp).ws2;
      n = TST_INPUT (wcsncmp).n;
      ret = wcsncmp (ws1, ws2, n);

      if (debug_flg)
       {
         fprintf (stderr, "tst_wcsncmp: ret = %d, 0x%x\n", ret, ret);
       }

      TST_IF_RETURN (S_WCSNCMP)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsncpy ( FILE ,
int   
)

Definition at line 13 of file tst_wcsncpy.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t ws1[WCSSIZE] =
    { 0x9999, 0x9999, 0x9999, 0x9999, 0x9999, 0x9999, 0x0000 };
  wchar_t *ws2, *ws_ex;
  int err, i;
  size_t n;

  TST_DO_TEST (wcsncpy)
  {
    TST_HEAD_LOCALE (wcsncpy, S_WCSNCPY);
    TST_DO_REC (wcsncpy)
    {
      TST_GET_ERRET (wcsncpy);

      for (n = 0; n < WCSNUM_NCPY - 1; ++n)
       {
         ws1[n] = 0x9999;
       }

      ws1[n] = 0;
      ws2 = TST_INPUT (wcsncpy).ws;       /* external value: size WCSSIZE */
      n = TST_INPUT (wcsncpy).n;
      ret = wcsncpy (ws1, ws2, n);

      TST_IF_RETURN (S_WCSNCPY)
      {
       if (ret == ws1)
         {
           Result (C_SUCCESS, S_WCSNCPY, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCSNCPY, CASE_3,
                  "the return address may not be correct");
         }
      }

      if (ret == ws1)
       {
         if (debug_flg)
           {
             fprintf (stderr, "\nwcsncpy: n = %zu\n\n", n);
           }

         ws_ex = TST_EXPECT (wcsncpy).ws;

         for (err = 0, i = 0; i < WCSNUM_NCPY && i < WCSSIZE; i++)
           {
             if (debug_flg)
              fprintf (stderr,
                      "wcsncpy: ws1[ %d ] = 0x%lx <-> wx_ex[ %d ] = 0x%lx\n",
                      i, (unsigned long int) ws1[i], i,
                      (unsigned long int) ws_ex[i]);

             if (ws1[i] != ws_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCSNCPY, CASE_4,
                       "copied string is different from an "
                       "expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCSNCPY, CASE_4, MS_PASSED);
           }

         /* A null terminate character is not supposed to be copied
            unless (num chars of ws2)<n. */
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcspbrk ( FILE ,
int   
)

Definition at line 11 of file tst_wcspbrk.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t *ws1, *ws2;
  int err;
  wchar_t wc_ex;

  TST_DO_TEST (wcspbrk)
  {
    TST_HEAD_LOCALE (wcspbrk, S_WCSPBRK);
    TST_DO_REC (wcspbrk)
    {
      TST_GET_ERRET (wcspbrk);
      ws1 = TST_INPUT (wcspbrk).ws1;
      ws2 = TST_INPUT (wcspbrk).ws2;

      ret = wcspbrk (ws1, ws2);

      if (debug_flg)
       {
         fprintf (stdout, "wcspbrk() [ %s : %d ] ret = %s\n", locale,
                 rec + 1, (ret == NULL) ? "null" : "not null");
         if (ret)
           fprintf (stderr,
                   "                     ret[0] = 0x%lx : 0x%lx = ws2[0]\n",
                   (unsigned long int) ret[0], (unsigned long int) ws2[0]);
       }

      TST_IF_RETURN (S_WCSPBRK)
      {
       if (ws2[0] == 0)
         {
           if (ret == ws1)
             {
              Result (C_SUCCESS, S_WCSPBRK, CASE_3, MS_PASSED);
             }
           else
             {
              err_count++;
              Result (C_FAILURE, S_WCSPBRK, CASE_3,
                     "return address is not same address as ws1");
             }

           continue;
         }

       wc_ex = TST_EXPECT (wcspbrk).wc;

       if (debug_flg)
         fprintf (stdout,
                 "                     *ret = 0x%lx <-> 0x%lx = wc_ex\n",
                 (unsigned long int) *ret, (unsigned long int) wc_ex);

       if (*ret != wc_ex)
         {
           err++;
           err_count++;
           Result (C_FAILURE, S_WCSPBRK, CASE_4, "the pointed wc is "
                  "different from an expected wc");
         }
       else
         {
           Result (C_SUCCESS, S_WCSPBRK, CASE_4, MS_PASSED);
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsrtombs ( FILE ,
int   
)

Definition at line 14 of file tst_wcsrtombs.c.

{
  TST_DECL_VARS (size_t);
  char s_flg, n;
  const wchar_t *ws, *wp;
  char s[MBSSIZE], *s_in;
  char t_flg, t_ini;
  static mbstate_t t = { 0 };
  mbstate_t *pt;
  int err, i;
  char *s_ex;

  TST_DO_TEST (wcsrtombs)
  {
    TST_HEAD_LOCALE (wcsrtombs, S_WCSRTOMBS);
    TST_DO_REC (wcsrtombs)
    {
      TST_GET_ERRET (wcsrtombs);
      memset (s, MARK_VAL, MBSSIZE);

      s_flg = TST_INPUT (wcsrtombs).s_flg;
      s_in = (s_flg == 1) ? s : (char *) NULL;
      wp = ws = TST_INPUT (wcsrtombs).ws;
      n = TST_INPUT (wcsrtombs).n;
      t_flg = TST_INPUT (wcsrtombs).t_flg;
      t_ini = TST_INPUT (wcsrtombs).t_init;
      pt = (t_flg == 0) ? NULL : &t;

      if (t_ini != 0)
       {
         memset (&t, 0, sizeof (t));
       }

      TST_CLEAR_ERRNO;
      ret = wcsrtombs (s_in, &wp, n, pt);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stderr, "wcsrtombs: ret = %zu\n", ret);
       }

      TST_IF_RETURN (S_WCSRTOMBS)
      {
      };

      if (s_in != NULL && ret != (size_t) - 1)
       {
         /* No definition for s, when error occurs.  */
         s_ex = TST_EXPECT (wcsrtombs).s;

         for (err = 0, i = 0; i <= ret && i < MBSSIZE; i++)
           {
             if (debug_flg)
              {
                fprintf (stderr,
                        "   : s[%d] = 0x%hx <-> 0x%hx = s_ex[%d]\n", i,
                        s[i], s_ex[i], i);
              }

             if (i == ret && ret == n)    /* no null termination */
              {
                if (s[i] == MARK_VAL)
                  {
                    Result (C_SUCCESS, S_WCSRTOMBS, CASE_4, MS_PASSED);
                  }
                else
                  {
                    err_count++;
                    Result (C_FAILURE, S_WCSRTOMBS, CASE_4,
                           "should not be null terminated "
                           "(it may be a null char), but it is");
                  }

                break;
              }

             if (i == ret && ret < n)     /* null termination */
              {
                if (s[i] == 0)
                  {
                    Result (C_SUCCESS, S_WCSRTOMBS, CASE_5, MS_PASSED);
                  }
                else
                  {
                    err_count++;
                    Result (C_FAILURE, S_WCSRTOMBS, CASE_5,
                           "should be null terminated, but it is not");
                  }

                break;
              }

             if (s[i] != s_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCSRTOMBS, CASE_6,
                       "converted string is different from an"
                       " expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCSRTOMBS, CASE_6, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsspn ( FILE ,
int   
)

Definition at line 11 of file tst_wcsspn.c.

{
  TST_DECL_VARS (size_t);
  wchar_t *ws1, *ws2;

  TST_DO_TEST (wcsspn)
  {
    TST_HEAD_LOCALE (wcsspn, S_WCSSPN);
    TST_DO_REC (wcsspn)
    {
      TST_GET_ERRET (wcsspn);
      ws1 = TST_INPUT (wcsspn).ws1;
      ws2 = TST_INPUT (wcsspn).ws2;       /* external value: size WCSSIZE */
      ret = wcsspn (ws1, ws2);

      if (debug_flg)
       {
         fprintf (stderr, "wcsspn: ret = %zu\n", ret);
       }

      TST_IF_RETURN (S_WCSSPN)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsstr ( FILE ,
int   
)

Definition at line 11 of file tst_wcsstr.c.

{
  TST_DECL_VARS (wchar_t *);
  wchar_t *ws1, *ws2;
  int err, i;

  TST_DO_TEST (wcsstr)
  {
    TST_HEAD_LOCALE (wcsstr, S_WCSSTR);
    TST_DO_REC (wcsstr)
    {
      TST_GET_ERRET (wcsstr);
      ws1 = TST_INPUT (wcsstr).ws1;
      ws2 = TST_INPUT (wcsstr).ws2;       /* external value: size WCSSIZE */
      ret = wcsstr (ws1, ws2);

      if (debug_flg)
       {
         fprintf (stderr, "wcsstr: %d : ret = %s\n", rec + 1,
                 (ret == NULL) ? "null" : "not null");
         if (ret)
           {
             fprintf (stderr,
                     "      ret[ 0 ] = 0x%lx <-> 0x%lx = ws2[ 0 ]\n",
                     (unsigned long int) ret[0], (unsigned long int) ws2[0]);
           }
       }

      TST_IF_RETURN (S_WCSSTR)
      {
       if (ws2[0] == 0)
         {
           if (ret == ws1)
             {
              Result (C_SUCCESS, S_WCSSTR, CASE_3, MS_PASSED);
             }
           else
             {
              err_count++;
              Result (C_FAILURE, S_WCSSTR, CASE_3,
                     "return address is not same address as ws1");
             }

           continue;
         }

       for (i = 0, err = 0; *(ws2 + i) != 0 && i < WCSSIZE; i++)
         {
           if (debug_flg)
             {
              fprintf (stderr,
                      "     : ret[ %d ] = 0x%lx <-> 0x%lx = ws2[ %d ]\n",
                      i, (unsigned long int) ret[i],
                      (unsigned long int) ws2[i], i);
             }

           if (ret[i] != ws2[i])
             {
              err++;
              err_count++;
              Result (C_FAILURE, S_WCSSTR, CASE_4, "pointed sub-string is "
                     "different from an expected sub-string");
              break;
             }
         }

       if (!err)
         {
           Result (C_SUCCESS, S_WCSSTR, CASE_4, MS_PASSED);
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcstod ( FILE ,
int   
)

Definition at line 11 of file tst_wcstod.c.

{
  TST_DECL_VARS (double);
  wchar_t *np, *endp, fwc;
  double val;

  TST_DO_TEST (wcstod)
  {
    TST_HEAD_LOCALE (wcstod, S_WCSTOD);
    TST_DO_REC (wcstod)
    {
      TST_GET_ERRET (wcstod);
      np = TST_INPUT (wcstod).np;

      TST_CLEAR_ERRNO;
      ret = wcstod (np, &endp);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stdout, "wcstod() [ %s : %d ] ret  = %f\n", locale,
                 rec + 1, ret);
         fprintf (stdout, "                 *endp = 0x%lx\n",
                 (unsigned long int) *endp);
       }

      TST_IF_RETURN (S_WCSTOD)
      {
       if (ret != 0)
         {
           val = ret - TST_EXPECT (wcstod).val;
           if (TST_ABS (val) < TST_DBL_EPS)
             {
              Result (C_SUCCESS, S_WCSTOD, CASE_3, MS_PASSED);
             }
           else
             {
              err_count++;
              Result (C_FAILURE, S_WCSTOD, CASE_3, "return value is wrong");
             }
         }
      }

      fwc = TST_EXPECT (wcstod).fwc;

      if (fwc == *endp)
       {
         Result (C_SUCCESS, S_WCSTOD, CASE_4, MS_PASSED);
       }
      else
       {
         err_count++;
         Result (C_FAILURE, S_WCSTOD, CASE_4, "a final wc is wrong.");
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcstok ( FILE ,
int   
)

Definition at line 12 of file tst_wcstok.c.

{
  TST_DECL_VARS (wchar_t *);
  char w_flg;
  wchar_t *ws;
  wchar_t *dt, *pt;
  wchar_t *ws_ex;
  int err, i;

  TST_DO_TEST (wcstok)
  {
    TST_HEAD_LOCALE (wcstok, S_WCSTOK);
    TST_DO_REC (wcstok)
    {
      TST_DO_SEQ (WCSTOK_SEQNUM)
      {
       TST_GET_ERRET_SEQ (wcstok);
       w_flg = TST_INPUT_SEQ (wcstok).w_flg;
       ws = (w_flg) ? TST_INPUT_SEQ (wcstok).ws : NULL;
       dt = TST_INPUT_SEQ (wcstok).dt;

       ret = wcstok (ws, dt, &pt);

       if (debug_flg)
         {
           fprintf (stdout, "wcstok() [ %s : %d : %d ] *ret  = 0x%lx\n",
                   locale, rec + 1, seq_num + 1, (unsigned long int) *ret);
           if (pt && *pt)
             {
              fprintf (stdout, "                  *pt   = 0x%lx\n",
                      (unsigned long int) *pt);
             }
         }

       TST_IF_RETURN (S_WCSTOK)
       {
       };

       if (ret != NULL)
         {
           ws_ex = TST_EXPECT_SEQ (wcstok).ws;

           /* XXX: REVISIT : insufficient conditions */
           for (err = 0, i = 0; i < WCSSIZE; i++)
             {
              if (ret[i] == L'\0' && ws_ex[i] == L'\0')
                {
                  break;
                }

              if (debug_flg)
                {
                  fprintf (stderr,
                          "                     ret[%d] = 0x%lx <-> "
                          "0x%lx = ws_ex[%d]\n",
                          i, (unsigned long int) ret[i],
                          (unsigned long int) ws_ex[i], i);
                }

              if (ret[i] != ws_ex[i])
                {
                  err++;
                  err_count++;
                  Result (C_FAILURE, S_WCSTOK, CASE_3,
                         "the token is different from an expected string");
                  break;
                }

              if (ret[i] == L'\0' || ws_ex[i] == L'\0')
                {
                  break;
                }
             }

           if (!err)
             {
              Result (C_SUCCESS, S_WCSTOK, CASE_3, MS_PASSED);
             }
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcstombs ( FILE ,
int   
)

Definition at line 13 of file tst_wcstombs.c.

{
  TST_DECL_VARS (size_t);
  char s_flg, n;
  wchar_t *ws;
  char s[MBSSIZE], *s_in;
  int err, i;
  char *s_ex;

  TST_DO_TEST (wcstombs)
  {
    TST_HEAD_LOCALE (wcstombs, S_WCSTOMBS);
    TST_DO_REC (wcstombs)
    {
      TST_GET_ERRET (wcstombs);
      memset (s, MARK_VAL, MBSSIZE);

      s_flg = TST_INPUT (wcstombs).s_flg;
      s_in = (s_flg == 1) ? s : (char *) NULL;
      ws = TST_INPUT (wcstombs).ws;
      n = TST_INPUT (wcstombs).n;

      TST_CLEAR_ERRNO;
      ret = wcstombs (s_in, ws, n);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stdout, "wcstombs: ret  = %zu\n", ret);
       }

      TST_IF_RETURN (S_WCSTOMBS)
      {
      };

      if (s_in != NULL && ret != (size_t) - 1)
       {
         /* No definition for s, when error occurs.  */
         s_ex = TST_EXPECT (wcstombs).s;

         for (err = 0, i = 0; i <= ret && i < MBSSIZE; i++)
           {
             if (debug_flg)
              {
                fprintf (stdout,
                        "   : s[%d] = 0x%hx <-> 0x%hx = s_ex[%d]\n", i,
                        s[i], s_ex[i], i);
              }

             if (i == ret && ret == n)    /* no null termination */
              {
                if (s[i] == MARK_VAL)
                  {
                    Result (C_SUCCESS, S_WCSTOMBS, CASE_4, MS_PASSED);
                  }
                else
                  {
                    err_count++;
                    Result (C_FAILURE, S_WCSTOMBS, CASE_4,
                           "should not be null terminated "
                           "(it may be a null char), but it is");
                  }

                break;
              }

             if (i == ret && ret < n)     /* null termination */
              {
                if (s[i] == 0)
                  {
                    Result (C_SUCCESS, S_WCSTOMBS, CASE_5, MS_PASSED);
                  }
                else
                  {
                    err_count++;
                    Result (C_FAILURE, S_WCSTOMBS, CASE_5,
                           "should be null terminated, but it is not");
                  }

                break;
              }

             if (s[i] != s_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCSTOMBS, CASE_6,
                       "converted string is different from an "
                       "expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCSTOMBS, CASE_6, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcswidth ( FILE ,
int   
)

Definition at line 11 of file tst_wcswidth.c.

{
  TST_DECL_VARS (int);
  wchar_t *ws;
  int n;

  TST_DO_TEST (wcswidth)
  {
    TST_HEAD_LOCALE (wcswidth, S_WCSWIDTH);
    TST_DO_REC (wcswidth)
    {
      TST_GET_ERRET (wcswidth);
      ws = TST_INPUT (wcswidth).ws;
      n = TST_INPUT (wcswidth).n;
      ret = wcswidth (ws, n);

      if (debug_flg)
       {
         fprintf (stderr, "wcswidth: [ %d ] : ret = %d\n", rec + 1, ret);
       }

      TST_IF_RETURN (S_WCSWIDTH)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcsxfrm ( FILE ,
int   
)

Definition at line 11 of file tst_wcsxfrm.c.

{
  TST_DECL_VARS (size_t);
  wchar_t *org1, *org2;
  wchar_t frm1[MBSSIZE], frm2[MBSSIZE];
  size_t n1, n2;
  int ret_coll, ret_cmp;

  TST_DO_TEST (wcsxfrm)
  {
    TST_HEAD_LOCALE (wcsxfrm, S_WCSXFRM);
    TST_DO_REC (wcsxfrm)
    {
      TST_GET_ERRET (wcsxfrm);
      org1 = TST_INPUT (wcsxfrm).org1;
      org2 = TST_INPUT (wcsxfrm).org2;
      n1 = TST_INPUT (wcsxfrm).n1;
      n2 = TST_INPUT (wcsxfrm).n2;
      if (n1 < 0 || sizeof (frm1) < n1 || sizeof (frm2) < n2)
       {
         warn_count++;
         Result (C_IGNORED, S_WCSXFRM, CASE_9,
                "input data n1 or n2 is invalid");
         continue;
       }

      /* an errno and a return value are checked
        only for 2nd wcsxfrm() call.
        A result of 1st call is used to compare
        those 2 values by using wcscmp().
       */

      TST_CLEAR_ERRNO;
      ret = wcsxfrm (frm1, org1, n1);     /* First call */
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stdout, "tst_wcsxfrm() : REC = %d\n", rec + 1);
         fprintf (stdout, "tst_wcsxfrm() : 1st ret = %zu\n", ret);
       }

      if (ret == -1 || ret >= n1 || errno_save != 0)
       {
         warn_count++;
         Result (C_INVALID, S_WCSXFRM, CASE_8,
                "got an error in fist wcsxfrm() call");
         continue;
       }

      TST_CLEAR_ERRNO;
      /* Second call */
      ret = wcsxfrm (((n2 == 0) ? NULL : frm2), org2, n2);
      TST_SAVE_ERRNO;

      TST_IF_RETURN (S_WCSXFRM)
      {
      };

      if (n2 == 0 || ret >= n2 || errno != 0)
       {
#if 0
         warn_count++;
         Result (C_IGNORED, S_WCSXFRM, CASE_7, "did not get a result");
#endif
         continue;
       }

      if (debug_flg)
       {
         fprintf (stdout, "tst_wcsxfrm() : 2nd ret = %zu\n", ret);
       }

      /* wcscoll() */
      TST_CLEAR_ERRNO;
      /* depends on wcscoll() ... not good though ... */
      ret_coll = wcscoll (org1, org2);
      TST_SAVE_ERRNO;

      if (errno != 0)              /* bugs * bugs may got correct results ... */
       {
         warn_count++;
         Result (C_INVALID, S_WCSXFRM, CASE_6,
                "got an error in wcscoll() call");
         continue;
       }
      /* wcscmp() */
      ret_cmp = wcscmp (frm1, frm2);

      if ((ret_coll == ret_cmp) || (ret_coll > 0 && ret_cmp > 0)
         || (ret_coll < 0 && ret_cmp < 0))
       {
         Result (C_SUCCESS, S_WCSXFRM, CASE_3,
                MS_PASSED " (depends on wcscoll & wcscmp)");
       }
      else
       {
         err_count++;
         Result (C_FAILURE, S_WCSXFRM, CASE_3,
                "results from wcscoll & wcscmp() do not match");
       }

      if (debug_flg)
       {
         fprintf (stdout, "tst_wcsxfrm() : coll = %d <-> %d = cmp\n",
                 ret_coll, ret_cmp);
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wctob ( FILE ,
int   
)

Definition at line 11 of file tst_wctob.c.

{
  TST_DECL_VARS (int);
  wchar_t wc;

  TST_DO_TEST (wctob)
  {
    TST_HEAD_LOCALE (wctob, S_WCTOB);
    TST_DO_REC (wctob)
    {
      TST_GET_ERRET (wctob);
      wc = TST_INPUT (wctob).wc;
      ret = wctob (wc);

      if (debug_flg)
       {
         fprintf (stderr, "tst_wctob : [ %d ] ret = %d\n", rec + 1, ret);
       }

      TST_IF_RETURN (S_WCTOB)
      {
      };
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wctomb ( FILE ,
int   
)

Definition at line 11 of file tst_wctomb.c.

{
  TST_DECL_VARS (int);
  wchar_t wc;
  char s[MBSSIZE], *s_in, *s_ex;
  int err, i;

  TST_DO_TEST (wctomb)
  {
    TST_HEAD_LOCALE (wctomb, S_WCTOMB);
    TST_DO_REC (wctomb)
    {
      TST_GET_ERRET (wctomb);
      wc = TST_INPUT (wctomb).wc;
      s_in = ((TST_INPUT (wctomb).s_flg) == 0) ? (char *) NULL : s;
      ret = wctomb (s_in, wc);

      if (debug_flg)
       {
         fprintf (stdout, "wctomb() [ %s : %d ] ret  = %d\n", locale,
                 rec + 1, ret);
       }

      TST_IF_RETURN (S_WCTOMB)
      {
       if (s_in == NULL)    /* state dependency */
         {
           if (ret_exp == +1)      /* state-dependent  */
             {
              if (ret != 0)
                {
                  /* Non-zero means state-dependent encoding.   */
                  Result (C_SUCCESS, S_WCTOMB, CASE_3, MS_PASSED);
                }
              else
                {
                  err_count++;
                  Result (C_FAILURE, S_WCTOMB, CASE_3,
                         "should be state-dependent encoding, "
                         "but a return value shows it is "
                         "state-independent");
                }
             }

           if (ret_exp == 0)       /* state-independent */
             {
              if (ret == 0)
                {
                  /* Non-zero means state-dependent encoding.   */
                  Result (C_SUCCESS, S_WCTOMB, CASE_3, MS_PASSED);
                }
              else
                {
                  err_count++;
                  Result (C_FAILURE, S_WCTOMB, CASE_3,
                         "should be state-independent encoding, "
                         "but a return value shows it is state-dependent");
                }
             }
         }
      }

      s_ex = TST_EXPECT (wctomb).s;

      if (s_in)
       {
         for (i = 0, err = 0; *(s_ex + i) != 0 && i < MBSSIZE; i++)
           {
             if (s_in[i] != s_ex[i])
              {
                err++;
                err_count++;
                Result (C_FAILURE, S_WCTOMB, CASE_4,
                       "copied string is different from an"
                       " expected string");
                break;
              }
           }

         if (!err)
           {
             Result (C_SUCCESS, S_WCTOMB, CASE_4, MS_PASSED);
           }
       }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wctrans ( FILE ,
int   
)

Definition at line 11 of file tst_wctrans.c.

{
  TST_DECL_VARS (wctrans_t);
  char *class;

  TST_DO_TEST (wctrans)
  {
    TST_HEAD_LOCALE (wctrans, S_WCTRANS);
    TST_DO_REC (wctrans)
    {
      TST_GET_ERRET (wctrans);
      class = TST_INPUT (wctrans).class;

      TST_CLEAR_ERRNO;
      ret = wctrans (class);
      TST_SAVE_ERRNO;

      if (debug_flg)
       {
         fprintf (stderr, "tst_wctrans : [ %d ] ret = %ld\n", rec + 1,
                 (long int) ret);
         fprintf (stderr, "               errno = %d\n", errno_save);
       }

      TST_IF_RETURN (S_WCTRANS)
      {
       if (ret != 0)
         {
           Result (C_SUCCESS, S_WCTYPE, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCTYPE, CASE_3,
                  "should return non-0, but returned 0");
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wctype ( FILE ,
int   
)

Definition at line 12 of file tst_wctype.c.

{
  TST_DECL_VARS (wctype_t);
  char *class;

  TST_DO_TEST (wctype)
  {
    TST_HEAD_LOCALE (wctype, S_WCTYPE);
    TST_DO_REC (wctype)
    {
      TST_GET_ERRET (wctype);
      class = TST_INPUT (wctype).class;
      ret = wctype (class);

      if (debug_flg)
       {
         fprintf (stderr, "tst_wctype : [ %d ] ret = %ld\n", rec + 1, ret);
       }

      TST_IF_RETURN (S_WCTYPE)
      {
       if (ret != 0)
         {
           Result (C_SUCCESS, S_WCTYPE, CASE_3, MS_PASSED);
         }
       else
         {
           err_count++;
           Result (C_FAILURE, S_WCTYPE, CASE_3,
                  "should return non-0, but returned 0");
         }
      }
    }
  }

  return err_count;
}

Here is the call graph for this function:

int tst_wcwidth ( FILE ,
int   
)

Definition at line 11 of file tst_wcwidth.c.

{
  TST_DECL_VARS (int);
  wchar_t wc;

  TST_DO_TEST (wcwidth)
  {
    TST_HEAD_LOCALE (wcwidth, S_WCWIDTH);
    TST_DO_REC (wcwidth)
    {
      TST_GET_ERRET (wcwidth);
      wc = TST_INPUT (wcwidth).wc;
      ret = wcwidth (wc);

      if (debug_flg)
       {
         fprintf (stdout, "wcwidth() [ %s : %d ] ret  = %d\n", locale,
                 rec + 1, ret);
       }

      TST_IF_RETURN (S_WCWIDTH)
      {
      }
    }
  }

  return err_count;
}

Here is the call graph for this function: