public void testBool() throws Exception
    {
        int num = 1;
        boolean value = true;
        int valueSize = 1;
        int tag = WireFormat.makeTag(num, FieldType.BOOL.wireType);
        int tagSize = CodedOutput.computeRawVarint32Size(tag);
        int expect = tagSize + valueSize;

        assertSize("boolean1", CodedOutput.computeBoolSize(num, value), expect);
        assertSize("boolean2", CodedOutput.getTagAndRawVarInt32Bytes(tag, 1).length, expect);
    }
CodedOutput test for the size of the bytes written.

@author David Yu
@created Nov 11, 2009
protostuff-core/src/test/java/io/protostuff/CodedOutputTest.java