2004-10-14 Joe Shaw <joeshaw@novell.com>
[mono.git] / mono / tests / delegate4.cs
index 5d4f03da1fa8a6e803cfdd416d3d267ecdc62355..04d5852516498443b522f54bc73ba38247d42907 100644 (file)
@@ -6,18 +6,28 @@ using System.Runtime.Remoting.Messaging;
 class Test {
        public delegate int SimpleDelegate (int a, int b);
 
-       [DllImport ("libtest.so", EntryPoint="mono_invoke_delegate")]
+       [DllImport ("libtest", EntryPoint="mono_invoke_delegate")]
        static extern int mono_invoke_delegate (SimpleDelegate d);
 
        public static int Add (int a, int b) {
-               Console.WriteLine ("Test.Add from delegate: " + a +  "+ " + b);
+               Console.WriteLine ("Test.Add from delegate: " + a +  " + " + b);
+               return a + b;
+       }
+
+       public static int Add2 (int a, int b) {
+               Console.WriteLine ("Test.Add2 from delegate: " + a +  " + " + b);
                return a + b;
        }
 
        static int Main () {
                SimpleDelegate d = new SimpleDelegate (Add);
+               SimpleDelegate d2 = new SimpleDelegate (Add2);
                
-               mono_invoke_delegate (d);
+               if (mono_invoke_delegate (d) != 5)
+                       return 1;
+
+               if (mono_invoke_delegate (d2) != 5)
+                       return 1;
 
                return 0;
        }