ソースを参照

Flush tests

svn path=/trunk/mcs/; revision=3607
Miguel de Icaza 24 年 前
コミット
ec53373289
3 ファイル変更53 行追加4 行削除
  1. 1 1
      mcs/tests/makefile
  2. 38 1
      mcs/tests/test-26.cs
  3. 14 2
      mcs/tests/test-28.cs

+ 1 - 1
mcs/tests/makefile

@@ -13,7 +13,7 @@ TEST_SOURCES = \
 	test-61	test-62 test-63	test-64 test-65 test-66 test-67 test-68 test-69 test-70	\
 	test-71 test-72 test-73 test-74 test-75		test-77 test-78 test-79 test-80 \
 	test-81 test-82 test-83 test-84         test-86 test-87 test-88 test-89 test-90 \
-	test-91 test-92 test-93 test-94 test-95
+	test-91 test-92 test-93 test-94 test-95 test-96 test-97 test-98
 
 UNSAFE_SOURCES = \
 	unsafe-1 unsafe-2

+ 38 - 1
mcs/tests/test-26.cs

@@ -9,7 +9,7 @@ public class Blah {
 		return i+j;
 	}
 
-	public static int Main ()
+	public static int Test1 ()
 	{
 		Blah f = new Blah ();
 
@@ -29,7 +29,44 @@ public class Blah {
 			return 0;
 		else
 			return 1;
+	}
+	
+	public delegate int List (params int [] args);
+
+	public static int Adder (params int [] args)
+	{
+		int total = 0;
+		
+		foreach (int i in args)
+			total += i;
+
+		return total;
+	}
+
+	public static int Test2 ()
+	{
+		List my_adder = new List (Adder);
+
+		if (my_adder (1, 2, 3) != 6)
+			return 2;
+
+		return 0;
+	}
+	
+	public static int Main ()
+	{
+		int v;
+
+		v = Test1 ();
+		if (v != 0)
+			return v;
+
+		v = Test2 ();
+		if (v != 0)
+			return v;
 
+		Console.WriteLine ("All tests pass");
+		return 0;
 	}
 
 }

+ 14 - 2
mcs/tests/test-28.cs

@@ -1,3 +1,16 @@
+abstract class A {
+        protected abstract int this [int a] { get; } 
+}
+
+class B : A {
+	protected override int this [int a] { get { return a;}  }
+
+	public int M ()
+	{
+		return this [0];
+	}
+	
+}
 class X {
 	int v1, v2;
 	
@@ -29,7 +42,6 @@ class X {
 		if (x [0] != 1)
 			return 2;
 
-		return 0;
-		
+		return new B ().M ();
 	}
 }