shithub: aubio

Download patch

ref: fcef3fd331e30e57971e15bc90874c05688da9fb
parent: de0a49250d04d9322d46172196df711494ac756d
author: Paul Brossier <piem@piem.org>
date: Tue May 3 13:39:02 EDT 2016

python/tests/test_fft.py: more tests

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