oleaut32/tests/vartype: test relative error, not absolute

Tijl Coosemans tijl at ulyssis.org
Sat Aug 5 16:00:14 CDT 2006


* test relative error, not absolute


The reason is that we want to verify if (about) 14 digits are correct,
independant of how big or small the value is. The == case is for the
0.0 case.


Index: dlls/oleaut32/tests/vartype.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/tests/vartype.c,v
retrieving revision 1.41
diff -u -r1.41 vartype.c
--- dlls/oleaut32/tests/vartype.c	22 Jun 2006 11:19:33 -0000	1.41
+++ dlls/oleaut32/tests/vartype.c	5 Aug 2006 20:53:21 -0000
@@ -91,7 +91,7 @@
 #define EXPECT_GT       EXPECTRES(VARCMP_GT, VARCMP_GT)
 #define EXPECT_EQ       EXPECTRES(VARCMP_EQ, VARCMP_EQ)
 #define EXPECT_DBL(x)   \
-  ok(hres == S_OK && fabs(out-(x))<1e-14, "expected " #x ", got %16.16g; hres=0x%08lx\n", out, hres)
+  ok(hres == S_OK && fabs(out-(x))<=1e-14*(x), "expected %16.16g, got %16.16g; hres=0x%08lx\n", (x), out, hres)
 
 #define CONVERT(func, val) in = val; hres = p##func(in, &out)
 #define CONVERTRANGE(func,start,end) for (i = start; i < end; i+=1) { CONVERT(func, i); EXPECT(i); };



More information about the wine-patches mailing list