commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/rank MinTest.java
Date Fri, 18 Jun 2004 22:10:35 GMT
psteitz     2004/06/18 15:10:35

  Modified:    math/src/test/org/apache/commons/math/stat/univariate/rank
                        MinTest.java
  Log:
  Added tests for special values.
  
  Revision  Changes    Path
  1.12      +17 -1     jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/rank/MinTest.java
  
  Index: MinTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/rank/MinTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MinTest.java	17 Jun 2004 21:37:05 -0000	1.11
  +++ MinTest.java	18 Jun 2004 22:10:35 -0000	1.12
  @@ -55,5 +55,21 @@
       public double expectedValue() {
           return this.min;
       }
  +    
  +    public void testSpecialValues() {
  +        double[] testArray = {0d, Double.NaN, Double.POSITIVE_INFINITY, 
  +                Double.NEGATIVE_INFINITY};
  +        Min min = new Min();
  +        assertTrue(Double.isNaN(min.getResult()));
  +        min.increment(testArray[0]);
  +        assertEquals(0d, min.getResult(), 0);
  +        min.increment(testArray[1]);
  +        assertEquals(0d, min.getResult(), 0);
  +        min.increment(testArray[2]);
  +        assertEquals(0d, min.getResult(), 0);
  +        min.increment(testArray[3]);
  +        assertEquals(Double.NEGATIVE_INFINITY, min.getResult(), 0);
  +        assertEquals(Double.NEGATIVE_INFINITY, min.evaluate(testArray), 0);     
  +    }
   
   }
  
  
  

---------------------------------------------------------------------
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