Changeset 633a408 for tests


Ignore:
Timestamp:
Dec 16, 2018, 3:47:53 AM (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/timestretch, fix/ffmpeg5, master
Children:
7fc8406
Parents:
46a1e34
Message:

[tests] improve sink_custom tests

File:
1 edited

Legend:

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

    r46a1e34 r633a408  
    6464int test_wrong_params(void)
    6565{
     66  aubio_sink_custom_t *s;
     67  char_t sink_path[PATH_MAX] = "tmp_aubio_XXXXXX";
     68  uint_t samplerate = 44100;
     69  // create temp file
     70  int fd = create_temp_sink(sink_path);
     71
     72  if (!fd) return 1;
     73
     74  if (new_aubio_sink_custom(   0,   samplerate)) return 1;
     75  if (new_aubio_sink_custom("\0",   samplerate)) return 1;
     76  if (new_aubio_sink_custom(sink_path,      -1)) return 1;
     77
     78  s = new_aubio_sink_custom(sink_path, 0);
     79
     80  if (aubio_sink_custom_preset_samplerate(s, samplerate)) return 1;
     81  if (aubio_sink_custom_preset_channels(s, 1)) return 1;
     82
     83  // test delete without closing
     84  del_aubio_sink_custom(s);
     85
     86  s = new_aubio_sink_custom(sink_path, 0);
     87
     88  if (aubio_sink_custom_preset_samplerate(s, samplerate)) return 1;
     89  if (aubio_sink_custom_preset_channels(s, 3)) return 1;
     90
     91  aubio_sink_custom_close(s);
     92  // test closing twice
     93  aubio_sink_custom_close(s);
     94
     95  del_aubio_sink_custom(s);
     96
     97  // delete temp file
     98  close_temp_sink(sink_path, fd);
     99
    66100  return run_on_default_source_and_sink(base_main);
    67101}
Note: See TracChangeset for help on using the changeset viewer.