2 // This test excercises array access on single dimension, multi-dimension
8 static void m (int [] a
)
13 static int test_int_single_dim ()
15 int [] a
= new int [10];
18 for (i
= 0; i
< 10; i
++)
27 for (i
= 9; i
>= 0; i
--){
34 static int simple_test_double_dim ()
36 int [,] b
= new int [10, 10];
41 if (b
[0, 0] != b
[4, 4])
43 if (b
[1, 1] != b
[5, 5])
49 // static void dd (int [,] b)
53 // for (i = 0; i < 10; i++)
54 // for (j = 0; j < 10; j++)
55 // b [i, j] = b [i, j] + 1;
58 // static int test_int_double_dim ()
60 // int [,] b = new int [10,10];
63 // for (i = 0; i < 10; i++)
64 // for (j = 0; j < 10; j++)
65 // b [i,j] = i * 10 + j;
69 // for (i = 0; i < 10; i++)
70 // for (j = 0; j < 10; j++)
71 // if (b [i,j] != i *10 + j + 1){
72 // Console.WriteLine ("Expecting " + (i * 10 + j + 1) + "got: " + b [i,j]);
79 // static int test_jagged ()
81 // int [][] a = new int [10][];
84 // for (i = 0; i < 10; i++){
88 // a [i] = new int [10];
90 // for (int j = 0; j < 10; j++){
93 // q = a [i][j] = j * 10;
97 // if (a [i][j] != q + 1)
109 Console
.WriteLine ("hello");
113 v
= test_int_single_dim ();
118 // v = test_int_double_dim ();
122 // v = test_jagged ();
124 v
= simple_test_double_dim ();
128 int [] a
= new int [10];
130 for (i
= 0; i
< 10; i
++){
133 // Console.WriteLine ("Should be: " + (i + 1) + " it is = " + a [i]);