Files
mckernel/test/issues/1470/include/okng.h
Masamichi Takagi 33dd2e60b1 mcexec: memory policy control by environmental variable
Refs: #1470
Change-Id: I3d556cae90d31d81572b1c4e5c680e826577d428
2020-12-24 11:18:01 +09:00

34 lines
882 B
C

#ifndef __OKNG_H_INCLUDED__
#define __OKNG_H_INCLUDED__
#include <stdio.h>
#define _OKNG(verb, jump, cond, fmt, args...) do { \
if (cond) { \
if (verb) \
printf("[ OK ] " fmt, ##args); \
} else { \
printf("[ NG ] " fmt, ##args); \
if (jump) { \
ret = 1; \
goto out; \
} \
} \
} while (0)
#define OKNG(args...) _OKNG(1, 1, ##args)
#define INFO(fmt, args...) printf("[ INFO ] " fmt, ##args)
#define START(fmt, args...) printf("[ START] " fmt, ##args)
#define INTERR(cond, fmt, args...) do { \
if (cond) { \
char msg[4096]; \
sprintf(msg, fmt, ##args); \
printf("[INTERR] %s:%d %s", __FILE__, __LINE__, msg); \
ret = 1; \
goto out; \
} \
} while (0)
#define ARRAY_SIZE_CHECK(array, size) INTERR(sizeof(array)/sizeof(array[0]) != size, "size of array \"%s\" isn't %d\n", #array, size)
#endif