shithub: aubio

Download patch

ref: 972094546fff148a563475e76050a1d4e98f9cbc
parent: b65230ac69ae27a954008e5e1bce96193363c413
author: Paul Brossier <piem@piem.org>
date: Sun Oct 1 12:00:07 EDT 2017

tests/: undo changes, removing calls to aubio_init

--- a/tests/src/io/test-sink-multi.c
+++ b/tests/src/io/test-sink-multi.c
@@ -6,8 +6,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -70,8 +68,5 @@
 beach_fmat:
   del_aubio_source(i);
 beach_source:
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink.c
+++ b/tests/src/io/test-sink.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -56,8 +54,5 @@
 beach_source:
   del_fvec(vec);
 beach_fvec:
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink_apple_audio-multi.c
+++ b/tests/src/io/test-sink_apple_audio-multi.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -76,8 +74,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_sink_apple_audio\n");
 #endif /* HAVE_SINK_APPLE_AUDIO */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink_apple_audio.c
+++ b/tests/src/io/test-sink_apple_audio.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -65,8 +63,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
 #endif /* HAVE_SINK_APPLE_AUDIO */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink_sndfile-multi.c
+++ b/tests/src/io/test-sink_sndfile-multi.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -76,8 +74,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_sink_sndfile\n");
 #endif /* HAVE_SNDFILE */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink_sndfile.c
+++ b/tests/src/io/test-sink_sndfile.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -65,8 +63,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_source_sndfile\n");
 #endif /* HAVE_SNDFILE */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink_wavwrite-multi.c
+++ b/tests/src/io/test-sink_wavwrite-multi.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -76,8 +74,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_sink_wavwrite\n");
 #endif /* HAVE_WAVWRITE */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-sink_wavwrite.c
+++ b/tests/src/io/test-sink_wavwrite.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -65,8 +63,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_sink_wavwrite\n");
 #endif /* HAVE_WAVWRITE */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-source.c
+++ b/tests/src/io/test-source.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -57,6 +55,5 @@
   del_fvec (vec);
   del_aubio_source (s);
 beach:
-  aubio_cleanup();
   return err;
 }
--- a/tests/src/io/test-source_apple_audio.c
+++ b/tests/src/io/test-source_apple_audio.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -61,8 +59,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
 #endif /* HAVE_SOURCE_APPLE_AUDIO */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-source_avcodec.c
+++ b/tests/src/io/test-source_avcodec.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -61,8 +59,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_source_avcodec\n");
 #endif /* HAVE_LIBAV */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-source_multi.c
+++ b/tests/src/io/test-source_multi.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
   if (argc < 2) {
     err = -2;
@@ -55,7 +53,5 @@
   del_aubio_source (s);
 beach:
 
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-source_seek.c
+++ b/tests/src/io/test-source_seek.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -90,8 +88,5 @@
   assert ( old_n_frames_2 == old_n_frames_1 );
   // check that we got about half the frames, with 3 decimals
   assert ( roundf(1.e3 * old_n_frames_1 / old_n_frames_3) / 1.e3 == 2.);
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-source_sndfile.c
+++ b/tests/src/io/test-source_sndfile.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -61,8 +59,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_source_sndfile\n");
 #endif /* HAVE_SNDFILE */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/io/test-source_wavread.c
+++ b/tests/src/io/test-source_wavread.c
@@ -7,8 +7,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -62,8 +60,5 @@
   err = 3;
   PRINT_ERR("aubio was not compiled with aubio_source_wavread\n");
 #endif /* HAVE_WAVREAD */
-
-  aubio_cleanup();
-  
   return err;
 }
--- a/tests/src/onset/test-onset.c
+++ b/tests/src/onset/test-onset.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-  
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
--- a/tests/src/pitch/test-pitch.c
+++ b/tests/src/pitch/test-pitch.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   // 1. allocate some memory
   uint_t n = 0; // frame counter
   uint_t win_s = 1024; // window size
--- a/tests/src/pitch/test-pitchfcomb.c
+++ b/tests/src/pitch/test-pitchfcomb.c
@@ -7,7 +7,6 @@
 
 int main (void)
 {
-  aubio_init();
   uint_t i = 0;
   uint_t win_s = 1024; // window size
   uint_t hop_s = win_s/4; // hop size
--- a/tests/src/pitch/test-pitchmcomb.c
+++ b/tests/src/pitch/test-pitchmcomb.c
@@ -7,8 +7,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t n = 10; // compute n times
   uint_t win_s = 1024; // window size
   uint_t hop_s = win_s/4; // hop size
--- a/tests/src/pitch/test-pitchschmitt.c
+++ b/tests/src/pitch/test-pitchschmitt.c
@@ -7,7 +7,6 @@
 
 int main (void)
 {
-  aubio_init();
   uint_t n = 10; // compute n times
   uint_t win_s = 1024; // window size
   // create some vectors
--- a/tests/src/pitch/test-pitchspecacf.c
+++ b/tests/src/pitch/test-pitchspecacf.c
@@ -7,8 +7,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t n = 10; // compute n times
   uint_t win_s = 1024; // window size
   // create some vectors
--- a/tests/src/pitch/test-pitchyin.c
+++ b/tests/src/pitch/test-pitchyin.c
@@ -7,8 +7,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t n = 10; // compute n times
   uint_t win_s = 1024; // window size
   // create some vectors
--- a/tests/src/pitch/test-pitchyinfft.c
+++ b/tests/src/pitch/test-pitchyinfft.c
@@ -7,8 +7,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t n = 10; // compute n times
   uint_t win_s = 1024; // window size
   // create some vectors
--- a/tests/src/spectral/test-awhitening.c
+++ b/tests/src/spectral/test-awhitening.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-
   sint_t err = 0;
 
   if (argc < 3) {
@@ -81,7 +79,6 @@
 beach_source:
   del_fvec(vec);
 beach_fvec:
-  aubio_cleanup();
   return err;
 }
 
--- a/tests/src/spectral/test-fft.c
+++ b/tests/src/spectral/test-fft.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   int return_code = 0;
   uint_t i, n_iters = 100; // number of iterations
   uint_t win_s = 512; // window size
@@ -45,8 +43,6 @@
   del_fvec(in);
   del_cvec(fftgrain);
   del_fvec(out);
-
   aubio_cleanup();
-  
   return return_code;
 }
--- a/tests/src/spectral/test-filterbank.c
+++ b/tests/src/spectral/test-filterbank.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t win_s = 1024; // window size
   uint_t n_filters = 13; // number of filters
 
@@ -35,7 +33,6 @@
   del_aubio_filterbank (o);
   del_cvec (in_spec);
   del_fvec (out_filters);
-  
   aubio_cleanup ();
 
   return 0;
--- a/tests/src/spectral/test-filterbank_mel.c
+++ b/tests/src/spectral/test-filterbank_mel.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t samplerate = 16000; // samplerate of signal to filter
   uint_t win_s = 512; // fft size
   uint_t n_filters = 40; // number of filters
@@ -34,7 +32,6 @@
   del_aubio_filterbank (o);
   del_cvec (in_spec);
   del_fvec (out_filters);
-  
   aubio_cleanup ();
 
   return 0;
--- a/tests/src/spectral/test-mfcc.c
+++ b/tests/src/spectral/test-mfcc.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t win_s = 512; // fft size
   uint_t n_filters = 40; // number of filters
   uint_t n_coefs = 13; // number of coefficients
@@ -26,7 +24,6 @@
   del_aubio_mfcc (o);
   del_cvec (in);
   del_fvec (out);
-  
   aubio_cleanup ();
 
   return 0;
--- a/tests/src/spectral/test-phasevoc.c
+++ b/tests/src/spectral/test-phasevoc.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t n = 6; // compute n times
   uint_t win_s = 32; // window size
   uint_t hop_s = win_s / 4; // hop size
@@ -43,7 +41,6 @@
   del_cvec(fftgrain);
   del_fvec(out);
   del_aubio_pvoc(pv);
-  
   aubio_cleanup();
 
   return 0;
--- a/tests/src/spectral/test-specdesc.c
+++ b/tests/src/spectral/test-specdesc.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t win_s = 1024; // window size
   cvec_t *in = new_cvec (win_s); // input buffer
   fvec_t *out = new_fvec (1); // output spectral descriptor
@@ -40,7 +38,6 @@
 
   del_cvec (in);
   del_fvec (out);
-  
   aubio_cleanup ();
 
   return 0;
--- a/tests/src/spectral/test-tss.c
+++ b/tests/src/spectral/test-tss.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t n = 10; // compute n times
   uint_t win_s = 1024; // window size
   uint_t hop_s = 256;  // hop size
--- a/tests/src/synth/test-sampler.c
+++ b/tests/src/synth/test-sampler.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-  
   sint_t err = 0;
 
   if (argc < 4) {
@@ -55,7 +53,6 @@
   del_aubio_source(source);
   del_aubio_sink(sink);
   del_fvec(vec);
-  
   aubio_cleanup();
 
   return 0;
--- a/tests/src/synth/test-wavetable.c
+++ b/tests/src/synth/test-wavetable.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-  
   sint_t err = 0;
 
   if (argc < 2) {
@@ -64,7 +62,6 @@
   del_aubio_wavetable (wavetable);
   del_aubio_sink(sink);
   del_fvec(vec);
-  
   aubio_cleanup();
 
   return 0;
--- a/tests/src/tempo/test-beattracking.c
+++ b/tests/src/tempo/test-beattracking.c
@@ -5,8 +5,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t i = 0;
   uint_t win_s = 1024; // window size
   fvec_t * in = new_fvec (win_s); // input buffer
@@ -35,7 +33,6 @@
   del_aubio_beattracking(tempo);
   del_fvec(in);
   del_fvec(out);
-  
   aubio_cleanup();
 
   return 0;
--- a/tests/src/tempo/test-tempo.c
+++ b/tests/src/tempo/test-tempo.c
@@ -3,8 +3,6 @@
 
 int main (int argc, char **argv)
 {
-  aubio_init();
-  
   uint_t err = 0;
   if (argc < 2) {
     err = 2;
@@ -58,7 +56,6 @@
   del_fvec(in);
   del_fvec(out);
   del_aubio_source(source);
-  
 beach:
   aubio_cleanup();
 
--- a/tests/src/temporal/test-a_weighting.c
+++ b/tests/src/temporal/test-a_weighting.c
@@ -2,8 +2,7 @@
 
 int main (void)
 {
-  aubio_init();
-
+  
   aubio_filter_t * f;
 
   uint_t rates[] = { 8000, 16000, 22050, 44100, 96000, 192000};
@@ -39,8 +38,6 @@
   }
   del_aubio_filter (f);
 
-  aubio_cleanup();
-  
   return 0;
 }
 
--- a/tests/src/temporal/test-biquad.c
+++ b/tests/src/temporal/test-biquad.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t win_s = 64; // window size
 
   // create biquad filter with `b0`, `b1`, `b2`, `a1`, `a2`
@@ -30,7 +28,5 @@
   del_fvec(tmp_vec);
   del_fvec(out_vec);
 
-  aubio_cleanup();
-  
   return 0;
 }
--- a/tests/src/temporal/test-c_weighting.c
+++ b/tests/src/temporal/test-c_weighting.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   aubio_filter_t * f;
 
   uint_t rates[] = { 8000, 16000, 22050, 44100, 96000, 192000};
@@ -39,8 +37,6 @@
   }
   del_aubio_filter (f);
 
-  aubio_cleanup();
-  
   return 0;
 }
 
--- a/tests/src/temporal/test-filter.c
+++ b/tests/src/temporal/test-filter.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-  
   uint_t win_s = 16; // window size
   uint_t impulse_at = win_s / 2;
   fvec_t *in = new_fvec (win_s); // input buffer
@@ -31,7 +29,6 @@
   del_fvec (in);
   del_fvec (out);
   del_aubio_filter (o);
-  
   aubio_cleanup ();
 
   return 0;
--- a/tests/src/temporal/test-resampler.c
+++ b/tests/src/temporal/test-resampler.c
@@ -2,8 +2,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t win_s = 1024; // window size
   smpl_t ratio = 0.5;
   fvec_t *in = new_fvec (win_s); // input buffer
@@ -19,8 +17,6 @@
   del_aubio_resampler (o);
   del_fvec (in);
   del_fvec (out);
-
-  aubio_cleanup();
 
   return 0;
 }
--- a/tests/src/test-cvec.c
+++ b/tests/src/test-cvec.c
@@ -3,8 +3,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t i, window_size = 16; // window size
   cvec_t * complex_vector = new_cvec (window_size); // input buffer
   uint_t rand_times = 4;
@@ -46,8 +44,5 @@
 
   // destroy it
   del_cvec(complex_vector);
-
-  aubio_cleanup();
-
   return 0;
 }
--- a/tests/src/test-delnull.c
+++ b/tests/src/test-delnull.c
@@ -6,8 +6,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t return_code = 0;
   fvec_t *f = new_fvec(-12);
   cvec_t *c = new_cvec(-12);
@@ -22,8 +20,5 @@
   } else if (fft != NULL) {
     return_code = 3;
   }
-
-  aubio_cleanup();
-  
   return return_code;
 }
--- a/tests/src/test-fmat.c
+++ b/tests/src/test-fmat.c
@@ -6,8 +6,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t height = 3, length = 9, i, j;
   // create fmat_t object
   fmat_t * mat = new_fmat (height, length);
@@ -27,9 +25,6 @@
   fmat_print(mat);
   // destroy it
   del_fmat(mat);
-
-  aubio_cleanup();
-  
   return 0;
 }
 
--- a/tests/src/test-fvec.c
+++ b/tests/src/test-fvec.c
@@ -3,8 +3,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t vec_size = 10, i;
   fvec_t * vec = new_fvec (vec_size);
 
@@ -39,8 +37,6 @@
 
   // now destroys the vector
   del_fvec(vec);
-
-  aubio_cleanup();
 
   return 0;
 }
--- a/tests/src/test-lvec.c
+++ b/tests/src/test-lvec.c
@@ -3,8 +3,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t win_s = 32; // window size
   lvec_t * sp = new_lvec (win_s); // input buffer
   lvec_set_sample (sp, 2./3., 0);
@@ -15,9 +13,6 @@
   lvec_set_all (sp, 3./5.);
   lvec_print (sp);
   del_lvec(sp);
-
-  aubio_cleanup();
-  
   return 0;
 }
 
--- a/tests/src/test-mathutils-window.c
+++ b/tests/src/test-mathutils-window.c
@@ -3,8 +3,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t length = 0;
   uint_t n_length = 4, n_types = 10, i, t;
   uint_t lengths[4] = { 8, 10, 15, 16 };
@@ -28,9 +26,6 @@
       del_fvec(window);
     }
   }
-
-  aubio_cleanup();
-  
   return 0;
 }
 
--- a/tests/src/test-mathutils.c
+++ b/tests/src/test-mathutils.c
@@ -113,13 +113,8 @@
 
 int main (void)
 {
-  aubio_init();
-
   test_next_power_of_two();
   test_miditofreq();
   test_freqtomidi();
-
-  aubio_cleanup();
-  
   return 0;
 }
--- a/tests/src/utils/test-hist.c
+++ b/tests/src/utils/test-hist.c
@@ -4,8 +4,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t length;
   for (length = 1; length < 10; length ++ ) {
     aubio_hist_t *o = new_aubio_hist(0, 1, length);
@@ -27,9 +25,6 @@
     del_aubio_hist(o);
     del_fvec(t);
   }
-
-  aubio_cleanup();
-  
   return 0;
 }
 
--- a/tests/src/utils/test-log.c
+++ b/tests/src/utils/test-log.c
@@ -23,8 +23,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   fprintf(stdout, "### testing normal logging\n");
   AUBIO_ERR("testing normal AUBIO_LOG_ERR\n");
   AUBIO_INF("testing normal AUBIO_LOG_INF\n");
@@ -58,7 +56,5 @@
   AUBIO_MSG("testing custom set_level_function AUBIO_LOG_MSG\n");
   AUBIO_DBG("testing again normal AUBIO_LOG_DBG\n");
 
-  aubio_cleanup();
-  
   return 0;
 }
--- a/tests/src/utils/test-parameter.c
+++ b/tests/src/utils/test-parameter.c
@@ -24,8 +24,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   smpl_t max_value = 100.;
   smpl_t min_value = 0.;
   uint_t steps = 10;
@@ -68,7 +66,5 @@
 
   del_aubio_parameter (param);
 
-  aubio_cleanup();
-  
   return 0;
 }
--- a/tests/src/utils/test-scale.c
+++ b/tests/src/utils/test-scale.c
@@ -4,8 +4,6 @@
 
 int main (void)
 {
-  aubio_init();
-
   uint_t n = 0;
   uint_t win_s = 1024; // window size
   fvec_t * in = new_fvec (win_s); // input buffer
@@ -20,7 +18,5 @@
   del_aubio_scale(o);
   del_fvec(in);
 
-  aubio_cleanup();
-  
   return 0;
 }