diff options
author | Marek Safar <marek.safar@gmail.com> | 2005-06-30 16:38:50 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2005-06-30 16:38:50 +0400 |
commit | 078ffb6cc4f7330f6bf52e1ee55efbc0681fb142 (patch) | |
tree | 1c6f5e8311a6331cc30be2f78e5d4754aa182f41 /mcs/tests/gtest-180.cs | |
parent | d398b14c78674b94365991eea3f08bbeabaed0c3 (diff) |
2005-06-30 Marek Safar <marek.safar@seznam.cz>
* gtest-180.cs: DefaultCharSetAttribute test.
* test-422.cs: New test for #75322.
svn path=/trunk/mcs/; revision=46762
Diffstat (limited to 'mcs/tests/gtest-180.cs')
-rw-r--r-- | mcs/tests/gtest-180.cs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/mcs/tests/gtest-180.cs b/mcs/tests/gtest-180.cs new file mode 100644 index 00000000000..4bd1176e337 --- /dev/null +++ b/mcs/tests/gtest-180.cs @@ -0,0 +1,58 @@ +using System; +using System.Runtime.InteropServices; + +[module: DefaultCharSet (CharSet.Unicode)] + +struct foo1 { +} + +enum E { +} + +[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)] +struct foo2 { +} + +[UnmanagedFunctionPointer (CallingConvention.Cdecl)] +delegate void D (); + +class C { + public class CC { + } +} + +class Program { + + [DllImport("bah")] + public static extern void test (); + + static int Main () + { + DllImportAttribute dia = Attribute.GetCustomAttribute (typeof (Program).GetMethod ("test"), typeof (DllImportAttribute)) as DllImportAttribute; + if (dia == null) + return 1; + + if (dia.CharSet != CharSet.Unicode) + return 2; + + if (!typeof (C).IsUnicodeClass ) + return 3; + + if (!typeof (C.CC).IsUnicodeClass ) + return 4; + + if (!typeof (D).IsUnicodeClass ) + return 5; + + if (!typeof (E).IsUnicodeClass ) + return 6; + + if (!typeof (foo1).IsUnicodeClass ) + return 7; + + if (!typeof (foo2).IsAutoClass ) + return 8; + + return 0; + } +} |