remove TARGET_JVM
[mono.git] / mcs / class / corlib / Test / System / ArrayTest.cs
index 49d31b5906a18ce2df9f509aa52c6f08bbe69474..9fce407fbdbbfa23fe07472240a68a976d2e4fea 100644 (file)
@@ -2783,7 +2783,72 @@ public class ArrayTest : Assertion
        }
 
        }
+
+       [Test]
+       // From bug #80563
+       public void ICollectionNull ()
+       {
+               ICollection<object> test;
+               
+               test = new List<object>();
+               AssertEquals ("list<o>", test.Contains (null), false);
+
+               test = new object[] {};
+               AssertEquals ("empty array", test.Contains (null), false);
+
+               test = new object[] {null};
+               AssertEquals ("array with null", test.Contains (null), true);
+
+               test = new List<object>(test);
+               AssertEquals ("List<object> with test", test.Contains (null), true);
+               
+               test = new object[] {new object()};
+               AssertEquals ("array with object", test.Contains (null), false);
+
+               test = new List<object>(test);
+               AssertEquals ("array with test", test.Contains (null), false);
+       }
 #endif
+
+       #region Bug 80299
+
+       enum ByteEnum : byte {}
+       enum IntEnum : int {}
+
+       [Test]
+       public void TestByteEnumArrayToByteArray ()
+       {
+               ByteEnum[] a = new ByteEnum[] {(ByteEnum) 1, (ByteEnum) 2};
+               byte[] b = new byte[a.Length];
+               a.CopyTo (b, 0);
+       }
+
+       [Test]
+       public void TestByteEnumArrayToIntArray ()
+       {
+               ByteEnum[] a = new ByteEnum[] {(ByteEnum) 1, (ByteEnum) 2};
+               int[] b = new int[a.Length];
+               a.CopyTo (b, 0);
+       }
+
+       [Test]
+       [ExpectedException (typeof (ArrayTypeMismatchException))]
+       public void TestIntEnumArrayToByteArray ()
+       {
+               IntEnum[] a = new IntEnum[] {(IntEnum) 1, (IntEnum) 2};
+               byte[] b = new byte[a.Length];
+               a.CopyTo (b, 0);
+       }
+
+       [Test]
+       public void TestIntEnumArrayToIntArray ()
+       {
+               IntEnum[] a = new IntEnum[] {(IntEnum) 1, (IntEnum) 2};
+               int[] b = new int[a.Length];
+               a.CopyTo (b, 0);
+       }
+
+       #endregion
 }
 
 }