From d03ee4b9e97ca863f60194f976f17cfd9af8bb06 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 30 Apr 2016 06:19:23 +0200 Subject: [PATCH] python/tests/test_fft.py: add test to make sure fft.do clashes on wrong size inputs --- python/tests/test_fft.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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() -- 2.11.0