2009-06-10 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / invoke.cs
index 387f0ecb95ec18b4f9de2261dd6b8de7570ba5f3..9add9a0bc0aaa7758ffa40336ba2168651d575e0 100644 (file)
@@ -69,7 +69,20 @@ class Test {
                // Test the return value from  ConstructorInfo.Invoke when a precreated
                // valuetype is used.
                ConstructorInfo ci = typeof (SimpleStruct).GetConstructor (new Type [] { typeof (bool) });
-               SimpleStruct res2 = (SimpleStruct)ci.Invoke (ss, new object [] { false });
+               ci.Invoke (ss, new object [] { false });
+
+               // Test invoking of the array Get/Set methods
+               string[,] arr = new string [10, 10];
+
+               arr.GetType ().GetMethod ("Set").Invoke (arr, new object [] { 1, 1, "FOO" });
+               string s = (string)arr.GetType ().GetMethod ("Get").Invoke (arr, new object [] { 1, 1 });
+               if (s != "FOO")
+                       return 3;
+
+               // Test the sharing of runtime invoke wrappers for string ctors
+               typeof (string).GetConstructor (new Type [] { typeof (char[]) }).Invoke (null, new object [] { new char [] { 'a', 'b', 'c' } });
+
+               typeof (Assembly).GetMethod ("GetType", new Type [] { typeof (string), }).Invoke (typeof (int).Assembly, new object [] { "A" });
        
                return 0;
        }