Changeset 9279ba0


Ignore:
Timestamp:
May 10, 2019, 10:40:29 AM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
Children:
08d07ce
Parents:
c62243f
Message:

[tests] use fabs in test-timestretch to avoid double truncation

File:
1 edited

Legend:

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

    rc62243f r9279ba0  
    11#define AUBIO_UNSTABLE 1
    22#include <aubio.h>
    3 #include "aubio_priv.h"
    43#include "utils_tests.h"
    54
     
    129128  if (aubio_timestretch_get_transpose(p) != 0) return 1;
    130129  if (aubio_timestretch_set_transpose(p, 2.)) return 1;
    131   if (ABS(aubio_timestretch_get_transpose(p) - 2.) > 1.e-6) return 1;
     130  if (fabs(aubio_timestretch_get_transpose(p) - 2.) >= 1e-6) return 1;
    132131  if (!aubio_timestretch_set_transpose(p, 200.)) return 1;
    133132  if (!aubio_timestretch_set_transpose(p, -200.)) return 1;
     
    136135  if (aubio_timestretch_get_pitchscale(p) != 1) return 1;
    137136  if (aubio_timestretch_set_pitchscale(p, 2.)) return 1;
    138   if (ABS(aubio_timestretch_get_pitchscale(p) - 2.) > 1.e-6) return 1;
     137  if (fabs(aubio_timestretch_get_pitchscale(p) - 2.) >= 1e-6) return 1;
    139138  if (!aubio_timestretch_set_pitchscale(p, 0.)) return 1;
    140139  if (!aubio_timestretch_set_pitchscale(p, 6.)) return 1;
     
    142141  if (aubio_timestretch_get_stretch(p) != stretch) return 1;
    143142  if (aubio_timestretch_set_stretch(p, 2.)) return 1;
    144   if (ABS(aubio_timestretch_get_stretch(p) - 2.) > 1.e-6) return 1;
     143  if (fabs(aubio_timestretch_get_stretch(p) - 2.) >= 1e-6) return 1;
    145144  if (!aubio_timestretch_set_stretch(p, 0.)) return 1;
    146145  if (!aubio_timestretch_set_stretch(p, 41.)) return 1;
Note: See TracChangeset for help on using the changeset viewer.