commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherb...@apache.org
Subject [commons-numbers] 02/03: Add tests that fails to be detected as a negative index.
Date Tue, 17 Dec 2019 00:31:00 GMT
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-numbers.git

commit bb48af087ed0221793ce3e051df3d56b53ec7cd6
Author: Alex Herbert <aherbert@apache.org>
AuthorDate: Tue Dec 17 00:20:41 2019 +0000

    Add tests that fails to be detected as a negative index.
    
    (-1,-1) or (Integer.MAX_VALUE, 2, Integer.MAX_VALUE) are not negative as
    a total product.
---
 .../org/apache/commons/numbers/arrays/MultidimensionalCounterTest.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/MultidimensionalCounterTest.java
b/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/MultidimensionalCounterTest.java
index 7294251..88f5815 100644
--- a/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/MultidimensionalCounterTest.java
+++ b/commons-numbers-arrays/src/test/java/org/apache/commons/numbers/arrays/MultidimensionalCounterTest.java
@@ -31,6 +31,8 @@ public class MultidimensionalCounterTest {
         Assertions.assertThrows(IllegalArgumentException.class, () -> MultidimensionalCounter.of(0,
1));
         Assertions.assertThrows(IllegalArgumentException.class, () -> MultidimensionalCounter.of(2,
0));
         Assertions.assertThrows(IllegalArgumentException.class, () -> MultidimensionalCounter.of(-1,
1));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> MultidimensionalCounter.of(-1,
-1));
+        Assertions.assertThrows(IllegalArgumentException.class, () -> MultidimensionalCounter.of(Integer.MAX_VALUE,
2, Integer.MAX_VALUE));
 
         final MultidimensionalCounter c = MultidimensionalCounter.of(2, 3);
         Assertions.assertThrows(IllegalArgumentException.class, () -> c.toUni(1, 1, 1));


Mime
View raw message