mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Explicitly check array lengths.
This commit is contained in:
@@ -55,7 +55,11 @@ public class BdfDictionaryTest extends BriarTestCase {
|
|||||||
BdfDictionary d = new BdfDictionary();
|
BdfDictionary d = new BdfDictionary();
|
||||||
d.put("foo", new byte[123]);
|
d.put("foo", new byte[123]);
|
||||||
d.put("bar", new Bytes(new byte[123]));
|
d.put("bar", new Bytes(new byte[123]));
|
||||||
assertArrayEquals(new byte[123], d.getRaw("foo"));
|
byte[] foo = d.getRaw("foo");
|
||||||
assertArrayEquals(new byte[123], d.getRaw("bar"));
|
assertEquals(123, foo.length);
|
||||||
|
assertArrayEquals(new byte[123], foo);
|
||||||
|
byte[] bar = d.getRaw("bar");
|
||||||
|
assertEquals(123, bar.length);
|
||||||
|
assertArrayEquals(new byte[123], bar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,11 @@ public class BdfListTest extends BriarTestCase {
|
|||||||
BdfList list = new BdfList();
|
BdfList list = new BdfList();
|
||||||
list.add(new byte[123]);
|
list.add(new byte[123]);
|
||||||
list.add(new Bytes(new byte[123]));
|
list.add(new Bytes(new byte[123]));
|
||||||
assertArrayEquals(new byte[123], list.getRaw(0));
|
byte[] first = list.getRaw(0);
|
||||||
assertArrayEquals(new byte[123], list.getRaw(1));
|
assertEquals(123, first.length);
|
||||||
|
assertArrayEquals(new byte[123], first);
|
||||||
|
byte[] second = list.getRaw(1);
|
||||||
|
assertEquals(123, second.length);
|
||||||
|
assertArrayEquals(new byte[123], second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user