summaryrefslogtreecommitdiff
path: root/tests/checkasm/sbrdsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-02-05 22:18:19 +0200
committerMartin Storsjö <martin@martin.st>2020-02-08 23:00:21 +0200
commit5181f491ee3688317e236130d79d91c940526aa9 (patch)
treefb3fac7d2b3679f11ecef88fd850a8ddc1331030 /tests/checkasm/sbrdsp.c
parent3750e36aa8ecb53764e5549470a39cd14ff6b513 (diff)
checkasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon for sum_square
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'tests/checkasm/sbrdsp.c')
-rw-r--r--tests/checkasm/sbrdsp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/checkasm/sbrdsp.c b/tests/checkasm/sbrdsp.c
index 558f452c9b..516b9f0ec6 100644
--- a/tests/checkasm/sbrdsp.c
+++ b/tests/checkasm/sbrdsp.c
@@ -17,6 +17,7 @@
*/
#include "libavcodec/sbrdsp.h"
+#include <float.h>
#include "checkasm.h"
@@ -51,13 +52,14 @@ static void test_sum_square(void)
INTFLOAT res0;
INTFLOAT res1;
LOCAL_ALIGNED_16(INTFLOAT, src, [256], [2]);
+ double t = 4 * 256;
declare_func_float(INTFLOAT, INTFLOAT (*x)[2], int n);
randomize((INTFLOAT *)src, 256 * 2);
res0 = call_ref(src, 256);
res1 = call_new(src, 256);
- if (!float_near_abs_eps(res0, res1, EPS))
+ if (!float_near_abs_eps(res0, res1, t * 2 * FLT_EPSILON))
fail();
bench_new(src, 256);
}