[FFmpeg-devel] [PATCH] tests/checkasm/checkasm: Provide verbose failure information on float_near_abs_eps() failures
Michael Niedermayer
michael at niedermayer.cc
Fri Apr 13 03:34:01 EEST 2018
This will make understanding failures and adjusting EPS easier
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
tests/checkasm/checkasm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 20ce56932f..8a3e24f100 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 %f with %f (abs diff=%f with EPS=%f)\n", a, b, abs_diff, eps);
+
+ return 0;
}
int float_near_abs_eps_array(const float *a, const float *b, float eps,
--
2.17.0
More information about the ffmpeg-devel
mailing list