Flush tests
authorMiguel de Icaza <miguel@gnome.org>
Thu, 4 Apr 2002 07:09:49 +0000 (07:09 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 4 Apr 2002 07:09:49 +0000 (07:09 -0000)
svn path=/trunk/mcs/; revision=3607

mcs/tests/makefile
mcs/tests/test-26.cs
mcs/tests/test-28.cs

index d4b1f74677a696a957e5ead0ac2566a048854a97..1fc921a63379b04f259275327af97d874d6b7f3a 100755 (executable)
@@ -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
index 8914ae61a817917c506f7f18940fc12099310b8e..38b173ca3bd001a6e5715ddfe144e97e65350c86 100644 (file)
@@ -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;
        }
 
 }
index def07a59b47a4e104e1b4cd43e63d266cb90983f..3dc65d776bd5c0444065c24649eece36cae1b7aa 100644 (file)
@@ -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 ();
        }
 }