|
21 | 21 | import org.apache.commons.codec.DecoderException; |
22 | 22 | import org.apache.commons.codec.EncoderException; |
23 | 23 | import org.apache.commons.lang3.ArrayUtils; |
24 | | -import org.junit.Assume; |
25 | 24 | import org.junit.Test; |
26 | 25 |
|
27 | 26 | import java.nio.charset.Charset; |
@@ -478,39 +477,6 @@ private String toString(final byte[] data) { |
478 | 477 | return buf.toString(); |
479 | 478 | } |
480 | 479 |
|
481 | | - /** |
482 | | - * Test for CODEC-265: Encode a ~1GiB file. |
483 | | - * |
484 | | - * @see <a href="https://issues.apache.org/jira/projects/CODEC/issues/CODEC-265">CODEC-265</a> |
485 | | - */ |
486 | | - @Test |
487 | | - public void testCodec265_over() { |
488 | | - // almost 1GiB file to encode: 2^29 bytes |
489 | | - final int size1GiB = 1 << 29; |
490 | | - |
491 | | - // Expecting a size of 2 output bytes per 1 input byte |
492 | | - final int blocks = size1GiB; |
493 | | - final int expectedLength = 2 * blocks; |
494 | | - |
495 | | - // This test is memory hungry. Check we can run it. |
496 | | - final long presumableFreeMemory = BaseNCodecTest.getPresumableFreeMemory(); |
497 | | - |
498 | | - // Estimate the maximum memory required: |
499 | | - // 1GiB + 1GiB + ~2GiB + ~1.33GiB + 32 KiB = ~5.33GiB |
500 | | - // |
501 | | - // 1GiB: Input buffer to encode |
502 | | - // 1GiB: Existing working buffer (due to doubling of default buffer size of 8192) |
503 | | - // ~2GiB: New working buffer to allocate (due to doubling) |
504 | | - // ~1.33GiB: Expected output size (since the working buffer is copied at the end) |
505 | | - // 32KiB: Some head room |
506 | | - final long estimatedMemory = (long) size1GiB * 4 + expectedLength + 32 * 1024; |
507 | | - Assume.assumeTrue("Not enough free memory for the test", presumableFreeMemory > estimatedMemory); |
508 | | - |
509 | | - final byte[] bytes = new byte[size1GiB]; |
510 | | - final byte[] encoded = new Base16().encode(bytes); |
511 | | - assertEquals(expectedLength, encoded.length); |
512 | | - } |
513 | | - |
514 | 480 | @Test(expected = IllegalArgumentException.class) |
515 | 481 | public void checkEncodeLengthBounds() { |
516 | 482 | final Base16 base16 = new Base16(); |
|
0 commit comments