stdint.c 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__
  2. #include <stdint.h>
  3. #include "test.h"
  4. void test_stdint_h(void)
  5. {
  6. intptr_t intptr;
  7. uintptr_t uintptr;
  8. intmax_t intmax;
  9. uintmax_t uintmax;
  10. testing_header("stdint.h");
  11. test_min(INTPTR_MIN, -32767);
  12. test_min(INTPTR_MAX, 32767);
  13. test_min(UINTPTR_MAX, 65535);
  14. test_min(INTMAX_MIN, -9223372036854775807LL);
  15. test_min(INTMAX_MAX, 9223372036854775807LL);
  16. test_min(UINTMAX_MAX, 18446744073709551615ULL);
  17. test_min(PTRDIFF_MIN, -65535);
  18. test_min(PTRDIFF_MAX, 65535);
  19. if (SIG_ATOMIC_MIN == 0) {
  20. test_min(SIG_ATOMIC_MAX, 255);
  21. } else {
  22. test_min(SIG_ATOMIC_MIN, -127);
  23. test_min(SIG_ATOMIC_MAX, 127);
  24. }
  25. test_min(SIZE_MAX, 65535);
  26. if (WCHAR_MIN == 0) {
  27. test_min(WCHAR_MAX, 255);
  28. } else {
  29. test_min(WCHAR_MIN, -127);
  30. test_min(WCHAR_MAX, 127);
  31. }
  32. if (WINT_MIN == 0) {
  33. test_min(WINT_MAX, 65535);
  34. } else {
  35. test_min(WINT_MIN, 0);
  36. test_min(WINT_MAX, 0);
  37. }
  38. testing_end();
  39. }
  40. #else
  41. void test_stdint_h(void)
  42. {
  43. }
  44. #endif