summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-21 10:53:35 +0200
committerMichael Adam <obnox@samba.org>2010-05-21 11:24:15 +0200
commit67439d4297781261ac469d7c9252677f36d8c54a (patch)
tree5a03c37da5022f7c9a9d022efd6bd2a119b37883
parentcba7f8b8273e661d3c43652900d93e5a8eab4e5f (diff)
downloadsamba-67439d4297781261ac469d7c9252677f36d8c54a.tar.gz
samba-67439d4297781261ac469d7c9252677f36d8c54a.tar.bz2
samba-67439d4297781261ac469d7c9252677f36d8c54a.zip
s4:torture:winreg: improve error messages in test_QueryValue_full
So that one has a chance to tell what part of the test failed. And why.
-rw-r--r--source4/torture/rpc/winreg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index ac9100cb1d..79ec9e525c 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -1677,9 +1677,11 @@ static bool test_QueryValue_full(struct dcerpc_binding_handle *b,
uint32_t data_length = 0;
uint8_t *data = NULL;
WERROR expected_error = WERR_BADFILE;
+ const char *errmsg_nonexisting = "expected WERR_BADFILE for nonexisting value";
if (valuename == NULL) {
expected_error = WERR_INVALID_PARAM;
+ errmsg_nonexisting = "expected WERR_INVALID_PARAM for NULL valuename";
}
ZERO_STRUCT(r);
@@ -1701,21 +1703,21 @@ static bool test_QueryValue_full(struct dcerpc_binding_handle *b,
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_QueryValue_r(b, tctx, &r),
"QueryValue failed");
torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM,
- "QueryValue failed");
+ "expected WERR_INVALID_PARAM for missing type length and size");
r.in.type = &type;
r.out.type = &type;
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_QueryValue_r(b, tctx, &r),
"QueryValue failed");
torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM,
- "QueryValue failed");
+ "expected WERR_INVALID_PARAM for missing length and size");
r.in.data_length = &data_length;
r.out.data_length = &data_length;
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_QueryValue_r(b, tctx, &r),
"QueryValue failed");
torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM,
- "QueryValue failed");
+ "expected WERR_INVALID_PARAM for missing size");
r.in.data_size = &data_size;
r.out.data_size = &data_size;
@@ -1726,7 +1728,7 @@ static bool test_QueryValue_full(struct dcerpc_binding_handle *b,
"QueryValue failed");
} else {
torture_assert_werr_equal(tctx, r.out.result, expected_error,
- "QueryValue failed");
+ errmsg_nonexisting);
}
real_data_size = *r.out.data_size;
@@ -1740,10 +1742,10 @@ static bool test_QueryValue_full(struct dcerpc_binding_handle *b,
"QueryValue failed");
if (existing_value) {
torture_assert_werr_equal(tctx, r.out.result, WERR_MORE_DATA,
- "QueryValue failed");
+ "expected WERR_MORE_DATA for query with too small buffer");
} else {
torture_assert_werr_equal(tctx, r.out.result, expected_error,
- "QueryValue failed");
+ errmsg_nonexisting);
}
data = talloc_zero_array(tctx, uint8_t, real_data_size);
@@ -1758,7 +1760,7 @@ static bool test_QueryValue_full(struct dcerpc_binding_handle *b,
"QueryValue failed");
} else {
torture_assert_werr_equal(tctx, r.out.result, expected_error,
- "QueryValue failed");
+ errmsg_nonexisting);
}
return true;