odyssey/tests/machinarium_test.h

29 lines
497 B
C

#ifndef MACHINARIUM_TEST_H
#define MACHINARIUM_TEST_H
/*
* machinarium.
*
* cooperative multitasking engine.
*/
#define machinarium_test(function) \
do { \
fprintf(stdout, "%s: ", #function); \
fflush(stdout); \
(function)(); \
fprintf(stdout, "ok\n"); \
} while (0);
#define test(expression) \
do { \
if (! (expression)) { \
fprintf(stdout, "fail (%s:%d) %s\n", \
__FILE__, __LINE__, #expression); \
fflush(stdout); \
abort(); \
} \
} while (0);
#endif