shithub: aubio

Download patch

ref: 43ea60dd7c94b89c761d14b8ac25713f88017d3b
parent: 387b605e7539ce6e8a637bed7dd869271960dfaa
author: Paul Brossier <piem@piem.org>
date: Wed Dec 19 09:53:18 EST 2018

[tests] improve test-sink variable names

--- a/tests/src/io/base-sink_custom.h
+++ b/tests/src/io/base-sink_custom.h
@@ -25,8 +25,8 @@
   char_t *source_path = argv[1];
   char_t *sink_path = argv[2];
 
-  aubio_source_t *i = NULL;
-  aubio_sink_custom_t *o = NULL;
+  aubio_source_t *src = NULL;
+  aubio_sink_custom_t *snk = NULL;
 
   if ( argc >= 4 ) samplerate = atoi(argv[3]);
   if ( argc >= 5 ) hop_size = atoi(argv[4]);
@@ -34,16 +34,16 @@
   fvec_t *vec = new_fvec(hop_size);
   if (!vec) { err = 1; goto failure; }
 
-  i = new_aubio_source(source_path, samplerate, hop_size);
-  if (!i) { err = 1; goto failure; }
-  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
+  src = new_aubio_source(source_path, samplerate, hop_size);
+  if (!src) { err = 1; goto failure; }
+  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src);
 
-  o = new_aubio_sink_custom(sink_path, samplerate);
-  if (!o) { err = 1; goto failure; }
+  snk = new_aubio_sink_custom(sink_path, samplerate);
+  if (!snk) { err = 1; goto failure; }
 
   do {
-    aubio_source_do(i, vec, &read);
-    aubio_sink_custom_do(o, vec, read);
+    aubio_source_do(src, vec, &read);
+    aubio_sink_custom_do(snk, vec, read);
     n_frames += read;
   } while ( read == hop_size );
 
@@ -52,13 +52,13 @@
       source_path, sink_path);
 
   // close sink now (optional)
-  aubio_sink_custom_close(o);
+  aubio_sink_custom_close(snk);
 
 failure:
-  if (o)
-    del_aubio_sink_custom(o);
-  if (i)
-    del_aubio_source(i);
+  if (snk)
+    del_aubio_sink_custom(snk);
+  if (src)
+    del_aubio_source(src);
   if (vec)
     del_fvec(vec);
 
--- a/tests/src/io/test-sink.c
+++ b/tests/src/io/test-sink.c
@@ -21,8 +21,8 @@
   char_t *source_path = argv[1];
   char_t *sink_path = argv[2];
 
-  aubio_source_t *i = NULL;
-  aubio_sink_t *o = NULL;
+  aubio_source_t *src = NULL;
+  aubio_sink_t *snk = NULL;
 
   if ( argc >= 4 ) samplerate = atoi(argv[3]);
   if ( argc >= 5 ) hop_size = atoi(argv[4]);
@@ -30,16 +30,16 @@
   fvec_t *vec = new_fvec(hop_size);
   if (!vec) { err = 1; goto failure; }
 
-  i = new_aubio_source(source_path, samplerate, hop_size);
-  if (!i) { err = 1; goto failure; }
-  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i);
+  src = new_aubio_source(source_path, samplerate, hop_size);
+  if (!src) { err = 1; goto failure; }
+  if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src);
 
-  o = new_aubio_sink(sink_path, samplerate);
-  if (!o) { err = 1; goto failure; }
+  snk = new_aubio_sink(sink_path, samplerate);
+  if (!snk) { err = 1; goto failure; }
 
   do {
-    aubio_source_do(i, vec, &read);
-    aubio_sink_do(o, vec, read);
+    aubio_source_do(src, vec, &read);
+    aubio_sink_do(snk, vec, read);
     n_frames += read;
   } while ( read == hop_size );
 
@@ -48,13 +48,13 @@
       source_path, sink_path);
 
   // close sink now (optional)
-  aubio_sink_close(o);
+  aubio_sink_close(snk);
 
 failure:
-  if (o)
-    del_aubio_sink(o);
-  if (i)
-    del_aubio_source(i);
+  if (snk)
+    del_aubio_sink(snk);
+  if (src)
+    del_aubio_source(src);
   if (vec)
     del_fvec(vec);