From 13eb8cca1711cb01e6d95fe86906a9a8be18aee4 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Mon, 16 Jul 2007 01:21:45 +0000 Subject: [PATCH] Added test to confirm that nextUniform excludes endpoints. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@556485 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/math/random/RandomDataTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/org/apache/commons/math/random/RandomDataTest.java b/src/test/org/apache/commons/math/random/RandomDataTest.java index d2b0559dc..f4cedaeec 100644 --- a/src/test/org/apache/commons/math/random/RandomDataTest.java +++ b/src/test/org/apache/commons/math/random/RandomDataTest.java @@ -367,6 +367,14 @@ public class RandomDataTest extends RetryTestCase { testStatistic.chiSquare(expected,observed) < 10.83); } + /** test exclusive endpoints of nextUniform **/ + public void testNextUniformExclusiveEndpoints() { + for (int i = 0; i < 1000; i++) { + double u = randomData.nextUniform(0.99, 1); + assertTrue(u > 0.99 && u < 1); + } + } + /** test failure modes and distribution of nextGaussian() */ public void testNextGaussian() { try {