Ignore:
Timestamp:
Dec 19, 2018, 6:16:29 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/constantq
Children:
dfe6ab6
Parents:
f87e191 (diff), fda3394 (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 'master' into feature/constantq

File:
1 edited

Legend:

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

    rf87e191 r868c6b8  
    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];
     
    7570  uint_t samplerate = 44100;
    7671  // hop_size < 1
    77   if (new_aubio_onset("default", 5, 0, samplerate))
    78     return 1;
     72  if (new_aubio_onset("default", 5, 0, samplerate)) return 1;
     73
    7974  // buf_size < 2
    80   if (new_aubio_onset("default", 1, 1, samplerate))
    81     return 1;
     75  if (new_aubio_onset("default", 1, 1, samplerate)) return 1;
     76
    8277  // buf_size < hop_size
    83   if (new_aubio_onset("default", hop_size, win_size, samplerate))
    84     return 1;
     78  if (new_aubio_onset("default", hop_size, win_size, samplerate)) return 1;
     79
    8580  // samplerate < 1
    86   if (new_aubio_onset("default", 1024, 512, 0))
    87     return 1;
     81  if (new_aubio_onset("default", 1024, 512, 0)) return 1;
    8882
    8983  // specdesc creation failed
    90   if (new_aubio_onset("abcd", win_size, win_size/2, samplerate))
    91     return 1;
    92   // pv creation failed
    93   if (new_aubio_onset("default", 5, 2, samplerate))
    94     return 1;
     84  if (new_aubio_onset("abcd", win_size, win_size/2, samplerate)) return 1;
    9585
    9686  aubio_onset_t *o;
     87
     88  // pv creation might fail
     89  o = new_aubio_onset("default", 5, 2, samplerate);
     90  if (o) del_aubio_onset(o);
     91
    9792  o = new_aubio_onset("default", win_size, hop_size, samplerate);
    98   if (!aubio_onset_set_default_parameters(o, "wrong_type"))
    99     return 1;
     93  if (!aubio_onset_set_default_parameters(o, "wrong_type")) return 1;
    10094  del_aubio_onset(o);
    10195
    102   return 0;
     96  return run_on_default_source(main);
    10397}
Note: See TracChangeset for help on using the changeset viewer.