mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-22 05:19:55 +00:00
[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:
parent
a4e8ef72ab
commit
23f17f7972
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user