diff options
author | Günther Deschner <gd@samba.org> | 2009-11-02 19:59:47 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-11-26 11:40:07 +0100 |
commit | a77a18a8f3927f2aa2941af8d9e7585d44241306 (patch) | |
tree | ea3392d44b34ff0e902170ade2899b6b64218ccf /source4 | |
parent | c37f6fab6c9ef3c55fdbd97a974c582c60c92cb8 (diff) | |
download | samba-a77a18a8f3927f2aa2941af8d9e7585d44241306.tar.gz samba-a77a18a8f3927f2aa2941af8d9e7585d44241306.tar.xz samba-a77a18a8f3927f2aa2941af8d9e7585d44241306.zip |
s4-smbtorture: simplify some torture_comments in RPC-LSA.
Guenther
(cherry picked from commit 074ad24653e85c60b9af863ac526832229754a96)
(cherry picked from commit 18a00b7c0c0fa6d3e2d8bcba2d3f0969697781f3)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/lsa.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 710f4c53d2f..35a3b0a16b0 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -2498,21 +2498,16 @@ static bool test_QueryInfoPolicyCalls( bool version2, NTSTATUS status; int i; bool ret = true; + const char *call = talloc_asprintf(tctx, "QueryInfoPolicy%s", version2 ? "2":""); - if (version2) - torture_comment(tctx, "\nTesting QueryInfoPolicy2\n"); - else - torture_comment(tctx, "\nTesting QueryInfoPolicy\n"); + torture_comment(tctx, "\nTesting %s\n", call); for (i=1;i<=14;i++) { r.in.handle = handle; r.in.level = i; r.out.info = &info; - if (version2) - torture_comment(tctx, "\nTrying QueryInfoPolicy2 level %d\n", i); - else - torture_comment(tctx, "\nTrying QueryInfoPolicy level %d\n", i); + torture_comment(tctx, "\nTrying %s level %d\n", call, i); if (version2) /* We can perform the cast, because both types are @@ -2543,10 +2538,7 @@ static bool test_QueryInfoPolicyCalls( bool version2, case LSA_POLICY_INFO_AUDIT_EVENTS: case LSA_POLICY_INFO_PD: if (!NT_STATUS_IS_OK(status)) { - if (version2) - torture_comment(tctx, "QueryInfoPolicy2 failed - %s\n", nt_errstr(status)); - else - torture_comment(tctx, "QueryInfoPolicy failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "%s failed - %s\n", call, nt_errstr(status)); ret = false; } break; @@ -2554,17 +2546,11 @@ static bool test_QueryInfoPolicyCalls( bool version2, if (torture_setting_bool(tctx, "samba4", false)) { /* Other levels not implemented yet */ if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_INFO_CLASS)) { - if (version2) - torture_comment(tctx, "QueryInfoPolicy2 failed - %s\n", nt_errstr(status)); - else - torture_comment(tctx, "QueryInfoPolicy failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "%s failed - %s\n", call, nt_errstr(status)); ret = false; } } else if (!NT_STATUS_IS_OK(status)) { - if (version2) - torture_comment(tctx, "QueryInfoPolicy2 failed - %s\n", nt_errstr(status)); - else - torture_comment(tctx, "QueryInfoPolicy failed - %s\n", nt_errstr(status)); + torture_comment(tctx, "%s failed - %s\n", call, nt_errstr(status)); ret = false; } break; |