X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mcs%2Ftests%2Ftest-19.cs;h=f63dff5295805505f56bb0939eae68308119929d;hb=9d76a57969148465880fc84084492b1112bf5778;hp=4a49c8fb6fd7901876cb4f5d4ac8b913d4741b5f;hpb=b638e43f8a76b61ad6edf928c3bf05487395ed4d;p=mono.git diff --git a/mcs/tests/test-19.cs b/mcs/tests/test-19.cs index 4a49c8fb6fd..f63dff52958 100755 --- a/mcs/tests/test-19.cs +++ b/mcs/tests/test-19.cs @@ -75,9 +75,40 @@ class X { Console.WriteLine (" Count: " + mi.Length); if (!filter (mi [0], "MyFilter")) return 1; + + // + // This test is used to call into a delegate defined in a separate + // namespace, but which is still not a nested delegate inside a class + // + NameSpace.TestDelegate td = new NameSpace.TestDelegate (multiply_by_three); + + if (td (8) != 24) + return 30; + + // + // Check the names that were used to define the delegates + // + if (td.GetType ().FullName != "NameSpace.TestDelegate") + return 31; + + if (_.GetType ().FullName != "I+GetTextFn") + return 32; Console.WriteLine ("Test passes"); return 0; } + + static int multiply_by_three (int v) + { + return v * 3; + } + +} + +namespace NameSpace { + + public delegate int TestDelegate (int a); + } +