Changeset a334368


Ignore:
Timestamp:
Nov 29, 2018, 12:41:45 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

Revert "[tests] fix unmatched parenthesis on windows"

This reverts commit bab46116728862e3c4b8d5480c39b75647abb73c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/utils_tests.h

    rbab4611 ra334368  
    2020#define PATH_MAX 1024
    2121#endif
    22 
    23 #define DEFAULT_TEST_FILE "python/tests/sounds/44100Hz_44100f_sine441.wav"
    2422
    2523#ifdef HAVE_C99_VARARGS_MACROS
     
    6866  int seed = tm_struct->tm_sec + (size_t)tm_address;
    6967  //PRINT_WRN("current seed: %d\n", seed);
    70   srandom ((unsigned int)seed);
     68  srandom (seed);
    7169}
    7270
     
    8785}
    8886
    89 #elif defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__)
     87#elif (defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__))
    9088// windows workaround, where mkstemp does not exist...
    9189int create_temp_sink(char *templ)
     
    115113#endif
    116114
    117 // pass progname / default
    118 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 build
    124   argv[1] = "../../" DEFAULT_TEST_FILE;
    125   // when running from source root directory
    126   if ( access(argv[1], R_OK) )
    127       argv[1] = DEFAULT_TEST_FILE;
    128   // no file found
    129   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 build
    140   argv[1] = "../../" DEFAULT_TEST_FILE;
    141   // when running from source root directory
    142   if ( access(argv[1], R_OK) )
    143       argv[1] = DEFAULT_TEST_FILE;
    144   // no file found
    145   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 }
    156115
    157116int run_on_default_sink( int main(int, char**) )
Note: See TracChangeset for help on using the changeset viewer.