feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 4ce62cd was
f1dca0e,
checked in by Paul Brossier <piem@piem.org>, 17 years ago
|
fvec test: change order in assertEqual
|
-
Property mode set to
100644
|
File size:
962 bytes
|
Rev | Line | |
---|
[203c551] | 1 | import unittest |
---|
| 2 | |
---|
| 3 | from aubio.aubiowrapper import * |
---|
| 4 | |
---|
| 5 | buf_size = 2048 |
---|
| 6 | channels = 3 |
---|
| 7 | |
---|
| 8 | class fvec_test_case(unittest.TestCase): |
---|
| 9 | |
---|
| 10 | def setUp(self): |
---|
| 11 | self.vector = new_fvec(buf_size, channels) |
---|
| 12 | |
---|
| 13 | def tearDown(self): |
---|
| 14 | del_fvec(self.vector) |
---|
| 15 | |
---|
| 16 | def test_fvec(self): |
---|
| 17 | """ create and delete fvec """ |
---|
| 18 | pass |
---|
| 19 | |
---|
| 20 | def test_fvec_read_sample(self): |
---|
| 21 | """ check new fvec elements are set to 0. """ |
---|
| 22 | for index in range(buf_size): |
---|
| 23 | for channel in range(channels): |
---|
[f1dca0e] | 24 | self.assertEqual(0., fvec_read_sample(self.vector,channel,index)) |
---|
[203c551] | 25 | |
---|
| 26 | def test_fvec_write_sample(self): |
---|
| 27 | """ check new fvec elements are set with fvec_write_sample """ |
---|
| 28 | for index in range(buf_size): |
---|
| 29 | for channel in range(channels): |
---|
| 30 | fvec_write_sample(self.vector,1.,channel,index) |
---|
| 31 | for index in range(buf_size): |
---|
| 32 | for channel in range(channels): |
---|
[f1dca0e] | 33 | self.assertEqual(1., fvec_read_sample(self.vector,channel,index)) |
---|
[203c551] | 34 | |
---|
| 35 | if __name__ == '__main__': |
---|
| 36 | unittest.main() |
---|
Note: See
TracBrowser
for help on using the repository browser.