Test of atof. fedora-glibc-20061210T1006
authordrepper <drepper>
Sun, 10 Dec 2006 09:54:35 +0000 (09:54 +0000)
committerdrepper <drepper>
Sun, 10 Dec 2006 09:54:35 +0000 (09:54 +0000)
stdlib/tst-atof1.c [new file with mode: 0644]

diff --git a/stdlib/tst-atof1.c b/stdlib/tst-atof1.c
new file mode 100644 (file)
index 0000000..879d866
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int
+do_test (void)
+{
+  char buf[100];
+  snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1"));
+  if (strcmp (buf, "8") != 0)
+    {
+      printf ("got \"%s\", expected \"8\"\n", buf);
+      return 1;
+    }
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"