summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/lsa.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 710f4c53d2..35a3b0a16b 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;