Represent booleans with a single byte.

This commit is contained in:
akwizgran
2015-05-02 21:12:33 +01:00
parent 41c4c4d808
commit d519c543a6
5 changed files with 17 additions and 20 deletions

View File

@@ -37,7 +37,7 @@ public class ReaderImplTest extends BriarTestCase {
@Test
public void testReadBoolean() throws Exception {
setContents("11" + "00" + "11" + "01");
setContents("10" + "11");
assertFalse(r.readBoolean());
assertTrue(r.readBoolean());
assertTrue(r.eof());
@@ -45,7 +45,7 @@ public class ReaderImplTest extends BriarTestCase {
@Test
public void testSkipBoolean() throws Exception {
setContents("11" + "00" + "11" + "01");
setContents("10" + "11");
r.skipBoolean();
r.skipBoolean();
assertTrue(r.eof());

View File

@@ -36,8 +36,8 @@ public class WriterImplTest extends BriarTestCase {
public void testWriteBoolean() throws IOException {
w.writeBoolean(true);
w.writeBoolean(false);
// BOOLEAN tag, 1, BOOLEAN tag, 0
checkContents("11" + "01" + "11" + "00");
// TRUE tag, FALSE tag
checkContents("11" + "10");
}
@Test