svn commit: samba r17958 - in branches/SAMBA_4_0/source: lib/talloc torture

metze at samba.org metze at samba.org
Thu Aug 31 09:26:43 GMT 2006


Author: metze
Date: 2006-08-31 09:26:43 +0000 (Thu, 31 Aug 2006)
New Revision: 17958

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17958

Log:
as talloc_init() enabled null tracking, we should avoid to use it
in smbtorture, and in the LOCAL-TALLOC we should reset the null tracking

also make bin/smbtorture //url/foo LOCAL-TALLOC LOCAL-TALLOC possible

metze
Modified:
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c
   branches/SAMBA_4_0/source/torture/gentest.c
   branches/SAMBA_4_0/source/torture/misc.c
   branches/SAMBA_4_0/source/torture/smbtorture.c
   branches/SAMBA_4_0/source/torture/util_smb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2006-08-31 09:18:06 UTC (rev 17957)
+++ branches/SAMBA_4_0/source/lib/talloc/testsuite.c	2006-08-31 09:26:43 UTC (rev 17958)
@@ -910,6 +910,7 @@
 		printf("FAILED TO FIRE LOOP DESTRUCTOR\n");
 		return False;
 	}
+	loop_destructor_count = 0;
 
 	return True;
 }
@@ -1021,6 +1022,7 @@
 {
 	BOOL ret = True;
 
+	talloc_disable_null_tracking();
 	talloc_enable_null_tracking();
 
 	ret &= test_ref1();

Modified: branches/SAMBA_4_0/source/torture/gentest.c
===================================================================
--- branches/SAMBA_4_0/source/torture/gentest.c	2006-08-31 09:18:06 UTC (rev 17957)
+++ branches/SAMBA_4_0/source/torture/gentest.c	2006-08-31 09:26:43 UTC (rev 17958)
@@ -1970,7 +1970,7 @@
 		current_op.opnum = op;
 		current_op.name = gen_ops[which_op].name;
 		current_op.status = NT_STATUS_OK;
-		current_op.mem_ctx = talloc_init("%s", current_op.name);
+		current_op.mem_ctx = talloc_named(NULL, 0, "%s", current_op.name);
 
 		ret = gen_ops[which_op].handler(instance);
 

Modified: branches/SAMBA_4_0/source/torture/misc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/misc.c	2006-08-31 09:18:06 UTC (rev 17957)
+++ branches/SAMBA_4_0/source/torture/misc.c	2006-08-31 09:26:43 UTC (rev 17958)
@@ -395,7 +395,7 @@
 		return False;
 	}
 
-	mem_ctx = talloc_init("ioctl_test");
+	mem_ctx = talloc_named_const(torture, 0, "ioctl_test");
 
 	printf("starting ioctl test\n");
 
@@ -786,7 +786,7 @@
 		torture_numops,torture_nprocs);
 
 	/*init talloc context*/
-	mem_ctx = talloc_init("bench-readwrite");
+	mem_ctx = talloc_named_const(torture, 0, "bench-readwrite");
 	ev = event_context_init(mem_ctx);
 	state = talloc_array(mem_ctx, struct benchrw_state *, torture_nprocs);
 

Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smbtorture.c	2006-08-31 09:18:06 UTC (rev 17957)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c	2006-08-31 09:26:43 UTC (rev 17958)
@@ -195,7 +195,7 @@
 
 static BOOL is_binding_string(const char *binding_string)
 {
-	TALLOC_CTX *mem_ctx = talloc_init("is_binding_string");
+	TALLOC_CTX *mem_ctx = talloc_named_const(NULL, 0, "is_binding_string");
 	struct dcerpc_binding *binding_struct;
 	NTSTATUS status;
 	

Modified: branches/SAMBA_4_0/source/torture/util_smb.c
===================================================================
--- branches/SAMBA_4_0/source/torture/util_smb.c	2006-08-31 09:18:06 UTC (rev 17957)
+++ branches/SAMBA_4_0/source/torture/util_smb.c	2006-08-31 09:26:43 UTC (rev 17958)
@@ -53,7 +53,7 @@
 	union smb_open io;
 	TALLOC_CTX *mem_ctx;
 
-	mem_ctx = talloc_init("create_directory_handle");
+	mem_ctx = talloc_named_const(tree, 0, "create_directory_handle");
 
 	io.generic.level = RAW_OPEN_NTCREATEX;
 	io.ntcreatex.in.root_fid = 0;
@@ -329,7 +329,7 @@
 */
 void torture_all_info(struct smbcli_tree *tree, const char *fname)
 {
-	TALLOC_CTX *mem_ctx = talloc_init("%s", fname);
+	TALLOC_CTX *mem_ctx = talloc_named(tree, 0, "%s", fname);
 	union smb_fileinfo finfo;
 	NTSTATUS status;
 
@@ -373,7 +373,7 @@
 	NTSTATUS status;
 	TALLOC_CTX *mem_ctx;
 
-	mem_ctx = talloc_init("torture_set_sparse");
+	mem_ctx = talloc_named_const(tree, 0, "torture_set_sparse");
 	if (!mem_ctx) {
 		return NT_STATUS_NO_MEMORY;
 	}



More information about the samba-cvs mailing list