Kinetica   C#   API  Version 7.2.3.1
Kinetica.Tests.UnitTests.AvroWireFormatTests Class Reference

Wire-format pinning tests for Avro encoding. More...

Classes

class  NullableRecord
 Test record with nullable fields. More...
 
class  SimpleRecord
 Test record for simple types. More...
 

Public Member Functions

void AvroVarint_EncodesCorrectly (int value, byte[] expectedBytes)
 Tests Avro varint zig-zag encoding for positive integers. More...
 
void AvroVarintLong_EncodesCorrectly (long value, byte[] expectedBytes)
 Tests Avro varint encoding for long values. More...
 
void SimpleRecord_WithBasicValues_EncodesCorrectly ()
 Tests encoding of a simple record with all basic types. More...
 
void SimpleRecord_WithZeroValues_EncodesCorrectly ()
 Tests encoding of a record with zero/empty values. More...
 
void SimpleRecord_WithNegativeValues_EncodesCorrectly ()
 Tests encoding of negative integers. More...
 
void String_WithUTF8_EncodesCorrectly ()
 Tests string encoding with UTF-8 multi-byte characters. More...
 
void NullableRecord_WithNulls_EncodesCorrectly ()
 Tests encoding of nullable fields with null values. More...
 
void NullableRecord_WithValues_EncodesCorrectly ()
 Tests encoding of nullable fields with non-null values. More...
 
void LargeVarint_EncodesWithMultipleBytes (int value, byte[] expectedBytes)
 Regression test: Large varint values (ensures multi-byte encoding). More...
 
void EmptyString_EncodesAsZeroLength ()
 Regression test: Empty string encoding. More...
 
void LongString_EncodesCorrectly ()
 Regression test: Very long string (tests buffer resizing). More...
 

Detailed Description

Wire-format pinning tests for Avro encoding.

These tests verify the exact binary encoding of Avro data to ensure backward compatibility. Any changes to the wire format will break these tests, which is intentional - wire format changes require careful consideration.

Test vectors are pinned (hardcoded expected bytes) to detect regressions.

Definition at line 17 of file AvroWireFormatTests.cs.

Member Function Documentation

◆ AvroVarint_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.AvroVarint_EncodesCorrectly ( int  value,
byte []  expectedBytes 
)
inline

Tests Avro varint zig-zag encoding for positive integers.

Avro uses zig-zag encoding: (n << 1) ^ (n >> 63) Then encodes as base-128 varint with continuation bits.

Definition at line 41 of file AvroWireFormatTests.cs.

◆ AvroVarintLong_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.AvroVarintLong_EncodesCorrectly ( long  value,
byte []  expectedBytes 
)
inline

Tests Avro varint encoding for long values.

Definition at line 64 of file AvroWireFormatTests.cs.

◆ EmptyString_EncodesAsZeroLength()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.EmptyString_EncodesAsZeroLength ( )
inline

Regression test: Empty string encoding.

Definition at line 417 of file AvroWireFormatTests.cs.

◆ LargeVarint_EncodesWithMultipleBytes()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.LargeVarint_EncodesWithMultipleBytes ( int  value,
byte []  expectedBytes 
)
inline

Regression test: Large varint values (ensures multi-byte encoding).

Definition at line 400 of file AvroWireFormatTests.cs.

◆ LongString_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.LongString_EncodesCorrectly ( )
inline

Regression test: Very long string (tests buffer resizing).

Definition at line 435 of file AvroWireFormatTests.cs.

◆ NullableRecord_WithNulls_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.NullableRecord_WithNulls_EncodesCorrectly ( )
inline

Tests encoding of nullable fields with null values.

Avro union encoding: null is union index 0, non-null is union index 1 (followed by value).

Definition at line 284 of file AvroWireFormatTests.cs.

◆ NullableRecord_WithValues_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.NullableRecord_WithValues_EncodesCorrectly ( )
inline

Tests encoding of nullable fields with non-null values.

Definition at line 317 of file AvroWireFormatTests.cs.

◆ SimpleRecord_WithBasicValues_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.SimpleRecord_WithBasicValues_EncodesCorrectly ( )
inline

Tests encoding of a simple record with all basic types.

Wire format: int(varint) + long(varint) + float(4 bytes LE) + double(8 bytes LE) + bool(1 byte) + string(varint len + UTF-8)

Definition at line 100 of file AvroWireFormatTests.cs.

◆ SimpleRecord_WithNegativeValues_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.SimpleRecord_WithNegativeValues_EncodesCorrectly ( )
inline

Tests encoding of negative integers.

Definition at line 189 of file AvroWireFormatTests.cs.

◆ SimpleRecord_WithZeroValues_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.SimpleRecord_WithZeroValues_EncodesCorrectly ( )
inline

Tests encoding of a record with zero/empty values.

Definition at line 145 of file AvroWireFormatTests.cs.

◆ String_WithUTF8_EncodesCorrectly()

void Kinetica.Tests.UnitTests.AvroWireFormatTests.String_WithUTF8_EncodesCorrectly ( )
inline

Tests string encoding with UTF-8 multi-byte characters.

Definition at line 227 of file AvroWireFormatTests.cs.


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