2 // This test is used for testing the foreach array support
8 static int test_single (int [] a)
18 static int test_continue (int [] a)
34 // test that we can iterate on doubles, with a float contorl
35 // variable (this excercises the conversion operator and the
36 // proper loading on the array
38 static bool test_double (double [] d)
44 foreach (float f in d){
50 static int test_break (int [] a)
65 static bool test_multi (int [,] d)
77 int [] a = new int [10];
78 int [] b = new int [2];
80 for (int i = 0; i < 10; i++)
83 for (int j = 0; j < 2; j++)
86 if (test_single (a) != 145)
89 if (test_single (b) != 101)
92 if (test_continue (a) != 131){
93 Console.WriteLine ("Expecting: 131, got " + test_continue (a));
97 if (test_break (a) != 46){
98 Console.WriteLine ("Expecting: 46, got " + test_break (a));
102 double [] d = new double [] { 1.0, 2.0, 3.0 };
103 if (!test_double (d))
106 int [,] jj = new int [2,2];
111 if (!test_multi (jj))