Henri Verbeet : d3dx9/tests: Use compare_float() in test_D3DXSHDot().

Alexandre Julliard julliard at winehq.org
Wed May 3 16:06:12 CDT 2017


Module: wine
Branch: master
Commit: 6ac2e70240a778e6259a98fd36e00dcb936b8a83
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6ac2e70240a778e6259a98fd36e00dcb936b8a83

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Apr 28 23:49:16 2017 +0200

d3dx9/tests: Use compare_float() in test_D3DXSHDot().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dx9_36/tests/math.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c
index 291fcdc..9f90d16 100644
--- a/dlls/d3dx9_36/tests/math.c
+++ b/dlls/d3dx9_36/tests/math.c
@@ -2593,10 +2593,11 @@ static void test_D3DXSHAdd(void)
 
 static void test_D3DXSHDot(void)
 {
+    float a[49], b[49], got;
     unsigned int i;
-    FLOAT a[49], b[49], got;
-    const FLOAT expected[] =
-    { 0.5f, 0.5f, 25.0f, 262.5f, 1428.0f, 5362.0f, 15873.0f, 39812.0f, };
+    BOOL equal;
+
+    static const float expected[] = {0.5f, 0.5f, 25.0f, 262.5f, 1428.0f, 5362.5f, 15873.0f, 39812.5f};
 
     for (i = 0; i < 49; i++)
     {
@@ -2608,10 +2609,9 @@ static void test_D3DXSHDot(void)
     for (i = 0; i <= D3DXSH_MAXORDER + 1; i++)
     {
         got = D3DXSHDot(i, a, b);
-        ok(relative_error(got, expected[i]) < admitted_error, "order %d: expected %f, received %f\n", i, expected[i], got);
+        equal = compare_float(got, expected[i], 0);
+        ok(equal, "order %u: Got %.8e, expected %.8e.\n", i, got, expected[i]);
     }
-
-    return;
 }
 
 static void test_D3DXSHEvalConeLight(void)




More information about the wine-cvs mailing list