Changeset 5573a6b for tests


Ignore:
Timestamp:
Dec 19, 2018, 9:50:06 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
Children:
65628c4, 9630fa8
Parents:
eba24c59 (diff), f5adffe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'feature/sink_vorbis' into feature/sink_flac

Location:
tests/src
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • tests/src/io/base-sink_custom.h

    reba24c59 r5573a6b  
    2626  char_t *sink_path = argv[2];
    2727
     28  aubio_source_t *src = NULL;
     29  aubio_sink_custom_t *snk = NULL;
     30
    2831  if ( argc >= 4 ) samplerate = atoi(argv[3]);
    2932  if ( argc >= 5 ) hop_size = atoi(argv[4]);
    3033
    3134  fvec_t *vec = new_fvec(hop_size);
     35  if (!vec) { err = 1; goto failure; }
    3236
    33   aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size);
    34   if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
     37  src = new_aubio_source(source_path, samplerate, hop_size);
     38  if (!src) { err = 1; goto failure; }
     39  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src);
    3540
    36   aubio_sink_custom_t *o = new_aubio_sink_custom(sink_path, samplerate);
    37 
    38   if (!vec || !i || !o) { err = 1; goto failure; }
     41  snk = new_aubio_sink_custom(sink_path, samplerate);
     42  if (!snk) { err = 1; goto failure; }
    3943
    4044  do {
    41     aubio_source_do(i, vec, &read);
    42     aubio_sink_custom_do(o, vec, read);
     45    aubio_source_do(src, vec, &read);
     46    aubio_sink_custom_do(snk, vec, read);
    4347    n_frames += read;
    4448  } while ( read == hop_size );
     
    4953
    5054  // close sink now (optional)
    51   aubio_sink_custom_close(o);
     55  aubio_sink_custom_close(snk);
    5256
    5357failure:
    54   if (o)
    55     del_aubio_sink_custom(o);
    56   if (i)
    57     del_aubio_source(i);
     58  if (snk)
     59    del_aubio_sink_custom(snk);
     60  if (src)
     61    del_aubio_source(src);
    5862  if (vec)
    5963    del_fvec(vec);
  • tests/src/io/test-sink.c

    reba24c59 r5573a6b  
    2222  char_t *sink_path = argv[2];
    2323
     24  aubio_source_t *src = NULL;
     25  aubio_sink_t *snk = NULL;
     26
    2427  if ( argc >= 4 ) samplerate = atoi(argv[3]);
    2528  if ( argc >= 5 ) hop_size = atoi(argv[4]);
    2629
    2730  fvec_t *vec = new_fvec(hop_size);
     31  if (!vec) { err = 1; goto failure; }
    2832
    29   aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size);
    30   if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
     33  src = new_aubio_source(source_path, samplerate, hop_size);
     34  if (!src) { err = 1; goto failure; }
     35  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src);
    3136
    32   aubio_sink_t *o = new_aubio_sink(sink_path, samplerate);
    33 
    34   if (!vec || !i || !o) { err = 1; goto failure; }
     37  snk = new_aubio_sink(sink_path, samplerate);
     38  if (!snk) { err = 1; goto failure; }
    3539
    3640  do {
    37     aubio_source_do(i, vec, &read);
    38     aubio_sink_do(o, vec, read);
     41    aubio_source_do(src, vec, &read);
     42    aubio_sink_do(snk, vec, read);
    3943    n_frames += read;
    4044  } while ( read == hop_size );
     
    4549
    4650  // close sink now (optional)
    47   aubio_sink_close(o);
     51  aubio_sink_close(snk);
    4852
    4953failure:
    50   if (o)
    51     del_aubio_sink(o);
    52   if (i)
    53     del_aubio_source(i);
     54  if (snk)
     55    del_aubio_sink(snk);
     56  if (src)
     57    del_aubio_source(src);
    5458  if (vec)
    5559    del_fvec(vec);
  • tests/src/onset/test-onset.c

    reba24c59 r5573a6b  
    7070  uint_t samplerate = 44100;
    7171  // hop_size < 1
    72   if (new_aubio_onset("default", 5, 0, samplerate))
    73     return 1;
     72  if (new_aubio_onset("default", 5, 0, samplerate)) return 1;
     73
    7474  // buf_size < 2
    75   if (new_aubio_onset("default", 1, 1, samplerate))
    76     return 1;
     75  if (new_aubio_onset("default", 1, 1, samplerate)) return 1;
     76
    7777  // buf_size < hop_size
    78   if (new_aubio_onset("default", hop_size, win_size, samplerate))
    79     return 1;
     78  if (new_aubio_onset("default", hop_size, win_size, samplerate)) return 1;
     79
    8080  // samplerate < 1
    81   if (new_aubio_onset("default", 1024, 512, 0))
    82     return 1;
     81  if (new_aubio_onset("default", 1024, 512, 0)) return 1;
    8382
    8483  // specdesc creation failed
    85   if (new_aubio_onset("abcd", win_size, win_size/2, samplerate))
    86     return 1;
     84  if (new_aubio_onset("abcd", win_size, win_size/2, samplerate)) return 1;
    8785
    8886  aubio_onset_t *o;
     
    9391
    9492  o = new_aubio_onset("default", win_size, hop_size, samplerate);
    95   if (!aubio_onset_set_default_parameters(o, "wrong_type"))
    96     return 1;
     93  if (!aubio_onset_set_default_parameters(o, "wrong_type")) return 1;
    9794  del_aubio_onset(o);
    9895
  • tests/src/tempo/test-tempo.c

    reba24c59 r5573a6b  
    8282
    8383  // test wrong method fails
    84   if (new_aubio_tempo("unexisting_method", win_size, hop_size, samplerate))
    85     return 1;
     84  if (new_aubio_tempo("undefined", win_size, hop_size, samplerate)) return 1;
    8685
    8786  // test hop > win fails
    88   if (new_aubio_tempo("default", hop_size, win_size, samplerate))
    89     return 1;
     87  if (new_aubio_tempo("default", hop_size, win_size, samplerate)) return 1;
    9088
    9189  // test null hop_size fails
    92   if (new_aubio_tempo("default", win_size, 0, samplerate))
    93     return 1;
     90  if (new_aubio_tempo("default", win_size, 0, samplerate)) return 1;
    9491
    9592  // test 1 buf_size fails
    96   if (new_aubio_tempo("default", 1, 1, samplerate))
    97     return 1;
     93  if (new_aubio_tempo("default", 1, 1, samplerate)) return 1;
    9894
    9995  // test null samplerate fails
    100   if (new_aubio_tempo("default", win_size, hop_size, 0))
    101     return 1;
     96  if (new_aubio_tempo("default", win_size, hop_size, 0)) return 1;
    10297
    10398  // test short sizes workaround
    10499  t = new_aubio_tempo("default", 2048, 2048, 500);
    105   if (!t)
    106     return 1;
     100  if (!t) return 1;
    107101
    108102  del_aubio_tempo(t);
    109103
    110104  t = new_aubio_tempo("default", win_size, hop_size, samplerate);
    111   if (!t)
    112     return 1;
     105  if (!t) return 1;
    113106
    114107  in = new_fvec(hop_size);
  • tests/src/temporal/test-filter.c

    reba24c59 r5573a6b  
    1010  aubio_filter_t *o = new_aubio_filter_c_weighting (44100);
    1111
    12   if (new_aubio_filter(0))
    13     return 1;
     12  if (new_aubio_filter(0)) return 1;
    1413
    15   if (aubio_filter_get_samplerate(o) != 44100)
    16     return 1;
     14  if (aubio_filter_get_samplerate(o) != 44100) return 1;
    1715
    18   if (aubio_filter_set_c_weighting (o, -1) == 0)
    19     return 1;
     16  if (aubio_filter_set_c_weighting (o, -1) == 0) return 1;
    2017
    21   if (aubio_filter_set_c_weighting (0, 32000) == 0)
    22     return 1;
     18  if (aubio_filter_set_c_weighting (0, 32000) == 0) return 1;
    2319
    2420  in->data[impulse_at] = 0.5;
     
    3026  o = new_aubio_filter_a_weighting (32000);
    3127
    32   if (aubio_filter_set_a_weighting (o, -1) == 0)
    33     return 1;
    34   if (aubio_filter_set_a_weighting (0, 32000) == 0)
    35     return 1;
     28  if (aubio_filter_set_a_weighting (o, -1) == 0) return 1;
     29
     30  if (aubio_filter_set_a_weighting (0, 32000) == 0) return 1;
    3631
    3732  in->data[impulse_at] = 0.5;
Note: See TracChangeset for help on using the changeset viewer.