Home / Function/ testSize3Varint() — netty Function Reference

testSize3Varint() — netty Function Reference

Architecture documentation for the testSize3Varint() function in ProtobufVarint32LengthFieldPrependerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  901c51a0_35f8_47ad_5d37_c8777981fdaa["testSize3Varint()"]
  6eaee290_afed_8a50_d035_25ef3cea2e1f["ProtobufVarint32LengthFieldPrependerTest"]
  901c51a0_35f8_47ad_5d37_c8777981fdaa -->|defined in| 6eaee290_afed_8a50_d035_25ef3cea2e1f
  style 901c51a0_35f8_47ad_5d37_c8777981fdaa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-protobuf/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java lines 95–129

    @Test
    public void testSize3Varint() {
        final int size = 3;
        final int num = 0x4000;
        assertEquals(size, ProtobufVarint32LengthFieldPrepender.computeRawVarint32Size(num));
        final byte[] buf = new byte[size + num];
        /**
         * 8    0    8    0    0    1
         * 1000 0000 1000 0000 0000 0001
         * 0000 0000 0000 0000 0000 0001
         * 0000 0001 0000 0000 0000 0000
         *  000 0001  000 0000  000 0000
         *
         *    0 0000 0100 0000 0000 0000
         *    0    0    4    0    0    0
         *
         */

        buf[0] = (byte) (0x80 & 0xFF);
        buf[1] = (byte) (0x80 & 0xFF);
        buf[2] = 0x01;
        for (int i = size; i < num + size; ++i) {
            buf[i] = 1;
        }
        assertTrue(ch.writeOutbound(wrappedBuffer(buf, size, buf.length - size)));

        ByteBuf expected = wrappedBuffer(buf);
        ByteBuf actual = ch.readOutbound();

        assertEquals(expected, actual);
        assertFalse(ch.finish());

        expected.release();
        actual.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does testSize3Varint() do?
testSize3Varint() is a function in the netty codebase, defined in codec-protobuf/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java.
Where is testSize3Varint() defined?
testSize3Varint() is defined in codec-protobuf/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java at line 95.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free