You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ps...@apache.org on 2004/07/10 19:10:42 UTC
cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/moment SkewnessTest.java
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