Changeset 8968ea7 for tests/src/io


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'

Location:
tests/src/io
Files:
15 edited

Legend:

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

    rc0ce78f r8968ea7  
    1010
    1111  if (argc < 3) {
    12     err = 2;
    13     PRINT_ERR("not enough arguments\n");
     12    PRINT_ERR("not enough arguments, running tests\n");
     13    err = run_on_default_source_and_sink(main);
    1414    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [channels] [hop_size]\n", argv[0]);
    1515    return err;
  • tests/src/io/test-sink.c

    rc0ce78f r8968ea7  
    77
    88  if (argc < 3) {
    9     err = 2;
    10     PRINT_ERR("not enough arguments\n");
     9    PRINT_ERR("not enough arguments, running tests\n");
     10    err = run_on_default_source_and_sink(main);
    1111    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
    1212    return err;
  • tests/src/io/test-sink_apple_audio-multi.c

    rc0ce78f r8968ea7  
    1111
    1212  if (argc < 3) {
    13     err = 2;
    14     PRINT_ERR("not enough arguments\n");
     13    PRINT_ERR("not enough arguments, running tests\n");
     14    err = run_on_default_source_and_sink(main);
    1515    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [channels] [hop_size]\n", argv[0]);
    1616    return err;
     
    7272beach_source:
    7373#else /* HAVE_SINK_APPLE_AUDIO */
    74   err = 3;
     74  err = 0;
    7575  PRINT_ERR("aubio was not compiled with aubio_sink_apple_audio\n");
    7676#endif /* HAVE_SINK_APPLE_AUDIO */
  • tests/src/io/test-sink_apple_audio.c

    rc0ce78f r8968ea7  
    1111
    1212  if (argc < 3) {
    13     err = 2;
    14     PRINT_ERR("not enough arguments\n");
     13    PRINT_ERR("not enough arguments, running tests\n");
     14    err = run_on_default_source_and_sink(main);
    1515    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
    1616    return err;
     
    6161beach_fvec:
    6262#else /* HAVE_SINK_APPLE_AUDIO */
    63   err = 3;
     63  err = 0;
    6464  PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
    6565#endif /* HAVE_SINK_APPLE_AUDIO */
  • tests/src/io/test-sink_sndfile-multi.c

    rc0ce78f r8968ea7  
    1111
    1212  if (argc < 3) {
    13     err = 2;
    14     PRINT_ERR("not enough arguments\n");
     13    PRINT_ERR("not enough arguments, running tests\n");
     14    err = run_on_default_source_and_sink(main);
    1515    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [channels] [hop_size]\n", argv[0]);
    1616    return err;
     
    7272beach_source:
    7373#else
    74   err = 3;
     74  err = 0;
    7575  PRINT_ERR("aubio was not compiled with aubio_sink_sndfile\n");
    7676#endif /* HAVE_SNDFILE */
  • tests/src/io/test-sink_sndfile.c

    rc0ce78f r8968ea7  
    1111
    1212  if (argc < 3) {
    13     err = 2;
    14     PRINT_ERR("not enough arguments\n");
     13    PRINT_ERR("not enough arguments, running tests\n");
     14    err = run_on_default_source_and_sink(main);
    1515    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
    1616    return err;
     
    6161beach_fvec:
    6262#else
    63   err = 3;
     63  err = 0;
    6464  PRINT_ERR("aubio was not compiled with aubio_source_sndfile\n");
    6565#endif /* HAVE_SNDFILE */
  • tests/src/io/test-sink_wavwrite-multi.c

    rc0ce78f r8968ea7  
    1111
    1212  if (argc < 3) {
    13     err = 2;
    14     PRINT_ERR("not enough arguments\n");
     13    PRINT_ERR("not enough arguments, running tests\n");
     14    err = run_on_default_source_and_sink(main);
    1515    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [channels] [hop_size]\n", argv[0]);
    1616    return err;
     
    7272beach_source:
    7373#else
    74   err = 3;
     74  err = 0;
    7575  PRINT_ERR("aubio was not compiled with aubio_sink_wavwrite\n");
    7676#endif /* HAVE_WAVWRITE */
  • tests/src/io/test-sink_wavwrite.c

    rc0ce78f r8968ea7  
    1111
    1212  if (argc < 3) {
    13     err = 2;
    14     PRINT_ERR("not enough arguments\n");
     13    PRINT_ERR("not enough arguments, running tests\n");
     14    err = run_on_default_source_and_sink(main);
    1515    PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]);
    1616    return err;
     
    6161beach_fvec:
    6262#else
    63   err = 3;
     63  err = 0;
    6464  PRINT_ERR("aubio was not compiled with aubio_sink_wavwrite\n");
    6565#endif /* HAVE_WAVWRITE */
  • tests/src/io/test-source.c

    rc0ce78f r8968ea7  
    66  uint_t err = 0;
    77  if (argc < 2) {
    8     err = 2;
    9     PRINT_ERR("not enough arguments\n");
     8    PRINT_ERR("not enough arguments, running tests\n");
     9    err = run_on_default_source(main);
    1010    PRINT_MSG("read a wave file as a mono vector\n");
    1111    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
     
    2323  uint_t hop_size = 256;
    2424  uint_t n_frames = 0, read = 0;
    25   if ( argc == 3 ) samplerate = atoi(argv[2]);
    26   if ( argc == 4 ) hop_size = atoi(argv[3]);
     25  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     26  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    2727
    2828  char_t *source_path = argv[1];
  • tests/src/io/test-source_apple_audio.c

    rc0ce78f r8968ea7  
    1010  uint_t err = 0;
    1111  if (argc < 2) {
    12     err = 2;
    13     PRINT_ERR("not enough arguments\n");
     12    PRINT_ERR("not enough arguments, running tests\n");
     13    err = run_on_default_source(main);
    1414    PRINT_MSG("read a wave file as a mono vector\n");
    1515    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
     
    2828  uint_t hop_size = 256;
    2929  uint_t n_frames = 0, read = 0;
    30   if ( argc == 3 ) samplerate = atoi(argv[2]);
    31   if ( argc == 4 ) hop_size = atoi(argv[3]);
     30  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     31  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    3232
    3333  char_t *source_path = argv[1];
     
    5757beach:
    5858#else /* HAVE_SOURCE_APPLE_AUDIO */
    59   err = 3;
     59  err = 0;
    6060  PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
    6161#endif /* HAVE_SOURCE_APPLE_AUDIO */
  • tests/src/io/test-source_avcodec.c

    rc0ce78f r8968ea7  
    1010  uint_t err = 0;
    1111  if (argc < 2) {
    12     err = 2;
    13     PRINT_ERR("not enough arguments\n");
     12    PRINT_ERR("not enough arguments, running tests\n");
     13    err = run_on_default_source(main);
    1414    PRINT_MSG("read a wave file as a mono vector\n");
    1515    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
     
    2828  uint_t hop_size = 256;
    2929  uint_t n_frames = 0, read = 0;
    30   if ( argc == 3 ) samplerate = atoi(argv[2]);
    31   if ( argc == 4 ) hop_size = atoi(argv[3]);
     30  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     31  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    3232
    3333  char_t *source_path = argv[1];
     
    5757beach:
    5858#else /* HAVE_LIBAV */
    59   err = 3;
     59  err = 0;
    6060  PRINT_ERR("aubio was not compiled with aubio_source_avcodec\n");
    6161#endif /* HAVE_LIBAV */
  • tests/src/io/test-source_multi.c

    rc0ce78f r8968ea7  
    66  sint_t err = 0;
    77  if (argc < 2) {
    8     err = -2;
    9     PRINT_ERR("not enough arguments\n");
     8    PRINT_ERR("not enough arguments, running tests\n");
     9    err = run_on_default_source(main);
    1010    PRINT_MSG("read a wave file as a mono vector\n");
    1111    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
  • tests/src/io/test-source_seek.c

    rc0ce78f r8968ea7  
    66  uint_t err = 0;
    77  if (argc < 2) {
    8     err = 2;
    9     PRINT_ERR("not enough arguments\n");
     8    PRINT_ERR("not enough arguments, running tests\n");
     9    err = run_on_default_source(main);
    1010    PRINT_MSG("read a wave file as a mono vector\n");
    1111    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
     
    2424  uint_t n_frames = 0, read = 0;
    2525  uint_t old_n_frames_1 = 0, old_n_frames_2 = 0, old_n_frames_3 = 0;
    26   if ( argc == 3 ) samplerate = atoi(argv[2]);
    27   if ( argc == 4 ) hop_size = atoi(argv[3]);
     26  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     27  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    2828
    2929  char_t *source_path = argv[1];
  • tests/src/io/test-source_sndfile.c

    rc0ce78f r8968ea7  
    1010  uint_t err = 0;
    1111  if (argc < 2) {
    12     err = 2;
    13     PRINT_ERR("not enough arguments\n");
     12    PRINT_ERR("not enough arguments, running tests\n");
     13    err = run_on_default_source(main);
    1414    PRINT_MSG("read a wave file as a mono vector\n");
    1515    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
     
    2828  uint_t hop_size = 256;
    2929  uint_t n_frames = 0, read = 0;
    30   if ( argc == 3 ) samplerate = atoi(argv[2]);
    31   if ( argc == 4 ) hop_size = atoi(argv[3]);
     30  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     31  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    3232
    3333  char_t *source_path = argv[1];
     
    5757beach:
    5858#else
    59   err = 3;
     59  err = 0;
    6060  PRINT_ERR("aubio was not compiled with aubio_source_sndfile\n");
    6161#endif /* HAVE_SNDFILE */
  • tests/src/io/test-source_wavread.c

    rc0ce78f r8968ea7  
    1010  uint_t err = 0;
    1111  if (argc < 2) {
    12     err = 2;
    13     PRINT_ERR("not enough arguments\n");
     12    PRINT_ERR("not enough arguments, running tests\n");
     13    err = run_on_default_source(main);
    1414    PRINT_MSG("read a wave file as a mono vector\n");
    1515    PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]);
     
    2828  uint_t hop_size = 256;
    2929  uint_t n_frames = 0, read = 0;
    30   if ( argc == 3 ) samplerate = atoi(argv[2]);
    31   if ( argc == 4 ) hop_size = atoi(argv[3]);
     30  if ( argc >= 3 ) samplerate = atoi(argv[2]);
     31  if ( argc >= 4 ) hop_size = atoi(argv[3]);
    3232
    3333  char_t *source_path = argv[1];
     
    3636  aubio_source_wavread_t * s =
    3737    new_aubio_source_wavread(source_path, samplerate, hop_size);
    38 
    3938  if (!s) { err = 1; goto beach; }
    4039  fvec_t *vec = new_fvec(hop_size);
     
    5857beach:
    5958#else
    60   err = 3;
     59  err = 0;
    6160  PRINT_ERR("aubio was not compiled with aubio_source_wavread\n");
    6261#endif /* HAVE_WAVREAD */
Note: See TracChangeset for help on using the changeset viewer.