[tests] improve test-sink variable names
authorPaul Brossier <piem@piem.org>
Wed, 19 Dec 2018 13:53:18 +0000 (14:53 +0100)
committerPaul Brossier <piem@piem.org>
Wed, 19 Dec 2018 13:53:18 +0000 (14:53 +0100)
tests/src/io/base-sink_custom.h
tests/src/io/test-sink.c

index 150ecc9..e8c8886 100644 (file)
@@ -25,8 +25,8 @@ int base_main(int argc, char **argv)
   char_t *source_path = argv[1];
   char_t *sink_path = argv[2];
 
   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]);
 
   if ( argc >= 4 ) samplerate = atoi(argv[3]);
   if ( argc >= 5 ) hop_size = atoi(argv[4]);
@@ -34,16 +34,16 @@ int base_main(int argc, char **argv)
   fvec_t *vec = new_fvec(hop_size);
   if (!vec) { err = 1; goto failure; }
 
   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 {
 
   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 );
 
     n_frames += read;
   } while ( read == hop_size );
 
@@ -52,13 +52,13 @@ int base_main(int argc, char **argv)
       source_path, sink_path);
 
   // close sink now (optional)
       source_path, sink_path);
 
   // close sink now (optional)
-  aubio_sink_custom_close(o);
+  aubio_sink_custom_close(snk);
 
 failure:
 
 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);
 
   if (vec)
     del_fvec(vec);
 
index 08247fb..e004268 100644 (file)
@@ -21,8 +21,8 @@ int main(int argc, char **argv)
   char_t *source_path = argv[1];
   char_t *sink_path = argv[2];
 
   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]);
 
   if ( argc >= 4 ) samplerate = atoi(argv[3]);
   if ( argc >= 5 ) hop_size = atoi(argv[4]);
@@ -30,16 +30,16 @@ int main(int argc, char **argv)
   fvec_t *vec = new_fvec(hop_size);
   if (!vec) { err = 1; goto failure; }
 
   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 {
 
   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 );
 
     n_frames += read;
   } while ( read == hop_size );
 
@@ -48,13 +48,13 @@ int main(int argc, char **argv)
       source_path, sink_path);
 
   // close sink now (optional)
       source_path, sink_path);
 
   // close sink now (optional)
-  aubio_sink_close(o);
+  aubio_sink_close(snk);
 
 failure:
 
 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);
 
   if (vec)
     del_fvec(vec);