mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Defined some user-defined tags for protocol elements. Currently they're just adding redundancy, but in future they'll be used for parsing nested elements.
This commit is contained in:
@@ -318,7 +318,7 @@ public class ReaderImplTest extends TestCase {
|
||||
|
||||
@Test
|
||||
public void testReadUserDefinedTag() throws IOException {
|
||||
setContents("C0" + "DF" + "E0" + "20" + "E0" + "FB7FFFFFFF");
|
||||
setContents("C0" + "DF" + "EF" + "20" + "EF" + "FB7FFFFFFF");
|
||||
assertEquals(0, r.readUserDefinedTag());
|
||||
assertEquals(31, r.readUserDefinedTag());
|
||||
assertEquals(32, r.readUserDefinedTag());
|
||||
|
||||
@@ -297,7 +297,7 @@ public class WriterImplTest extends TestCase {
|
||||
w.writeUserDefinedTag(32);
|
||||
w.writeUserDefinedTag(Integer.MAX_VALUE);
|
||||
// USER tag, 32 as uint7, USER tag, 2147483647 as int32
|
||||
checkContents("E0" + "20" + "E0" + "FB7FFFFFFF");
|
||||
checkContents("EF" + "20" + "EF" + "FB7FFFFFFF");
|
||||
}
|
||||
|
||||
private void checkContents(String hex) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user