Ignore:
Timestamp:
Nov 26, 2018, 11:48:27 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
804c8eb
Parents:
ce323e4
Message:

[tests] increase awhitening coverage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/spectral/test-awhitening.c

    rce323e4 r88a4d8a  
    11#include <aubio.h>
    22#include "utils_tests.h"
     3
     4int test_wrong_params(void);
    35
    46int main (int argc, char **argv)
     
    810  if (argc < 3) {
    911    err = 2;
    10     PRINT_ERR("not enough arguments\n");
     12    PRINT_WRN("no arguments, running tests\n");
     13    if (test_wrong_params() != 0) {
     14      PRINT_ERR("tests failed!\n");
     15      err = 1;
     16    } else {
     17      err = 0;
     18    }
    1119    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
    1220    return err;
     
    8391}
    8492
     93int test_wrong_params(void)
     94{
     95  uint_t buf_size = 512;
     96  uint_t hop_size = 256;
     97  uint_t samplerate = 44100;
     98  aubio_spectral_whitening_t *o;
     99
     100  if (new_aubio_spectral_whitening(       0, hop_size, samplerate)) return 1;
     101  if (new_aubio_spectral_whitening(buf_size,        0, samplerate)) return 1;
     102  if (new_aubio_spectral_whitening(buf_size, hop_size,          0)) return 1;
     103
     104  o = new_aubio_spectral_whitening(buf_size, hop_size, samplerate);
     105
     106  aubio_spectral_whitening_get_relax_time(o);
     107  aubio_spectral_whitening_get_floor(o);
     108
     109  del_aubio_spectral_whitening(o);
     110
     111  return 0;
     112}
Note: See TracChangeset for help on using the changeset viewer.