2 using System
.Collections
.Generic
;
3 using System
.Runtime
.InteropServices
;
7 public static int test_0_jagged ()
9 int[][] j2
= new int [3][];
12 // j2 [0] = new int[] {1, 2, 3};
13 // j2 [1] = new int[] {1, 2, 3, 4, 5, 6};
14 // j2 [2] = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
20 for (int i
= 0; i
< j2
.Length
; i
++)
21 for (int j
= 0; j
< (i
+1)*3; j
++)
24 for (int i
= 0; i
< j2
.Length
; i
++)
25 for (int j
= 0; j
< (i
+1)*3; j
++)
31 public static int test_0_stest ()
33 string[] sa
= new string[32];
41 for (int i
= 0; i
< sa
.Length
; i
++){
43 Console
.WriteLine (sa
[i
]);
49 public static int test_0_atest2 ()
51 int[,] ia
= new int[32,32];
53 for (int i
= 0; i
<ia
.GetLength (0); i
++)
56 for (int i
= 0; i
<ia
.GetLength (0); i
++)
60 for (int i
= 0; i
<ia
.GetLength (0); i
++)
61 ia
.SetValue (i
*i
*i
, i
, i
);
63 for (int i
= 0; i
<ia
.GetLength (0); i
++)
64 if ((int)ia
.GetValue (i
, i
) != i
*i
*i
)
70 public static int test_0_atest ()
72 int[] ia
= new int[32];
74 for (int i
= 0; i
<ia
.Length
; i
++)
77 for (int i
= 0; i
<ia
.Length
; i
++)
84 if (ia
.GetValue (2) == null)
87 for (int i
= 0; i
<ia
.Length
; i
++)
88 ia
.SetValue (i
*i
*i
, i
);
90 for (int i
= 0; i
<ia
.Length
; i
++)
91 if ((int)ia
.GetValue (i
) != i
*i
*i
){
92 Console
.WriteLine ("Crap: " + i
+ " " + (int) ia
.GetValue (i
) );
101 public static int test_0_enum_array_casting () {
104 var y
= (IReadOnlyList
<int>)(object)x
;
105 } catch (Exception e
) {
109 var y
= (IList
<int>)(object)x
;
110 } catch (Exception e
) {
115 var y
= (ICollection
<int>)(object)x
;
116 } catch (Exception e
) {
121 var y
= (IEnumerable
<int>)(object)x
;
122 } catch (Exception e
) {
127 var y
= (IReadOnlyCollection
<int>)(object)x
;
128 } catch (Exception e
) {
134 public static int Main (string[] args
) {
135 return TestDriver
.RunTests (typeof (Test
), args
);