df81be817990cc60e8787d6b2722b487b498bcfa
[mono.git] / mono / tests / pinvoke5.cs
1 using System;
2 using System.Text;
3 using System.Runtime.InteropServices;
4
5 public class Test {
6
7
8         [DllImport ("libtest.so", EntryPoint="mono_test_marshal_stringbuilder")]
9         public static extern void mono_test_marshal_stringbuilder (StringBuilder sb, int len);
10
11         public static int Main () {
12                 StringBuilder sb = new StringBuilder(255);
13                 mono_test_marshal_stringbuilder (sb, sb.Capacity);
14                 Console.Write ("name: ");
15                 String res = sb.ToString();
16                 Console.WriteLine (res);
17
18                 if (res != "This is my message.  Isn't it nice?")
19                         return 1;  
20                 
21                 return 0;
22         }
23 }