lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [07/13] git commit: Fixed BaseDocIdSetTestCase.TestAgainstBitSet
Date Mon, 15 Sep 2014 22:52:58 GMT
Fixed BaseDocIdSetTestCase.TestAgainstBitSet

Since our LuceneTestCase.Random() method returns the same Random (seed =
1) each time, this method went into an infinite loop.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/b71aa760
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/b71aa760
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/b71aa760

Branch: refs/heads/master
Commit: b71aa7606a15b50c20f22d780beb1e09ed47a763
Parents: 28e2750
Author: Prad Nelluru <prnell@microsoft.com>
Authored: Fri Sep 12 11:51:35 2014 -0700
Committer: Prad Nelluru <prnell@microsoft.com>
Committed: Fri Sep 12 11:51:35 2014 -0700

----------------------------------------------------------------------
 src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/b71aa760/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs b/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
index 011bcb9..786eeb4 100644
--- a/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
@@ -43,6 +43,7 @@ namespace Lucene.Net.Util
         {
             Debug.Assert(numBitsSet <= numBits);
             BitArray set = new BitArray(numBits);
+            Random random = Random();
             if (numBitsSet == numBits)
             {
                 set.Set(0, numBits != 0); //convert int to boolean
@@ -53,7 +54,7 @@ namespace Lucene.Net.Util
                 {
                     while (true)
                     {
-                        int o = Random().Next(numBits);
+                        int o = random.Next(numBits);
                         if (!set.Get(o))
                         {
                             set.Set(o, true);


Mime
View raw message