History

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

Paul Brossier committed 10 years ago

Commit d03ee4b1 parent d13f0bb1 file · +16 −0Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/tests/test_fft.py+16−0
@@ -136,6 +136,22 @@ class aubio_fft_test_case(TestCase): · 135 unmodified lines
136136 assert_almost_equal ( r[0], impulse, decimal = 6)
137137 assert_almost_equal ( r[1:], 0)
138138
139+ def test_large_input_timegrain(self):
140+ win_s = 1024
141+ f = fft(win_s)
142+ t = fvec(win_s + 1)
143+ print f(t)
144+ with self.assertRaises(ValueError):
145+ print f(t)
146+
147+ def test_small_input_timegrain(self):
148+ win_s = 1024
149+ f = fft(win_s)
150+ t = fvec(1)
151+ print f(t).phas
152+ with self.assertRaises(ValueError):
153+ f(t)
154+
139155 if __name__ == '__main__':
140156 from unittest import main
141157 main()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t