remove debug writelines
[mcs.git] / tests / test-120.cs
blobc525c386bb1c1d8e470afec7596f4bfb7c9267f6
1 //
2 // This tests checks that the compiler catches the special attributes
3 // for in a struct for CharSet, and turns the right bit on the TypeAttribute
4 //
5 using System;
6 using System.Reflection;
7 using System.Runtime.InteropServices;
9 [StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Unicode)]
10 struct MyUnicode
12 [FieldOffset(0)] public float fh_float;
13 [FieldOffset(0)] public int fh_int;
16 [StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Ansi)]
17 struct MyAnsi
19 [FieldOffset(0)] public float fh_float;
20 [FieldOffset(0)] public int fh_int;
22 [StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Auto)]
23 struct MyAuto
25 [FieldOffset(0)] public float fh_float;
26 [FieldOffset(0)] public int fh_int;
29 class test
32 static int Main ()
34 int errors = 0;
35 Type t = typeof (MyUnicode);
37 if ((t.Attributes & TypeAttributes.StringFormatMask) != TypeAttributes.UnicodeClass){
38 Console.WriteLine ("Class MyUnicode does not have Unicode bit set");
39 errors += 1;
42 t = typeof (MyAuto);
43 if ((t.Attributes & TypeAttributes.StringFormatMask) != TypeAttributes.AutoClass){
44 Console.WriteLine ("Class MyAuto does not have Auto bit set");
45 errors += 2;
48 t = typeof (MyAnsi);
50 if ((t.Attributes & TypeAttributes.StringFormatMask) != TypeAttributes.AnsiClass){
51 Console.WriteLine ("Class MyUnicode does not have Ansi bit set");
52 errors += 4;
55 return errors;