tst_wctrans.c 935 B

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