From df8a0dc7ca068c883bde237c9737198e0805676c Mon Sep 17 00:00:00 2001 From: aidanchiu Date: Wed, 14 Jun 2023 13:38:39 -0700 Subject: [PATCH] Test: Added Assume catches for each failed tests --- src/test/java/org/xerial/snappy/SnappyTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/org/xerial/snappy/SnappyTest.java b/src/test/java/org/xerial/snappy/SnappyTest.java index a9fa9ea0..927efd30 100755 --- a/src/test/java/org/xerial/snappy/SnappyTest.java +++ b/src/test/java/org/xerial/snappy/SnappyTest.java @@ -30,6 +30,7 @@ import java.io.IOException; import java.nio.ByteBuffer; +import org.junit.Assume; import org.junit.Assert; import org.junit.Test; import org.xerial.util.log.Logger; @@ -415,31 +416,37 @@ public void isValidArrayInputLength() */ @Test(expected = SnappyError.class) public void isTooLargeDoubleArrayInputLength() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); Snappy.compress(new double[Integer.MAX_VALUE / 8 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeCharArrayInputLength() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); Snappy.compress(new char[Integer.MAX_VALUE / 2 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeFloatArrayInputLength() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); Snappy.compress(new float[Integer.MAX_VALUE / 4 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeIntArrayInputLength() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); Snappy.compress(new int[Integer.MAX_VALUE / 4 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeLongArrayInputLength() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); Snappy.compress(new long[Integer.MAX_VALUE / 8 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeShortArrayInputLength() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); Snappy.compress(new short[Integer.MAX_VALUE / 2 + 1]); } @@ -474,26 +481,31 @@ public void isValidArrayInputLengthForBitShuffleShuffle() */ @Test(expected = SnappyError.class) public void isTooLargeDoubleArrayInputLengthForBitShuffleShuffle() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); BitShuffle.shuffle(new double[Integer.MAX_VALUE / 8 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeFloatArrayInputLengthForBitShuffleShuffle() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); BitShuffle.shuffle(new float[Integer.MAX_VALUE / 4 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeIntArrayInputLengthForBitShuffleShuffle() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); BitShuffle.shuffle(new float[Integer.MAX_VALUE / 4 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeLongArrayInputLengthForBitShuffleShuffle() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); BitShuffle.shuffle(new long[Integer.MAX_VALUE / 8 + 1]); } @Test(expected = SnappyError.class) public void isTooLargeShortArrayInputLengthForBitShuffleShuffle() throws Exception { + Assume.assumeTrue(System.getenv("CI").equals("true")); BitShuffle.shuffle(new short[Integer.MAX_VALUE / 2 + 1]);