Classes | Public Member Functions | Private Member Functions | List of all members
com.google.protobuf.test.CodedInputStreamTest Class Reference
Inheritance diagram for com.google.protobuf.test.CodedInputStreamTest:
Inheritance graph
[legend]

Classes

class  SmallBlockInputStream
 

Public Member Functions

int makeTag (int number, int tag)
 
void testDecodeZigZag () throws Exception
 
void testInvalidTag () throws Exception
 
void testReadFromSlice () throws Exception
 
void testReadHugeBlob () throws Exception
 
void testReadInvalidUtf8 () throws Exception
 
void testReadLittleEndian () throws Exception
 
void testReadMaliciouslyLargeBlob () throws Exception
 
void testReadVarint () throws Exception
 
void testReadWholeMessage () throws Exception
 
void testResetSizeCounter () throws Exception
 
void testSkipRawBytesBug () throws Exception
 
void testSkipRawBytesPastEndOfBufferWithLimit () throws Exception
 
void testSkipWholeMessage () throws Exception
 

Private Member Functions

void assertMessageDepth (TestRecursiveMessage message, int depth)
 
void assertReadLittleEndian32 (byte[] data, int value) throws Exception
 
void assertReadLittleEndian64 (byte[] data, long value) throws Exception
 
void assertReadVarint (byte[] data, long value) throws Exception
 
void assertReadVarintFailure (InvalidProtocolBufferException expected, byte[] data) throws Exception
 
byte[] bytes (int... bytesAsInts)
 
TestRecursiveMessage makeRecursiveMessage (int depth)
 

Detailed Description

Unit test for CodedInputStream.

Author
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Definition at line 49 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

Member Function Documentation

◆ assertMessageDepth()

void com.google.protobuf.test.CodedInputStreamTest.assertMessageDepth ( TestRecursiveMessage  message,
int  depth 
)
inlineprivate

◆ assertReadLittleEndian32()

void com.google.protobuf.test.CodedInputStreamTest.assertReadLittleEndian32 ( byte[]  data,
int  value 
) throws Exception
inlineprivate

Parses the given bytes using readRawLittleEndian32() and checks that the result matches the given value.

Definition at line 180 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ assertReadLittleEndian64()

void com.google.protobuf.test.CodedInputStreamTest.assertReadLittleEndian64 ( byte[]  data,
long  value 
) throws Exception
inlineprivate

Parses the given bytes using readRawLittleEndian64() and checks that the result matches the given value.

Definition at line 199 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ assertReadVarint()

void com.google.protobuf.test.CodedInputStreamTest.assertReadVarint ( byte[]  data,
long  value 
) throws Exception
inlineprivate

Parses the given bytes using readRawVarint32() and readRawVarint64() and checks that the result matches the given value.

Definition at line 93 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ assertReadVarintFailure()

void com.google.protobuf.test.CodedInputStreamTest.assertReadVarintFailure ( InvalidProtocolBufferException  expected,
byte[]  data 
) throws Exception
inlineprivate

Parses the given bytes using readRawVarint32() and readRawVarint64() and expects them to fail with an InvalidProtocolBufferException whose description matches the given one.

Definition at line 126 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ bytes()

byte [] com.google.protobuf.test.CodedInputStreamTest.bytes ( int...  bytesAsInts)
inlineprivate

Helper to construct a byte array from a bunch of bytes. The inputs are actually ints so that I can use hex notation and not get stupid errors about precision.

Definition at line 55 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ makeRecursiveMessage()

TestRecursiveMessage com.google.protobuf.test.CodedInputStreamTest.makeRecursiveMessage ( int  depth)
inlineprivate

◆ makeTag()

int com.google.protobuf.test.CodedInputStreamTest.makeTag ( int  number,
int  tag 
)
inline

◆ testDecodeZigZag()

void com.google.protobuf.test.CodedInputStreamTest.testDecodeZigZag ( ) throws Exception
inline

◆ testInvalidTag()

void com.google.protobuf.test.CodedInputStreamTest.testInvalidTag ( ) throws Exception
inline

◆ testReadFromSlice()

void com.google.protobuf.test.CodedInputStreamTest.testReadFromSlice ( ) throws Exception
inline

◆ testReadHugeBlob()

void com.google.protobuf.test.CodedInputStreamTest.testReadHugeBlob ( ) throws Exception
inline

◆ testReadInvalidUtf8()

void com.google.protobuf.test.CodedInputStreamTest.testReadInvalidUtf8 ( ) throws Exception
inline

Tests that if we read an string that contains invalid UTF-8, no exception is thrown. Instead, the invalid bytes are replaced with the Unicode "replacement character" U+FFFD.

Definition at line 429 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ testReadLittleEndian()

void com.google.protobuf.test.CodedInputStreamTest.testReadLittleEndian ( ) throws Exception
inline

Tests readRawLittleEndian32() and readRawLittleEndian64().

Definition at line 215 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ testReadMaliciouslyLargeBlob()

void com.google.protobuf.test.CodedInputStreamTest.testReadMaliciouslyLargeBlob ( ) throws Exception
inline

◆ testReadVarint()

void com.google.protobuf.test.CodedInputStreamTest.testReadVarint ( ) throws Exception
inline

◆ testReadWholeMessage()

void com.google.protobuf.test.CodedInputStreamTest.testReadWholeMessage ( ) throws Exception
inline

Tests reading and parsing a whole message with every field type.

Definition at line 257 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ testResetSizeCounter()

void com.google.protobuf.test.CodedInputStreamTest.testResetSizeCounter ( ) throws Exception
inline

◆ testSkipRawBytesBug()

void com.google.protobuf.test.CodedInputStreamTest.testSkipRawBytesBug ( ) throws Exception
inline

Test that a bug in skipRawBytes() has been fixed: if the skip skips exactly up to a limit, this should not break things.

Definition at line 300 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ testSkipRawBytesPastEndOfBufferWithLimit()

void com.google.protobuf.test.CodedInputStreamTest.testSkipRawBytesPastEndOfBufferWithLimit ( ) throws Exception
inline

Test that a bug in skipRawBytes() has been fixed: if the skip skips past the end of a buffer with a limit that has been set past the end of that buffer, this should not break things.

Definition at line 315 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedInputStreamTest.java.

◆ testSkipWholeMessage()

void com.google.protobuf.test.CodedInputStreamTest.testSkipWholeMessage ( ) throws Exception
inline

The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:09