2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-183.cs
blob6d81e446f4a758c06c3304eae8b598d5a5c3b053
1 //
2 // This test just verifies that we generate the proper signature for
3 // EndInvoke, something that we were not doing before in the presence
4 // of out parameters
6 using System;
8 class Test
10 delegate int D (int x, out int y);
12 static int M (int x, out int y)
14 y = x + 2;
15 return ++x;
18 static int Main ()
20 int x = 1;
21 int y = 0;
23 D del = new D (M);
24 IAsyncResult ar = del.BeginInvoke (x, out y, null, null);
25 if (del.EndInvoke (out y, ar) != 2)
26 return 1;
27 if (y != 3)
28 return 2;
30 Console.WriteLine ("Test ok");
31 return 0;