2007-11-14 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Wed, 14 Nov 2007 14:39:25 +0000 (14:39 -0000)
committerZoltan Varga <vargaz@gmail.com>
Wed, 14 Nov 2007 14:39:25 +0000 (14:39 -0000)
* ArrayTest.cs: Add a test for Copy () and exceptions.

svn path=/trunk/mcs/; revision=89613

mcs/class/corlib/Test/System/ArrayTest.cs
mcs/class/corlib/Test/System/ChangeLog

index 1a92d87708247a4ace5a76d5da6dcda79bb2232c..d5cead8d023723eb83df3a67fb724d68d3991c1f 100644 (file)
@@ -436,6 +436,17 @@ public class ArrayTest : Assertion
                Assert("#E38", copy[3] != orig[3]);
        }
 
+       [Test]
+       [ExpectedException (typeof (InvalidCastException))]
+       public void Copy_InvalidCast () {
+               object[] arr1 = new object [10];
+               Type[] arr2 = new Type [10];
+
+               arr1 [0] = new object ();
+
+               Array.Copy (arr1, 0, arr2, 0, 10);
+       }
+
        [Test]
        public void TestCopyTo() {
                {
index a973547602c28e6e6f7c174f90e29c08f2e85ae4..0ab60b5628ebe3ac1c5810b378cd93199a8a24fc 100644 (file)
@@ -1,3 +1,7 @@
+2007-11-14  Zoltan Varga  <vargaz@gmail.com>
+
+       * ArrayTest.cs: Add a test for Copy () and exceptions.
+
 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
 
        * DelegateTest.cs: Add tests for virtual target methods.