2 using System
.Collections
;
3 using System
.Runtime
.InteropServices
;
6 [StructLayout(LayoutKind
.Sequential
, Pack
= 1)]
11 public Bogus (int a
) {
13 str
= "hello-" + a
.ToString ();
19 static void test (Bogus
[] arr
) {
20 for (int i
= 0; i
< 256; ++i
) {
21 if (arr
[i
].b
!= (byte)i
)
22 throw new Exception ("wrong b at " + i
);
23 if (arr
[i
].str
!= "hello-" + i
.ToString ())
24 throw new Exception ("wrong str at " + i
);
28 Bogus
[] arr
= new Bogus
[256];
30 for (i
= 0; i
< 256; ++i
) {
31 arr
[i
] = new Bogus (i
);
34 for (i
= 0; i
< 10000; ++i
) {
35 ArrayList l
= new ArrayList ();