]> git.sesse.net Git - ffmpeg/commitdiff
tests/checkasm/checkasm: Provide verbose failure information on float_near_abs_eps...
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 13 Apr 2018 00:34:01 +0000 (02:34 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 14 Apr 2018 13:54:06 +0000 (15:54 +0200)
This will make understanding failures and adjusting EPS easier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tests/checkasm/checkasm.c

index 20ce56932fe5de4f5cde1ec3ddedf12497f837e6..ba1d1d0253d2b19585d565e312961e7da97469e9 100644 (file)
@@ -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,