[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Fri May 21 03:55:30 MDT 2010


The branch, master has been updated
       via  1240478... s4:torture:winreg: improve error messages in test_HKLM_wellknown
       via  67439d4... s4:torture:winreg: improve error messages in test_QueryValue_full
      from  cba7f8b... s3:dom_sid Global replace of DOM_SID with struct dom_sid

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 124047877d3287b9cbc145682c5e5ce5606d682b
Author: Michael Adam <obnox at samba.org>
Date:   Fri May 21 10:56:37 2010 +0200

    s4:torture:winreg: improve error messages in test_HKLM_wellknown

commit 67439d4297781261ac469d7c9252677f36d8c54a
Author: Michael Adam <obnox at samba.org>
Date:   Fri May 21 10:53:35 2010 +0200

    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.

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/rpc/winreg.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index ac9100c..370bd67 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;
@@ -2091,11 +2093,11 @@ static bool test_HKLM_wellknown(struct torture_context *tctx,
 	torture_assert(tctx, test_QueryValue_full(b, tctx, &newhandle, VALUE_CURRENT_VERSION, true),
 		"failed to query current version");
 	torture_assert(tctx, test_QueryValue_full(b, tctx, &newhandle, "IDoNotExist", false),
-		"failed to query current version");
+		"succeeded to query nonexistent value");
 	torture_assert(tctx, test_QueryValue_full(b, tctx, &newhandle, NULL, false),
-		"test_QueryValue_full for NULL value failed");
+		"succeeded to query value with NULL name");
 	torture_assert(tctx, test_QueryValue_full(b, tctx, &newhandle, "", false),
-		"test_QueryValue_full for \"\" value failed");
+		"succeeded to query nonexistent default value (\"\")");
 
 	torture_assert(tctx, test_CloseKey(b, tctx, &newhandle),
 		"failed to close current version key");


-- 
Samba Shared Repository


More information about the samba-cvs mailing list