summaryrefslogtreecommitdiff
path: root/inttypes.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 /inttypes.c
parent3289aef6dd90453f46f0ba3102ae184734374dc7 (diff)
skeleton tests for all C99 headers
Diffstat (limited to 'inttypes.c')
-rw-r--r--inttypes.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/inttypes.c b/inttypes.c
new file mode 100644
index 0000000..0d88d9b
--- /dev/null
+++ b/inttypes.c
@@ -0,0 +1,26 @@
+#if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__
+#include <wchar.h>
+#include <inttypes.h>
+#include "test.h"
+
+void test_inttypes_h(void)
+{
+ imaxdiv_t imaxdiv;
+ char *endptr;
+
+ testing_header("inttypes.h");
+
+ test_true(imaxabs(-1) == 1);
+
+ intmax_t im = strtoimax("100000000q", &endptr, 0);
+ test_true(im == 100000000);
+ test_true(*endptr == 'q');
+
+ testing_end();
+}
+
+#else
+void test_inttypes_h(void)
+{
+}
+#endif