1 package net.sf.openrocket.util;
3 import java.util.Arrays;
4 import java.util.Random;
6 import static org.junit.Assert.*;
10 public class Base64Test {
13 public void oldMainTest() throws Exception {
15 // TODO - this test case should probably be less random and more targeted to
16 // special cases such as:
19 // decoding bad string
21 Random rnd = new Random();
23 for (int round=0; round < 1000; round++) {
24 int n = rnd.nextInt(1000);
27 byte[] array = new byte[n];
30 String encoded = Base64.encode(array);
32 byte[] decoded = null;
33 decoded = Base64.decode(encoded);
35 if (!Arrays.equals(array, decoded)) {
36 fail("Data differs! n="+n);
38 System.out.println("n="+n+" ok!");