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 SkewnessTest.java
Date Sat, 10 Jul 2004 17:10:42 GMT
psteitz     2004/07/10 10:10:42

  Modified:    math/src/test/org/apache/commons/math/stat/univariate/moment
                        SkewnessTest.java
  Log:
  Added test to make sure NaN is returned when it should be.
  
  Revision  Changes    Path
  1.12      +16 -1     jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment/SkewnessTest.java
  
  Index: SkewnessTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment/SkewnessTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SkewnessTest.java	17 Jun 2004 21:37:05 -0000	1.11
  +++ SkewnessTest.java	10 Jul 2004 17:10:42 -0000	1.12
  @@ -56,5 +56,20 @@
       public double expectedValue() {
           return this.skew;
       }
  +    
  +    /**
  +     * Make sure Double.NaN is returned iff n < 3
  +     *
  +     */
  +    public void testNaN() {
  +        Skewness skew = new Skewness();
  +        assertTrue(Double.isNaN(skew.getResult()));
  +        skew.increment(1d);
  +        assertTrue(Double.isNaN(skew.getResult()));
  +        skew.increment(1d);
  +        assertTrue(Double.isNaN(skew.getResult()));
  +        skew.increment(1d);
  +        assertFalse(Double.isNaN(skew.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