tst_wcsncmp.c 934 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*-------------------------------------------------------------------------------------*/
  2. /* WCSNCMP: int wcsncmp( const wchar_t *ws1, const wchar_t *ws2, size_t n ) */
  3. /*-------------------------------------------------------------------------------------*/
  4. #define TST_FUNCTION wcsncmp
  5. #include "tsp_common.c"
  6. #include "dat_wcsncmp.c"
  7. int
  8. tst_wcsncmp (FILE * fp, int debug_flg)
  9. {
  10. TST_DECL_VARS (int);
  11. wchar_t *ws1, *ws2;
  12. size_t n;
  13. TST_DO_TEST (wcsncmp)
  14. {
  15. TST_HEAD_LOCALE (wcsncmp, S_WCSNCMP);
  16. TST_DO_REC (wcsncmp)
  17. {
  18. TST_GET_ERRET (wcsncmp);
  19. ws1 = TST_INPUT (wcsncmp).ws1; /* external value: size WCSSIZE */
  20. ws2 = TST_INPUT (wcsncmp).ws2;
  21. n = TST_INPUT (wcsncmp).n;
  22. ret = wcsncmp (ws1, ws2, n);
  23. if (debug_flg)
  24. {
  25. fprintf (stderr, "tst_wcsncmp: ret = %d, 0x%x\n", ret, ret);
  26. }
  27. TST_IF_RETURN (S_WCSNCMP)
  28. {
  29. };
  30. }
  31. }
  32. return err_count;
  33. }