Commit 752d867e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 5fd1fb70
...@@ -3220,13 +3220,17 @@ static void test_D3DXSHEvalSphericalLight(void) ...@@ -3220,13 +3220,17 @@ static void test_D3DXSHEvalSphericalLight(void)
static void test_D3DXSHMultiply2(void) static void test_D3DXSHMultiply2(void)
{ {
float a[20], b[20], c[20];
unsigned int i; unsigned int i;
FLOAT a[20], b[20], c[20]; BOOL equal;
/* D3DXSHMultiply2 only modifies the first 4 elements of the array */
const FLOAT expected[20] = /* D3DXSHMultiply2() only modifies the first 4 elements of the array. */
{ 3.418594f, 1.698211f, 1.703853f, 1.709494f, 4.0f, 5.0f, static const float expected[20] =
6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, {
14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f }; 3.41859412f, 1.69821072f, 1.70385253f, 1.70949447f, 4.0f, 5.0f, 6.0f,
7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f,
14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f,
};
for (i = 0; i < 20; i++) for (i = 0; i < 20; i++)
{ {
...@@ -3237,7 +3241,10 @@ static void test_D3DXSHMultiply2(void) ...@@ -3237,7 +3241,10 @@ static void test_D3DXSHMultiply2(void)
D3DXSHMultiply2(c, a, b); D3DXSHMultiply2(c, a, b);
for (i = 0; i < 20; i++) for (i = 0; i < 20; i++)
ok(relative_error(c[i], expected[i]) < admitted_error, "Expected[%d] = %f, received = %f\n", i, expected[i], c[i]); {
equal = compare_float(c[i], expected[i], 2);
ok(equal, "Expected[%u] = %.8e, received = %.8e.\n", i, expected[i], c[i]);
}
} }
static void test_D3DXSHMultiply3(void) static void test_D3DXSHMultiply3(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment