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:
akwizgran
2011-07-18 17:44:18 +01:00
parent 427142ae51
commit 30fc6c1a92
14 changed files with 146 additions and 52 deletions

View File

@@ -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());

View File

@@ -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 {