diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-13 02:34:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-14 15:54:06 +0200 |
commit | 18d6ff2b42c120f1b388c472366b0275ddf9629a (patch) | |
tree | 19f868dde81b2e0ff8e2d95982905aabe1204295 /tests/checkasm | |
parent | 23e994ca496c51f67d764ffa48be715c877883e5 (diff) | |
download | ffmpeg-18d6ff2b42c120f1b388c472366b0275ddf9629a.tar.gz |
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: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'tests/checkasm')
-rw-r--r-- | tests/checkasm/checkasm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 20ce56932f..ba1d1d0253 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -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, |