david/ipxe
Archived
1
0

[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 <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-01-04 00:35:45 +01:00
parent a4e8ef72ab
commit 23f17f7972

View File

@ -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 */