lucenenet-commits mailing list archives

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

Used the Java-BitSet versions of BitArray Get and Set. Commented out a
line that was commented out in the original Java source.


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

Branch: refs/heads/master
Commit: 9b2187e6ff1b27cf60c9d6671d3b8644cc0f8dcb
Parents: b71aa76
Author: Prad Nelluru <prnell@microsoft.com>
Authored: Fri Sep 12 15:18:07 2014 -0700
Committer: Prad Nelluru <prnell@microsoft.com>
Committed: Fri Sep 12 15:18:07 2014 -0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/BitSetSupport.cs              | 2 +-
 src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs | 2 +-
 src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs          | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9b2187e6/src/Lucene.Net.Core/Support/BitSetSupport.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/BitSetSupport.cs b/src/Lucene.Net.Core/Support/BitSetSupport.cs
index 7b816d0..3ffa0a8 100644
--- a/src/Lucene.Net.Core/Support/BitSetSupport.cs
+++ b/src/Lucene.Net.Core/Support/BitSetSupport.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Support
             {
                 // if index bit is set, return it
                 // otherwise check previous index bit
-                if (bitArray.Get(index))
+                if (bitArray.SafeGet(index))
                     return index;
                 index--;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9b2187e6/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 786eeb4..76c5265 100644
--- a/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/BaseDocIdSetTestCase.cs
@@ -142,7 +142,7 @@ namespace Lucene.Net.Util
             copy_ = CopyOf(set_, numBits); // then random index
             AssertEquals(numBits, set_, copy_);
             // test regular increments
-            for (int inc = 2; inc < 1000; inc += TestUtil.NextInt(Random(), 1, 100))
+            for (int inc = 2; inc < 10; inc += TestUtil.NextInt(Random(), 1, 100))
             {
                 set_ = new BitArray(numBits);
                 for (int d = Random().Next(10); d < numBits; d += inc)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9b2187e6/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs b/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
index 1c7f626..a9264e8 100644
--- a/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestLongBitSet.cs
@@ -55,9 +55,9 @@ namespace Lucene.Net.Util
             long bb = aa;
             do
             {
-                aa = a.PrevSetBit(aa-1);
+                //aa = a.PrevSetBit(aa-1);
                 aa--;
-                while ((aa >= 0) && (!a.Get(aa)))
+                while ((aa >= 0) && (!a.SafeGet(aa)))
                 {
                     aa--;
                 }
@@ -318,7 +318,7 @@ namespace Lucene.Net.Util
             BitArray bs = new BitArray(a.Length);
             foreach (int e in a)
             {
-                bs.Set(e, true);
+                bs.SafeSet(e, true);
             }
             return bs;
         }


Mime
View raw message