lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1147534 - /lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java
Date Sun, 17 Jul 2011 06:00:31 GMT
Author: shaie
Date: Sun Jul 17 06:00:30 2011
New Revision: 1147534

URL: http://svn.apache.org/viewvc?rev=1147534&view=rev
Log:
random.nextInt does not take '0' as a valid argument, so ensure numBits is never 0

Modified:
    lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java

Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java?rev=1147534&r1=1147533&r2=1147534&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java Sun Jul 17
06:00:30 2011
@@ -197,7 +197,7 @@ public class TestFixedBitSet extends Luc
   */
 
   public void testEquals() {
-    final int numBits = random.nextInt(2000);
+    final int numBits = random.nextInt(2000) + 1 /* numBits cannot be 0 */;
     FixedBitSet b1 = new FixedBitSet(numBits);
     FixedBitSet b2 = new FixedBitSet(numBits);
     assertTrue(b1.equals(b2));



Mime
View raw message