diff options
author | Günther Deschner <gd@samba.org> | 2010-05-20 20:49:44 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-20 22:49:50 +0200 |
commit | 7370d036278d2cd0cb14267b5c2b0baa6e1788eb (patch) | |
tree | 0cbe2587829f7bf959bc8e7fe582fb34729d3004 | |
parent | 29f549e3fb62b8b431aea5f9e53fc916ff121111 (diff) | |
download | samba-7370d036278d2cd0cb14267b5c2b0baa6e1788eb.tar.gz samba-7370d036278d2cd0cb14267b5c2b0baa6e1788eb.tar.xz samba-7370d036278d2cd0cb14267b5c2b0baa6e1788eb.zip |
s4-smbtorture: use push_reg_sz()/push_reg_multi_sz() in RPC-WINREG.
Guenther
-rw-r--r-- | source4/torture/rpc/winreg.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 216a30c7a8..0fb0c08e9e 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -4,7 +4,7 @@ Copyright (C) Tim Potter 2003 Copyright (C) Jelmer Vernooij 2004-2007 - Copyright (C) Günther Deschner 2007 + Copyright (C) Günther Deschner 2007,2010 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1919,6 +1919,7 @@ static bool test_SetValue_simple(struct dcerpc_binding_handle *b, uint32_t value = 0x12345678; uint64_t value2 = 0x12345678; const char *string = "torture"; + const char *array[2]; DATA_BLOB blob; enum winreg_Type types[] = { REG_DWORD, @@ -1930,6 +1931,9 @@ static bool test_SetValue_simple(struct dcerpc_binding_handle *b, }; int t; + array[0] = "array0"; + array[1] = NULL; + torture_comment(tctx, "Testing SetValue (standard formats)\n"); for (t=0; t < ARRAY_SIZE(types); t++) { @@ -1952,26 +1956,10 @@ static bool test_SetValue_simple(struct dcerpc_binding_handle *b, blob = data_blob_string_const("binary_blob"); break; case REG_SZ: - torture_assert(tctx, - convert_string_talloc_convenience(tctx, lp_iconv_convenience(tctx->lp_ctx), - CH_UNIX, CH_UTF16, - string, - strlen(string)+1, - (void **)&blob.data, - &blob.length, - false), ""); + torture_assert(tctx, push_reg_sz(tctx, &blob, string), "failed to push REG_SZ"); break; case REG_MULTI_SZ: - torture_assert(tctx, - convert_string_talloc_convenience(tctx, lp_iconv_convenience(tctx->lp_ctx), - CH_UNIX, CH_UTF16, - string, - strlen(string)+1, - (void **)&blob.data, - &blob.length, - false), ""); - torture_assert(tctx, data_blob_realloc(tctx, &blob, blob.length + 2), ""); - memset(&blob.data[blob.length - 2], '\0', 2); + torture_assert(tctx, push_reg_multi_sz(tctx, &blob, array), "failed to push REG_MULTI_SZ"); break; default: break; |