feature/cnnfeature/crepefeature/pitchshiftfeature/timestretchfix/ffmpeg5
Last change
on this file since 439ba7b was
776d65b,
checked in by Paul Brossier <piem@piem.org>, 6 years ago
|
[tests] test-mathutils-window input validation
|
-
Property mode set to
100644
|
File size:
906 bytes
|
Rev | Line | |
---|
[332487b] | 1 | #include "aubio.h" |
---|
| 2 | #include "utils_tests.h" |
---|
[4e9101e] | 3 | |
---|
[158e031] | 4 | int main (void) |
---|
[4e9101e] | 5 | { |
---|
[7e35b37] | 6 | uint_t length = 0; |
---|
| 7 | uint_t n_length = 4, n_types = 10, i, t; |
---|
| 8 | uint_t lengths[4] = { 8, 10, 15, 16 }; |
---|
| 9 | char *method = "default"; |
---|
[776d65b] | 10 | char *window_types[11] = { "default", |
---|
| 11 | "ones", "rectangle", "hamming", "hanning", "hanningz", |
---|
[7e35b37] | 12 | "blackman", "blackman_harris", "gaussian", "welch", "parzen"}; |
---|
| 13 | |
---|
| 14 | for ( t = 0; t < n_types; t ++ ) { |
---|
| 15 | for ( i = 0; i < n_length; i++) |
---|
| 16 | { |
---|
| 17 | length = lengths[i]; |
---|
| 18 | method = window_types[t]; |
---|
| 19 | |
---|
| 20 | fvec_t * window = new_aubio_window(method, length); |
---|
| 21 | |
---|
| 22 | fvec_set_window(window, method); |
---|
| 23 | fprintf(stdout, "length: %d, method: %s, window:, ", length, method); |
---|
| 24 | fvec_print(window); |
---|
| 25 | |
---|
| 26 | del_fvec(window); |
---|
| 27 | } |
---|
[4e9101e] | 28 | } |
---|
[776d65b] | 29 | |
---|
| 30 | assert (new_aubio_window("parzen", -1) == NULL); |
---|
| 31 | assert (new_aubio_window(NULL, length) == NULL); |
---|
| 32 | assert (new_aubio_window("\0", length) == NULL); |
---|
[4e9101e] | 33 | return 0; |
---|
| 34 | } |
---|
| 35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.