From: Paul Brossier Date: Thu, 12 May 2016 18:05:34 +0000 (+0200) Subject: tests/src/temporal: avoid crash, clarify X-Git-Tag: 0.4.4~300^2~64 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=b2de03fb286cca44838f273441ebf00d77780c73;p=aubio.git tests/src/temporal: avoid crash, clarify --- diff --git a/tests/src/temporal/test-a_weighting.c b/tests/src/temporal/test-a_weighting.c index f6399b5c..4030a0db 100644 --- a/tests/src/temporal/test-a_weighting.c +++ b/tests/src/temporal/test-a_weighting.c @@ -20,16 +20,22 @@ int main (void) // samplerate unknown f = new_aubio_filter_a_weighting (4200); - del_aubio_filter (f); + if (!f) { + //PRINT_MSG ("failed creating A-weighting filter with samplerate=4200Hz\n"); + } // order to small f = new_aubio_filter (2); - aubio_filter_set_a_weighting (f, samplerate); + if (aubio_filter_set_a_weighting (f, samplerate) != 0) { + //PRINT_MSG ("failed setting filter to A-weighting\n"); + } del_aubio_filter (f); // order to big f = new_aubio_filter (12); - aubio_filter_set_a_weighting (f, samplerate); + if (aubio_filter_set_a_weighting (f, samplerate) != 0) { + //PRINT_MSG ("failed setting filter to A-weighting\n"); + } del_aubio_filter (f); return 0; diff --git a/tests/src/temporal/test-c_weighting.c b/tests/src/temporal/test-c_weighting.c index 96d8ee70..84380c9b 100644 --- a/tests/src/temporal/test-c_weighting.c +++ b/tests/src/temporal/test-c_weighting.c @@ -19,16 +19,22 @@ int main (void) // samplerate unknown f = new_aubio_filter_c_weighting (4200); - del_aubio_filter (f); + if (!f) { + //PRINT_WRN ("failed creating C-weighting filter with samplerate=4200Hz"); + } // order to small f = new_aubio_filter (2); - aubio_filter_set_c_weighting (f, samplerate); + if (aubio_filter_set_c_weighting (f, samplerate) != 0) { + //PRINT_WRN ("failed setting filter to C-weighting"); + } del_aubio_filter (f); // order to big f = new_aubio_filter (12); - aubio_filter_set_c_weighting (f, samplerate); + if (aubio_filter_set_c_weighting (f, samplerate) != 0) { + //PRINT_WRN ("failed setting filter to C-weighting"); + } del_aubio_filter (f); return 0;