From c62243f3824ca2f1c9aaee0c427b6db541518275 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 10 May 2019 10:11:03 +0200 Subject: [PATCH] [tests] use ABS in test-timestretch --- tests/src/effects/test-timestretch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/src/effects/test-timestretch.c b/tests/src/effects/test-timestretch.c index 9ead77ad..2e957e8e 100644 --- a/tests/src/effects/test-timestretch.c +++ b/tests/src/effects/test-timestretch.c @@ -1,5 +1,6 @@ #define AUBIO_UNSTABLE 1 #include +#include "aubio_priv.h" #include "utils_tests.h" int test_wrong_params(void); @@ -127,20 +128,20 @@ int test_wrong_params(void) if (aubio_timestretch_get_transpose(p) != 0) return 1; if (aubio_timestretch_set_transpose(p, 2.)) return 1; - if (fabsf(aubio_timestretch_get_transpose(p) - 2.) >= 1e-6) return 1; + if (ABS(aubio_timestretch_get_transpose(p) - 2.) > 1.e-6) return 1; if (!aubio_timestretch_set_transpose(p, 200.)) return 1; if (!aubio_timestretch_set_transpose(p, -200.)) return 1; if (aubio_timestretch_set_transpose(p, 0.)) return 1; if (aubio_timestretch_get_pitchscale(p) != 1) return 1; if (aubio_timestretch_set_pitchscale(p, 2.)) return 1; - if (fabsf(aubio_timestretch_get_pitchscale(p) - 2.) >= 1e-6) return 1; + if (ABS(aubio_timestretch_get_pitchscale(p) - 2.) > 1.e-6) return 1; if (!aubio_timestretch_set_pitchscale(p, 0.)) return 1; if (!aubio_timestretch_set_pitchscale(p, 6.)) return 1; if (aubio_timestretch_get_stretch(p) != stretch) return 1; if (aubio_timestretch_set_stretch(p, 2.)) return 1; - if (fabsf(aubio_timestretch_get_stretch(p) - 2.) >= 1e-6) return 1; + if (ABS(aubio_timestretch_get_stretch(p) - 2.) > 1.e-6) return 1; if (!aubio_timestretch_set_stretch(p, 0.)) return 1; if (!aubio_timestretch_set_stretch(p, 41.)) return 1; -- 2.11.0