tst_iswctype.c 983 B

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