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 StorelessUnivariateStatisticAbstractTest.java
Date Tue, 29 Jun 2004 06:11:22 GMT
psteitz     2004/06/28 23:11:22

  Modified:    math/src/test/org/apache/commons/math/stat/univariate
                        StorelessUnivariateStatisticAbstractTest.java
  Log:
  Added small sample tests for 2nd+ order moments.
  
  Revision  Changes    Path
  1.14      +13 -2     jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/StorelessUnivariateStatisticAbstractTest.java
  
  Index: StorelessUnivariateStatisticAbstractTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/StorelessUnivariateStatisticAbstractTest.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- StorelessUnivariateStatisticAbstractTest.java	17 Jun 2004 22:33:23 -0000	1.13
  +++ StorelessUnivariateStatisticAbstractTest.java	29 Jun 2004 06:11:22 -0000	1.14
  @@ -16,9 +16,10 @@
   package org.apache.commons.math.stat.univariate;
   
   import org.apache.commons.math.TestUtils;
  +import org.apache.commons.math.stat.univariate.moment.SecondMoment;
   
   /**
  - * Test cases for the {@link UnivariateStatistic} class.
  + * Test cases for {@link StorelessUnivariateStatistic} classes.
    * @version $Revision$ $Date$
    */
   public abstract class StorelessUnivariateStatisticAbstractTest
  @@ -124,6 +125,16 @@
           assertEquals("cleared stats should have thashcode of empty stat", 
                   emptyHash, statistic.hashCode());
           
  +    }
  +    
  +    public void testMomentSmallSamples() {
  +        UnivariateStatistic stat = getUnivariateStatistic();
  +        if (stat instanceof SecondMoment) {
  +            SecondMoment moment = (SecondMoment) getUnivariateStatistic();
  +            assertTrue(Double.isNaN(moment.getResult()));
  +            moment.increment(1d);
  +            assertEquals(0d, moment.getResult(), 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