codeowners update
[mono.git] / mcs / tests / gtest-180.cs
index 4bd1176e33727805d83debf2697632cc7ed6acad..1001a86d96d396ffc0148a6facd6066b891053b6 100644 (file)
@@ -3,30 +3,36 @@ using System.Runtime.InteropServices;
 
 [module: DefaultCharSet (CharSet.Unicode)]
 
-struct foo1 {
+struct foo1
+{
 }
 
-enum E {
+enum E
+{
 }
 
-[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
-struct foo2 {
+[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Auto)]
+struct foo2
+{
 }
 
 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
 delegate void D ();
 
-class C {
-    public class CC {
-    }
+class C
+{
+       public class CC
+       {
+       }
 }
 
-class Program {
+class Program
+{
 
-       [DllImport("bah")]
+       [DllImport ("bah")]
        public static extern void test ();
-    
-       static int Main ()
+
+       public static int Main ()
        {
                DllImportAttribute dia = Attribute.GetCustomAttribute (typeof (Program).GetMethod ("test"), typeof (DllImportAttribute)) as DllImportAttribute;
                if (dia == null)
@@ -35,22 +41,26 @@ class Program {
                if (dia.CharSet != CharSet.Unicode)
                        return 2;
 
-               if (!typeof (C).IsUnicodeClass )
+               if (!typeof (C).IsUnicodeClass)
                        return 3;
 
-               if (!typeof (C.CC).IsUnicodeClass )
+               if (!typeof (C.CC).IsUnicodeClass)
                        return 4;
 
-               if (!typeof (D).IsUnicodeClass )
+               if (!typeof (D).IsUnicodeClass)
                        return 5;
 
-               if (!typeof (E).IsUnicodeClass )
+               var ufp = typeof (D).GetCustomAttributes (false)[0] as UnmanagedFunctionPointerAttribute;
+               if (ufp.CharSet != CharSet.Unicode)
+                       return 51;
+
+               if (!typeof (E).IsUnicodeClass)
                        return 6;
 
-               if (!typeof (foo1).IsUnicodeClass )
+               if (!typeof (foo1).IsUnicodeClass)
                        return 7;
 
-               if (!typeof (foo2).IsAutoClass )
+               if (!typeof (foo2).IsAutoClass)
                        return 8;
 
                return 0;