From fcef3fd331e30e57971e15bc90874c05688da9fb Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 3 May 2016 17:39:02 +0200 Subject: [PATCH] python/tests/test_fft.py: more tests --- python/tests/test_fft.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/python/tests/test_fft.py b/python/tests/test_fft.py index 83871d82..8ab92ef1 100755 --- a/python/tests/test_fft.py +++ b/python/tests/test_fft.py @@ -164,6 +164,27 @@ class aubio_fft_test_case(TestCase): with self.assertRaises(ValueError): f.rdo(s) +class aubio_fft_wrong_params(TestCase): + + def test_wrong_buf_size(self): + win_s = -1 + with self.assertRaises(ValueError): + fft(win_s) + + def test_buf_size_not_power_of_two(self): + # when compiled with fftw3, aubio supports non power of two fft sizes + win_s = 320 + try: + with self.assertRaises(RuntimeError): + fft(win_s) + except AssertionError as e: + self.skipTest('creating aubio.fft with size %d did not fail' % win_s) + + def test_buf_size_too_small(self): + win_s = 1 + with self.assertRaises(RuntimeError): + fft(win_s) + if __name__ == '__main__': from nose2 import main main() -- 2.11.0