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/tests (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
136 assert_almost_equal ( r[0], impulse, decimal = 6)136 assert_almost_equal ( r[0], impulse, decimal = 6)
137 assert_almost_equal ( r[1:], 0)137 assert_almost_equal ( r[1:], 0)
138 138
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
139if __name__ == '__main__':155if __name__ == '__main__':
140 from unittest import main156 from unittest import main
141 main()157 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