You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2008/11/23 15:57:45 UTC

svn commit: r719993 - /commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java

Author: psteitz
Date: Sun Nov 23 06:57:44 2008
New Revision: 719993

URL: http://svn.apache.org/viewvc?rev=719993&view=rev
Log:
Added test case to ensure nextPermutation fails for negative arguments.

Modified:
    commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java

Modified: commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java?rev=719993&r1=719992&r2=719993&view=diff
==============================================================================
--- commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java (original)
+++ commons/proper/math/branches/MATH_2_0/src/test/org/apache/commons/math/random/RandomDataTest.java Sun Nov 23 06:57:44 2008
@@ -589,7 +589,16 @@
                 fail("permutation k = n = 0, expecting IllegalArgumentException");
             } catch (IllegalArgumentException ex) {
                 ;
-            }               
+            }  
+            
+            // Make sure we fail for k < n < 0
+            try {
+                perm = randomData.nextPermutation(-1,-3);
+                fail("permutation k < n < 0, expecting IllegalArgumentException");
+            } catch (IllegalArgumentException ex) {
+                ;
+            }  
+            
         }       
     }