shithub: aubio

Download patch

ref: d03ee4b9e97ca863f60194f976f17cfd9af8bb06
parent: d13f0bb00d621cb04f99d87adcd701ddd6638095
author: Paul Brossier <piem@piem.org>
date: Sat Apr 30 02:19:23 EDT 2016

python/tests/test_fft.py: add test to make sure fft.do clashes on wrong size inputs

--- a/python/tests/test_fft.py
+++ b/python/tests/test_fft.py
@@ -136,6 +136,22 @@
         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()