new test framework (one main per test)
[libc-test] / src / stdlib / strtod_long.c
diff --git a/src/stdlib/strtod_long.c b/src/stdlib/strtod_long.c
new file mode 100644 (file)
index 0000000..d2db2e8
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "test.h"
+
+int main(void)
+{
+       double x, want = .1111111111111111111111;
+       char buf[40000];
+
+       memset(buf, '1', sizeof buf);
+       buf[0] = '.';
+       buf[sizeof buf - 1] = 0;
+
+       if ((x=strtod(buf, 0)) != want)
+               error("strtod(.11[...]1) got %a want %a\n", x, want);
+       return test_status;
+}
+