2008-01-08 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 8 Jan 2008 17:33:51 +0000 (17:33 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 8 Jan 2008 17:33:51 +0000 (17:33 -0000)
* ArrayTest.cs: Test both LastIndexOf versions for
ArgumentOutOfRangeException.

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

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

index d5cead8d023723eb83df3a67fb724d68d3991c1f..93fddcd331d615e1fdb76bc697f3bb3451922607 100644 (file)
@@ -1489,11 +1489,20 @@ public class ArrayTest : Assertion
        }
 
        [Test]
-       [ExpectedException (typeof (ArgumentOutOfRangeException))]
        public void TestLastIndexOf4 ()
        {
                short [] a = new short [] { 19, 238, 317, 6, 565, 0, -52, 60, -563, 753, 238, 238};
-               Array.LastIndexOf (a, 16, -1);
+               try {
+                       Array.LastIndexOf (a, (object)16, -1);
+                       NUnit.Framework.Assert.Fail ("#1");
+               } catch (ArgumentOutOfRangeException) { }
+               
+#if NET_2_0            
+               try {
+                       Array.LastIndexOf<short> (a, 16, -1);
+                       NUnit.Framework.Assert.Fail ("#2");
+               } catch (ArgumentOutOfRangeException) { }
+#endif         
        }
 
        [Test]
index 6ea1f42b1d16bfa50a00134b910d7015a907af9a..401d43f00480ccd12ab622fcbe65725580654581 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-08  Marek Safar  <marek.safar@gmail.com>
+
+       * ArrayTest.cs: Test both LastIndexOf versions for
+       ArgumentOutOfRangeException.
+
 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * TypeTest.cs: Added GetProperty and GetProperties tests for bug