monotouch uses the real HttpWebRequest
[mcs.git] / tests / test-anon-59.cs
bloba3458b7f9b168eb85bceabdfaf0d35f743966b79
1 using System;
3 public class X
5 public delegate void TestDelegate ();
7 static long sum_i, sum_j, sum_k;
8 static ulong sum_p;
10 public static int Test (int p)
12 TestDelegate d = null;
13 for (int i = 1; i <= 5; i++) {
14 for (int j = i; j <= 8; j++) {
15 int k = i;
16 TestDelegate temp = delegate {
17 Console.WriteLine ("i = {0}, j = {1}, k = {2}, p = {3}",
18 i, j, k, p);
19 sum_i += 1 << i;
20 sum_j += 1 << j;
21 sum_k += 1 << k;
22 sum_p += (ulong) (1 << p);
23 p += k;
25 temp ();
26 d += temp;
29 Console.WriteLine ("SUM i = {0}, j = {1}, k = {2}, p = {3}",
30 sum_i, sum_j, sum_k, sum_p);
31 Console.WriteLine ();
32 if (sum_i != 300)
33 return 1;
34 if (sum_j != 2498)
35 return 2;
36 if (sum_k != 300)
37 return 3;
38 if (sum_p != 1825434804)
39 return 4;
40 sum_i = sum_j = sum_k = 0;
41 sum_p = 0;
42 d();
43 Console.WriteLine ("SUM i = {0}, j = {1}, k = {2}, p = {3}",
44 sum_i, sum_j, sum_k, sum_p);
45 Console.WriteLine ();
46 if (sum_i != 1920)
47 return 5;
48 if (sum_j != 15360)
49 return 6;
50 if (sum_k != 300)
51 return 7;
52 if (sum_p != 18446744073385831629)
53 return 8;
54 return 0;
57 public static int Main ()
59 int result = Test (5);
60 if (result != 0)
61 Console.WriteLine ("ERROR: {0}", result);
62 else
63 Console.WriteLine ("OK");
64 return result;