1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

Use torture_assert_mem_equal() in a couple more places.

This commit is contained in:
Jelmer Vernooij 2008-04-13 22:00:36 +02:00
parent b6319b64d7
commit e2c3fab9d1
6 changed files with 13 additions and 13 deletions

View File

@ -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");

View File

@ -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;
}

View File

@ -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;

View File

@ -69,7 +69,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
torture_assert_int_equal(tctx, sig.length, expected_sig.length, "Wrong sig length");
torture_assert(tctx, 0 == memcmp(sig.data, expected_sig.data, sig.length),
torture_assert_mem_equal(tctx, sig.data, expected_sig.data, sig.length,
"data mismatch");
torture_assert_ntstatus_equal(tctx,
@ -123,7 +123,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
torture_assert_int_equal(tctx, sig.length, expected_sig.length, "Wrong sig length");
torture_assert(tctx, 0 == memcmp(sig.data+8, expected_sig.data+8, sig.length-8),
torture_assert_mem_equal(tctx, sig.data+8, expected_sig.data+8, sig.length-8,
"data mismatch");
torture_assert_ntstatus_equal(tctx,

View File

@ -590,7 +590,7 @@ static bool rw_torture2(struct torture_context *tctx,
break;
}
torture_assert(tctx, memcmp(buf_rd, buf, buf_size) == 0,
torture_assert_mem_equal(tctx, buf_rd, buf, buf_size,
"read/write compare failed\n");
}

View File

@ -46,7 +46,7 @@ static bool netrserverauthenticate3_in_check(struct torture_context *tctx,
torture_assert_int_equal(tctx, r->in.secure_channel_type, 2, "secure channel type");
torture_assert_str_equal(tctx, r->in.computer_name, "NATIVE-2K", "computer name");
torture_assert_int_equal(tctx, *r->in.negotiate_flags, 0x6007ffff, "negotiate flags");
torture_assert(tctx, memcmp(cred_expected, r->in.credentials->data, 8) == 0, "credentials");
torture_assert_mem_equal(tctx, cred_expected, r->in.credentials->data, 8, "credentials");
return true;
}
@ -59,7 +59,7 @@ static bool netrserverauthenticate3_out_check(struct torture_context *tctx,
struct netr_ServerAuthenticate3 *r)
{
uint8_t cred_expected[8] = { 0x22, 0x0c, 0x86, 0x8a, 0xe9, 0x92, 0x93, 0xc9 };
torture_assert(tctx, memcmp(cred_expected, r->out.credentials->data, 8) == 0, "credentials");
torture_assert_mem_equal(tctx, cred_expected, r->out.credentials->data, 8, "credentials");
torture_assert_int_equal(tctx, *r->out.negotiate_flags, 0x6007ffff, "negotiate flags");
torture_assert_int_equal(tctx, *r->out.rid, 0x454, "rid");
torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
@ -85,7 +85,7 @@ static bool netrserverreqchallenge_in_check(struct torture_context *tctx,
uint8_t cred_expected[8] = { 0xa3, 0x2c, 0xa2, 0x95, 0x40, 0xcc, 0xb7, 0xbb };
torture_assert_str_equal(tctx, r->in.server_name, "\\\\NATIVE-DC.NATIVE.BASE", "server name");
torture_assert_str_equal(tctx, r->in.computer_name, "NATIVE-2K", "account name");
torture_assert(tctx, memcmp(cred_expected, r->in.credentials->data, 8) == 0, "credentials");
torture_assert_mem_equal(tctx, cred_expected, r->in.credentials->data, 8, "credentials");
return true;
}
@ -98,7 +98,7 @@ static bool netrserverreqchallenge_out_check(struct torture_context *tctx,
struct netr_ServerReqChallenge *r)
{
uint8_t cred_expected[8] = { 0x22, 0xfc, 0xc1, 0x17, 0xc0, 0xae, 0x27, 0x8e };
torture_assert(tctx, memcmp(cred_expected, r->out.credentials->data, 8) == 0, "credentials");
torture_assert_mem_equal(tctx, cred_expected, r->out.credentials->data, 8, "credentials");
torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
return true;