Author: celestin
Date: Sun Nov 25 16:05:57 2012
New Revision: 1413367

URL: http://svn.apache.org/viewvc?rev=1413367&view=rev
Log:
Further unit tests of Gamma.logGammaSum(double, double): preconditions.

Modified:
    
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java

Modified: 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java?rev=1413367&r1=1413366&r2=1413367&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
 (original)
+++ 
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/special/GammaTest.java
 Sun Nov 25 16:05:57 2012
@@ -19,10 +19,10 @@ package org.apache.commons.math3.special
 import org.apache.commons.math3.TestUtils;
 import org.apache.commons.math3.exception.NumberIsTooLargeException;
 import org.apache.commons.math3.exception.NumberIsTooSmallException;
+import org.apache.commons.math3.exception.OutOfRangeException;
 import org.apache.commons.math3.util.FastMath;
-
-import org.junit.Test;
 import org.junit.Assert;
+import org.junit.Test;
 
 /**
  * @version $Id$
@@ -1075,6 +1075,30 @@ public class GammaTest {
         }
     }
 
+    @Test(expected = OutOfRangeException.class)
+    public void testLogGammaSumPrecondition1() {
+
+        Gamma.logGammaSum(0.0, 1.0);
+    }
+
+    @Test(expected = OutOfRangeException.class)
+    public void testLogGammaSumPrecondition2() {
+
+        Gamma.logGammaSum(3.0, 1.0);
+    }
+
+    @Test(expected = OutOfRangeException.class)
+    public void testLogGammaSumPrecondition3() {
+
+        Gamma.logGammaSum(1.0, 0.0);
+    }
+
+    @Test(expected = OutOfRangeException.class)
+    public void testLogGammaSumPrecondition4() {
+
+        Gamma.logGammaSum(1.0, 3.0);
+    }
+
     private static final double[][] LOG_GAMMA_MINUS_LOG_GAMMA_SUM_REF = {
         { 0.0 , 8.0 , 0.0 },
         { 0.0 , 9.0 , 0.0 },


Reply via email to