Changeset 868c6b8 for tests/src/onset/test-onset.c
- Timestamp:
- Dec 19, 2018, 6:16:29 PM (5 years ago)
- Branches:
- feature/constantq
- Children:
- dfe6ab6
- Parents:
- f87e191 (diff), fda3394 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/onset/test-onset.c
rf87e191 r868c6b8 10 10 err = 2; 11 11 PRINT_WRN("no arguments, running tests\n"); 12 if (test_wrong_params() != 0) { 13 PRINT_ERR("tests failed!\n"); 14 err = 1; 15 } else { 16 err = 0; 17 } 12 err = test_wrong_params(); 18 13 PRINT_MSG("usage: %s <source_path> [samplerate] [hop_size]\n", argv[0]); 19 14 return err; … … 23 18 uint_t hop_size = win_s / 4; 24 19 uint_t n_frames = 0, read = 0; 25 if ( argc == 3 ) samplerate = atoi(argv[2]);26 if ( argc == 4 ) hop_size = atoi(argv[3]);20 if ( argc >= 3 ) samplerate = atoi(argv[2]); 21 if ( argc >= 4 ) hop_size = atoi(argv[3]); 27 22 28 23 char_t *source_path = argv[1]; … … 75 70 uint_t samplerate = 44100; 76 71 // hop_size < 1 77 if (new_aubio_onset("default", 5, 0, samplerate)) 78 return 1; 72 if (new_aubio_onset("default", 5, 0, samplerate)) return 1; 73 79 74 // buf_size < 2 80 if (new_aubio_onset("default", 1, 1, samplerate)) 81 return 1; 75 if (new_aubio_onset("default", 1, 1, samplerate)) return 1; 76 82 77 // buf_size < hop_size 83 if (new_aubio_onset("default", hop_size, win_size, samplerate)) 84 return 1; 78 if (new_aubio_onset("default", hop_size, win_size, samplerate)) return 1; 79 85 80 // samplerate < 1 86 if (new_aubio_onset("default", 1024, 512, 0)) 87 return 1; 81 if (new_aubio_onset("default", 1024, 512, 0)) return 1; 88 82 89 83 // specdesc creation failed 90 if (new_aubio_onset("abcd", win_size, win_size/2, samplerate)) 91 return 1; 92 // pv creation failed 93 if (new_aubio_onset("default", 5, 2, samplerate)) 94 return 1; 84 if (new_aubio_onset("abcd", win_size, win_size/2, samplerate)) return 1; 95 85 96 86 aubio_onset_t *o; 87 88 // pv creation might fail 89 o = new_aubio_onset("default", 5, 2, samplerate); 90 if (o) del_aubio_onset(o); 91 97 92 o = new_aubio_onset("default", win_size, hop_size, samplerate); 98 if (!aubio_onset_set_default_parameters(o, "wrong_type")) 99 return 1; 93 if (!aubio_onset_set_default_parameters(o, "wrong_type")) return 1; 100 94 del_aubio_onset(o); 101 95 102 return 0;96 return run_on_default_source(main); 103 97 }
Note: See TracChangeset
for help on using the changeset viewer.