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/moment KurtosisTest.java
Date Fri, 18 Jun 2004 01:43:32 GMT
psteitz     2004/06/17 18:43:32

  Modified:    math/src/test/org/apache/commons/math/stat/univariate/moment
                        KurtosisTest.java
  Log:
  Added tests to ensure NaN is returned for n<4
  
  Revision  Changes    Path
  1.12      +18 -1     jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment/KurtosisTest.java
  
  Index: KurtosisTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment/KurtosisTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- KurtosisTest.java	17 Jun 2004 21:37:05 -0000	1.11
  +++ KurtosisTest.java	18 Jun 2004 01:43:32 -0000	1.12
  @@ -55,5 +55,22 @@
       public double expectedValue() {
           return this.kurt;
       }
  +    
  +    /**
  +     * Make sure Double.NaN is returned iff n < 4
  +     *
  +     */
  +    public void testNaN() {
  +        Kurtosis kurt = new Kurtosis();
  +        assertTrue(Double.isNaN(kurt.getResult()));
  +        kurt.increment(1d);
  +        assertTrue(Double.isNaN(kurt.getResult()));
  +        kurt.increment(1d);
  +        assertTrue(Double.isNaN(kurt.getResult()));
  +        kurt.increment(1d);
  +        assertTrue(Double.isNaN(kurt.getResult()));
  +        kurt.increment(1d);
  +        assertFalse(Double.isNaN(kurt.getResult()));      
  +    }
   
   }
  
  
  

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