[TESTS] Fix test bug in PagedBytesReferenceTest.

This commit is contained in:
Adrien Grand 2014-05-14 10:09:11 +02:00
parent 265b386fa7
commit bfcebbb957
1 changed files with 1 additions and 2 deletions

View File

@ -26,7 +26,6 @@ import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.common.util.ByteArray; import org.elasticsearch.common.util.ByteArray;
import org.elasticsearch.test.ElasticsearchTestCase; import org.elasticsearch.test.ElasticsearchTestCase;
import org.elasticsearch.test.cache.recycler.MockBigArrays;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
@ -61,7 +60,7 @@ public class PagedBytesReferenceTest extends ElasticsearchTestCase {
int sliceLength = Math.max(1, length - sliceOffset - 1); int sliceLength = Math.max(1, length - sliceOffset - 1);
BytesReference slice = pbr.slice(sliceOffset, sliceLength); BytesReference slice = pbr.slice(sliceOffset, sliceLength);
assertEquals(pbr.get(sliceOffset), slice.get(0)); assertEquals(pbr.get(sliceOffset), slice.get(0));
assertEquals(pbr.get(sliceOffset + sliceLength), slice.get(sliceLength)); assertEquals(pbr.get(sliceOffset + sliceLength - 1), slice.get(sliceLength - 1));
} }
public void testLength() { public void testLength() {