From: Michael Brown Date: Fri, 3 Jan 2014 23:35:45 +0000 (+0100) Subject: [test] Add okx() macro taking an explicit file name and line number X-Git-Tag: v1.20.1~1304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23f17f7972c34fc96249ffd2d58004ab048dcba0;p=thirdparty%2Fipxe.git [test] Add okx() macro taking an explicit file name and line number Allow test reports to specify an explicit file name and line number using the extended okx() macro. This allows large blocks of test report code such as tcpip_random_ok() to be implemented as functions rather than macros. Signed-off-by: Michael Brown --- diff --git a/src/include/ipxe/test.h b/src/include/ipxe/test.h index 6b74ff007..028ee29fb 100644 --- a/src/include/ipxe/test.h +++ b/src/include/ipxe/test.h @@ -38,9 +38,12 @@ extern void test_ok ( int success, const char *file, unsigned int line, * Report test result * * @v success Test succeeded + * @v file File name + * @v line Line number */ -#define ok( success ) do { \ - test_ok ( (success), __FILE__, __LINE__, #success ); \ - } while ( 0 ) +#define okx( success, file, line ) \ + test_ok ( success, file, line, #success ) +#define ok( success ) \ + okx ( success, __FILE__, __LINE__ ) #endif /* _IPXE_TEST_H */