summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-01-19 14:39:36 +0100
committerGünther Deschner <gd@samba.org>2011-01-21 10:58:20 +0100
commit1f3fb30ed938d1ffdf4fbdcbc8b429becbbdb801 (patch)
treec66b392a8a6120272da3ca0f2a57a8ada6bd1bfc /source4/torture
parent9b1878e538a39b5459a74790b371ef5c098e0642 (diff)
downloadsamba-1f3fb30ed938d1ffdf4fbdcbc8b429becbbdb801.tar.gz
samba-1f3fb30ed938d1ffdf4fbdcbc8b429becbbdb801.tar.bz2
samba-1f3fb30ed938d1ffdf4fbdcbc8b429becbbdb801.zip
s4-smbtorture: make sure there is always driverextra data in spoolss devmode size tests.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/spoolss.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 8f60faba1c..dc9f704a69 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -2186,12 +2186,20 @@ static bool test_devicemode_full(struct torture_context *tctx,
uint16_t __driverextra_length;/* [value(r->driverextra_data.length)] */
uint32_t fields;
#endif
-
TEST_DEVMODE_INT_EXP(8, size, 8, size, __LINE__, WERR_INVALID_PARAM);
TEST_DEVMODE_INT_EXP(8, size, 8, size, 0, WERR_INVALID_PARAM);
TEST_DEVMODE_INT_EXP(8, size, 8, size, 0xffff, WERR_INVALID_PARAM);
- TEST_DEVMODE_INT_EXP(8, size, 8, size, ndr_size_spoolss_DeviceMode(devmode_ctr.devmode, 0), WERR_INVALID_PARAM);
+ TEST_DEVMODE_INT_EXP(8, size, 8, size, ndr_size_spoolss_DeviceMode(devmode_ctr.devmode, 0), (devmode_ctr.devmode->__driverextra_length > 0 ) ? WERR_INVALID_PARAM : WERR_OK);
+ TEST_DEVMODE_INT(8, size, 8, size, ndr_size_spoolss_DeviceMode(devmode_ctr.devmode, 0) - devmode_ctr.devmode->__driverextra_length);
+
+ devmode_ctr.devmode->driverextra_data = data_blob_string_const("foobar");
+ torture_assert(tctx,
+ test_devmode_set_level(tctx, b, handle, 8, devmode_ctr.devmode),
+ "failed to set devmode");
+
+ TEST_DEVMODE_INT_EXP(8, size, 8, size, ndr_size_spoolss_DeviceMode(devmode_ctr.devmode, 0), (devmode_ctr.devmode->__driverextra_length > 0 ) ? WERR_INVALID_PARAM : WERR_OK);
TEST_DEVMODE_INT(8, size, 8, size, ndr_size_spoolss_DeviceMode(devmode_ctr.devmode, 0) - devmode_ctr.devmode->__driverextra_length);
+
TEST_DEVMODE_INT(8, orientation, 8, orientation, __LINE__);
TEST_DEVMODE_INT(8, papersize, 8, papersize, __LINE__);
TEST_DEVMODE_INT(8, paperlength, 8, paperlength, __LINE__);