You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/03/03 23:50:08 UTC

[commons-rng] 02/02: InternalUtilsTest: Test for NegativeArraySizeException

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git

commit fccc73e3eb62f57cb0f03b1e52d7c7499aa4112a
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Mar 3 23:50:04 2019 +0000

    InternalUtilsTest: Test for NegativeArraySizeException
---
 .../apache/commons/rng/sampling/distribution/InternalUtilsTest.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
index d1a3b6a..86f41de 100644
--- a/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
+++ b/commons-rng-sampling/src/test/java/org/apache/commons/rng/sampling/distribution/InternalUtilsTest.java
@@ -85,4 +85,9 @@ public class InternalUtilsTest {
     public void testLogFactorialThrowsWhenNegative() {
         FactorialLog.create().value(-1);
     }
+
+    @Test(expected = NegativeArraySizeException.class)
+    public void testLogFactorialWithCacheThrowsWhenNegative() {
+        FactorialLog.create().withCache(-1);
+    }
 }