Skip to content

[Variant] Tests for creating "large" VariantObjectss #7821

Open
@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The Variant encoding uses different sizes for offsets in nested types to optimize the encoding size

Specifically

Describe the solution you'd like

I would like tests that use the VariantBuilder API and cover the following cases:

  1. VariantObject with between 2^8 and 2^16 elements ( field_id_size_minus_1 = 1, 2 byte field ids)

  2. VariantObject with between 2^16 and 2^24 elements ( field_id_size_minus_1 = 2, 3 byte field ids)

  3. VariantObject with between 2^24 and 2^32 elements ( field_id_size_minus_1 = 3, 4 byte field ids)

  4. VariantObject with total child data length between 2^8 and 2^16 elements ( field_offset_size_minus_1 = 1, 2 byte field offsets)

  5. VariantObject with total child data length between 2^16 and 2^24 elements ( field_offset_size_minus_1 = 2, 3 byte field offsets)

  6. VariantObject with total child data length between 2^24 and 2^32 elements ( field_offset_size_minus_1 = 3, 4 byte field offsets)

The "total child data length" can be made by adding some large strings as children (for example, by adding 1KB - 1MB Varaint::Strings via ArrayBuilder::append)

Describe alternatives you've considered

Additional context
The tests may not pass until this ticket is implemented:

If they dont' pass, we can mark them #[ignored] until it is

Metadata

Metadata

Assignees

Labels

enhancementAny new improvement worthy of a entry in the changeloggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions