From: Paul Brossier Date: Mon, 19 Oct 2009 13:27:20 +0000 (+0200) Subject: python/: update to new filter, test_filter.py py-filter.c X-Git-Tag: bzr2git~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=07bf04e6d7a996b10ec25d8c9f89901f0a6a38ac;p=aubio.git python/: update to new filter, test_filter.py py-filter.c --- diff --git a/interfaces/python/py-filter.c b/interfaces/python/py-filter.c index 8d24a072..7f463411 100644 --- a/interfaces/python/py-filter.c +++ b/interfaces/python/py-filter.c @@ -147,9 +147,9 @@ static PyMemberDef Py_filter_members[] = { }; static PyMethodDef Py_filter_methods[] = { - {"set_c_weighting", (PyCFunction) Py_filter_set_c_weighting, METH_NOARGS, + {"set_c_weighting", (PyCFunction) Py_filter_set_c_weighting, METH_VARARGS, "set filter coefficients to C-weighting"}, - {"set_a_weighting", (PyCFunction) Py_filter_set_a_weighting, METH_NOARGS, + {"set_a_weighting", (PyCFunction) Py_filter_set_a_weighting, METH_VARARGS, "set filter coefficients to A-weighting"}, {NULL} }; diff --git a/interfaces/python/test_filter.py b/interfaces/python/test_filter.py index 3007a987..b3bcac1d 100644 --- a/interfaces/python/test_filter.py +++ b/interfaces/python/test_filter.py @@ -17,18 +17,18 @@ class aubio_filter_test_case(TestCase): f(fvec()) def test_cweighting_error(self): - f = digital_filter (44100, 2, 1) - self.assertRaises ( ValueError, f.set_c_weighting ) - f = digital_filter (44100, 8, 1) - self.assertRaises ( ValueError, f.set_c_weighting ) - f = digital_filter (4000, 5, 1) - self.assertRaises ( ValueError, f.set_c_weighting ) - f = digital_filter (193000, 5, 1) - self.assertRaises ( ValueError, f.set_c_weighting ) - f = digital_filter (193000, 7, 1) - self.assertRaises ( ValueError, f.set_a_weighting ) - f = digital_filter (192000, 5, 1) - self.assertRaises ( ValueError, f.set_a_weighting ) + f = digital_filter (2, 1) + self.assertRaises ( ValueError, f.set_c_weighting, 44100 ) + f = digital_filter (8, 1) + self.assertRaises ( ValueError, f.set_c_weighting, 44100 ) + f = digital_filter (5, 1) + self.assertRaises ( ValueError, f.set_c_weighting, 4000 ) + f = digital_filter (5, 1) + self.assertRaises ( ValueError, f.set_c_weighting, 193000 ) + f = digital_filter (7, 1) + self.assertRaises ( ValueError, f.set_a_weighting, 193000 ) + f = digital_filter (5, 1) + self.assertRaises ( ValueError, f.set_a_weighting, 192000 ) def test_c_weighting(self): expected = array_from_text_file('c_weighting_test_simple.expected')