tests/utils_tests.h: add utils_init_random
[aubio.git] / tests / utils_tests.h
1 #include <time.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <math.h>
5 #include <assert.h>
6
7 #define PRINT_ERR(format, args...)   fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args)
8 #define PRINT_MSG(format, args...)   fprintf(stdout, format , ##args)
9 #define PRINT_DBG(format, args...)   fprintf(stderr, format , ##args)
10 #define PRINT_WRN(format, args...)   fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args)
11
12 void utils_init_random () {
13   time_t now = time(0);
14   struct tm *tm_struct = localtime(&now);
15   int seed = tm_struct->tm_sec;
16   //PRINT_WRN("current seed: %d\n", seed);
17   srandom (seed);
18 }