Test for atof (Bug 4337)

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sat Jan 21 08:12:14 CST 2006


Changelog:
	dlls/msvcrt/tests/strings.c
	Add a test for atof 

This shows that not atof() is the cause for Bug 4337 but printf
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/msvcrt/tests/string.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/tests/string.c,v
retrieving revision 1.6
diff -u -r1.6 string.c
--- wine/dlls/msvcrt/tests/string.c	21 Nov 2005 12:03:18 -0000	1.6
+++ wine/dlls/msvcrt/tests/string.c	21 Jan 2006 14:08:15 -0000
@@ -99,6 +99,28 @@
     ok( ret==0, "_mbsspn returns %d should be 0\n", ret);
 }
 
+static void test_atof( void)
+{
+    char s1[]="  -2309.12E-15";
+    char s2[]="7.8912654773d210";
+    char s3[]="  -9885 pigs";
+    char s4[]="98854 dollars";
+    double x;
+
+    x = atof( s1 );
+    ok(x==-2.309120e-012, "atof(%s) returnrd  %e\n", s1, x );
+
+    x = atof( s2 );
+    ok(x==7.8912654773, "atof(%s) returnrd  %e\n", s2, x );
+    
+    x = atof( s3 );
+    ok(x==-9.885000e+003, "atof(%s) returnrd  %e\n", s3, x );
+    
+    x = atof( s4 );
+    ok(x==9.885400e+004, "atof(%s) returnrd  %e\n", s4, x );
+    
+}
+    
 START_TEST(string)
 {
     void *mem;
@@ -125,4 +147,5 @@
     test_ismbblead();
    /* test _mbsspn */
     test_mbsspn();
+    test_atof();
 }



More information about the wine-patches mailing list