Ignore:
Timestamp:
Dec 19, 2018, 2:49:22 PM (5 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/timestretch, fix/ffmpeg5, master
Children:
43ea60d
Parents:
7b5e1a5
Message:

[tests] avoid test-sink crash on missing input file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/io/test-sink.c

    r7b5e1a5 r387b605  
    2222  char_t *sink_path = argv[2];
    2323
     24  aubio_source_t *i = NULL;
     25  aubio_sink_t *o = 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);
     33  i = new_aubio_source(source_path, samplerate, hop_size);
     34  if (!i) { err = 1; goto failure; }
    3035  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
    3136
    32   aubio_sink_t *o = new_aubio_sink(sink_path, samplerate);
    33 
    34   if (!vec || !i || !o) { err = 1; goto failure; }
     37  o = new_aubio_sink(sink_path, samplerate);
     38  if (!o) { err = 1; goto failure; }
    3539
    3640  do {
Note: See TracChangeset for help on using the changeset viewer.