mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s4-smbtorture: add torture_assert_strn_equal macro.
Guenther
This commit is contained in:
parent
f08fdfae27
commit
28d618ddf0
@ -311,6 +311,16 @@ void torture_result(struct torture_context *test,
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define torture_assert_strn_equal(torture_ctx,got,expected,len,cmt)\
|
||||
do { const char *__got = (got), *__expected = (expected); \
|
||||
if (strncmp(__got, __expected, len) != 0) { \
|
||||
torture_result(torture_ctx, TORTURE_FAIL, \
|
||||
__location__": "#got" %s of len %d did not match "#expected" %s: %s", \
|
||||
__got, (int)len, __expected, cmt); \
|
||||
return false; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#define torture_assert_str_equal_goto(torture_ctx,got,expected,ret,label,cmt)\
|
||||
do { const char *__got = (got), *__expected = (expected); \
|
||||
if (strcmp_safe(__got, __expected) != 0) { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user