shithub: aubio

Download patch

ref: a33436815d2ffe6af940fcf96c1acde0628ac61c
parent: bab46116728862e3c4b8d5480c39b75647abb73c
author: Paul Brossier <piem@piem.org>
date: Wed Nov 28 19:41:45 EST 2018

Revert "[tests] fix unmatched parenthesis on windows"

This reverts commit bab46116728862e3c4b8d5480c39b75647abb73c.

--- a/tests/utils_tests.h
+++ b/tests/utils_tests.h
@@ -20,8 +20,6 @@
 #define PATH_MAX 1024
 #endif
 
-#define DEFAULT_TEST_FILE "python/tests/sounds/44100Hz_44100f_sine441.wav"
-
 #ifdef HAVE_C99_VARARGS_MACROS
 #define PRINT_ERR(...)   fprintf(stderr, "AUBIO-TESTS ERROR: " __VA_ARGS__)
 #define PRINT_MSG(...)   fprintf(stdout, __VA_ARGS__)
@@ -67,7 +65,7 @@
   size_t **tm_address = (void*)&tm_struct;
   int seed = tm_struct->tm_sec + (size_t)tm_address;
   //PRINT_WRN("current seed: %d\n", seed);
-  srandom ((unsigned int)seed);
+  srandom (seed);
 }
 
 // create_temp_sink / close_temp_sink
@@ -86,7 +84,7 @@
   return err;
 }
 
-#elif defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__)
+#elif (defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__))
 // windows workaround, where mkstemp does not exist...
 int create_temp_sink(char *templ)
 {
@@ -114,45 +112,6 @@
 #error "mkstemp undefined, but not on windows. additional workaround required."
 #endif
 
-// pass progname / default
-int run_on_default_source( int main(int, char**) )
-{
-  int argc = 2;
-  char* argv[argc];
-  argv[0] = __FILE__;
-  // when running from waf build
-  argv[1] = "../../" DEFAULT_TEST_FILE;
-  // when running from source root directory
-  if ( access(argv[1], R_OK) )
-      argv[1] = DEFAULT_TEST_FILE;
-  // no file found
-  if ( access(argv[1], R_OK) != 0 )
-      return 1;
-  return main(argc, argv);
-}
-
-int run_on_default_source_and_sink( int main(int, char**) )
-{
-  int argc = 3, err;
-  char* argv[argc];
-  argv[0] = __FILE__;
-  // when running from waf build
-  argv[1] = "../../" DEFAULT_TEST_FILE;
-  // when running from source root directory
-  if ( access(argv[1], R_OK) )
-      argv[1] = DEFAULT_TEST_FILE;
-  // no file found
-  if ( access(argv[1], R_OK) != 0 )
-      return 1;
-  char sink_path[PATH_MAX] = "tmp_aubio_XXXXXX";
-  int fd = mkstemp(sink_path);
-  if (!fd) return 1;
-  argv[2] = sink_path;
-  err = main(argc, argv);
-  unlink(sink_path);
-  close(fd);
-  return err;
-}
 
 int run_on_default_sink( int main(int, char**) )
 {