History

python/tests/test_fft.py: skip test fft(zeros).phas == 0 if needed, expected powerpc

Paul Brossier committed 9 years ago

Commit d98f3c01 parent 4093c0c2 files · +16 −2Browse files

Showing the changes to python (2 of 2 files). Show all

Unified · Split

2 files
  1. python/tests/test_fft.py +8 −1
  2. python/tests/test_phasevoc.py +8 −1
python/tests/test_fft.py+8−1
@@ -33,7 +33,14 @@ class aubio_fft_test_case(TestCase): · 32 unmodified lines
3333 f = fft (win_s)
3434 fftgrain = f (timegrain)
3535 assert_equal ( fftgrain.norm, 0 )
36− assert_equal ( fftgrain.phas, 0 )
36+ try:
37+ assert_equal ( fftgrain.phas, 0 )
38+ except AssertionError:
39+ assert_equal (fftgrain.phas[fftgrain.phas > 0], +pi)
40+ assert_equal (fftgrain.phas[fftgrain.phas < 0], -pi)
41+ assert_equal (np.abs(fftgrain.phas[np.abs(fftgrain.phas) != pi]), 0)
42+ self.skipTest('fft(fvec(%d)).phas != +0, ' % win_s \
43+ + 'This is expected when using fftw3 on powerpc.')
3744
3845 def test_impulse(self):
3946 """ check the transform of one impulse at a random place """
python/tests/test_phasevoc.py+8−1
@@ -46,7 +46,14 @@ class aubio_pvoc_test_case(TestCase): · 45 unmodified lines
4646 r = f.rdo(s)
4747 assert_equal ( t, 0.)
4848 assert_equal ( s.norm, 0.)
49− assert_equal ( s.phas, 0.)
49+ try:
50+ assert_equal ( s.phas, 0 )
51+ except AssertionError:
52+ assert_equal (s.phas[s.phas > 0], +np.pi)
53+ assert_equal (s.phas[s.phas < 0], -np.pi)
54+ assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0)
55+ self.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
56+ + 'This is expected when using fftw3 on powerpc.')
5057 assert_equal ( r, 0.)
5158
5259 @params(

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