[LTP] [PATCH v3 1/2] lib: TST_EXP_FAIL_PTR
Cyril Hrubis
chrubis@suse.cz
Tue Jan 23 11:41:28 CET 2024
Hi!
> +#define TST_EXP_FAIL_SILENT_PTR_(SCALL, SSCALL, ERRNOS, ERRNOS_CNT, ...) \
> + do { \
> + TESTPTR(SCALL); \
> + \
> + TST_PASS = 0; \
> + \
> + if (TST_RET_PTR) { \
Unfortunatelly there are two types of calls, one returns NULL on a
failure and the second returns (void *)-1, from the top of my head these
are mmap(), shmat() and possibly other memory related syscalls.
So I suppose that this macro needs another parameter for the actual
value that is returned on a failure:
#define TST_EXP_FAIL_SILENT_PTR_(SCALL, SSCALL, FAIL_PTR_VAL, ERRNOS, ...)
do {
TESTPTR(SCALL);
...
if (TST_RET_PTR == FAILPTR_VAL) {
...
The hard question is if we want to pass this parameter explicitly from the
macros used by the tests, i.e. if each test would need to specify a
FAIL_PTR_VAL or if we want to pass it in the macros, but that would mean
that the number of macros will explode again and we would have to figure
out a good names. So maybe it would be easier to pass them from each
test.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list