mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 068c973dbe
)
This commit is contained in:
commit
7361899e80
@ -220,6 +220,10 @@ sub SharedLibrary($$)
|
||||
{
|
||||
my ($self,$ctx) = @_;
|
||||
|
||||
if (!defined($ctx->{LIBRARY_SONAME})) {
|
||||
$ctx->{LIBRARY_SONAME} = "";
|
||||
}
|
||||
|
||||
$self->output("SHARED_LIBS += $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n") if (defined($ctx->{SO_VERSION}));
|
||||
|
||||
$self->_prepare_list($ctx, "DEPEND_LIST");
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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; \
|
||||
|
Loading…
Reference in New Issue
Block a user