Commit 18d6ff2b authored by Michael Niedermayer's avatar Michael Niedermayer

tests/checkasm/checkasm: Provide verbose failure information on float_near_abs_eps() failures

This will make understanding failures and adjusting EPS easier
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 23e994ca
......@@ -294,8 +294,12 @@ int float_near_ulp_array(const float *a, const float *b, unsigned max_ulp,
int float_near_abs_eps(float a, float b, float eps)
{
float abs_diff = fabsf(a - b);
if (abs_diff < eps)
return 1;
return abs_diff < eps;
fprintf(stderr, "test failed comparing %g with %g (abs diff=%g with EPS=%g)\n", a, b, abs_diff, eps);
return 0;
}
int float_near_abs_eps_array(const float *a, const float *b, float eps,
......
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