Merge pull request #1941 from kasthack/system.web-fixes
[mono.git] / mcs / class / corlib / Test / System / ArrayTest.cs
index fbea6549dc9041e1a42486dc3ea3444f42719e81..6902f43be1e989a386ccaf9144a8dd7d1c881aa9 100644 (file)
@@ -3449,7 +3449,6 @@ public class ArrayTest
                Assert.AreEqual (input, expected);
        }
 
-#if NET_4_0
        [Test]
        [ExpectedException (typeof (ArgumentException))]
        public void CompareToWithJaggedArray () {
@@ -3616,7 +3615,23 @@ public class ArrayTest
                Assert.AreEqual (3, c.Counter);         
        }
 
-#endif
 
+       [Test]
+       public void JaggedArrayCtor ()
+       {
+        var type = Type.GetType ("System.Object[][]");
+
+               ConstructorInfo ctor = null;
+        foreach (var c in type.GetConstructors ()) {
+                       if (c.GetParameters ().Length == 2)
+                               ctor = c;
+               }
+               Assert.IsNotNull (ctor);
+               var arr = (object[])ctor.Invoke (new object [] { 4, 10 });
+               for (int i = 0; i < 4; ++i) {
+                       Assert.IsNotNull (arr [i]);
+                       Assert.AreEqual (10, ((object[])arr [i]).Length);
+               }
+       }
 }
 }