diff --git a/src/test/java/org/xerial/snappy/BitShuffleTest.java b/src/test/java/org/xerial/snappy/BitShuffleTest.java index 5c92ebf..49f904d 100644 --- a/src/test/java/org/xerial/snappy/BitShuffleTest.java +++ b/src/test/java/org/xerial/snappy/BitShuffleTest.java @@ -29,7 +29,8 @@ import static org.junit.Assert.*; import org.junit.Test; public class BitShuffleTest { - @Test + + @Test public void bitShuffleLongArray() throws Exception { @@ -58,4 +59,24 @@ public class BitShuffleTest { int[] result = BitShuffle.bitUnShuffleIntArray(shuffledData); assertArrayEquals(data, result); } + + @Test + public void bitShuffleFloatArray() + throws Exception + { + float[] data = new float[] {100.0f, 0.5f, -0.1f, 30.3f, Float.MIN_NORMAL, Float.MAX_EXPONENT, Float.MAX_VALUE, -0.1f, Integer.MIN_VALUE}; + byte[] shuffledData = BitShuffle.bitShuffle(data); + float[] result = BitShuffle.bitUnShuffleFloatArray(shuffledData); + assertArrayEquals(data, result, 0.0000001f); + } + + @Test + public void bitShuffleDoubleArray() + throws Exception + { + double[] data = new double[] {100.0f, 0.5f, -0.1f, 30.3f, Float.MIN_NORMAL, Float.MAX_EXPONENT, Float.MAX_VALUE, -0.1f, Integer.MIN_VALUE}; + byte[] shuffledData = BitShuffle.bitShuffle(data); + double[] result = BitShuffle.bitUnShuffleDoubleArray(shuffledData); + assertArrayEquals(data, result, 0.0000001f); + } }