commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tobr...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang ArrayUtilsTest.java
Date Sat, 11 Oct 2003 19:58:40 GMT
tobrien     2003/10/11 12:58:40

  Modified:    lang/src/test/org/apache/commons/lang ArrayUtilsTest.java
  Log:
  Added one test case to ArrayUtilsTest and some small changes to test
  cases to test indexOf and lastIndexOf with negative array
  index values.
  
  Revision  Changes    Path
  1.14      +9 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/ArrayUtilsTest.java
  
  Index: ArrayUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/ArrayUtilsTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ArrayUtilsTest.java	18 Aug 2003 02:22:25 -0000	1.13
  +++ ArrayUtilsTest.java	11 Oct 2003 19:58:40 -0000	1.14
  @@ -1023,6 +1023,8 @@
           assertEquals(2, ArrayUtils.indexOf(array, (double) 2.2, 0, (double) 0.35));
           assertEquals(3, ArrayUtils.indexOf(array, (double) 4.15, 0, (double) 2.0));
           assertEquals(1, ArrayUtils.indexOf(array, (double) 1.00001324, 0, (double) 0.0001));
  +        assertEquals(3, ArrayUtils.indexOf(array, (double) 4.15, -1, (double) 2.0));
  +        assertEquals(1, ArrayUtils.indexOf(array, (double) 1.00001324, -300, (double) 0.0001));
       }
   
       public void testLastIndexOfDouble() {
  @@ -1076,6 +1078,7 @@
           assertEquals(2, ArrayUtils.lastIndexOf(array, (double) 2.2, 3, (double) 0.35));
           assertEquals(3, ArrayUtils.lastIndexOf(array, (double) 4.15, array.length, (double)
2.0));
           assertEquals(1, ArrayUtils.lastIndexOf(array, (double) 1.00001324, array.length,
(double) 0.0001));
  +        assertEquals(-1, ArrayUtils.lastIndexOf(array, (double) 4.15, -200, (double) 2.0));
       }
   
       public void testContainsDouble() {
  @@ -1422,6 +1425,11 @@
            );
        }
        
  +    public void testToPrimitive_intNull() {
  +        Integer[] iArray = null;
  +        assertEquals(null, ArrayUtils.toPrimitive(iArray, Integer.MIN_VALUE));
  +    }
  +
       public void testToObject_int() {
           final int[] b = null;
           assertEquals(null, ArrayUtils.toObject(b));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message