Changes in tests/src/synth/test-sampler.c [9720945:953cde5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/synth/test-sampler.c
r9720945 r953cde5 1 #include <string.h> // strncpy 2 #include <limits.h> // PATH_MAX 1 3 #include <aubio.h> 2 4 #include "utils_tests.h" … … 6 8 sint_t err = 0; 7 9 8 if (argc < 4) {9 err = 2;10 PRINT_ERR("not enough arguments\n");10 if (argc < 3) { 11 PRINT_ERR("not enough arguments, running tests\n"); 12 err = run_on_default_source_and_sink(main); 11 13 PRINT_MSG("usage: %s <input_path> <output_path> <sample_path> [samplerate]\n", argv[0]); 12 14 return err; … … 19 21 char_t *source_path = argv[1]; 20 22 char_t *sink_path = argv[2]; 21 char_t *sample_path = argv[3]; 22 if ( argc == 5 ) samplerate = atoi(argv[4]); 23 char_t sample_path[PATH_MAX]; 24 if ( argc >= 4 ) { 25 strncpy(sample_path, argv[3], PATH_MAX - 1); 26 } else { 27 // use input_path as sample 28 strncpy(sample_path, source_path, PATH_MAX - 1); 29 } 30 sample_path[PATH_MAX - 1] = '\0'; 31 if ( argc >= 5 ) samplerate = atoi(argv[4]); 23 32 24 33 fvec_t *vec = new_fvec(hop_size);
Note: See TracChangeset
for help on using the changeset viewer.