From: Paul Brossier Date: Sat, 30 Apr 2016 04:19:23 +0000 (+0200) Subject: python/tests/test_fft.py: add test to make sure fft.do clashes on wrong size inputs X-Git-Tag: 0.4.4~300^2~170 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=d03ee4b9e97ca863f60194f976f17cfd9af8bb06;p=aubio.git python/tests/test_fft.py: add test to make sure fft.do clashes on wrong size inputs --- diff --git a/python/tests/test_fft.py b/python/tests/test_fft.py index 5a3d9150..257a571a 100755 --- a/python/tests/test_fft.py +++ b/python/tests/test_fft.py @@ -136,6 +136,22 @@ class aubio_fft_test_case(TestCase): assert_almost_equal ( r[0], impulse, decimal = 6) assert_almost_equal ( r[1:], 0) + def test_large_input_timegrain(self): + win_s = 1024 + f = fft(win_s) + t = fvec(win_s + 1) + print f(t) + with self.assertRaises(ValueError): + print f(t) + + def test_small_input_timegrain(self): + win_s = 1024 + f = fft(win_s) + t = fvec(1) + print f(t).phas + with self.assertRaises(ValueError): + f(t) + if __name__ == '__main__': from unittest import main main()