From b2de03fb286cca44838f273441ebf00d77780c73 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 12 May 2016 20:05:34 +0200 Subject: [PATCH] tests/src/temporal: avoid crash, clarify --- tests/src/temporal/test-a_weighting.c | 12 +++++++++--- tests/src/temporal/test-c_weighting.c | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) 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; -- 2.11.0