Fix CompressorTest on non-x86 environment

patch by ReiOdaira; reviewed by blambov for CASSANDRA-11913


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

Branch: refs/heads/trunk
Commit: 8d5b7b6288a4f558e0847165d0d98332481ca4ce
Parents: b3dd05e
Author: Rei Odaira <rei.oda...@gmail.com>
Authored: Thu Jun 23 10:29:22 2016 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu Jun 23 10:29:22 2016 +0200

----------------------------------------------------------------------
 test/unit/org/apache/cassandra/io/compress/CompressorTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8d5b7b62/test/unit/org/apache/cassandra/io/compress/CompressorTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/compress/CompressorTest.java 
b/test/unit/org/apache/cassandra/io/compress/CompressorTest.java
index 6018cc7..1d285ea4 100644
--- a/test/unit/org/apache/cassandra/io/compress/CompressorTest.java
+++ b/test/unit/org/apache/cassandra/io/compress/CompressorTest.java
@@ -80,7 +80,7 @@ public class CompressorTest
 
         // need byte[] representation which direct buffers don't have
         byte[] compressedBytes = new byte[compressed.capacity()];
-        ByteBufferUtil.arrayCopy(compressed, outOffset, compressedBytes, 
outOffset, compressed.capacity() - outOffset);
+        ByteBufferUtil.arrayCopy(compressed, outOffset, compressedBytes, 
outOffset, compressed.limit() - outOffset);
 
         final int decompressedLength = compressor.uncompress(compressedBytes, 
outOffset, compressed.remaining(), restored, restoreOffset);
 

Reply via email to