summaryrefslogtreecommitdiff
path: root/stdint.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-03-01 21:36:22 -0500
committerJakob Kaivo <jkk@ung.org>2019-03-01 21:36:22 -0500
commit306613c5a17842fc6967f9a9a3722a63767c3b75 (patch)
treebf74e7e66e8e6167292dd92feb2dd1d6cee4ba85 /stdint.c
parent3289aef6dd90453f46f0ba3102ae184734374dc7 (diff)
skeleton tests for all C99 headers
Diffstat (limited to 'stdint.c')
-rw-r--r--stdint.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/stdint.c b/stdint.c
new file mode 100644
index 0000000..6214bdd
--- /dev/null
+++ b/stdint.c
@@ -0,0 +1,44 @@
+#if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__
+#include <stdint.h>
+#include "test.h"
+
+void test_stdint_h(void)
+{
+ intptr_t intptr;
+ uintptr_t uintptr;
+ intmax_t intmax;
+ uintmax_t uintmax;
+
+ testing_header("inttypes.h");
+
+ test_min(INTPTR_MIN, 0);
+ test_min(INTPTR_MAX, 0);
+ test_min(UINTPTR_MAX, 0);
+
+ test_min(INTMAX_MIN, 0);
+ test_min(INTMAX_MAX, 0);
+ test_min(UINTMAX_MAX, 0);
+
+ test_min(PTRDIFF_MIN, 0);
+ test_min(PTRDIFF_MAX, 0);
+ test_min(PTRDIFF_MAX, 0);
+
+ test_min(SIG_ATOMIC_MIN, 0);
+ test_min(SIG_ATOMIC_MAX, 0);
+
+ test_min(SIZE_MAX, 0);
+
+ test_min(WCHAR_MIN, 0);
+ test_min(WCHAR_MAX, 0);
+
+ test_min(WINT_MIN, 0);
+ test_min(WINT_MAX, 0);
+
+ testing_end();
+}
+
+#else
+void test_stdint_h(void)
+{
+}
+#endif