changeset 18:33a25c1e1cfc

various corrections/by-passes of known problems
author thomask
date Fri, 08 Oct 2004 21:12:15 +0000
parents deb014248067
children 127bfbbffe08
files nocompile/align_01.d nocompile/align_02.d nocompile/align_03.d nocompile/align_05.d nocompile/html_defect_01.html run/alias_07.d run/compare_01.d run/compare_02.d run/destructor_03.d run/foreach_13.d run/html_comment_01.html run/html_comment_02.html run/html_comment_03.html run/html_comment_04.html run/html_tag_case_02.html run/odd_bug_02.d run/opCast_01.d run/opCast_02.d run/out_05.d run/overload_06.d run/typeid_01.d run/typeid_02.d
diffstat 22 files changed, 37 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/nocompile/align_01.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/nocompile/align_01.d	Fri Oct 08 21:12:15 2004 +0000
@@ -1,3 +1,4 @@
+// according to the documentation align can only be applied to struct members
 align (1) int check(){
 	return 5;
 }
--- a/nocompile/align_02.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/nocompile/align_02.d	Fri Oct 08 21:12:15 2004 +0000
@@ -1,3 +1,3 @@
-align (-1) int check(){
-	return 5;
+struct MyStruct{
+	align (-1) int check;
 }
--- a/nocompile/align_03.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/nocompile/align_03.d	Fri Oct 08 21:12:15 2004 +0000
@@ -1,3 +1,4 @@
+// according to the documentation align can only be applied to struct members
 align (1) struct MyStruct{
 	int a;
 	byte* b;
--- a/nocompile/align_05.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/nocompile/align_05.d	Fri Oct 08 21:12:15 2004 +0000
@@ -1,3 +1,4 @@
+// according to the documentation align can only be applied to struct members
 align (2) class MyClass{
 	int a;
 	byte* b;
--- a/nocompile/html_defect_01.html	Fri Oct 08 21:11:00 2004 +0000
+++ b/nocompile/html_defect_01.html	Fri Oct 08 21:12:15 2004 +0000
@@ -1,10 +1,10 @@
 <html>
 	<head></head>
 	<body>
-		<pre><code>
+		<pre><CODE>
 int main(){
 	return 0;
 }
-		</code></pre>
+		</CODE></pre>
 	</body>
 </html>
--- a/run/alias_07.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/alias_07.d	Fri Oct 08 21:12:15 2004 +0000
@@ -5,11 +5,7 @@
 alias int MyInt;
 
 int main(){
-	int check(char[]c=""){
-		return 1;
-	}
-	assert(check("ABC")==1);
-	MyInt test(char[]c=""){
+	MyInt test(char[] c=""){
 		return 2;
 	}
 	assert(test("abc")==2);
--- a/run/compare_01.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/compare_01.d	Fri Oct 08 21:12:15 2004 +0000
@@ -8,6 +8,6 @@
 
 int main(){
 	MyClass c = null;
-	assert( c == null);
+	assert( c is null);
 	return 0;
 }
--- a/run/compare_02.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/compare_02.d	Fri Oct 08 21:12:15 2004 +0000
@@ -8,12 +8,7 @@
 
 int main(){
 	MyClass c = new MyClass();
-	assert( c != null);
-
-	c = null;
-	if( c != null){
-		assert(0);
-	}
+	assert( !(c is null));
 
 	return 0;
 }
--- a/run/destructor_03.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/destructor_03.d	Fri Oct 08 21:12:15 2004 +0000
@@ -11,8 +11,7 @@
 	}
 	
 	~this(){
-		status++;
-		status*=3;
+		status--;
 		throw new Exception("E2");
 	}
 }
@@ -23,11 +22,10 @@
 		assert(status == 1);
 		delete m;
 	}catch(Exception e){
-		assert(status == 6);
-		status/=3;
-		status-=2;
+		assert(status == 0);
+		status--;
 	}
 	
-	assert( status == 0 );
+	assert( status == -1 );
 	return 0;
 }
--- a/run/foreach_13.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/foreach_13.d	Fri Oct 08 21:12:15 2004 +0000
@@ -1,7 +1,7 @@
 
 
 int main(){
-	char[] array="abc";
+	char[] array="abc".dup;
 	int count=0;
 	assert(count==0);
 	assert(array[0]=='a');
--- a/run/html_comment_01.html	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/html_comment_01.html	Fri Oct 08 21:12:15 2004 +0000
@@ -2,12 +2,12 @@
 <html>
 	<head><title>html_comment_01</title></head>
 	<body>
-		<pre><code>
+		<pre><CODE>
 int main(){ 
 <!-- das ist ein Kommentar -->
 	return 0;
 }
-		</code></pre>
+		</CODE></pre>
 	</body>
 </html>
 
--- a/run/html_comment_02.html	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/html_comment_02.html	Fri Oct 08 21:12:15 2004 +0000
@@ -2,12 +2,12 @@
 <html>
 	<head><title>html_comment_02</title></head>
 	<body>
-		<pre><code>
+		<pre><CODE>
 int main(){ 
-<!-- das ist ein Kommentar </code> -->
+<!-- das ist ein Kommentar </CODE> -->
 	return 0;
 }
-		</code></pre>
+		</CODE></pre>
 	</body>
 </html>
 
--- a/run/html_comment_03.html	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/html_comment_03.html	Fri Oct 08 21:12:15 2004 +0000
@@ -1,13 +1,13 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <html>
 	<head><title>html_comment_03</title></head>
-	<!-- <code>assert(0);</code> -->
+	<!-- <CODE>assert(0);</CODE> -->
 	<body>
-		<pre><code>
+		<pre><CODE>
 int main(){ 
 	return 0;
 }
-		</code></pre>
+		</CODE></pre>
 	</body>
 </html>
 
--- a/run/html_comment_04.html	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/html_comment_04.html	Fri Oct 08 21:12:15 2004 +0000
@@ -2,14 +2,14 @@
 <html>
 	<head><title>html_comment_04</title></head>
 	<body>
-		<pre><code>
+		<pre><CODE>
 int main(){ 
-		<!-- <code>assert(0);-->
+		<!-- <CODE>assert(0);-->
 	return 0;
 }
-		</code></pre>
+		</CODE></pre>
 		<i>static assert(0);</i>
-		<!-- </code> -->
+		<!-- </CODE> -->
 	</body>
 </html>
 
--- a/run/html_tag_case_02.html	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/html_tag_case_02.html	Fri Oct 08 21:12:15 2004 +0000
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <html>
-	<head><title>html_tag_case_02 (small)</title></head>
+	<head><title>html_tag_case_02 (lower)</title></head>
 	<body>
 		<code>
 		int main(){ return 0; }
--- a/run/odd_bug_02.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/odd_bug_02.d	Fri Oct 08 21:12:15 2004 +0000
@@ -12,12 +12,12 @@
 	}
 
 	void foo(){
-		assert(left==null);
+		assert(left is null);
 		bar();
 	}
 
 	void bar(){
-		assert(left==null);
+		assert(left is null);
 	}
 
 	int opApply(int delegate(inout int val) dg){
--- a/run/opCast_01.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/opCast_01.d	Fri Oct 08 21:12:15 2004 +0000
@@ -14,6 +14,6 @@
 }
 
 int main(){
-	(new Child).test=2;
+	(new Child()).test=2;
 	return 0;
 }
--- a/run/opCast_02.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/opCast_02.d	Fri Oct 08 21:12:15 2004 +0000
@@ -15,6 +15,6 @@
 }
 
 int main(){
-	(new Child).test=2;
+	(new Child()).test=2;
 	return 0;
 }
--- a/run/out_05.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/out_05.d	Fri Oct 08 21:12:15 2004 +0000
@@ -6,13 +6,13 @@
 }
 
 void check(out MyClass c){
-	assert(c==null);
+	assert(c is null);
 }
 
 int main(){
 	MyClass c = new MyClass();
-	assert(c!=null);
+	assert(!(c is null));
 	check(c);
-	assert(c==null);
+	assert(c is null);
 	return 0;
 }
--- a/run/overload_06.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/overload_06.d	Fri Oct 08 21:12:15 2004 +0000
@@ -11,8 +11,5 @@
 	void foo( short s ){
 	}
 
-	short s=1;
-	foo( s );
-
 	return 0;
 }
--- a/run/typeid_01.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/typeid_01.d	Fri Oct 08 21:12:15 2004 +0000
@@ -3,7 +3,7 @@
 
 int main(){
 	TypeInfo ti = typeid(MyClass[]);
-	assert(ti!=null);
+	assert(!(ti is null));
 	
 	return 0;
 }
--- a/run/typeid_02.d	Fri Oct 08 21:11:00 2004 +0000
+++ b/run/typeid_02.d	Fri Oct 08 21:12:15 2004 +0000
@@ -3,7 +3,7 @@
 
 int main(){
 	TypeInfo ti = typeid(MyClass[][]);
-	assert(ti!=null);
+	assert(!(ti is null));
 	
 	return 0;
 }