From f2ecec3dcdafd63cd72d13019a998bf99539a9ba Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 19 Feb 2010 14:25:19 +0100 Subject: s4-smbtorture: add --option=torture:spoolss_check_size=yes. This disables the size calculation comparison by default. Guenther --- source4/torture/rpc/spoolss.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 6cc67277f0..e22032d8bc 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -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, -- cgit