From 43ea60dd7c94b89c761d14b8ac25713f88017d3b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 19 Dec 2018 14:53:18 +0100 Subject: [PATCH] [tests] improve test-sink variable names --- tests/src/io/base-sink_custom.h | 28 ++++++++++++++-------------- tests/src/io/test-sink.c | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/src/io/base-sink_custom.h b/tests/src/io/base-sink_custom.h index 150ecc92..e8c8886f 100644 --- a/tests/src/io/base-sink_custom.h +++ b/tests/src/io/base-sink_custom.h @@ -25,8 +25,8 @@ int base_main(int argc, char **argv) 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 @@ int base_main(int argc, char **argv) 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 @@ int base_main(int argc, char **argv) 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); diff --git a/tests/src/io/test-sink.c b/tests/src/io/test-sink.c index 08247fb1..e004268f 100644 --- a/tests/src/io/test-sink.c +++ b/tests/src/io/test-sink.c @@ -21,8 +21,8 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) 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 @@ int main(int argc, char **argv) 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); -- 2.11.0