test: Add testcase for #1031
Refs: #1031 Change-Id: I6a51596b84a97329ba7d5b765c8471246dcf85df
This commit is contained in:
committed by
Masamichi Takagi
parent
992705d465
commit
04e54ead5d
23
test/issues/1031/test_chk.h
Normal file
23
test/issues/1031/test_chk.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef HEADER_TEST_CHK_H
|
||||
#define HEADER_TEST_CHK_H
|
||||
|
||||
#define CHKANDJUMP(cond, ...) do {\
|
||||
if (cond) {\
|
||||
fprintf(stderr, " [NG] ");\
|
||||
fprintf(stderr, __VA_ARGS__);\
|
||||
fprintf(stderr, " failed\n");\
|
||||
goto fn_fail;\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define OKNG(cond, ...) do {\
|
||||
if (cond) {\
|
||||
CHKANDJUMP(cond, __VA_ARGS__);\
|
||||
} else {\
|
||||
fprintf(stdout, " [OK] ");\
|
||||
fprintf(stdout, __VA_ARGS__);\
|
||||
fprintf(stdout, "\n");\
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user