tst_wctype.c 796 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. WCTYPE: wctype_t wctype (const char *class);
  3. */
  4. #define TST_FUNCTION wctype
  5. #include "tsp_common.c"
  6. #include "dat_wctype.c"
  7. int
  8. tst_wctype (FILE * fp, int debug_flg)
  9. {
  10. TST_DECL_VARS (wctype_t);
  11. char *class;
  12. TST_DO_TEST (wctype)
  13. {
  14. TST_HEAD_LOCALE (wctype, S_WCTYPE);
  15. TST_DO_REC (wctype)
  16. {
  17. TST_GET_ERRET (wctype);
  18. class = TST_INPUT (wctype).class;
  19. ret = wctype (class);
  20. if (debug_flg)
  21. {
  22. fprintf (stderr, "tst_wctype : [ %d ] ret = %ld\n", rec + 1, ret);
  23. }
  24. TST_IF_RETURN (S_WCTYPE)
  25. {
  26. if (ret != 0)
  27. {
  28. Result (C_SUCCESS, S_WCTYPE, CASE_3, MS_PASSED);
  29. }
  30. else
  31. {
  32. err_count++;
  33. Result (C_FAILURE, S_WCTYPE, CASE_3,
  34. "should return non-0, but returned 0");
  35. }
  36. }
  37. }
  38. }
  39. return err_count;
  40. }