Skip to content

Commit f3db0de

Browse files
committed
@iGore tests for a lineSeparator much bigger than DEFAULT_BUFFER_SIZE. See http://mail-archives.apache.org/mod_mbox/commons-dev/201202.mbox/%3C4F3C85D7.5060706@snafu.de%3E"
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1245005 13f79535-47bb-0310-9956-ffa450edef68
1 parent a43e6ac commit f3db0de

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/test/java/org/apache/commons/codec/binary/Base64Test.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import org.apache.commons.codec.DecoderException;
3232
import org.apache.commons.codec.EncoderException;
33+
import org.junit.Ignore;
3334
import org.junit.Test;
3435

3536
/**
@@ -1217,5 +1218,22 @@ private String toString(byte[] data) {
12171218
}
12181219
return buf.toString();
12191220
}
1221+
1222+
/**
1223+
* Tests a lineSeparator much bigger than DEFAULT_BUFFER_SIZE.
1224+
*
1225+
* @see <a href="http://mail-archives.apache.org/mod_mbox/commons-dev/201202.mbox/%3C4F3C85D7.5060706@snafu.de%3E">dev@commons.apache.org</a>
1226+
*/
1227+
@Test
1228+
@Ignore
1229+
public void testHugeLineSeparator() {
1230+
final int BaseNCodec_DEFAULT_BUFFER_SIZE = 8192;
1231+
final int Base64_BYTES_PER_ENCODED_BLOCK = 4;
1232+
byte[] baLineSeparator = new byte[BaseNCodec_DEFAULT_BUFFER_SIZE * 4 - 3];
1233+
Base64 b64 = new Base64(Base64_BYTES_PER_ENCODED_BLOCK, baLineSeparator);
1234+
String strOriginal = "Hello World";
1235+
String strDecoded = new String(b64.decode(b64.encode(StringUtils.getBytesUtf8(strOriginal))));
1236+
assertTrue("testDEFAULT_BUFFER_SIZE", strOriginal.equals(strDecoded));
1237+
}
12201238

12211239
}

0 commit comments

Comments
 (0)