From 574708177d5fabaec1d91d5b2f9bfeaad77d57cc Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 3 Mar 2013 15:19:35 -0500 Subject: [PATCH] tests/python/src/temporal/c_weighting.py: replaced by python/tests/test_filter.py --- .../c_weighting_test_simple_8000.expected | 0 python/tests/test_filter.py | 9 +++ tests/python/src/temporal/c_weighting.py | 59 ------------------- 3 files changed, 9 insertions(+), 59 deletions(-) rename {tests/python/src/temporal => python/tests}/c_weighting_test_simple_8000.expected (100%) delete mode 100644 tests/python/src/temporal/c_weighting.py diff --git a/tests/python/src/temporal/c_weighting_test_simple_8000.expected b/python/tests/c_weighting_test_simple_8000.expected similarity index 100% rename from tests/python/src/temporal/c_weighting_test_simple_8000.expected rename to python/tests/c_weighting_test_simple_8000.expected diff --git a/python/tests/test_filter.py b/python/tests/test_filter.py index 14a880d0..8e24bad3 100755 --- a/python/tests/test_filter.py +++ b/python/tests/test_filter.py @@ -40,6 +40,15 @@ class aubio_filter_test_case(TestCase): u = f(v) assert_almost_equal (expected[1], u) + def test_c_weighting_8000(self): + expected = array_from_text_file('c_weighting_test_simple_8000.expected') + f = digital_filter(5) + f.set_c_weighting(8000) + v = fvec(32) + v[12] = .5 + u = f(v) + assert_almost_equal (expected[1], u) + def test_a_weighting(self): expected = array_from_text_file('a_weighting_test_simple.expected') f = digital_filter(7) diff --git a/tests/python/src/temporal/c_weighting.py b/tests/python/src/temporal/c_weighting.py deleted file mode 100644 index 35dd4030..00000000 --- a/tests/python/src/temporal/c_weighting.py +++ /dev/null @@ -1,59 +0,0 @@ -from localaubio import * - -class c_weighting_unit(aubio_unit_template): - - def test_simple(self): - expected = array_from_text_file('src/temporal/c_weighting_test_simple.expected') - samplerate = 44100 - channels = 1 - buf_size = 32 - - # prepare input - input = new_fvec (buf_size, 1) - output = new_fvec (buf_size, 1) - fvec_write_sample (input, 0.5, 0, 12) - - # check input - for i in range(buf_size): - for c in range(channels): - self.assertEqual(expected[0][i], fvec_read_sample(input, c, i)) - - # filter - f = new_aubio_filter_c_weighting (samplerate, channels) - aubio_filter_do_outplace (f, input, output) - del_aubio_filter (f) - - # check output - for i in range(buf_size): - for c in range(channels): - self.assertAlmostEqual(expected[1][i], fvec_read_sample(output, c, i)) - - def test_simple_8000(self): - expected = array_from_text_file('src/temporal/c_weighting_test_simple_8000.expected') - samplerate = 8000 - channels = 1 - buf_size = 32 - - # prepare input - input = new_fvec (buf_size, 1) - output = new_fvec (buf_size, 1) - fvec_write_sample (input, 0.5, 0, 12) - - # check input - for i in range(buf_size): - for c in range(channels): - self.assertEqual(expected[0][i], fvec_read_sample(input, c, i)) - - # filter - f = new_aubio_filter_c_weighting (samplerate, channels) - aubio_filter_do_outplace (f, input, output) - del_aubio_filter (f) - - # check output - for i in range(buf_size): - for c in range(channels): - self.assertAlmostEqual(expected[1][i], fvec_read_sample(output, c, i)) - -if __name__ == '__main__': - import unittest - unittest.main() -- 2.26.2