d3dx9/tests: Avoid using FP_NAN for portability. (try 2)

Dylan Smith dylan.ah.smith at gmail.com
Fri Jun 24 10:26:03 CDT 2011


---
 dlls/d3dx9_36/tests/mesh.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index a07cc9d..f8235c6 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -4809,7 +4809,8 @@ static void test_create_skin_info(void)
             exp_vertices[0] = 0;
             exp_vertices[1] = 0x87654321;
             exp_weights[0] = 0.5;
-            exp_weights[1] = FP_NAN;
+            /* -NAN assuming IEEE 745 standard float; if this assumption is wrong, then it won't break the tests. */
+            memset(&exp_weights[1], 0xff, sizeof(exp_weights[1]));
             num_influences = 2;
 
             hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 1, num_influences, vertices, weights);
@@ -4834,7 +4835,7 @@ static void test_create_skin_info(void)
             for (i = 0; i < num_influences; i++) {
                 ok(exp_vertices[i] == vertices[i],
                    "influence[%d]: expected vertex %u, got %u\n", i, exp_vertices[i], vertices[i]);
-                ok(exp_weights[i] == weights[i],
+                ok(exp_weights[i] == weights[i] || (isnan(exp_weights[i]) && isnan(weights[i])),
                    "influence[%d]: expected weights %g, got %g\n", i, exp_weights[i], weights[i]);
             }
 
-- 
1.7.4.1



More information about the wine-patches mailing list