libbrandt/test.h
2016-06-12 20:52:22 +02:00

13 lines
275 B
C

#ifndef _BRANDT_TEST_H
#define _BRANDT_TEST_H
#include <stdio.h>
int tests_run = 0;
int ret = 0;
#define check(cond, message) do { if (!(cond)) { fputs(message, stderr); return 0; } } while (0)
#define run(test) do { tests_run++; if (!test()) ret = 1; } while (0)
#endif