diff options
author | Marek Safar <marek.safar@gmail.com> | 2011-03-31 14:20:04 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2011-03-31 14:20:32 +0400 |
commit | 766d5a60e92ffa7e9d1352f17ec34eac8b6bb9b1 (patch) | |
tree | 27c0c2de5cd40d6d439670867ed700c785bd1fc4 /mcs/tests/gtest-180.cs | |
parent | 20978edc61ddbcc69415e42564e6f0ffdc89e9a6 (diff) |
Apply module character settings to more attributes
Diffstat (limited to 'mcs/tests/gtest-180.cs')
-rw-r--r-- | mcs/tests/gtest-180.cs | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/mcs/tests/gtest-180.cs b/mcs/tests/gtest-180.cs index 4bd1176e337..b323b623172 100644 --- a/mcs/tests/gtest-180.cs +++ b/mcs/tests/gtest-180.cs @@ -3,29 +3,35 @@ 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 () { DllImportAttribute dia = Attribute.GetCustomAttribute (typeof (Program).GetMethod ("test"), typeof (DllImportAttribute)) as DllImportAttribute; @@ -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; |