summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/tests/hive.c2
-rw-r--r--source4/torture/ui.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c
index 70b0241b04..a16736c761 100644
--- a/source4/lib/registry/tests/hive.c
+++ b/source4/lib/registry/tests/hive.c
@@ -220,7 +220,7 @@ static bool test_get_value(struct torture_context *tctx, const void *test_data)
torture_assert_int_equal(tctx, value.length, 4, "value length");
torture_assert_int_equal(tctx, type, REG_DWORD, "value type");
- torture_assert_int_equal(tctx, data, IVAL(value.data, 0),
+ torture_assert_mem_equal(tctx, &data, value.data, sizeof(uint32_t),
"value data");
return true;
diff --git a/source4/torture/ui.h b/source4/torture/ui.h
index 6645d9b012..ec4a658d74 100644
--- a/source4/torture/ui.h
+++ b/source4/torture/ui.h
@@ -253,6 +253,15 @@ void torture_result(struct torture_context *test,
} \
} while(0)
+#define torture_assert_mem_equal(torture_ctx,got,expected,len,cmt)\
+ do { const void *__got = (got), *__expected = (expected); \
+ if (memcmp(__got, __expected, len) != 0) { \
+ torture_result(torture_ctx, TORTURE_FAIL, \
+ __location__": "#got" of len %d did not match"#expected": %s", len, cmt); \
+ return false; \
+ } \
+ } while(0)
+
#define torture_assert_file_contains_text(torture_ctx,filename,expected,cmt)\
do { \
char *__got; \