Changeset a334368
- Timestamp:
- Nov 29, 2018, 12:41:45 AM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- 6a91a9d
- Parents:
- bab4611
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/utils_tests.h
rbab4611 ra334368 20 20 #define PATH_MAX 1024 21 21 #endif 22 23 #define DEFAULT_TEST_FILE "python/tests/sounds/44100Hz_44100f_sine441.wav"24 22 25 23 #ifdef HAVE_C99_VARARGS_MACROS … … 68 66 int seed = tm_struct->tm_sec + (size_t)tm_address; 69 67 //PRINT_WRN("current seed: %d\n", seed); 70 srandom ( (unsigned int)seed);68 srandom (seed); 71 69 } 72 70 … … 87 85 } 88 86 89 #elif defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__)87 #elif (defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__)) 90 88 // windows workaround, where mkstemp does not exist... 91 89 int create_temp_sink(char *templ) … … 115 113 #endif 116 114 117 // pass progname / default118 int run_on_default_source( int main(int, char**) )119 {120 int argc = 2;121 char* argv[argc];122 argv[0] = __FILE__;123 // when running from waf build124 argv[1] = "../../" DEFAULT_TEST_FILE;125 // when running from source root directory126 if ( access(argv[1], R_OK) )127 argv[1] = DEFAULT_TEST_FILE;128 // no file found129 if ( access(argv[1], R_OK) != 0 )130 return 1;131 return main(argc, argv);132 }133 134 int run_on_default_source_and_sink( int main(int, char**) )135 {136 int argc = 3, err;137 char* argv[argc];138 argv[0] = __FILE__;139 // when running from waf build140 argv[1] = "../../" DEFAULT_TEST_FILE;141 // when running from source root directory142 if ( access(argv[1], R_OK) )143 argv[1] = DEFAULT_TEST_FILE;144 // no file found145 if ( access(argv[1], R_OK) != 0 )146 return 1;147 char sink_path[PATH_MAX] = "tmp_aubio_XXXXXX";148 int fd = mkstemp(sink_path);149 if (!fd) return 1;150 argv[2] = sink_path;151 err = main(argc, argv);152 unlink(sink_path);153 close(fd);154 return err;155 }156 115 157 116 int run_on_default_sink( int main(int, char**) )
Note: See TracChangeset
for help on using the changeset viewer.