mirror of https://github.com/yandex/odyssey.git
27 lines
466 B
C
27 lines
466 B
C
![]() |
#ifndef MACHINARIUM_TEST_H
|
||
|
#define MACHINARIUM_TEST_H
|
||
|
|
||
|
/*
|
||
|
* machinarium.
|
||
|
*
|
||
|
* cooperative multitasking engine.
|
||
|
*/
|
||
|
|
||
|
#define machinarium_test(FUNCTION) \
|
||
|
do { \
|
||
|
(FUNCTION)(); \
|
||
|
fprintf(stdout, "%s: ok\n", #FUNCTION); \
|
||
|
} while (0);
|
||
|
|
||
|
#define test(expression) \
|
||
|
do { \
|
||
|
if (! (expression)) { \
|
||
|
fprintf(stdout, "%s: fail (%s:%d) %s\n", \
|
||
|
__func__, __FILE__, __LINE__, #expression); \
|
||
|
fflush(stdout); \
|
||
|
abort(); \
|
||
|
} \
|
||
|
} while (0);
|
||
|
|
||
|
#endif
|