Ignore:
Timestamp:
Nov 29, 2018, 7:19:52 PM (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:
3821415
Parents:
c0ce78f (diff), 2cf905f (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/c_tests'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/onset/test-onset.c

    rc0ce78f r8968ea7  
    1010    err = 2;
    1111    PRINT_WRN("no arguments, running tests\n");
    12     if (test_wrong_params() != 0) {
    13       PRINT_ERR("tests failed!\n");
    14       err = 1;
    15     } else {
    16       err = 0;
    17     }
     12    err = test_wrong_params();
    1813    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
    1914    return err;
     
    2318  uint_t hop_size = win_s / 4;
    2419  uint_t n_frames = 0, read = 0;
    25   if ( argc == 3 ) samplerate = atoi(argv[2]);
    26   if ( argc == 4 ) hop_size = atoi(argv[3]);
     20  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     21  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    2722
    2823  char_t *source_path = argv[1];
     
    9085  if (new_aubio_onset("abcd", win_size, win_size/2, samplerate))
    9186    return 1;
    92   // pv creation failed
    93   if (new_aubio_onset("default", 5, 2, samplerate))
    94     return 1;
    9587
    9688  aubio_onset_t *o;
     89
     90  // pv creation might fail
     91  o = new_aubio_onset("default", 5, 2, samplerate);
     92  if (o) del_aubio_onset(o);
     93
    9794  o = new_aubio_onset("default", win_size, hop_size, samplerate);
    9895  if (!aubio_onset_set_default_parameters(o, "wrong_type"))
     
    10097  del_aubio_onset(o);
    10198
    102   return 0;
     99  return run_on_default_source(main);
    103100}
Note: See TracChangeset for help on using the changeset viewer.