test to ensure the generated payload is not larger

This commit is contained in:
Vincent Batts 2012-11-09 12:54:09 -05:00
parent f809735ad3
commit 8374c7c97c
2 changed files with 4 additions and 0 deletions

View file

@ -124,6 +124,7 @@ public class App {
} catch (IOException ex) { }
return null;
}
public static byte[] getBytesFromFile(File file) throws IOException {
InputStream is = new FileInputStream(file);

View file

@ -110,8 +110,10 @@ public class TestPathTree {
PathTree pt1;
List<String> contents0;
List<String> contents1;
long len0;
bytes = TestHelpers.loadBytes(this, "test.bin");
len0 = bytes.length;
pt0 = new PathTree(bytes);
contents0 = pt0.toList();
for (String str : contents0) {
@ -126,6 +128,7 @@ public class TestPathTree {
assertNotNull(pt1);
//printByteArray(pt1.getPayload());
contents1 = pt1.toList();
assertEquals(len0, pt1.getPayload().length);
assertTrue(TestHelpers.cmpStrings(contents0, contents1));
for (String str : contents1) {
System.out.println(str);