inttypes.c 421 B

123456789101112131415161718192021222324252627
  1. #if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__
  2. #include <wchar.h>
  3. #include <inttypes.h>
  4. #include "test.h"
  5. void test_inttypes_h(void)
  6. {
  7. imaxdiv_t imaxdiv;
  8. char *endptr;
  9. testing_header("inttypes.h");
  10. test_true(imaxabs(-1) == 1);
  11. intmax_t im = strtoimax("100000000q", &endptr, 0);
  12. test_true(im == 100000000);
  13. test_true(*endptr == 'q');
  14. testing_end();
  15. }
  16. #else
  17. void test_inttypes_h(void)
  18. {
  19. }
  20. #endif