2004-12-04 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Sat, 4 Dec 2004 19:25:01 +0000 (19:25 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 4 Dec 2004 19:25:01 +0000 (19:25 -0000)
* delegate.cs: Add test for unboxing and delegates.

svn path=/trunk/mono/; revision=37093

mono/tests/ChangeLog
mono/tests/delegate.cs

index 20a575c7141dbcfb0b1b4d9322696e8528fc2cbd..49b34f334b4f2398eeb0cdcbfd9046c7cda2cb03 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
+
+       * delegate.cs: Add test for unboxing and delegates.
+
 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
 
        * appdomain-unload.cs: Add tests for unloading an appdomain from inside
index 7a3987a56c5cf21d2a2ceda41d76406d102a9758..b411d390f8658485fbd28705d217b4639e54e19f 100644 (file)
@@ -23,6 +23,8 @@ class Test {
        delegate void SimpleDelegate ();
        delegate string NotSimpleDelegate (int a);
        delegate int AnotherDelegate (string s);
+
+       delegate string StringDelegate (); 
        
        public int data;
        
@@ -85,6 +87,12 @@ class Test {
                Console.WriteLine (d4.Method);
                Console.WriteLine (d4.Method.Name);
                Console.WriteLine (d4.Method.DeclaringType);
+
+               // Check unboxing of this argument
+               int x = 10;
+               StringDelegate d5 = new StringDelegate (x.ToString);
+               if (d5 () != "10")
+                       return 1;
                
                return 0;