diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/tests/hive.c | 2 | ||||
-rw-r--r-- | source4/lib/registry/tests/registry.c | 4 | ||||
-rw-r--r-- | source4/lib/socket/testsuite.c | 6 | ||||
-rw-r--r-- | source4/lib/util/tests/file.c | 4 |
4 files changed, 8 insertions, 8 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/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c index e5e34c11e0..b19a6abffb 100644 --- a/source4/lib/registry/tests/registry.c +++ b/source4/lib/registry/tests/registry.c @@ -428,7 +428,7 @@ static bool test_get_value(struct torture_context *tctx, void *_data) torture_assert_werr_ok(tctx, error, "getting value"); torture_assert_int_equal(tctx, 4, data.length, "value length ok"); - torture_assert(tctx, memcmp(data.data, &value, 4) == 0, + torture_assert_mem_equal(tctx, data.data, &value, 4, "value content ok"); torture_assert_int_equal(tctx, REG_DWORD, type, "value type"); @@ -496,7 +496,7 @@ static bool test_list_values(struct torture_context *tctx, void *_data) torture_assert_str_equal(tctx, name, "bar", "value name"); torture_assert_int_equal(tctx, 4, data.length, "value length"); - torture_assert(tctx, memcmp(data.data, &value, 4) == 0, + torture_assert_mem_equal(tctx, data.data, &value, 4, "value content"); torture_assert_int_equal(tctx, REG_DWORD, type, "value type"); diff --git a/source4/lib/socket/testsuite.c b/source4/lib/socket/testsuite.c index 6d4d81a884..813412c7bc 100644 --- a/source4/lib/socket/testsuite.c +++ b/source4/lib/socket/testsuite.c @@ -86,7 +86,7 @@ static bool test_udp(struct torture_context *tctx) torture_assert_int_equal(tctx, nread, size, "Unexpected recvfrom size"); - torture_assert(tctx, memcmp(blob2.data, blob.data, size) == 0, + torture_assert_mem_equal(tctx, blob2.data, blob.data, size, "Bad data in recvfrom"); generate_random_buffer(blob.data, blob.length); @@ -104,7 +104,7 @@ static bool test_udp(struct torture_context *tctx) torture_assert_int_equal(tctx, from_addr->port, srv_addr->port, "Unexpected recvfrom port"); - torture_assert(tctx, memcmp(blob2.data, blob.data, size) == 0, + torture_assert_mem_equal(tctx, blob2.data, blob.data, size, "Bad data in recvfrom"); talloc_free(sock1); @@ -181,7 +181,7 @@ static bool test_tcp(struct torture_context *tctx) torture_assert_int_equal(tctx, nread, size, "Unexpected recvfrom size"); - torture_assert(tctx, memcmp(blob2.data, blob.data, size) == 0, + torture_assert_mem_equal(tctx, blob2.data, blob.data, size, "Bad data in recv"); return true; } diff --git a/source4/lib/util/tests/file.c b/source4/lib/util/tests/file.c index fe87293671..3377e833dc 100644 --- a/source4/lib/util/tests/file.c +++ b/source4/lib/util/tests/file.c @@ -45,9 +45,9 @@ static bool test_file_load_save(struct torture_context *tctx) data = file_load(TEST_FILENAME, &len, mem_ctx); torture_assert(tctx, data, "loading file"); - torture_assert(tctx, len == strlen(TEST_DATA), "Length"); + torture_assert_int_equal(tctx, len, strlen(TEST_DATA), "Length"); - torture_assert(tctx, memcmp(data, TEST_DATA, len) == 0, "Contents"); + torture_assert_mem_equal(tctx, data, TEST_DATA, len, "Contents"); unlink(TEST_FILENAME); return true; |