diff options
author | Günther Deschner <gd@samba.org> | 2010-03-15 14:11:44 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-15 14:16:03 +0100 |
commit | 06cbf05e8b964d353d0ca505ade7b018f93c8465 (patch) | |
tree | e8e2de2f4e559fcfaa6bc009aeec1cad5aa26dc3 | |
parent | 6bfde084e65718cfdf81696120f64f17e832b313 (diff) | |
download | samba-06cbf05e8b964d353d0ca505ade7b018f93c8465.tar.gz samba-06cbf05e8b964d353d0ca505ade7b018f93c8465.tar.bz2 samba-06cbf05e8b964d353d0ca505ade7b018f93c8465.zip |
s4-smbtorture: when cross checking enumdata{ex} make sure to have at least one entry.
Guenther
-rw-r--r-- | source4/torture/rpc/spoolss.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index b12e42e71d..3f675a8826 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -3149,6 +3149,14 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx, return true; } +static bool test_SetPrinterData(struct torture_context *tctx, + struct dcerpc_pipe *p, + struct policy_handle *handle, + const char *value_name, + enum winreg_Type type, + uint8_t *data, + uint32_t offered); + static bool test_EnumPrinterData_consistency(struct torture_context *tctx, struct dcerpc_pipe *p, struct policy_handle *handle) @@ -3160,9 +3168,20 @@ static bool test_EnumPrinterData_consistency(struct torture_context *tctx, uint32_t value_offered, data_offered; WERROR result; + enum winreg_Type type; + DATA_BLOB blob; + torture_comment(tctx, "Testing EnumPrinterData vs EnumPrinterDataEx consistency\n"); torture_assert(tctx, + reg_string_to_val(tctx, lp_iconv_convenience(tctx->lp_ctx), + "REG_SZ", "torture_data", &type, &blob), ""); + + torture_assert(tctx, + test_SetPrinterData(tctx, p, handle, "torture_value", type, blob.data, blob.length), + "SetPrinterData failed"); + + torture_assert(tctx, test_EnumPrinterDataEx(tctx, p, handle, "PrinterDriverData", &count, &info), "failed to call EnumPrinterDataEx"); @@ -3226,6 +3245,8 @@ static bool test_EnumPrinterData_consistency(struct torture_context *tctx, torture_assert_mem_equal(tctx, data, info[i].data->data, info[i].data_length, "data mismatch"); } + torture_comment(tctx, "EnumPrinterData vs EnumPrinterDataEx consistency test succeeded\n\n"); + return true; } |