4 // Tests for pinvoke name mangling
7 using System
.Runtime
.InteropServices
;
12 * These tests exercise the search order associated with the different charset values.
15 /* This should call NameManglingAnsi */
16 [DllImport("libtest", CharSet
=CharSet
.Ansi
)]
17 private static extern int NameManglingAnsi (string data
);
19 /* This should call NameManglingAnsi2A */
20 [DllImport ("libtest", CharSet
=CharSet
.Ansi
)]
21 private static extern int NameManglingAnsi2 (string data
);
23 /* This should call NameManglingUnicodeW */
24 [DllImport ("libtest", CharSet
=CharSet
.Unicode
)]
25 private static extern int NameManglingUnicode (string data
);
27 /* This should call NameManglingUnicode2 */
28 [DllImport ("libtest", CharSet
=CharSet
.Unicode
)]
29 private static extern int NameManglingUnicode2 (string data
);
31 /* This should call NameManglingAutoW under windows, and NameManglingAuto under unix */
32 [DllImport ("libtest", CharSet
=CharSet
.Auto
)]
33 private static extern int NameManglingAuto (string s
);
35 public static int Main (String
[] args
) {
38 res
= NameManglingAnsi ("ABC");
41 res
= NameManglingAnsi2 ("ABC");
44 res
= NameManglingUnicode ("ABC");
47 res
= NameManglingUnicode2 ("ABC");
51 res
= NameManglingAuto ("ABC");