Changeset 474a573 for tests


Ignore:
Timestamp:
Mar 3, 2013, 8:10:45 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
56a7580
Parents:
7e35b37
Message:

tests/utils_tests.h: add utils_init_random

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/utils_tests.h

    r7e35b37 r474a573  
     1#include <time.h>
    12#include <stdlib.h>
    23#include <stdio.h>
     4#include <math.h>
     5#include <assert.h>
    36
    4 #define PRINT_ERR(format, args...)   fprintf(stderr, "AUBIO ERROR: " format , ##args)
     7#define PRINT_ERR(format, args...)   fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args)
    58#define PRINT_MSG(format, args...)   fprintf(stdout, format , ##args)
    69#define PRINT_DBG(format, args...)   fprintf(stderr, format , ##args)
    7 #define PRINT_WRN(...)               fprintf(stderr, "AUBIO WARNING: " format, ##args)
     10#define PRINT_WRN(format, args...)   fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args)
     11
     12void 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}
Note: See TracChangeset for help on using the changeset viewer.