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)
67 int [] a = new int [10];
68 int [] b = new int [2];
70 for (int i = 0; i < 10; i++)
73 for (int j = 0; j < 2; j++)
76 if (test_single (a) != 145)
79 if (test_single (b) != 101)
82 if (test_continue (a) != 131){
83 Console.WriteLine ("Expecting: 131, got " + test_continue (a));
87 if (test_break (a) != 46){
88 Console.WriteLine ("Expecting: 46, got " + test_break (a));
92 double [] d = new double [] { 1.0, 2.0, 3.0 };