[PATCH 04/10] d3dx9/tests: Use compare_float() in test_D3DXSHEvalSphericalLight().

Henri Verbeet hverbeet at gmail.com
Thu May 4 17:31:23 CDT 2017


On 5 May 2017 at 00:15, Matteo Bruni <matteo.mystral at gmail.com> wrote:
> 2017-05-04 12:05 GMT+02:00 Henri Verbeet <hverbeet at codeweavers.com>:
>
>> -                ok(relative_error(expected, test[l].red_received[j]) < 0.0005f,
>> -                    "Red: case %u, order %u: expected[%u] = %f, received %f\n", l, order, j, expected, test[l].red_received[j]);
>> +                equal = compare_float(expected, test[l].red_received[j], 512);
>> +                ok(equal || (fabs(expected) < 1.0e-6f && fabs(test[l].red_received[j]) < 1.0e-6f),
>> +                        "Red: case %u, order %u: expected[%u] = %.8e, received %.8e.\n",
>> +                        l, order, j, expected, test[l].red_received[j]);
>
> I guess those are mostly to make our implementation pass the test. Did
> you have a look at it by any chance?
>
In this case, yes, but the one in test_D3DXSHRotateZ() actually has
large differences between Windows versions as well. I did briefly look
into it, but decided it was going to be more trouble than I cared for
to fix. My guess would be that it would mostly be a matter of being
more careful in weightedcapintegrale() and D3DXSHEvalDirection() on
the one hand, and perhaps picking more reasonable inputs on the other.



More information about the wine-devel mailing list