Blame src/common/test.h

Szabolcs Nagy cfa23c
#include <stdint.h>
Szabolcs Nagy cfa23c
#include <unistd.h>
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
/* TODO: not thread-safe nor fork-safe */
Szabolcs Nagy 814c6f
extern volatile int t_status;
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
#define T_LOC2(l) __FILE__ ":" #l
Szabolcs Nagy cfa23c
#define T_LOC1(l) T_LOC2(l)
Szabolcs Nagy 814c6f
#define t_error(...) t_printf(T_LOC1(__LINE__) ": " __VA_ARGS__)
Szabolcs Nagy 814c6f
Szabolcs Nagy 814c6f
int t_printf(const char *s, ...);
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
int t_vmfill(void **, size_t *, int);
Szabolcs Nagy a7679d
int t_memfill(void);
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
void t_fdfill(void);
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
void t_randseed(uint64_t s);
Szabolcs Nagy cfa23c
uint64_t t_randn(uint64_t n);
Szabolcs Nagy cfa23c
uint64_t t_randint(uint64_t a, uint64_t b);
Szabolcs Nagy cfa23c
void t_shuffle(uint64_t *p, size_t n);
Szabolcs Nagy cfa23c
void t_randrange(uint64_t *p, size_t n);
Szabolcs Nagy cfa23c
int t_choose(uint64_t n, size_t k, uint64_t *p);
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
char *t_pathrel(char *buf, size_t n, char *argv0, char *p);
Szabolcs Nagy cfa23c
Szabolcs Nagy 814c6f
int t_setrlim(int r, long lim);
Szabolcs Nagy 814c6f