diff options
author | Günther Deschner <gd@samba.org> | 2010-03-16 16:05:07 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-16 16:08:49 +0100 |
commit | c323629a1a3c3baf4ce799d2a9efe446822f6ec0 (patch) | |
tree | 634d2ad74908c59356eb6e7f47fdd05adc5f9899 /source4 | |
parent | cb5805d789d276f4bf13db75491099c9dde0f660 (diff) | |
download | samba-c323629a1a3c3baf4ce799d2a9efe446822f6ec0.tar.gz samba-c323629a1a3c3baf4ce799d2a9efe446822f6ec0.tar.bz2 samba-c323629a1a3c3baf4ce799d2a9efe446822f6ec0.zip |
s4-smbtorture: use random buffer for extended SetValue test in RPC-WINREG.
Guenther
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/winreg.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index ca4434bc98..a5a3812b48 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -2073,11 +2073,16 @@ static bool test_SetValue_extended(struct dcerpc_binding_handle *b, uint32_t w_size, w_length; uint8_t *w_data; - const char *string = generate_random_str(tctx, l); - DATA_BLOB blob = data_blob_string_const(string); + uint32_t size; + uint8_t *data; + + size = l; + data = talloc_array(tctx, uint8_t, size); + + generate_random_buffer(data, size); torture_assert(tctx, - test_SetValue(b, tctx, handle, value_name, types[t], blob.data, blob.length), + test_SetValue(b, tctx, handle, value_name, types[t], data, size), "test_SetValue failed"); torture_assert(tctx, @@ -2089,9 +2094,9 @@ static bool test_SetValue_extended(struct dcerpc_binding_handle *b, "test_DeleteValue failed"); torture_assert_int_equal(tctx, w_type, types[t], "winreg type mismatch"); - torture_assert_int_equal(tctx, w_size, blob.length, "winreg size mismatch"); - torture_assert_int_equal(tctx, w_length, blob.length, "winreg length mismatch"); - torture_assert_mem_equal(tctx, w_data, blob.data, blob.length, "winreg buffer mismatch"); + torture_assert_int_equal(tctx, w_size, size, "winreg size mismatch"); + torture_assert_int_equal(tctx, w_length, size, "winreg length mismatch"); + torture_assert_mem_equal(tctx, w_data, data, size, "winreg buffer mismatch"); } } |