1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00
openbsd-src/regress/lib/libradius/incs.h
yasuoka f4d7e9fdc5 Fix a compiler warning. Also use srandom_deterministic(3) since using
random(3) intentionally is to repeat the test failure if it happens.
2019-03-29 03:04:19 +00:00

30 lines
612 B
C

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <radius.h>
typedef void (*testfunc)(void);
void check_failed(const char *expr, const char *file, int line);
void add_test(testfunc fn, const char *name);
#define CHECK(x) \
do { if (!(x)) check_failed(#x, __FILE__, __LINE__); } while(0)
#define ADD_TEST(fn) \
extern void fn(void); \
__attribute__((__constructor__)) \
void fn ## _add(void) \
{ \
add_test(fn, #fn); \
}