[LTP] [PATCH 3/8] syscalls/waitpid: implement waitpid_ret_test()

Cyril Hrubis chrubis@suse.cz
Mon Aug 22 19:38:19 CEST 2016


Hi!
> > #define TST_TRACE(expr) \
> > 	({int ret = expr; ret != 0 ? tst_res(TINFO, #expr " failed"), ret : ret;})
> 
> I like this idea with '#expr'.
> 
> Do you want me to put this in tst_test.h, or is it acceptable if I keep
> this in waitpid_common.h? If it's acceptable, I'd rename it to
> WAITPID_TEST and used the 'return' statement"

I guess that this is useful enough to be included in the test library.

I mildy oppose to the return in the macro, since that hides the actuall
code flow. Maybe we can make it clearer by including RET in the macro
name. I couldn't come up with something short and descriptive though,
maybe something as TRACE_RET_ON_FAIL(waitpid_ret_test(...)) or
TRET_ON_FAIL(...).

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list