Make this a real regression test.
authorMartin Baulig <martin@novell.com>
Tue, 14 Nov 2006 08:45:16 +0000 (08:45 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 14 Nov 2006 08:45:16 +0000 (08:45 -0000)
svn path=/branches/martin/anonymous-methods2/work/; revision=67830

mcs/work/test-martin-1.cs

index c2f61439926bba9512f5fe38cc766c0923319202..5ff93726fa75ded56f7907b13fc987cc0a071710 100755 (executable)
@@ -1,10 +1,12 @@
 using System;
 
-public class Test
+public class X
 {
        public delegate void TestDelegate ();
 
-       public static void Main ()
+       static long sum_i, sum_k;
+
+       public static int Test ()
        {
                TestDelegate d = null;
                for (int i = 1; i <= 5; i++) {
@@ -12,11 +14,31 @@ public class Test
                        TestDelegate temp = delegate {
                                Console.WriteLine (i);
                                Console.WriteLine (k);
-                               Console.WriteLine ();
+                               sum_i += 1 << i;
+                               sum_k += 1 << k;
                        };
                        temp ();
                        d += temp;
                }
+               Console.WriteLine ();
+               if (sum_i != 62)
+                       return 1;
+               if (sum_k != 62)
+                       return 2;
+               sum_i = sum_k = 0;
                d();
+               if (sum_i != 320)
+                       return 3;
+               if (sum_k != 62)
+                       return 4;
+               return 0;
+       }
+
+       public static int Main ()
+       {
+               int result = Test ();
+               if (result != 0)
+                       Console.WriteLine ("ERROR: {0}", result);
+               return result;
        }
 }