changeset 799:c67acdbaf88e

Sean Kelly <sean@f4.ca> 2006-01-24 news:dr5uqg$2hn7$1@digitaldaemon.com
author thomask
date Wed, 25 Jan 2006 08:03:40 +0000
parents b483c271ce80
children 6662d67963c0
files run/a/auto_14_A.d run/a/auto_14_B.d run/auto_02.d run/auto_03.d run/auto_04.d run/auto_06.d run/auto_07.d run/auto_08.d
diffstat 8 files changed, 121 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/a/auto_14_A.d	Wed Jan 25 08:03:40 2006 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Sean Kelly <sean@f4.ca>
+// @date@	2006-01-24
+// @uri@	news:dr5uqg$2hn7$1@digitaldaemon.com
+
+module dstress.run.a.auto_14_A;
+
+bool hadDtor = false;
+
+auto class MyClass{
+	this(){
+		throw new Exception("dummy");
+	}
+
+	~this(){
+		hadDtor = true;
+		throw new Exception("should never throw");
+		
+	}
+}
+
+int main(){
+	try{
+		auto MyClass c;
+		c = new MyClass();
+	}catch{
+		if(!hadDtor){
+			return 0;
+		}else{
+			assert(0);
+		}
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/a/auto_14_B.d	Wed Jan 25 08:03:40 2006 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Sean Kelly <sean@f4.ca>
+// @date@	2006-01-24
+// @uri@	news:dr5uqg$2hn7$1@digitaldaemon.com
+
+module dstress.run.a.auto_14_B;
+
+bool hadDtor = false;
+
+class MyClass{
+	this(){
+		throw new Exception("dummy");
+	}
+
+	~this(){
+		hadDtor = true;
+		throw new Exception("should never throw");
+		
+	}
+}
+
+int main(){
+
+	try{
+		auto MyClass c;
+		c = new MyClass();
+	}catch{
+		if(!hadDtor){
+			return 0;
+		}else{
+			assert(0);
+		}
+	}
+
+	assert(0);
+}
--- a/run/auto_02.d	Wed Jan 25 08:02:59 2006 +0000
+++ b/run/auto_02.d	Wed Jan 25 08:03:40 2006 +0000
@@ -14,8 +14,12 @@
 		throw new Exception("error msg");
 	}
 	~this(){
-		assert(status==0);
-		status--;
+		
+		if(status == 0){
+			status--;
+		}else{
+			status = -100;
+		}
 	}
 }
 
@@ -24,12 +28,22 @@
 		auto AutoClass ac = new AutoClass();
 		ac.bad();
 	}catch{
+		if(status == -1){
+			status = 20;
+		}
+	}
+
+	if(status != 20){
+		throw new Exception("dtor not called");
 	}
 }
 
 int main(){
-	assert(status==0);
+	assert(status == 0);
+
 	test();
-	assert(status==-1);
-	return 0;
+	
+	if(status == 20){
+		return 0;
+	}
 }
--- a/run/auto_03.d	Wed Jan 25 08:02:59 2006 +0000
+++ b/run/auto_03.d	Wed Jan 25 08:03:40 2006 +0000
@@ -29,6 +29,9 @@
 		test();
 	}catch{
 	}
-	assert(status==-1);
-	return 0;
+	
+	if(status==-1){
+		return 0;
+	}
+	assert(0);
 }
--- a/run/auto_04.d	Wed Jan 25 08:02:59 2006 +0000
+++ b/run/auto_04.d	Wed Jan 25 08:03:40 2006 +0000
@@ -36,6 +36,9 @@
 		assert(status==1);
 		status-=5;
 	}
-	assert(status==-4);
-	return 0;
+	
+	if(status==-4){
+		return 0;
+	}
+	assert(0);
 }
--- a/run/auto_06.d	Wed Jan 25 08:02:59 2006 +0000
+++ b/run/auto_06.d	Wed Jan 25 08:03:40 2006 +0000
@@ -26,6 +26,8 @@
 
 int main(){
 	test();
-	assert(status==-2);
-	return 0;
+	
+	if(status==-2){
+		return 0;
+	}
 }
--- a/run/auto_07.d	Wed Jan 25 08:02:59 2006 +0000
+++ b/run/auto_07.d	Wed Jan 25 08:03:40 2006 +0000
@@ -32,7 +32,11 @@
 
 int main(){
 	test();
-	assert(status==2);
-	return 0;
+	
+	if(status==2){
+		return 0;
+	}
+
+	assert(0);
 }
 
--- a/run/auto_08.d	Wed Jan 25 08:02:59 2006 +0000
+++ b/run/auto_08.d	Wed Jan 25 08:03:40 2006 +0000
@@ -32,7 +32,10 @@
 
 int main(){
 	test();
-	assert(status==2);
-	return 0;
+	
+	if(status==2){
+		return 0;
+	}
+	assert(0);
 }