From: Paul Brossier Date: Tue, 3 May 2016 15:39:02 +0000 (+0200) Subject: python/tests/test_fft.py: more tests X-Git-Tag: 0.4.4~300^2~120 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=fcef3fd331e30e57971e15bc90874c05688da9fb python/tests/test_fft.py: more tests --- 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()