Changeset c62243f for tests


Ignore:
Timestamp:
May 10, 2019, 10:11:03 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
Children:
9279ba0
Parents:
65f7886
Message:

[tests] use ABS in test-timestretch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/effects/test-timestretch.c

    r65f7886 rc62243f  
    11#define AUBIO_UNSTABLE 1
    22#include <aubio.h>
     3#include "aubio_priv.h"
    34#include "utils_tests.h"
    45
     
    128129  if (aubio_timestretch_get_transpose(p) != 0) return 1;
    129130  if (aubio_timestretch_set_transpose(p, 2.)) return 1;
    130   if (fabsf(aubio_timestretch_get_transpose(p) - 2.) >= 1e-6) return 1;
     131  if (ABS(aubio_timestretch_get_transpose(p) - 2.) > 1.e-6) return 1;
    131132  if (!aubio_timestretch_set_transpose(p, 200.)) return 1;
    132133  if (!aubio_timestretch_set_transpose(p, -200.)) return 1;
     
    135136  if (aubio_timestretch_get_pitchscale(p) != 1) return 1;
    136137  if (aubio_timestretch_set_pitchscale(p, 2.)) return 1;
    137   if (fabsf(aubio_timestretch_get_pitchscale(p) - 2.) >= 1e-6) return 1;
     138  if (ABS(aubio_timestretch_get_pitchscale(p) - 2.) > 1.e-6) return 1;
    138139  if (!aubio_timestretch_set_pitchscale(p, 0.)) return 1;
    139140  if (!aubio_timestretch_set_pitchscale(p, 6.)) return 1;
     
    141142  if (aubio_timestretch_get_stretch(p) != stretch) return 1;
    142143  if (aubio_timestretch_set_stretch(p, 2.)) return 1;
    143   if (fabsf(aubio_timestretch_get_stretch(p) - 2.) >= 1e-6) return 1;
     144  if (ABS(aubio_timestretch_get_stretch(p) - 2.) > 1.e-6) return 1;
    144145  if (!aubio_timestretch_set_stretch(p, 0.)) return 1;
    145146  if (!aubio_timestretch_set_stretch(p, 41.)) return 1;
Note: See TracChangeset for help on using the changeset viewer.