You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/09/25 23:19:56 UTC

svn commit: r1627669 - /lucene/dev/branches/lucene5969/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java

Author: rmuir
Date: Thu Sep 25 21:19:56 2014
New Revision: 1627669

URL: http://svn.apache.org/r1627669
Log:
LUCENE-5969: beef up AssertingLiveDocs more

Modified:
    lucene/dev/branches/lucene5969/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java

Modified: lucene/dev/branches/lucene5969/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5969/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java?rev=1627669&r1=1627668&r2=1627669&view=diff
==============================================================================
--- lucene/dev/branches/lucene5969/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java (original)
+++ lucene/dev/branches/lucene5969/lucene/test-framework/src/java/org/apache/lucene/codecs/asserting/AssertingLiveDocsFormat.java Thu Sep 25 21:19:56 2014
@@ -39,6 +39,10 @@ public class AssertingLiveDocsFormat ext
     assert size >= 0;
     MutableBits raw = in.newLiveDocs(size);
     assert raw != null;
+    assert raw.length() == size;
+    for (int i = 0; i < raw.length(); i++) {
+      assert raw.get(i);
+    }
     return new AssertingMutableBits(raw);
   }
 
@@ -48,6 +52,10 @@ public class AssertingLiveDocsFormat ext
     Bits rawExisting = ((AssertingBits)existing).in;
     MutableBits raw = in.newLiveDocs(rawExisting);
     assert raw != null;
+    assert raw.length() == rawExisting.length();
+    for (int i = 0; i < raw.length(); i++) {
+      assert rawExisting.get(i) == raw.get(i);
+    }
     return new AssertingMutableBits(raw);
   }