s4-torture: add some tests for pre-allocated buffers in enumprinterdrivers call.
authorGünther Deschner <gd@samba.org>
Thu, 20 Mar 2014 14:57:10 +0000 (15:57 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 20 Mar 2014 15:28:26 +0000 (16:28 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/rpc/spoolss.c

index 44405aa3252890821c476b7f169f5e6af793688e..ccc842aadf7bc7683fc1f06da00b3fe7636f9643 100644 (file)
@@ -662,6 +662,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
        struct dcerpc_pipe *p = ctx->spoolss_pipe;
        struct dcerpc_binding_handle *b = p->binding_handle;
        uint16_t levels[] = { 1, 2, 3, 4, 5, 6, 8 };
+       uint16_t buffer_sizes[] = { 0, 1024, 6040, 0xffff };
        int i, j, a;
 
        /* FIXME: gd, come back and fix "" as server, and handle
@@ -675,6 +676,15 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
 
        for (a=0;a<ARRAY_SIZE(environments);a++) {
 
+       for (i=0;i<ARRAY_SIZE(buffer_sizes);i++) {
+               torture_assert(tctx,
+                       test_EnumPrinterDrivers_buffers(tctx, b, server_name,
+                                                       environments[a], 3,
+                                                       buffer_sizes[i],
+                                                       NULL, NULL),
+                       "failed to enumerate drivers");
+       }
+
        for (i=0;i<ARRAY_SIZE(levels);i++) {
                int level = levels[i];
                uint32_t count;