libbrandt/test.h

13 lines
296 B
C
Raw Normal View History

2016-06-12 20:52:22 +02:00
#ifndef _BRANDT_TEST_H
#define _BRANDT_TEST_H
#include <stdio.h>
int tests_run = 0;
int ret = 0;
2016-06-13 21:01:14 +02:00
#define check(cond, message) do { if (!(cond)) { fputs(message, stderr); fputc('\n', stderr); return 0; } } while (0)
2016-06-12 20:52:22 +02:00
#define run(test) do { tests_run++; if (!test()) ret = 1; } while (0)
#endif