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

Public Member Functions

void testEncodeZigZag () throws Exception
 
void testWriteLittleEndian () throws Exception
 
void testWriteMessageWithNegativeEnumValue () throws Exception
 
void testWriteVarint () throws Exception
 
void testWriteWholeMessage () throws Exception
 
void testWriteWholePackedFieldsMessage () throws Exception
 

Private Member Functions

void assertEqualBytes (byte[] a, byte[] b)
 
void assertWriteLittleEndian32 (byte[] data, int value) throws Exception
 
void assertWriteLittleEndian64 (byte[] data, long value) throws Exception
 
void assertWriteVarint (byte[] data, long value) throws Exception
 
byte[] bytes (int... bytesAsInts)
 
List< BytetoList (byte[] bytes)
 

Detailed Description

Unit test for CodedOutputStream.

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

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

Member Function Documentation

◆ assertEqualBytes()

void com.google.protobuf.test.CodedOutputStreamTest.assertEqualBytes ( byte[]  a,
byte[]  b 
)
inlineprivate

◆ assertWriteLittleEndian32()

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

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

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

◆ assertWriteLittleEndian64()

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

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

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

◆ assertWriteVarint()

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

Writes the given value using writeRawVarint32() and writeRawVarint64() and checks that the result matches the given bytes.

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

◆ bytes()

byte [] com.google.protobuf.test.CodedOutputStreamTest.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 56 of file bloaty/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/CodedOutputStreamTest.java.

◆ testEncodeZigZag()

void com.google.protobuf.test.CodedOutputStreamTest.testEncodeZigZag ( ) throws Exception
inline

◆ testWriteLittleEndian()

void com.google.protobuf.test.CodedOutputStreamTest.testWriteLittleEndian ( ) throws Exception
inline

Tests writeRawLittleEndian32() and writeRawLittleEndian64().

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

◆ testWriteMessageWithNegativeEnumValue()

void com.google.protobuf.test.CodedOutputStreamTest.testWriteMessageWithNegativeEnumValue ( ) throws Exception
inline

Test writing a message containing a negative enum value. This used to fail because the size was not properly computed as a sign-extended varint.

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

◆ testWriteVarint()

void com.google.protobuf.test.CodedOutputStreamTest.testWriteVarint ( ) throws Exception
inline

◆ testWriteWholeMessage()

void com.google.protobuf.test.CodedOutputStreamTest.testWriteWholeMessage ( ) throws Exception
inline

◆ testWriteWholePackedFieldsMessage()

void com.google.protobuf.test.CodedOutputStreamTest.testWriteWholePackedFieldsMessage ( ) throws Exception
inline

Tests writing a whole message with every packed field type. Ensures the wire format of packed fields is compatible with C++.

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

◆ toList()

List<Byte> com.google.protobuf.test.CodedOutputStreamTest.toList ( byte[]  bytes)
inlineprivate

Arrays.asList() does not work with arrays of primitives. :(

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


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


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