Skip to content

Commit 196f32e

Browse files
committed
Abstract common test code into BaseNTestData
1 parent 77fa03c commit 196f32e

13 files changed

Lines changed: 245 additions & 352 deletions

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ public void testBase16InputStreamByChunk() throws IOException {
9292

9393
// OpenSSL interop test.
9494
encoded = StringUtils.getBytesUtf8(Base16TestData.ENCODED_UTF8_UPPERCASE);
95-
decoded = Base16TestData.DECODED;
95+
decoded = BaseNTestData.DECODED;
9696
testByChunk(encoded, decoded);
9797

9898
// test random data of sizes 0 thru 150
99+
final BaseNCodec codec = new Base16(true);
99100
for (int i = 0; i <= 150; i++) {
100-
final byte[][] randomData = Base16TestData.randomData(i);
101+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
101102
encoded = randomData[1];
102103
decoded = randomData[0];
103104
testByChunk(encoded, decoded, true);
@@ -123,12 +124,13 @@ public void testBase16InputStreamByteByByte() throws IOException {
123124

124125
// OpenSSL interop test.
125126
encoded = StringUtils.getBytesUtf8(Base16TestData.ENCODED_UTF8_UPPERCASE);
126-
decoded = Base16TestData.DECODED;
127+
decoded = BaseNTestData.DECODED;
127128
testByteByByte(encoded, decoded);
128129

129130
// test random data of sizes 0 thru 150
131+
final BaseNCodec codec = new Base16(true);
130132
for (int i = 0; i <= 150; i++) {
131-
final byte[][] randomData = Base16TestData.randomData(i);
133+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
132134
encoded = randomData[1];
133135
decoded = randomData[0];
134136
testByteByByte(encoded, decoded, true);
@@ -166,7 +168,7 @@ private void testByChunk(final byte[] encoded, final byte[] decoded, final boole
166168

167169
// Start with encode.
168170
try (final InputStream in = new Base16InputStream(new ByteArrayInputStream(decoded), true, lowerCase)) {
169-
final byte[] output = Base16TestData.streamToBytes(in);
171+
final byte[] output = BaseNTestData.streamToBytes(in);
170172

171173
assertEquals("EOF", -1, in.read());
172174
assertEquals("Still EOF", -1, in.read());
@@ -175,7 +177,7 @@ private void testByChunk(final byte[] encoded, final byte[] decoded, final boole
175177

176178
// Now let's try decode.
177179
try (final InputStream in = new Base16InputStream(new ByteArrayInputStream(encoded), false, lowerCase)) {
178-
final byte[] output = Base16TestData.streamToBytes(in);
180+
final byte[] output = BaseNTestData.streamToBytes(in);
179181

180182
assertEquals("EOF", -1, in.read());
181183
assertEquals("Still EOF", -1, in.read());
@@ -187,7 +189,7 @@ private void testByChunk(final byte[] encoded, final byte[] decoded, final boole
187189
final InputStream inEncode = new Base16InputStream(in, true, lowerCase);
188190
final InputStream inDecode = new Base16InputStream(inEncode, false, lowerCase)) {
189191

190-
final byte[] output = Base16TestData.streamToBytes(inDecode);
192+
final byte[] output = BaseNTestData.streamToBytes(inDecode);
191193

192194
assertEquals("EOF", -1, inDecode.read());
193195
assertEquals("Still EOF", -1, inDecode.read());

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ public void testBase16OutputStreamByChunk() throws Exception {
6464
testByChunk(encoded, decoded);
6565

6666
// test random data of sizes 0 thru 150
67+
final BaseNCodec codec = new Base16(true);
6768
for (int i = 0; i <= 150; i++) {
68-
final byte[][] randomData = Base16TestData.randomData(i);
69+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
6970
encoded = randomData[1];
7071
decoded = randomData[0];
7172
testByChunk(encoded, decoded, true);
@@ -90,8 +91,9 @@ public void testBase16OutputStreamByteByByte() throws IOException {
9091
testByteByByte(encoded, decoded);
9192

9293
// test random data of sizes 0 thru 150
94+
final BaseNCodec codec = new Base16(true);
9395
for (int i = 0; i <= 150; i++) {
94-
final byte[][] randomData = Base16TestData.randomData(i);
96+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
9597
encoded = randomData[1];
9698
decoded = randomData[0];
9799
testByteByByte(encoded, decoded, true);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void testConstructors() {
117117
@Test
118118
public void testConstructor_LowerCase() {
119119
final Base16 Base16 = new Base16(true);
120-
final byte[] encoded = Base16.encode(Base16TestData.DECODED);
120+
final byte[] encoded = Base16.encode(BaseNTestData.DECODED);
121121
final String expectedResult = Base16TestData.ENCODED_UTF8_LOWERCASE;
122122
final String result = StringUtils.newStringUtf8(encoded);
123123
assertEquals("new Base16(true)", expectedResult, result);
@@ -126,7 +126,7 @@ public void testConstructor_LowerCase() {
126126
@Test
127127
public void testConstructor_LowerCase_DecodingPolicy() {
128128
final Base16 Base16 = new Base16(false, CodecPolicy.STRICT);
129-
final byte[] encoded = Base16.encode(Base16TestData.DECODED);
129+
final byte[] encoded = Base16.encode(BaseNTestData.DECODED);
130130
final String expectedResult = Base16TestData.ENCODED_UTF8_UPPERCASE;
131131
final String result = StringUtils.newStringUtf8(encoded);
132132
assertEquals("new Base16(false, CodecPolicy.STRICT)", result, expectedResult);

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

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
package org.apache.commons.codec.binary;
1919

20-
import java.io.ByteArrayOutputStream;
21-
import java.io.IOException;
22-
import java.io.InputStream;
23-
import java.util.Random;
24-
2520
/**
2621
* This random data was encoded by OpenSSL. Java had nothing to do with it. This data helps us test interop between
2722
* Commons-Codec and OpenSSL.
@@ -35,77 +30,4 @@ public class Base16TestData {
3530

3631
final static String ENCODED_UTF8_UPPERCASE
3732
= "F483CD2B052F74B888029E9CB73D764A2426386B2D5B262F48F79EBEE7C386BCDAC2CEB9BE8CA42A36C88F7DD85936BDC40EDCFC51F2A56725AD9850EE89DF737244F77049E5F4F847DCC011D8DB8F2D61BF8658367113E1625E5CC2C9FF9A7EA81A53B0FA5EA56F03355632D5CD36FF5C320BE92003A0AF45477D712AFF96DF3C00476C4D5E063029F5F84C2E02261D8AFC6ECE7F9C2CCF2ADA37B0AA5239DAD3FD27B0ACF2FA86EF5B3AF960042CABE6FD4A2FBF268E8BE39D3147E343424B88B907BBAA7D3B0520BD0AA20CACC4BFF02E828D1D4CF67360613208FE4656B95EDD041D81C8881E7A5D7785544CF19151B5DE29B87EF94DDF6C922783FB105CCDC8601C8C67BC6DF47592D4B51C45D43B3EBC27FC89505B138C7AAF8A6494A802F896B5DB1EAD7C876C811AFFF866AF8A7F8FCD24D20F6ADF986AD5AC8633DF7CE002D349A67C59EC856D9C750B10BF428A9FF76507FF2941467489367E2C4B4A1ADEE51B36F3A7A640780FD57B52DF5AB629C226BC3EC2225C325FBD929DB9D48531046038714C61D1E6B19373835A7C08F79124B6658E2B00923F4C635B020CC438F2830006E51F1F93D1FD6D58B5B6131ABE6E270DCE2F68DA1213546764D6306E25159553CCF44725BC959359DEA2816780D0CC47000F2238CE559E6AA9FD618CED40EAE7DAC121D3500A879325A02412D02E2CBE73A2039AE5EF8CCD58EF0793184253A569A4ED42B440A576B967855F11A9EEF542B67E2D53F2324F142D8F99779BC69D1B9CEF955BE6E0C8474822421009A66AD4C2960B72AE88E4BD049D6DECED00D892892AFA04E1436E9735764C6082F8A0279A346A401A979499A08C7400A0735928E99AFEE2103ACBDF0E7AA271874399FC8262E57CF478C0D47F2D88327CE557ECAC51DD71B3C0A0D0A98BAE5AC094877DD3CED4D0CE34E2BEF92ED8D155D4828618AC157863B61B0BCC20FE7A9C8A6AF7966DED472A7E42C80ACDD4446DF3519341793CBC8B7EC50495EA63B3541D5777C45752C9B62CB0037B9B54D40947185B6316BF0BF5F2DAAC699BABEF74BF76977AB571C7AFDF921C68E892C7B226FBF1B157695529D68EBD85460C3D730517BA6360B041BF69D3CF25DFFF77A86479E7DDCD0A2B8F3D672C0D6C144A13351325B414D5F517C6E7CC79D88A3A3213F8DFE2CFE5F5B05DEF225D456442CA287659CCA902238812406C1FE7424E06A5BBCB110E8321E1920105D8077E8654C9C2EA45E4052D96784A5E334A6CEDE6F43140584429BF7E7DFFF8ADBD4A028EB089F7A783155F22C6B66F99635F302A5ECEC990FBE60BA7DAED7E19667751A246B1625BB7720F0E57EB86FFA6001D98A5A3C6ADD0EA6490D74D16E870B8696406AAD928D523FE04A2618734EA017FAFFCFA896023A572515B5AAADC22D95DD64567F56BA977958ED380BB60";
38-
39-
final static byte[] DECODED
40-
= {-12, -125, -51, 43, 5, 47, 116, -72, -120, 2, -98, -100, -73, 61, 118, 74, 36, 38, 56, 107, 45, 91, 38,
41-
47, 72, -9, -98, -66, -25, -61, -122, -68, -38, -62, -50, -71, -66, -116, -92, 42, 54, -56, -113, 125,
42-
-40, 89, 54, -67, -60, 14, -36, -4, 81, -14, -91, 103, 37, -83, -104, 80, -18, -119, -33, 115, 114, 68,
43-
-9, 112, 73, -27, -12, -8, 71, -36, -64, 17, -40, -37, -113, 45, 97, -65, -122, 88, 54, 113, 19, -31, 98,
44-
94, 92, -62, -55, -1, -102, 126, -88, 26, 83, -80, -6, 94, -91, 111, 3, 53, 86, 50, -43, -51, 54, -1, 92,
45-
50, 11, -23, 32, 3, -96, -81, 69, 71, 125, 113, 42, -1, -106, -33, 60, 0, 71, 108, 77, 94, 6, 48, 41, -11,
46-
-8, 76, 46, 2, 38, 29, -118, -4, 110, -50, 127, -100, 44, -49, 42, -38, 55, -80, -86, 82, 57, -38, -45,
47-
-3, 39, -80, -84, -14, -6, -122, -17, 91, 58, -7, 96, 4, 44, -85, -26, -3, 74, 47, -65, 38, -114, -117,
48-
-29, -99, 49, 71, -29, 67, 66, 75, -120, -71, 7, -69, -86, 125, 59, 5, 32, -67, 10, -94, 12, -84, -60, -65,
49-
-16, 46, -126, -115, 29, 76, -10, 115, 96, 97, 50, 8, -2, 70, 86, -71, 94, -35, 4, 29, -127, -56, -120,
50-
30, 122, 93, 119, -123, 84, 76, -15, -111, 81, -75, -34, 41, -72, 126, -7, 77, -33, 108, -110, 39, -125,
51-
-5, 16, 92, -51, -56, 96, 28, -116, 103, -68, 109, -12, 117, -110, -44, -75, 28, 69, -44, 59, 62, -68,
52-
39, -4, -119, 80, 91, 19, -116, 122, -81, -118, 100, -108, -88, 2, -8, -106, -75, -37, 30, -83, 124, -121,
53-
108, -127, 26, -1, -8, 102, -81, -118, 127, -113, -51, 36, -46, 15, 106, -33, -104, 106, -43, -84, -122,
54-
51, -33, 124, -32, 2, -45, 73, -90, 124, 89, -20, -123, 109, -100, 117, 11, 16, -65, 66, -118, -97, -9,
55-
101, 7, -1, 41, 65, 70, 116, -119, 54, 126, 44, 75, 74, 26, -34, -27, 27, 54, -13, -89, -90, 64, 120, 15,
56-
-43, 123, 82, -33, 90, -74, 41, -62, 38, -68, 62, -62, 34, 92, 50, 95, -67, -110, -99, -71, -44, -123,
57-
49, 4, 96, 56, 113, 76, 97, -47, -26, -79, -109, 115, -125, 90, 124, 8, -9, -111, 36, -74, 101, -114, 43,
58-
0, -110, 63, 76, 99, 91, 2, 12, -60, 56, -14, -125, 0, 6, -27, 31, 31, -109, -47, -3, 109, 88, -75, -74,
59-
19, 26, -66, 110, 39, 13, -50, 47, 104, -38, 18, 19, 84, 103, 100, -42, 48, 110, 37, 21, -107, 83, -52,
60-
-12, 71, 37, -68, -107, -109, 89, -34, -94, -127, 103, -128, -48, -52, 71, 0, 15, 34, 56, -50, 85, -98,
61-
106, -87, -3, 97, -116, -19, 64, -22, -25, -38, -63, 33, -45, 80, 10, -121, -109, 37, -96, 36, 18, -48,
62-
46, 44, -66, 115, -94, 3, -102, -27, -17, -116, -51, 88, -17, 7, -109, 24, 66, 83, -91, 105, -92, -19,
63-
66, -76, 64, -91, 118, -71, 103, -123, 95, 17, -87, -18, -11, 66, -74, 126, 45, 83, -14, 50, 79, 20, 45,
64-
-113, -103, 119, -101, -58, -99, 27, -100, -17, -107, 91, -26, -32, -56, 71, 72, 34, 66, 16, 9, -90, 106,
65-
-44, -62, -106, 11, 114, -82, -120, -28, -67, 4, -99, 109, -20, -19, 0, -40, -110, -119, 42, -6, 4, -31,
66-
67, 110, -105, 53, 118, 76, 96, -126, -8, -96, 39, -102, 52, 106, 64, 26, -105, -108, -103, -96, -116,
67-
116, 0, -96, 115, 89, 40, -23, -102, -2, -30, 16, 58, -53, -33, 14, 122, -94, 113, -121, 67, -103, -4,
68-
-126, 98, -27, 124, -12, 120, -64, -44, 127, 45, -120, 50, 124, -27, 87, -20, -84, 81, -35, 113, -77,
69-
-64, -96, -48, -87, -117, -82, 90, -64, -108, -121, 125, -45, -50, -44, -48, -50, 52, -30, -66, -7, 46,
70-
-40, -47, 85, -44, -126, -122, 24, -84, 21, 120, 99, -74, 27, 11, -52, 32, -2, 122, -100, -118, 106, -9,
71-
-106, 109, -19, 71, 42, 126, 66, -56, 10, -51, -44, 68, 109, -13, 81, -109, 65, 121, 60, -68, -117, 126,
72-
-59, 4, -107, -22, 99, -77, 84, 29, 87, 119, -60, 87, 82, -55, -74, 44, -80, 3, 123, -101, 84, -44, 9, 71,
73-
24, 91, 99, 22, -65, 11, -11, -14, -38, -84, 105, -101, -85, -17, 116, -65, 118, -105, 122, -75, 113,
74-
-57, -81, -33, -110, 28, 104, -24, -110, -57, -78, 38, -5, -15, -79, 87, 105, 85, 41, -42, -114, -67,
75-
-123, 70, 12, 61, 115, 5, 23, -70, 99, 96, -80, 65, -65, 105, -45, -49, 37, -33, -1, 119, -88, 100, 121,
76-
-25, -35, -51, 10, 43, -113, 61, 103, 44, 13, 108, 20, 74, 19, 53, 19, 37, -76, 20, -43, -11, 23, -58, -25,
77-
-52, 121, -40, -118, 58, 50, 19, -8, -33, -30, -49, -27, -11, -80, 93, -17, 34, 93, 69, 100, 66, -54, 40,
78-
118, 89, -52, -87, 2, 35, -120, 18, 64, 108, 31, -25, 66, 78, 6, -91, -69, -53, 17, 14, -125, 33, -31, -110,
79-
1, 5, -40, 7, 126, -122, 84, -55, -62, -22, 69, -28, 5, 45, -106, 120, 74, 94, 51, 74, 108, -19, -26, -12,
80-
49, 64, 88, 68, 41, -65, 126, 125, -1, -8, -83, -67, 74, 2, -114, -80, -119, -9, -89, -125, 21, 95, 34,
81-
-58, -74, 111, -103, 99, 95, 48, 42, 94, -50, -55, -112, -5, -26, 11, -89, -38, -19, 126, 25, 102, 119,
82-
81, -94, 70, -79, 98, 91, -73, 114, 15, 14, 87, -21, -122, -1, -90, 0, 29, -104, -91, -93, -58, -83, -48,
83-
-22, 100, -112, -41, 77, 22, -24, 112, -72, 105, 100, 6, -86, -39, 40, -43, 35, -2, 4, -94, 97, -121, 52,
84-
-22, 1, 127, -81, -4, -6, -119, 96, 35, -91, 114, 81, 91, 90, -86, -36, 34, -39, 93, -42, 69, 103, -11,
85-
107, -87, 119, -107, -114, -45, -128, -69, 96};
86-
87-
static byte[] streamToBytes(final InputStream is) throws IOException {
88-
final ByteArrayOutputStream os = new ByteArrayOutputStream();
89-
final byte[] buf = new byte[4096];
90-
int read;
91-
while ((read = is.read(buf)) > -1) {
92-
os.write(buf, 0, read);
93-
}
94-
return os.toByteArray();
95-
}
96-
97-
/**
98-
* Returns an encoded and decoded copy of the same random data.
99-
*
100-
* @param size amount of random data to generate and encode
101-
* @return two byte[] arrays: [0] = decoded, [1] = encoded
102-
*/
103-
static byte[][] randomData(final int size) {
104-
final Random r = new Random();
105-
final byte[] decoded = new byte[size];
106-
r.nextBytes(decoded);
107-
final char[] encodedChars = Hex.encodeHex(decoded);
108-
final byte[] encoded = new String(encodedChars).getBytes(Hex.DEFAULT_CHARSET);
109-
return new byte[][] {decoded, encoded};
110-
}
11133
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void testCodec130() throws IOException {
5757

5858
// we skip the first character read from the reader
5959
ins.skip(1);
60-
final byte[] decodedBytes = Base32TestData.streamToBytes(ins, new byte[64]);
60+
final byte[] decodedBytes = BaseNTestData.streamToBytes(ins, new byte[64]);
6161
final String str = StringUtils.newStringUtf8(decodedBytes);
6262

6363
assertEquals(STRING_FIXTURE.substring(1), str);
@@ -222,7 +222,7 @@ public void testBase32InputStreamByChunk() throws Exception {
222222
// test random data of sizes 0 thru 150
223223
final BaseNCodec codec = new Base32();
224224
for (int i = 0; i <= 150; i++) {
225-
final byte[][] randomData = Base32TestData.randomData(codec, i);
225+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
226226
encoded = randomData[1];
227227
decoded = randomData[0];
228228
testByChunk(encoded, decoded, 0, LF);
@@ -256,7 +256,7 @@ public void testBase32InputStreamByteByByte() throws Exception {
256256
// test random data of sizes 0 thru 150
257257
final BaseNCodec codec = new Base32();
258258
for (int i = 0; i <= 150; i++) {
259-
final byte[][] randomData = Base32TestData.randomData(codec, i);
259+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
260260
encoded = randomData[1];
261261
decoded = randomData[0];
262262
testByteByByte(encoded, decoded, 0, LF);
@@ -287,15 +287,15 @@ private void testByChunk(final byte[] encoded, final byte[] decoded, final int c
287287
InputStream in;
288288

289289
in = new Base32InputStream(new ByteArrayInputStream(decoded), true, chunkSize, separator);
290-
byte[] output = Base32TestData.streamToBytes(in);
290+
byte[] output = BaseNTestData.streamToBytes(in);
291291

292292
assertEquals("EOF", -1, in.read());
293293
assertEquals("Still EOF", -1, in.read());
294294
assertTrue("Streaming base32 encode", Arrays.equals(output, encoded));
295295

296296
// Now let's try decode.
297297
in = new Base32InputStream(new ByteArrayInputStream(encoded));
298-
output = Base32TestData.streamToBytes(in);
298+
output = BaseNTestData.streamToBytes(in);
299299

300300
assertEquals("EOF", -1, in.read());
301301
assertEquals("Still EOF", -1, in.read());
@@ -307,7 +307,7 @@ private void testByChunk(final byte[] encoded, final byte[] decoded, final int c
307307
in = new Base32InputStream(in, true, chunkSize, separator);
308308
in = new Base32InputStream(in, false);
309309
}
310-
output = Base32TestData.streamToBytes(in);
310+
output = BaseNTestData.streamToBytes(in);
311311

312312
assertEquals("EOF", -1, in.read());
313313
assertEquals("Still EOF", -1, in.read());
@@ -572,13 +572,13 @@ public void testStrictDecoding() throws Exception {
572572
Base32InputStream in = new Base32InputStream(new ByteArrayInputStream(encoded), false);
573573
// Default is lenient decoding; it should not throw
574574
assertFalse(in.isStrictDecoding());
575-
Base32TestData.streamToBytes(in);
575+
BaseNTestData.streamToBytes(in);
576576

577577
// Strict decoding should throw
578578
in = new Base32InputStream(new ByteArrayInputStream(encoded), false, 0, null, CodecPolicy.STRICT);
579579
assertTrue(in.isStrictDecoding());
580580
try {
581-
Base32TestData.streamToBytes(in);
581+
BaseNTestData.streamToBytes(in);
582582
fail();
583583
} catch (final IllegalArgumentException ex) {
584584
// expected

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void testBase32OutputStreamByChunk() throws Exception {
117117
// test random data of sizes 0 thru 150
118118
final BaseNCodec codec = new Base32();
119119
for (int i = 0; i <= 150; i++) {
120-
final byte[][] randomData = Base32TestData.randomData(codec, i);
120+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
121121
encoded = randomData[1];
122122
decoded = randomData[0];
123123
testByChunk(encoded, decoded, 0, LF);
@@ -152,7 +152,7 @@ public void testBase32OutputStreamByteByByte() throws Exception {
152152
// test random data of sizes 0 thru 150
153153
final BaseNCodec codec = new Base32();
154154
for (int i = 0; i <= 150; i++) {
155-
final byte[][] randomData = Base32TestData.randomData(codec, i);
155+
final byte[][] randomData = BaseNTestData.randomData(codec, i);
156156
encoded = randomData[1];
157157
decoded = randomData[0];
158158
testByteByByte(encoded, decoded, 0, LF);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void testCodec200() {
244244
public void testRandomBytes() {
245245
for (int i = 0; i < 20; i++) {
246246
final Base32 codec = new Base32();
247-
final byte[][] b = Base32TestData.randomData(codec, i);
247+
final byte[][] b = BaseNTestData.randomData(codec, i);
248248
assertEquals(""+i+" "+codec.lineLength,b[1].length,codec.getEncodedLength(b[0]));
249249
//assertEquals(b[0],codec.decode(b[1]));
250250
}
@@ -254,7 +254,7 @@ public void testRandomBytes() {
254254
public void testRandomBytesChunked() {
255255
for (int i = 0; i < 20; i++) {
256256
final Base32 codec = new Base32(10);
257-
final byte[][] b = Base32TestData.randomData(codec, i);
257+
final byte[][] b = BaseNTestData.randomData(codec, i);
258258
assertEquals(""+i+" "+codec.lineLength,b[1].length,codec.getEncodedLength(b[0]));
259259
//assertEquals(b[0],codec.decode(b[1]));
260260
}
@@ -264,7 +264,7 @@ public void testRandomBytesChunked() {
264264
public void testRandomBytesHex() {
265265
for (int i = 0; i < 20; i++) {
266266
final Base32 codec = new Base32(true);
267-
final byte[][] b = Base32TestData.randomData(codec, i);
267+
final byte[][] b = BaseNTestData.randomData(codec, i);
268268
assertEquals(""+i+" "+codec.lineLength,b[1].length,codec.getEncodedLength(b[0]));
269269
//assertEquals(b[0],codec.decode(b[1]));
270270
}

0 commit comments

Comments
 (0)