summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-06-20 22:28:43 +1200
committerJeremy Allison <jra@samba.org>2014-06-23 23:30:13 +0200
commit0e003b3cc3bf42db287a54c1ddc339a53b891253 (patch)
treed86a038db2edde1f95aa4e19dd8c1dbf23e9cf25
parent439de096ae0e1c1b8812fa202f5eba7a891d7a0a (diff)
downloadsamba-0e003b3cc3bf42db287a54c1ddc339a53b891253.tar.gz
samba-0e003b3cc3bf42db287a54c1ddc339a53b891253.tar.xz
samba-0e003b3cc3bf42db287a54c1ddc339a53b891253.zip
torture: Use torture_assert() macros in rpc.samr test
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source4/torture/rpc/samr.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 0cdd242b74..7dfd1833d2 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -250,28 +250,13 @@ static bool test_SetUserInfo(struct dcerpc_binding_handle *b, struct torture_con
}
#define STRING_EQUAL(s1, s2, field) \
- if ((s1 && !s2) || (s2 && !s1) || strcmp(s1, s2)) { \
- torture_result(tctx, TORTURE_FAIL, "Failed to set %s to '%s' (%s)\n", \
- #field, s2, __location__); \
- ret = false; \
- break; \
- }
+ torture_assert_str_equal(tctx, s1, s2, "Failed to set " #field)
#define MEM_EQUAL(s1, s2, length, field) \
- if ((s1 && !s2) || (s2 && !s1) || memcmp(s1, s2, length)) { \
- torture_result(tctx, TORTURE_FAIL, "Failed to set %s to '%s' (%s)\n", \
- #field, (const char *)s2, __location__); \
- ret = false; \
- break; \
- }
+ torture_assert_mem_equal(tctx, s1, s2, length, "Failed to set " #field)
#define INT_EQUAL(i1, i2, field) \
- if (i1 != i2) { \
- torture_result(tctx, TORTURE_FAIL, "Failed to set %s to 0x%llx - got 0x%llx (%s)\n", \
- #field, (unsigned long long)i2, (unsigned long long)i1, __location__); \
- ret = false; \
- break; \
- }
+ torture_assert_int_equal(tctx, i1, i2, "Failed to set " #field)
#define TEST_USERINFO_STRING(lvl1, field1, lvl2, field2, value, fpval) do { \
torture_comment(tctx, "field test %d/%s vs %d/%s\n", lvl1, #field1, lvl2, #field2); \