diff options
author | Günther Deschner <gd@samba.org> | 2011-01-19 13:44:46 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-01-21 10:58:20 +0100 |
commit | 7a7b61ef082070de9407c937a86e299a98a6ef58 (patch) | |
tree | 4d0c8eff9b8407eadbeb6f79a9a460cb1a255604 /source4/torture/rpc | |
parent | bb51c050149c2e2ea5bf81f283da862fc1e840d2 (diff) | |
download | samba-7a7b61ef082070de9407c937a86e299a98a6ef58.tar.gz samba-7a7b61ef082070de9407c937a86e299a98a6ef58.tar.bz2 samba-7a7b61ef082070de9407c937a86e299a98a6ef58.zip |
s4-smbtorture: prepare devicemode test for expected result tests.
Guenther
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r-- | source4/torture/rpc/spoolss.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 3536b82b50..8ab4f801e7 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -5,7 +5,7 @@ Copyright (C) Tim Potter 2003 Copyright (C) Stefan Metzmacher 2005 Copyright (C) Jelmer Vernooij 2007 - Copyright (C) Guenther Deschner 2009-2010 + Copyright (C) Guenther Deschner 2009-2011 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2135,7 +2135,7 @@ static bool test_devicemode_full(struct torture_context *tctx, bool ret = true; NTSTATUS status; -#define TEST_DEVMODE_INT_EXP(lvl1, field1, lvl2, field2, value, exp_value) do { \ +#define TEST_DEVMODE_INT_EXP_RESULT(lvl1, field1, lvl2, field2, value, exp_value, expected_result) do { \ torture_comment(tctx, "field test %d/%s vs %d/%s\n", lvl1, #field1, lvl2, #field2); \ q.in.level = lvl1; \ TESTGETCALL(GetPrinter, q) \ @@ -2147,16 +2147,22 @@ static bool test_devicemode_full(struct torture_context *tctx, }\ devmode_ctr.devmode = q.out.info->info ## lvl1.devmode; \ devmode_ctr.devmode->field1 = value; \ - TESTSETCALL(SetPrinter, s) \ - TESTGETCALL(GetPrinter, q) \ - INT_EQUAL(q.out.info->info ## lvl1.devmode->field1, exp_value, field1); \ - q.in.level = lvl2; \ - TESTGETCALL(GetPrinter, q) \ - INT_EQUAL(q.out.info->info ## lvl2.devmode->field2, exp_value, field1); \ + TESTSETCALL_EXP(SetPrinter, s, expected_result) \ + if (W_ERROR_IS_OK(expected_result)) { \ + TESTGETCALL(GetPrinter, q) \ + INT_EQUAL(q.out.info->info ## lvl1.devmode->field1, exp_value, field1); \ + q.in.level = lvl2; \ + TESTGETCALL(GetPrinter, q) \ + INT_EQUAL(q.out.info->info ## lvl2.devmode->field2, exp_value, field1); \ + }\ } while (0) +#define TEST_DEVMODE_INT_EXP(lvl1, field1, lvl2, field2, value, expected_result) do { \ + TEST_DEVMODE_INT_EXP_RESULT(lvl1, field1, lvl2, field2, value, value, expected_result); \ + } while (0) + #define TEST_DEVMODE_INT(lvl1, field1, lvl2, field2, value) do { \ - TEST_DEVMODE_INT_EXP(lvl1, field1, lvl2, field2, value, value); \ + TEST_DEVMODE_INT_EXP_RESULT(lvl1, field1, lvl2, field2, value, value, WERR_OK); \ } while (0) ZERO_STRUCT(devmode_ctr); |