s4-smbtorture: add --option=torture:spoolss_check_size=yes.
authorGünther Deschner <gd@samba.org>
Fri, 19 Feb 2010 13:25:19 +0000 (14:25 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 19 Feb 2010 13:25:19 +0000 (14:25 +0100)
This disables the size calculation comparison by default.

Guenther

source4/torture/rpc/spoolss.c

index 6cc67277f0816d79453a4ead94567d50a925e249..e22032d8bc618ae6f911fe359694527c2a9693ed 100644 (file)
@@ -120,30 +120,36 @@ struct test_spoolss_context {
 #define DO_ROUND(size, n) (((size)+((n)-1)) & ~((n)-1))
 
 #define CHECK_NEEDED_SIZE_ENUM_LEVEL(fn, info, level, count, ic, needed, align) do { \
+       if (torture_setting_bool(tctx, "spoolss_check_size", false)) {\
        uint32_t size = ndr_size_##fn##_info(tctx, ic, level, count, info);\
        uint32_t round_size = DO_ROUND(size, align);\
        if (round_size != needed) {\
                torture_warning(tctx, __location__": "#fn" level %d (count: %d) got unexpected needed size: %d, we calculated: %d", level, count, needed, round_size);\
                CHECK_ALIGN(size, align);\
        }\
+       }\
 } while(0)
 
 #define CHECK_NEEDED_SIZE_ENUM(fn, info, count, ic, needed, align) do { \
+       if (torture_setting_bool(tctx, "spoolss_check_size", false)) {\
        uint32_t size = ndr_size_##fn##_info(tctx, ic, count, info);\
        uint32_t round_size = DO_ROUND(size, align);\
        if (round_size != needed) {\
                torture_warning(tctx, __location__": "#fn" (count: %d) got unexpected needed size: %d, we calculated: %d", count, needed, round_size);\
                CHECK_ALIGN(size, align);\
        }\
+       }\
 } while(0)
 
 #define CHECK_NEEDED_SIZE_LEVEL(fn, info, level, ic, needed, align) do { \
+       if (torture_setting_bool(tctx, "spoolss_check_size", false)) {\
        uint32_t size = ndr_size_##fn(info, level, ic, 0);\
        uint32_t round_size = DO_ROUND(size, align);\
        if (round_size != needed) {\
                torture_warning(tctx, __location__": "#fn" level %d got unexpected needed size: %d, we calculated: %d", level, needed, round_size);\
                CHECK_ALIGN(size, align);\
        }\
+       }\
 } while(0)
 
 static bool test_OpenPrinter_server(struct torture_context *tctx,