changeset 1126:785c8eaa48b4

various test case fixes
author thomask
date Wed, 06 Sep 2006 21:12:08 +0000
parents a929acac9127
children 08057f3259c9
files run/f/float_27_B.d run/f/float_27_C.d run/f/float_27_D.d run/t/typeid_86_A.d run/t/typeid_86_B.d run/t/typeid_86_C.d run/t/typeid_86_D.d run/t/typeid_86_E.d run/t/typeid_87.d run/t/typeid_88_A.d run/t/typeid_88_B.d run/t/typeid_88_C.d run/t/typeid_88_D.d run/t/typeid_88_E.d run/t/typeid_88_F.d run/t/typeid_89.d run/t/typeof_08_C.d run/t/typeof_08_D.d run/version_02.d run/version_04.d
diffstat 20 files changed, 134 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/f/float_27_B.d	Wed Sep 06 21:12:08 2006 +0000
@@ -0,0 +1,20 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Lionello Lunesu <lio@lunesu.com>
+// @date@	2006-08-18
+// @uri@	news:bug-291-3@http.d.puremagic.com/issues/
+// @desc@	[Issue 291] assertion
+
+module dstress.run.f.float_27_B;
+
+int main(){
+	float r;
+
+	if(r == 0.0){
+		assert(0);
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/f/float_27_C.d	Wed Sep 06 21:12:08 2006 +0000
@@ -0,0 +1,20 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Lionello Lunesu <lio@lunesu.com>
+// @date@	2006-08-18
+// @uri@	news:bug-291-3@http.d.puremagic.com/issues/
+// @desc@	[Issue 291] assertion
+
+module dstress.run.f.float_27_C;
+
+int main(){
+	const float r;
+
+	static if(r == 0.0){
+		assert(0);
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/f/float_27_D.d	Wed Sep 06 21:12:08 2006 +0000
@@ -0,0 +1,20 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Lionello Lunesu <lio@lunesu.com>
+// @date@	2006-08-18
+// @uri@	news:bug-291-3@http.d.puremagic.com/issues/
+// @desc@	[Issue 291] assertion
+
+module dstress.run.f.float_27_D;
+
+int main(){
+	const float r = real.nan;
+
+	static if(r == 0.0){
+		assert(0);
+	}
+
+	return 0;
+}
--- a/run/t/typeid_86_A.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_86_A.d	Wed Sep 06 21:12:08 2006 +0000
@@ -15,7 +15,8 @@
 	struct B{
 	}
 
-	assert(typeid(A) != typeid(B));
-
-	return 0;
+	if(typeid(A) != typeid(B)){
+		return 0;
+	}
+	assert(0);
 }
--- a/run/t/typeid_86_B.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_86_B.d	Wed Sep 06 21:12:08 2006 +0000
@@ -15,7 +15,8 @@
 	class B{
 	}
 
-	assert(typeid(A) != typeid(B));
-
-	return 0;
+	if(typeid(A) != typeid(B)){
+		return 0;
+	}
+	assert(0);
 }
--- a/run/t/typeid_86_C.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_86_C.d	Wed Sep 06 21:12:08 2006 +0000
@@ -15,7 +15,8 @@
 	union B{
 	}
 
-	assert(typeid(A) != typeid(B));
-
-	return 0;
+	if(typeid(A) != typeid(B)){
+		return 0;
+	}
+	assert(0);
 }
--- a/run/t/typeid_86_D.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_86_D.d	Wed Sep 06 21:12:08 2006 +0000
@@ -9,11 +9,21 @@
 module dstress.run.t.typeid_86_D;
 
 int main(){
-	assert(typeid(int function(float)) != typeid(int function(char)));
-	assert(typeid(int function(float)) != typeid(byte function(float)));
-	assert(typeid(byte function(byte)) != typeid(byte function(int)));
-	assert(typeid(void function(int)) != typeid(int function(int)));
-	assert(typeid(int function()) != typeid(int function(int)));
+	if(typeid(int function(float)) == typeid(int function(char))){
+		assert(0);
+	}
+	if(typeid(int function(float)) == typeid(byte function(float))){
+		assert(0);
+	}
+	if(typeid(byte function(byte)) == typeid(byte function(int))){
+		assert(0);
+	}
+	if(typeid(void function(int)) == typeid(int function(int))){
+		assert(0);
+	}
+	if(typeid(int function()) == typeid(int function(int))){
+		assert(0);
+	}
 
 	return 0;
 }
--- a/run/t/typeid_86_E.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_86_E.d	Wed Sep 06 21:12:08 2006 +0000
@@ -9,11 +9,21 @@
 module dstress.run.t.typeid_86_E;
 
 int main(){
-	assert(typeid(int delegate(float)) != typeid(int delegate(char)));
-	assert(typeid(int delegate(float)) != typeid(byte delegate(float)));
-	assert(typeid(byte delegate(byte)) != typeid(byte delegate(int)));
-	assert(typeid(void delegate(int)) != typeid(int delegate(int)));
-	assert(typeid(int delegate()) != typeid(int delegate(int)));
+	if(typeid(int delegate(float)) == typeid(int delegate(char))){
+		assert(0);
+	}
+	if(typeid(int delegate(float)) == typeid(byte delegate(float))){
+		assert(0);
+	}
+	if(typeid(byte delegate(byte)) == typeid(byte delegate(int))){
+		assert(0);
+	}
+	if(typeid(void delegate(int)) == typeid(int delegate(int))){
+		assert(0);
+	}
+	if(typeid(int delegate()) == typeid(int delegate(int))){
+		assert(0);
+	}
 
 	return 0;
 }
--- a/run/t/typeid_87.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_87.d	Wed Sep 06 21:12:08 2006 +0000
@@ -9,9 +9,18 @@
 
 int main(){
 	TypeInfo ti = typeid(MyClass);
-	assert(!(ti is null));
+	if(ti is null){
+		assert(0);
+	}
 	assert(ti);
-	assert(ti.tsize==(MyClass).sizeof);
-	assert(ti.toString()=="dstress.run.t.typeid_87.MyClass");
+	if(ti.tsize != (MyClass).sizeof){
+		assert(0);
+	}
+	if(MyClass.mangleof != "C7dstress3run1t9typeid_877MyClass"){
+		assert(0);
+	}
+	if(ti.toString() != "dstress.run.t.typeid_87.MyClass"){
+		assert(0);
+	}
 	return 0;
 }
--- a/run/t/typeid_88_A.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_88_A.d	Wed Sep 06 21:12:08 2006 +0000
@@ -12,4 +12,5 @@
 	if(typeid(int) != typeid(short)){
 		return 0;
 	}
+	assert(0);
 }
--- a/run/t/typeid_88_B.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_88_B.d	Wed Sep 06 21:12:08 2006 +0000
@@ -12,4 +12,5 @@
 	if(typeid(int[]) != typeid(short[])){
 		return 0;
 	}
+	assert(0);
 }
--- a/run/t/typeid_88_C.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_88_C.d	Wed Sep 06 21:12:08 2006 +0000
@@ -12,4 +12,5 @@
 	if(typeid(int*) != typeid(short*)){
 		return 0;
 	}
+	assert(0);
 }
--- a/run/t/typeid_88_D.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_88_D.d	Wed Sep 06 21:12:08 2006 +0000
@@ -12,4 +12,5 @@
 	if(typeid(int*[]) != typeid(short*[])){
 		return 0;
 	}
+	assert(0);
 }
--- a/run/t/typeid_88_E.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_88_E.d	Wed Sep 06 21:12:08 2006 +0000
@@ -12,4 +12,5 @@
 	if(typeid(int[]*) != typeid(short[]*)){
 		return 0;
 	}
+	assert(0);
 }
--- a/run/t/typeid_88_F.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_88_F.d	Wed Sep 06 21:12:08 2006 +0000
@@ -12,4 +12,5 @@
 	if(typeid(int**) != typeid(short**)){
 		return 0;
 	}
+	assert(0);
 }
--- a/run/t/typeid_89.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeid_89.d	Wed Sep 06 21:12:08 2006 +0000
@@ -9,7 +9,7 @@
 module dstress.run.t.typeid_89;
 
 int main(){
-	Typeid t = typeid(bit);
+	TypeInfo t = typeid(bit);
 
 	if(!t){
 		assert(0);
--- a/run/t/typeof_08_C.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeof_08_C.d	Wed Sep 06 21:12:08 2006 +0000
@@ -11,11 +11,11 @@
 typeof("abc"w) y;
 
 int main(){
-	static if(!is(typeof(y) == wchar[])){
+	static if(!is(typeof(y) == wchar[3])){
 		static assert(0);
 	}
 
-	if(y.length != 0){
+	if(y.length != 3){
 		assert(0);
 	}
 
--- a/run/t/typeof_08_D.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/t/typeof_08_D.d	Wed Sep 06 21:12:08 2006 +0000
@@ -8,10 +8,10 @@
 
 module dstress.run.t.typeof_08_D;
 
-typeof("") y;
+typeof(""w) y;
 
 int main(){
-	static if(!is(typeof(y) == wchar[])){
+	static if(!is(typeof(y) == wchar[0])){
 		static assert(0);
 	}
 
--- a/run/version_02.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/version_02.d	Wed Sep 06 21:12:08 2006 +0000
@@ -24,18 +24,20 @@
 	}
 
 	version(darwin){
-		assert(0); // this isn't yet part of the standard (v0.124)
+		static assert(0); // this isn't yet part of the standard (v 0.166)
 	}
 
 	version(Unix){
-		assert(0); // this isn't yet part of the standard (v0.124)
+		static assert(0); // this isn't yet part of the standard (v 0.166)
 	}
 
 	version(solaris){
-		assert(0); // this isn't yet part of the standard (v0.124)
+		static assert(0); // this isn't yet part of the standard (v 0.166)
 	}
 	
-	assert(os == 1);
+	if(os != 1){
+		assert(0);
+	}
 	
 	return 0;
 }
--- a/run/version_04.d	Wed Sep 06 05:07:33 2006 +0000
+++ b/run/version_04.d	Wed Sep 06 21:12:08 2006 +0000
@@ -27,7 +27,9 @@
 		static assert(0); // this isn't yet part of the standard (v0.124)
 	}
 
-	assert(cpu==1);
+	if(cpu != 1){
+		assert(0);
+	}
 
 	return 0;
 }