svn commit: samba r21211 - in branches/SAMBA_4_0/source/torture/local: .

tridge at samba.org tridge at samba.org
Wed Feb 7 02:57:45 GMT 2007


Author: tridge
Date: 2007-02-07 02:57:44 +0000 (Wed, 07 Feb 2007)
New Revision: 21211

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

Log:

fixed 3 places that assumed that torture_fail() didn't call
return. Having a lowercase macro that returns from a function is
probably a bad idea - it looks too much like a C function but doesn't
behave like one.

Modified:
   branches/SAMBA_4_0/source/torture/local/dbspeed.c
   branches/SAMBA_4_0/source/torture/local/event.c
   branches/SAMBA_4_0/source/torture/local/iconv.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/local/dbspeed.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/dbspeed.c	2007-02-07 02:39:43 UTC (rev 21210)
+++ branches/SAMBA_4_0/source/torture/local/dbspeed.c	2007-02-07 02:57:44 UTC (rev 21211)
@@ -63,8 +63,9 @@
 	tdbw = tdb_wrap_open(tmp_ctx, "test.tdb", 
 			     10000, 0, O_RDWR|O_CREAT|O_TRUNC, 0600);
 	if (!tdbw) {
+		unlink("test.tdb");
+		talloc_free(tmp_ctx);
 		torture_fail(torture, "Failed to open test.tdb");
-		goto failed;
 	}
 
 	torture_comment(torture, "Adding %d SID records\n", torture_entries);
@@ -171,8 +172,9 @@
 	ldb = ldb_wrap_connect(tmp_ctx, "tdb://test.ldb", 
 				NULL, NULL, LDB_FLG_NOSYNC, NULL);
 	if (!ldb) {
+		unlink("./test.ldb");
+		talloc_free(tmp_ctx);
 		torture_fail(torture, "Failed to open test.ldb");
-		goto failed;
 	}
 
 	/* add an index */
@@ -220,8 +222,9 @@
 	}
 
 	if (talloc_total_blocks(torture) > 100) {
+		unlink("./test.ldb");
+		talloc_free(tmp_ctx);
 		torture_fail(torture, "memory leak in ldb search");
-		goto failed;
 	}
 
 	torture_comment(torture, "ldb speed %.2f ops/sec\n", count/timeval_elapsed(&tv));

Modified: branches/SAMBA_4_0/source/torture/local/event.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/event.c	2007-02-07 02:39:43 UTC (rev 21210)
+++ branches/SAMBA_4_0/source/torture/local/event.c	2007-02-07 02:57:44 UTC (rev 21211)
@@ -99,9 +99,8 @@
 	t = timeval_current();
 	while (!finished) {
 		if (event_loop_once(ev_ctx) == -1) {
-			torture_fail(test, "Failed event loop\n");
 			talloc_free(ev_ctx);
-			return False;
+			torture_fail(test, "Failed event loop\n");
 		}
 	}
 

Modified: branches/SAMBA_4_0/source/torture/local/iconv.c
===================================================================
--- branches/SAMBA_4_0/source/torture/local/iconv.c	2007-02-07 02:39:43 UTC (rev 21210)
+++ branches/SAMBA_4_0/source/torture/local/iconv.c	2007-02-07 02:57:44 UTC (rev 21211)
@@ -135,8 +135,6 @@
 				     talloc_asprintf(test, 
 						     "failed to open %s to UTF-16LE",
 						     charset));
-			cd = NULL;
-			return false;
 		}
 		cd2 = smb_iconv_open(charset, "UTF-16LE");
 		cd3 = smb_iconv_open("UTF-16LE", charset);
@@ -246,11 +244,11 @@
 		torture_comment(test, "pull bytes mismatch:");
 		show_buf("inbuf", inbuf, size);
 		show_buf(" buf3", buf3, sizeof(buf3) - outsize3);
-		torture_fail(test, "");
 		torture_comment(test, "next codepoint is %u\n", 
 		       get_codepoint((char *)(inbuf+sizeof(buf3) - outsize3), 
 				     size - (sizeof(buf3) - outsize3),
 				     "UTF-16LE"));
+		torture_fail(test, "");
 	}
 
 	return true;



More information about the samba-cvs mailing list