blob: bdfcc77b55db452550e3f25d28f880958d46953a [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Code generated by tools/fidl/gidl-conformance-suite/regen.sh; DO NOT EDIT.
import 'dart:typed_data';
import 'package:test/test.dart';
import 'package:fidl/fidl.dart' as fidl;
import 'conformance_test_types.dart';
import 'gidl.dart';
void main() {
group('conformance', () {
group('encode success cases', () {
EncodeSuccessCase.run(
Encoders.v1,
'AddEthernetDeviceRequest_v1',
TestAddEthernetDeviceRequest(
topologicalPath: '@/dev/sys/pci/00:03.0/e1000/ethernet',
config: InterfaceConfig(
name: 'ethp0003',
ipAddressConfig: IpAddressConfig.withDhcp(true)),
thisShouldBeAHandle: 0xffffffff),
kTestAddEthernetDeviceRequest_Type,
Uint8List.fromList([
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
0x40, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x73, 0x79, //
0x73, 0x2f, 0x70, 0x63, 0x69, 0x2f, 0x30, 0x30, //
0x3a, 0x30, 0x33, 0x2e, 0x30, 0x2f, 0x65, 0x31, //
0x30, 0x30, 0x30, 0x2f, 0x65, 0x74, 0x68, 0x65, //
0x72, 0x6e, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, //
0x65, 0x74, 0x68, 0x70, 0x30, 0x30, 0x30, 0x33, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Optionals_v1',
StructWithOptionals(
s: EmptyStruct(),
s2: EmptyStruct(),
t: TableWithEmptyStruct(s: EmptyStruct()),
xu: XUnionWithEmptyStruct.withS(EmptyStruct()),
xu2: XUnionWithEmptyStruct.withS(EmptyStruct()),
u: UnionWithEmptyStruct.withS(EmptyStruct()),
u2: UnionWithEmptyStruct.withS(EmptyStruct())),
kStructWithOptionals_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xfe, 0xe0, 0x99, 0x74, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xfe, 0xe0, 0x99, 0x74, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1Case1_v1',
Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
kSandwich1_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1Case1WithHdr_v1',
Sandwich1Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605)),
kSandwich1Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1WithOptUnionPresent_v1',
Sandwich1WithOptUnion(
before: 0x4030201,
optUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
kSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1WithOptUnionAbsent_v1',
Sandwich1WithOptUnion(before: 0x4030201, after: 0x8070605),
kSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich2Case1_v1',
Sandwich2(
before: 0x4030201,
theUnion: UnionSize12Align4.withVariant(
Uint8List.fromList([0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5])),
after: 0x8070605),
kSandwich2_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich3Case1_v1',
Sandwich3(
before: 0x4030201,
theUnion: UnionSize24Align8.withVariant(StructSize16Align8(
f1: 0xa7a6a5a4a3a2a1a0, f2: 0xafaeadacabaaa9a8)),
after: 0x8070605),
kSandwich3_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Case1_v1',
Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605),
kSandwich4_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Case1WithHdr_v1',
Sandwich4Message(
header: TransactionHeader(
txId: 0x0,
flags: Uint8List.fromList([0x0, 0x0, 0x0]),
magicNumber: 0x0,
ordinal: 0x0),
body: Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605)),
kSandwich4Message_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich5Case1_v1',
Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize8align4(
UnionSize8Align4.withVariant(0xc0b0a09)),
after: 0x8070605),
kSandwich5_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich5Case1WithHdr_v1',
Sandwich5Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize8align4(
UnionSize8Align4.withVariant(0xc0b0a09)),
after: 0x8070605)),
kSandwich5Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich5Case2_v1',
Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize24align8(
UnionSize24Align8.withVariant(StructSize16Align8(
f1: 0xa7a6a5a4a3a2a1a0, f2: 0xafaeadacabaaa9a8))),
after: 0x8070605),
kSandwich5_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich5Case2WithHdr_v1',
Sandwich5Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize24align8(
UnionSize24Align8.withVariant(StructSize16Align8(
f1: 0xa7a6a5a4a3a2a1a0, f2: 0xafaeadacabaaa9a8))),
after: 0x8070605)),
kSandwich5Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case1_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorOfUint8(
Uint8List.fromList([0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5])),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case1AbsentVector_v1',
Sandwich6(
before: 0x4030201,
theUnion:
UnionWithVector.withVectorOfUint8(Uint8List.fromList([])),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case2_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withS('soft migrations rock!'),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case3_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorS3A1([
StructSize3Align1(
threeBytes: Uint8List.fromList([0x73, 0x6f, 0x66])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0x20, 0x6d, 0x69])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0x72, 0x61, 0x74]))
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x20, 0x6d, 0x69, 0x72, 0x61, //
0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case4_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorS3A2([
StructSize3Align2(f1: 0x6f73, f2: 0x66),
StructSize3Align2(f1: 0x6d20, f2: 0x69),
StructSize3Align2(f1: 0x6172, f2: 0x74)
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x00, 0x20, 0x6d, 0x69, 0x00, //
0x72, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case5_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withHandles(
Uint32List.fromList([0xffffffff, 0xffffffff, 0xffffffff])),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case6_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withArrayS3A1([
StructSize3Align1(
threeBytes: Uint8List.fromList([0xa1, 0xa2, 0xa3])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0xa4, 0xa5, 0xa6]))
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case7_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withArrayS3A2([
StructSize3Align2(f1: 0xa2a1, f2: 0xa3),
StructSize3Align2(f1: 0xa5a4, f2: 0xa6)
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa1, 0xa2, 0xa3, 0x00, 0xa4, 0xa5, 0xa6, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case8_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorUnion(
[UnionSize8Align4.withVariant(0xc0b0a09)]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich7Case1_v1',
Sandwich7(
before: 0x14131211,
optSandwich1: Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
after: 0x24232221),
kSandwich7_Type,
Uint8List.fromList([
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich7Case1WithHdr_v1',
Sandwich7Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich7(
before: 0x14131211,
optSandwich1: Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
after: 0x24232221)),
kSandwich7Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich7Case2_v1',
Sandwich7(before: 0x14131211, after: 0x24232221),
kSandwich7_Type,
Uint8List.fromList([
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich7Case2WithHdr_v1',
Sandwich7Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich7(before: 0x14131211, after: 0x24232221)),
kSandwich7Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression1_v1',
Regression1(f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
kRegression1_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression2_v1',
Regression2(
head: Regression1(
f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
f7: 0x7),
kRegression2_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression3Absent_v1',
Regression3(),
kRegression3_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression3Present_v1',
Regression3(
optValue: Regression2(
head: Regression1(
f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
f7: 0x7)),
kRegression3_Type,
Uint8List.fromList([
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Size5Alignment1Array_v1',
Size5Alignment1Array(a: [
Size5Alignment1(
data: Uint8List.fromList([0x1, 0x2, 0x3, 0x4, 0x5])),
Size5Alignment1(
data: Uint8List.fromList([0x6, 0x7, 0x8, 0x9, 0xa])),
Size5Alignment1(data: Uint8List.fromList([0xb, 0xc, 0xd, 0xe, 0xf]))
]),
kSize5Alignment1Array_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Size5Alignment4Array_v1',
Size5Alignment4Array(a: [
Size5Alignment4(four: 0x4030201, one: 0x5),
Size5Alignment4(four: 0x9080706, one: 0xa),
Size5Alignment4(four: 0xe0d0c0b, one: 0xf)
]),
kSize5Alignment4Array_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, //
0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00, //
0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Size5Alignment1Vector_v1',
Size5Alignment1Vector(v: [
Size5Alignment1(
data: Uint8List.fromList([0x1, 0x2, 0x3, 0x4, 0x5])),
Size5Alignment1(data: Uint8List.fromList([0x6, 0x7, 0x8, 0x9, 0xa]))
]),
kSize5Alignment1Vector_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Size5Alignment4Vector_v1',
Size5Alignment4Vector(v: [
Size5Alignment4(four: 0x4030201, one: 0x5),
Size5Alignment4(four: 0x9080706, one: 0xa)
]),
kSize5Alignment4Vector_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, //
0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Table_NoFields_v1',
StructTableNoFields(t: TableNoFields()),
kStruct_Table_NoFields_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Table_TwoReservedFields_v1',
StructTableTwoReservedFields(t: TableTwoReservedFields()),
kStruct_Table_TwoReservedFields_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Table_StructWithReservedSandwich_v1',
TableStructWithReservedSandwichStruct(
table: TableStructWithReservedSandwich(
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x9, 0xa, 0xb])),
s2: StructSize3Align1(
threeBytes: Uint8List.fromList([0x19, 0x1a, 0x1b])))),
kTable_StructWithReservedSandwichStruct_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x19, 0x1a, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Table_StructWithUint32Sandwich_v1',
TableStructWithUint32SandwichStruct(
table: TableStructWithUint32Sandwich(
i: 0x4030201,
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x9, 0xa, 0xb])),
s2: StructSize3Align1(
threeBytes: Uint8List.fromList([0x19, 0x1a, 0x1b])),
i2: 0xd0c0b0a)),
kTable_StructWithUint32SandwichStruct_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x19, 0x1a, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x0a, 0x0b, 0x0c, 0x0d, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Table_UnionWithVector_ReservedSandwich_v1',
TableUnionWithVectorReservedSandwichStruct(
table: TableUnionWithVectorReservedSandwich(
uv: UnionWithVector.withS('hello'))),
kTable_UnionWithVector_ReservedSandwichStruct_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Table_UnionWithVector_StructSandwich_v1',
TableUnionWithVectorStructSandwichStruct(
table: TableUnionWithVectorStructSandwich(
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x1, 0x2, 0x3])),
uv: UnionWithVector.withS('hello'),
s2: StructSize3Align1(
threeBytes: Uint8List.fromList([0x4, 0x5, 0x6])))),
kTable_UnionWithVector_StructSandwichStruct_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'XUnionWithStruct_v1',
XUnionWithStructStruct(
xu: XUnionWithStruct.withS(StructSize3Align1(
threeBytes: Uint8List.fromList([0x1, 0x2, 0x3])))),
kXUnionWithStructStruct_Type,
Uint8List.fromList([
0x14, 0x5c, 0x3e, 0x19, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'ArrayStruct_v1',
ArrayStruct(unions: [
StringUnion.withS('one'),
StringUnion.withS('two'),
StringUnion.withS('three')
], optionalUnions: [
StringUnion.withS('four'),
StringUnion.withS('five'),
StringUnion.withS('six')
]),
kArrayStruct_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x66, 0x6f, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x66, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x69, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'TransformerEmptyStruct_v1',
TransformerEmptyStruct(),
kTransformerEmptyStruct_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'EmptyStructUnion_v1',
EmptyStructUnionStruct(
u: EmptyStructUnion.withEs(TransformerEmptyStruct())),
kEmptyStructUnionStruct_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'NoCodingTablesStressor_v1',
NoCodingTablesStressor(
f1: 0x1111111111111111,
f2: 0x2222222222222222,
u1: UnionSize36Align4.withVariant(Uint8List.fromList([
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33
])),
f3: 0x4444444444444444,
f4: 0x5555555555555555,
u2: UnionSize36Align4.withVariant(Uint8List.fromList([
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66
])),
f5: 0x7777777777777777,
f6: 0x8888888888888888,
u3: UnionSize36Align4.withVariant(Uint8List.fromList([
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99
])),
f7: 0xaaaaaaaaaaaaaaaa,
p1: Size8Align8(data: 0xeeeeeeeeeeeeeeee),
f8: 0xbbbbbbbbbbbbbbbb,
p2: Size8Align8(data: 0xeeeeeeeeeeeeeeee),
f9: 0xdddddddddddddddd),
kNoCodingTablesStressor_Type,
Uint8List.fromList([
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, //
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, //
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, //
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'OutOfLineSandwich1Case1_v1',
OutOfLineSandwich1(
before: 'soft migrations rock!',
v: [
Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605)
],
after: 'hard transitions suck!'),
kOutOfLineSandwich1_Type,
Uint8List.fromList([
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x61, 0x72, 0x64, 0x20, 0x74, 0x72, 0x61, //
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, //
0x20, 0x73, 0x75, 0x63, 0x6b, 0x21, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'OutOfLineSandwich1WithOptUnionPresent_v1',
OutOfLineSandwich1WithOptUnion(
before: 'soft migrations rock!',
v: [
Sandwich1WithOptUnion(
before: 0x4030201,
optUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605)
],
after: 'hard transitions suck!'),
kOutOfLineSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x61, 0x72, 0x64, 0x20, 0x74, 0x72, 0x61, //
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, //
0x20, 0x73, 0x75, 0x63, 0x6b, 0x21, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'OutOfLineSandwich1WithOptUnionAbsent_v1',
OutOfLineSandwich1WithOptUnion(
before: 'soft migrations rock!',
v: [Sandwich1WithOptUnion(before: 0x4030201, after: 0x8070605)],
after: 'hard transitions suck!'),
kOutOfLineSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x61, 0x72, 0x64, 0x20, 0x74, 0x72, 0x61, //
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, //
0x20, 0x73, 0x75, 0x63, 0x6b, 0x21, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression4_v1',
Regression4(
f1: 0x1,
f2: 0x2,
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x9, 0xa, 0xb])),
f3: 0x3,
f4: 0x4,
f5: 0x5,
f6: 0x6),
kRegression4_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x03, 0x04, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression5Enums_v1',
Regression5(
f1: 0x1,
f2: 0x3231302f,
f3: 0x8,
f4: 0x1615,
f5: 0x64636261605f5e5d,
f6: 0x8),
kRegression5_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x2f, 0x30, 0x31, 0x32, //
0x08, 0x00, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, //
0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression6Bits_v1',
Regression6(
f1: 0x1,
f2: 0x3231302f,
f3: 0x8,
f4: 0x1615,
f5: 0x64636261605f5e5d,
f6: 0x8),
kRegression6_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x2f, 0x30, 0x31, 0x32, //
0x08, 0x00, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, //
0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression7TableUnionXUnion_v1',
Regression7TableUnionXUnion(
value: TableOfUnionThenXUnionThenTableThenXUnionThenUnion(
member: UnionOfXUnionThenTableThenXUnionThenUnion.withVariant(
XUnionOfTableThenXUnionThenUnion.withVariant(
TableOfXUnionThenUnion(
member: XUnionOfUnion.withVariant(
UnionAtTheBottom.withTiny(0x8))))))),
kRegression7TableUnionXUnion_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x4e, 0x61, 0xb8, 0x22, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x94, 0x05, 0x22, 0x38, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression8OptUnionSize12Aligned4_v1',
Regression8OptUnionSize12Align4(
optUnion1: UnionSize12Align4.withVariant(
Uint8List.fromList([0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6])),
optUnion3: UnionSize12Align4.withVariant(
Uint8List.fromList([0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6]))),
kRegression8OptUnionSize12Align4_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression8VectorOfOptUnionSize12Aligned4_v1',
Regression8VectorOfOptUnionSize12Align4(value: [
null,
UnionSize12Align4.withVariant(
Uint8List.fromList([0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6])),
null,
UnionSize12Align4.withVariant(
Uint8List.fromList([0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6])),
null
]),
kRegression8VectorOfOptUnionSize12Align4_Type,
Uint8List.fromList([
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression8TableWithUnionSize12Aligned4_v1',
Regression8TableWithUnionSize12Align4(
value: TableWithUnionSize12Align4(
before: 0xaa,
member: UnionSize12Align4.withVariant(
Uint8List.fromList([0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6])),
after: 0xbb)),
kRegression8TableWithUnionSize12Align4_Type,
Uint8List.fromList([
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0x00, 0x00, //
0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Regression9Response_v1',
Regression9Message(
header: TransactionHeader(
txId: 0x1,
flags: Uint8List.fromList([0x1, 0x0, 0x0]),
magicNumber: 0x1,
ordinal: 0x56cbc96900000000),
body: Regression9Result.withOk(Regression9Value(
u: StringBoolUnion.withS('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'),
nullableU: StringBoolUnion.withB(false)))),
kRegression9Message_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, //
0x00, 0x00, 0x00, 0x00, 0x69, 0xc9, 0xcb, 0x56, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Align8_v1',
Sandwich4Align8(
sandwich4: Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605),
alignment8Enforcement: 0x100f0e0d0c0b0a09),
kSandwich4Align8_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Align8WithPointer_v1',
Sandwich4Align8WithPointer(
sandwich4: Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605),
alignment8Enforcement: Size8Align8(data: 0x100f0e0d0c0b0a09)),
kSandwich4Align8WithPointer_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich8Case1_v1',
Sandwich8(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize8align4(
UnionSize8Align4.withVariant(0xc0b0a09)),
after: 0x8070605),
kSandwich8_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'Sandwich9Case1_v1',
Sandwich9(
before: 0x201,
theUnion: UnionWithVectorOfVectors.withV([
[
StructSize3Align1(
threeBytes: Uint8List.fromList([0x10, 0x11, 0x12])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0x13, 0x14, 0x15]))
]
]),
after: 0x1211),
kSandwich9_Type,
Uint8List.fromList([
0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x10, 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x13, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'SimpleTableArrayStruct_v1',
SimpleTableArrayStruct(theArray: [
TransformerSimpleTable(value: 0xa3a2a1a0),
TransformerSimpleTable(value: 0xb3b2b1b0)
]),
kSimpleTableArrayStruct_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'StringUnionVector_v1',
StringUnionVector(theVector: [
StringUnion.withS('hello'),
StringUnion.withU8(0xaa),
StringUnion.withU8(0xbb)
]),
kStringUnionVector_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'StringUnionStructWrapperResponse_v1',
StringUnionStructWrapperResponse(
header: TransactionHeader(
txId: 0x0,
flags: Uint8List.fromList([0x1, 0x0, 0x0]),
magicNumber: 0x1,
ordinal: 0x32a0322500000000),
body: StringUnionStructWrapper(
sus: StringUnionStruct(
u: StringBoolUnion.withS('hello'),
nullableU: StringBoolUnion.withB(true)))),
kStringUnionStructWrapperResponse_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, //
0x00, 0x00, 0x00, 0x00, 0x25, 0x32, 0xa0, 0x32, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'RegressionNoUnionLauncherCreateComponentRequest_v1',
CreateComponentRequest(
launchInfo: LaunchInfo(
url:
'fuchsia-pkg://fuchsia.com/fidl_compatibility_test_server_rust_write_xunion#meta/fidl_compatibility_test_server_rust_write_xunion.cmx',
directoryRequest: 0xffffffff),
controller: 0xffffffff),
kCreateComponentRequest_Type,
Uint8List.fromList([
0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
0x66, 0x75, 0x63, 0x68, 0x73, 0x69, 0x61, 0x2d, //
0x70, 0x6b, 0x67, 0x3a, 0x2f, 0x2f, 0x66, 0x75, //
0x63, 0x68, 0x73, 0x69, 0x61, 0x2e, 0x63, 0x6f, //
0x6d, 0x2f, 0x66, 0x69, 0x64, 0x6c, 0x5f, 0x63, //
0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, //
0x6c, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x65, 0x73, //
0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, //
0x5f, 0x72, 0x75, 0x73, 0x74, 0x5f, 0x77, 0x72, //
0x69, 0x74, 0x65, 0x5f, 0x78, 0x75, 0x6e, 0x69, //
0x6f, 0x6e, 0x23, 0x6d, 0x65, 0x74, 0x61, 0x2f, //
0x66, 0x69, 0x64, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, //
0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, //
0x74, 0x79, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, //
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x72, //
0x75, 0x73, 0x74, 0x5f, 0x77, 0x72, 0x69, 0x74, //
0x65, 0x5f, 0x78, 0x75, 0x6e, 0x69, 0x6f, 0x6e, //
0x2e, 0x63, 0x6d, 0x78, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'CompatTable_v1',
CompatTable(
value: CompatTableValue(
unionMember: CompatUnion.withB(true),
arrayMember:
Uint32List.fromList([0x5129679d, 0x9491b48e, 0x93d21b51]),
tableMember: CompatTableString(s: 'AB'),
xunionMember: CompatXUnion.withS('CD')),
empty: ''),
kCompatTable_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x9d, 0x67, 0x29, 0x51, 0x8e, 0xb4, 0x91, 0x94, //
0x51, 0x1b, 0xd2, 0x93, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x41, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xa8, 0xef, 0xf8, 0x5a, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'MixedFields_v1',
MixedFieldsMessage(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: MixedFieldsBody(
before: 0x4030201,
firstUnion: UnionSize8Align4.withVariant(0xc0b0a09),
middleStart: 0xb0a,
middleEnd: 0x102030405060708,
secondUnion: UnionSize8Align4.withVariant(0xc0b0a090),
after: 0x8070605)),
kMixedFieldsMessage_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
0x90, 0xa0, 0xb0, 0xc0, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'TableWithXUnion_v1',
StructOfTableWithXUnion(
value: TableWithXUnion(member: CompatXUnion.withS('AB'))),
kStructOfTableWithXUnion_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa8, 0xef, 0xf8, 0x5a, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x41, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'UnionWithBoundString_v1',
UnionWithBoundStringStruct(
v: UnionWithBoundString.withBoundFiveStr('abcd')),
kUnionWithBoundStringStruct_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x61, 0x62, 0x63, 0x64, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'UnionMigration_SingleVariant_v1',
SingleVariantUnionStruct(u: SingleVariantUnion.withX(0x2a)),
kSingleVariantUnionStruct_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
EncodeSuccessCase.run(
Encoders.v1,
'ReverseOrdinalUnion_v1',
ReverseOrdinalUnionStruct(u: ReverseOrdinalUnion.withX(0x2a)),
kReverseOrdinalUnionStruct_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
});
group('decode success cases', () {
DecodeSuccessCase.run(
Decoders.v1,
'AddEthernetDeviceRequest_v1',
TestAddEthernetDeviceRequest(
topologicalPath: '@/dev/sys/pci/00:03.0/e1000/ethernet',
config: InterfaceConfig(
name: 'ethp0003',
ipAddressConfig: IpAddressConfig.withDhcp(true)),
thisShouldBeAHandle: 0xffffffff),
kTestAddEthernetDeviceRequest_Type,
Uint8List.fromList([
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
0x40, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x73, 0x79, //
0x73, 0x2f, 0x70, 0x63, 0x69, 0x2f, 0x30, 0x30, //
0x3a, 0x30, 0x33, 0x2e, 0x30, 0x2f, 0x65, 0x31, //
0x30, 0x30, 0x30, 0x2f, 0x65, 0x74, 0x68, 0x65, //
0x72, 0x6e, 0x65, 0x74, 0x00, 0x00, 0x00, 0x00, //
0x65, 0x74, 0x68, 0x70, 0x30, 0x30, 0x30, 0x33, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Optionals_v1',
StructWithOptionals(
s: EmptyStruct(),
s2: EmptyStruct(),
t: TableWithEmptyStruct(s: EmptyStruct()),
xu: XUnionWithEmptyStruct.withS(EmptyStruct()),
xu2: XUnionWithEmptyStruct.withS(EmptyStruct()),
u: UnionWithEmptyStruct.withS(EmptyStruct()),
u2: UnionWithEmptyStruct.withS(EmptyStruct())),
kStructWithOptionals_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xfe, 0xe0, 0x99, 0x74, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xfe, 0xe0, 0x99, 0x74, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1Case1_v1',
Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
kSandwich1_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1Case1WithHdr_v1',
Sandwich1Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605)),
kSandwich1Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1WithOptUnionPresent_v1',
Sandwich1WithOptUnion(
before: 0x4030201,
optUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
kSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1WithOptUnionAbsent_v1',
Sandwich1WithOptUnion(before: 0x4030201, after: 0x8070605),
kSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich2Case1_v1',
Sandwich2(
before: 0x4030201,
theUnion: UnionSize12Align4.withVariant(
Uint8List.fromList([0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5])),
after: 0x8070605),
kSandwich2_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich3Case1_v1',
Sandwich3(
before: 0x4030201,
theUnion: UnionSize24Align8.withVariant(StructSize16Align8(
f1: 0xa7a6a5a4a3a2a1a0, f2: 0xafaeadacabaaa9a8)),
after: 0x8070605),
kSandwich3_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Case1_v1',
Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605),
kSandwich4_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Case1WithHdr_v1',
Sandwich4Message(
header: TransactionHeader(
txId: 0x0,
flags: Uint8List.fromList([0x0, 0x0, 0x0]),
magicNumber: 0x0,
ordinal: 0x0),
body: Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605)),
kSandwich4Message_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich5Case1_v1',
Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize8align4(
UnionSize8Align4.withVariant(0xc0b0a09)),
after: 0x8070605),
kSandwich5_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich5Case1WithHdr_v1',
Sandwich5Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize8align4(
UnionSize8Align4.withVariant(0xc0b0a09)),
after: 0x8070605)),
kSandwich5Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich5Case2_v1',
Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize24align8(
UnionSize24Align8.withVariant(StructSize16Align8(
f1: 0xa7a6a5a4a3a2a1a0, f2: 0xafaeadacabaaa9a8))),
after: 0x8070605),
kSandwich5_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich5Case2WithHdr_v1',
Sandwich5Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich5(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize24align8(
UnionSize24Align8.withVariant(StructSize16Align8(
f1: 0xa7a6a5a4a3a2a1a0, f2: 0xafaeadacabaaa9a8))),
after: 0x8070605)),
kSandwich5Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case1_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorOfUint8(
Uint8List.fromList([0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5])),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case1AbsentVector_v1',
Sandwich6(
before: 0x4030201,
theUnion:
UnionWithVector.withVectorOfUint8(Uint8List.fromList([])),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case2_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withS('soft migrations rock!'),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case3_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorS3A1([
StructSize3Align1(
threeBytes: Uint8List.fromList([0x73, 0x6f, 0x66])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0x20, 0x6d, 0x69])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0x72, 0x61, 0x74]))
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x20, 0x6d, 0x69, 0x72, 0x61, //
0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case4_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorS3A2([
StructSize3Align2(f1: 0x6f73, f2: 0x66),
StructSize3Align2(f1: 0x6d20, f2: 0x69),
StructSize3Align2(f1: 0x6172, f2: 0x74)
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x00, 0x20, 0x6d, 0x69, 0x00, //
0x72, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case5_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withHandles(
Uint32List.fromList([0xffffffff, 0xffffffff, 0xffffffff])),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case6_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withArrayS3A1([
StructSize3Align1(
threeBytes: Uint8List.fromList([0xa1, 0xa2, 0xa3])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0xa4, 0xa5, 0xa6]))
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case7_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withArrayS3A2([
StructSize3Align2(f1: 0xa2a1, f2: 0xa3),
StructSize3Align2(f1: 0xa5a4, f2: 0xa6)
]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xa1, 0xa2, 0xa3, 0x00, 0xa4, 0xa5, 0xa6, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case8_v1',
Sandwich6(
before: 0x4030201,
theUnion: UnionWithVector.withVectorUnion(
[UnionSize8Align4.withVariant(0xc0b0a09)]),
after: 0x8070605),
kSandwich6_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich7Case1_v1',
Sandwich7(
before: 0x14131211,
optSandwich1: Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
after: 0x24232221),
kSandwich7_Type,
Uint8List.fromList([
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich7Case1WithHdr_v1',
Sandwich7Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich7(
before: 0x14131211,
optSandwich1: Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605),
after: 0x24232221)),
kSandwich7Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich7Case2_v1',
Sandwich7(before: 0x14131211, after: 0x24232221),
kSandwich7_Type,
Uint8List.fromList([
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich7Case2WithHdr_v1',
Sandwich7Message(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: Sandwich7(before: 0x14131211, after: 0x24232221)),
kSandwich7Message_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression1_v1',
Regression1(f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
kRegression1_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression2_v1',
Regression2(
head: Regression1(
f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
f7: 0x7),
kRegression2_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression3Absent_v1',
Regression3(),
kRegression3_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression3Present_v1',
Regression3(
optValue: Regression2(
head: Regression1(
f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
f7: 0x7)),
kRegression3_Type,
Uint8List.fromList([
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Size5Alignment1Array_v1',
Size5Alignment1Array(a: [
Size5Alignment1(
data: Uint8List.fromList([0x1, 0x2, 0x3, 0x4, 0x5])),
Size5Alignment1(
data: Uint8List.fromList([0x6, 0x7, 0x8, 0x9, 0xa])),
Size5Alignment1(data: Uint8List.fromList([0xb, 0xc, 0xd, 0xe, 0xf]))
]),
kSize5Alignment1Array_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Size5Alignment4Array_v1',
Size5Alignment4Array(a: [
Size5Alignment4(four: 0x4030201, one: 0x5),
Size5Alignment4(four: 0x9080706, one: 0xa),
Size5Alignment4(four: 0xe0d0c0b, one: 0xf)
]),
kSize5Alignment4Array_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, //
0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00, //
0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Size5Alignment1Vector_v1',
Size5Alignment1Vector(v: [
Size5Alignment1(
data: Uint8List.fromList([0x1, 0x2, 0x3, 0x4, 0x5])),
Size5Alignment1(data: Uint8List.fromList([0x6, 0x7, 0x8, 0x9, 0xa]))
]),
kSize5Alignment1Vector_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
0x09, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Size5Alignment4Vector_v1',
Size5Alignment4Vector(v: [
Size5Alignment4(four: 0x4030201, one: 0x5),
Size5Alignment4(four: 0x9080706, one: 0xa)
]),
kSize5Alignment4Vector_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00, //
0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Table_NoFields_v1',
StructTableNoFields(t: TableNoFields()),
kStruct_Table_NoFields_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Table_TwoReservedFields_v1',
StructTableTwoReservedFields(t: TableTwoReservedFields()),
kStruct_Table_TwoReservedFields_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Table_StructWithReservedSandwich_v1',
TableStructWithReservedSandwichStruct(
table: TableStructWithReservedSandwich(
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x9, 0xa, 0xb])),
s2: StructSize3Align1(
threeBytes: Uint8List.fromList([0x19, 0x1a, 0x1b])))),
kTable_StructWithReservedSandwichStruct_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x19, 0x1a, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Table_StructWithUint32Sandwich_v1',
TableStructWithUint32SandwichStruct(
table: TableStructWithUint32Sandwich(
i: 0x4030201,
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x9, 0xa, 0xb])),
s2: StructSize3Align1(
threeBytes: Uint8List.fromList([0x19, 0x1a, 0x1b])),
i2: 0xd0c0b0a)),
kTable_StructWithUint32SandwichStruct_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x19, 0x1a, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x0a, 0x0b, 0x0c, 0x0d, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Table_UnionWithVector_ReservedSandwich_v1',
TableUnionWithVectorReservedSandwichStruct(
table: TableUnionWithVectorReservedSandwich(
uv: UnionWithVector.withS('hello'))),
kTable_UnionWithVector_ReservedSandwichStruct_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Table_UnionWithVector_StructSandwich_v1',
TableUnionWithVectorStructSandwichStruct(
table: TableUnionWithVectorStructSandwich(
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x1, 0x2, 0x3])),
uv: UnionWithVector.withS('hello'),
s2: StructSize3Align1(
threeBytes: Uint8List.fromList([0x4, 0x5, 0x6])))),
kTable_UnionWithVector_StructSandwichStruct_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'XUnionWithStruct_v1',
XUnionWithStructStruct(
xu: XUnionWithStruct.withS(StructSize3Align1(
threeBytes: Uint8List.fromList([0x1, 0x2, 0x3])))),
kXUnionWithStructStruct_Type,
Uint8List.fromList([
0x14, 0x5c, 0x3e, 0x19, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'ArrayStruct_v1',
ArrayStruct(unions: [
StringUnion.withS('one'),
StringUnion.withS('two'),
StringUnion.withS('three')
], optionalUnions: [
StringUnion.withS('four'),
StringUnion.withS('five'),
StringUnion.withS('six')
]),
kArrayStruct_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x66, 0x6f, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x66, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x69, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'TransformerEmptyStruct_v1',
TransformerEmptyStruct(),
kTransformerEmptyStruct_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'EmptyStructUnion_v1',
EmptyStructUnionStruct(
u: EmptyStructUnion.withEs(TransformerEmptyStruct())),
kEmptyStructUnionStruct_Type,
Uint8List.fromList([
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'NoCodingTablesStressor_v1',
NoCodingTablesStressor(
f1: 0x1111111111111111,
f2: 0x2222222222222222,
u1: UnionSize36Align4.withVariant(Uint8List.fromList([
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33,
0x33
])),
f3: 0x4444444444444444,
f4: 0x5555555555555555,
u2: UnionSize36Align4.withVariant(Uint8List.fromList([
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66
])),
f5: 0x7777777777777777,
f6: 0x8888888888888888,
u3: UnionSize36Align4.withVariant(Uint8List.fromList([
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99,
0x99
])),
f7: 0xaaaaaaaaaaaaaaaa,
p1: Size8Align8(data: 0xeeeeeeeeeeeeeeee),
f8: 0xbbbbbbbbbbbbbbbb,
p2: Size8Align8(data: 0xeeeeeeeeeeeeeeee),
f9: 0xdddddddddddddddd),
kNoCodingTablesStressor_Type,
Uint8List.fromList([
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, //
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, //
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, //
0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, //
0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'OutOfLineSandwich1Case1_v1',
OutOfLineSandwich1(
before: 'soft migrations rock!',
v: [
Sandwich1(
before: 0x4030201,
theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605)
],
after: 'hard transitions suck!'),
kOutOfLineSandwich1_Type,
Uint8List.fromList([
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x61, 0x72, 0x64, 0x20, 0x74, 0x72, 0x61, //
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, //
0x20, 0x73, 0x75, 0x63, 0x6b, 0x21, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'OutOfLineSandwich1WithOptUnionPresent_v1',
OutOfLineSandwich1WithOptUnion(
before: 'soft migrations rock!',
v: [
Sandwich1WithOptUnion(
before: 0x4030201,
optUnion: UnionSize8Align4.withVariant(0xc0b0a09),
after: 0x8070605)
],
after: 'hard transitions suck!'),
kOutOfLineSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x61, 0x72, 0x64, 0x20, 0x74, 0x72, 0x61, //
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, //
0x20, 0x73, 0x75, 0x63, 0x6b, 0x21, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'OutOfLineSandwich1WithOptUnionAbsent_v1',
OutOfLineSandwich1WithOptUnion(
before: 'soft migrations rock!',
v: [Sandwich1WithOptUnion(before: 0x4030201, after: 0x8070605)],
after: 'hard transitions suck!'),
kOutOfLineSandwich1WithOptUnion_Type,
Uint8List.fromList([
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x73, 0x6f, 0x66, 0x74, 0x20, 0x6d, 0x69, 0x67, //
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, //
0x72, 0x6f, 0x63, 0x6b, 0x21, 0x00, 0x00, 0x00, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x61, 0x72, 0x64, 0x20, 0x74, 0x72, 0x61, //
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, //
0x20, 0x73, 0x75, 0x63, 0x6b, 0x21, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression4_v1',
Regression4(
f1: 0x1,
f2: 0x2,
s1: StructSize3Align1(
threeBytes: Uint8List.fromList([0x9, 0xa, 0xb])),
f3: 0x3,
f4: 0x4,
f5: 0x5,
f6: 0x6),
kRegression4_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x03, 0x04, 0x00, 0x00, 0x00, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression5Enums_v1',
Regression5(
f1: 0x1,
f2: 0x3231302f,
f3: 0x8,
f4: 0x1615,
f5: 0x64636261605f5e5d,
f6: 0x8),
kRegression5_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x2f, 0x30, 0x31, 0x32, //
0x08, 0x00, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, //
0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression6Bits_v1',
Regression6(
f1: 0x1,
f2: 0x3231302f,
f3: 0x8,
f4: 0x1615,
f5: 0x64636261605f5e5d,
f6: 0x8),
kRegression6_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x2f, 0x30, 0x31, 0x32, //
0x08, 0x00, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, //
0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression7TableUnionXUnion_v1',
Regression7TableUnionXUnion(
value: TableOfUnionThenXUnionThenTableThenXUnionThenUnion(
member: UnionOfXUnionThenTableThenXUnionThenUnion.withVariant(
XUnionOfTableThenXUnionThenUnion.withVariant(
TableOfXUnionThenUnion(
member: XUnionOfUnion.withVariant(
UnionAtTheBottom.withTiny(0x8))))))),
kRegression7TableUnionXUnion_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x4e, 0x61, 0xb8, 0x22, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x94, 0x05, 0x22, 0x38, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression8OptUnionSize12Aligned4_v1',
Regression8OptUnionSize12Align4(
optUnion1: UnionSize12Align4.withVariant(
Uint8List.fromList([0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6])),
optUnion3: UnionSize12Align4.withVariant(
Uint8List.fromList([0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6]))),
kRegression8OptUnionSize12Align4_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression8VectorOfOptUnionSize12Aligned4_v1',
Regression8VectorOfOptUnionSize12Align4(value: [
null,
UnionSize12Align4.withVariant(
Uint8List.fromList([0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6])),
null,
UnionSize12Align4.withVariant(
Uint8List.fromList([0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6])),
null
]),
kRegression8VectorOfOptUnionSize12Align4_Type,
Uint8List.fromList([
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression8TableWithUnionSize12Aligned4_v1',
Regression8TableWithUnionSize12Align4(
value: TableWithUnionSize12Align4(
before: 0xaa,
member: UnionSize12Align4.withVariant(
Uint8List.fromList([0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6])),
after: 0xbb)),
kRegression8TableWithUnionSize12Align4_Type,
Uint8List.fromList([
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0x00, 0x00, //
0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Regression9Response_v1',
Regression9Message(
header: TransactionHeader(
txId: 0x1,
flags: Uint8List.fromList([0x1, 0x0, 0x0]),
magicNumber: 0x1,
ordinal: 0x56cbc96900000000),
body: Regression9Result.withOk(Regression9Value(
u: StringBoolUnion.withS('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'),
nullableU: StringBoolUnion.withB(false)))),
kRegression9Message_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, //
0x00, 0x00, 0x00, 0x00, 0x69, 0xc9, 0xcb, 0x56, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Align8_v1',
Sandwich4Align8(
sandwich4: Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605),
alignment8Enforcement: 0x100f0e0d0c0b0a09),
kSandwich4Align8_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Align8WithPointer_v1',
Sandwich4Align8WithPointer(
sandwich4: Sandwich4(
before: 0x4030201,
theUnion: UnionSize36Align4.withVariant(Uint8List.fromList([
0xa0,
0xa1,
0xa2,
0xa3,
0xa4,
0xa5,
0xa6,
0xa7,
0xa8,
0xa9,
0xaa,
0xab,
0xac,
0xad,
0xae,
0xaf,
0xb0,
0xb1,
0xb2,
0xb3,
0xb4,
0xb5,
0xb6,
0xb7,
0xb8,
0xb9,
0xba,
0xbb,
0xbc,
0xbd,
0xbe,
0xbf
])),
after: 0x8070605),
alignment8Enforcement: Size8Align8(data: 0x100f0e0d0c0b0a09)),
kSandwich4Align8WithPointer_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, //
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, //
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich8Case1_v1',
Sandwich8(
before: 0x4030201,
unionOfUnion: UnionOfUnion.withSize8align4(
UnionSize8Align4.withVariant(0xc0b0a09)),
after: 0x8070605),
kSandwich8_Type,
Uint8List.fromList([
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'Sandwich9Case1_v1',
Sandwich9(
before: 0x201,
theUnion: UnionWithVectorOfVectors.withV([
[
StructSize3Align1(
threeBytes: Uint8List.fromList([0x10, 0x11, 0x12])),
StructSize3Align1(
threeBytes: Uint8List.fromList([0x13, 0x14, 0x15]))
]
]),
after: 0x1211),
kSandwich9_Type,
Uint8List.fromList([
0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x10, 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x13, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'SimpleTableArrayStruct_v1',
SimpleTableArrayStruct(theArray: [
TransformerSimpleTable(value: 0xa3a2a1a0),
TransformerSimpleTable(value: 0xb3b2b1b0)
]),
kSimpleTableArrayStruct_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa0, 0xa1, 0xa2, 0xa3, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'StringUnionVector_v1',
StringUnionVector(theVector: [
StringUnion.withS('hello'),
StringUnion.withU8(0xaa),
StringUnion.withU8(0xbb)
]),
kStringUnionVector_Type,
Uint8List.fromList([
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'StringUnionStructWrapperResponse_v1',
StringUnionStructWrapperResponse(
header: TransactionHeader(
txId: 0x0,
flags: Uint8List.fromList([0x1, 0x0, 0x0]),
magicNumber: 0x1,
ordinal: 0x32a0322500000000),
body: StringUnionStructWrapper(
sus: StringUnionStruct(
u: StringBoolUnion.withS('hello'),
nullableU: StringBoolUnion.withB(true)))),
kStringUnionStructWrapperResponse_Type,
Uint8List.fromList([
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, //
0x00, 0x00, 0x00, 0x00, 0x25, 0x32, 0xa0, 0x32, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'RegressionNoUnionLauncherCreateComponentRequest_v1',
CreateComponentRequest(
launchInfo: LaunchInfo(
url:
'fuchsia-pkg://fuchsia.com/fidl_compatibility_test_server_rust_write_xunion#meta/fidl_compatibility_test_server_rust_write_xunion.cmx',
directoryRequest: 0xffffffff),
controller: 0xffffffff),
kCreateComponentRequest_Type,
Uint8List.fromList([
0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
0x66, 0x75, 0x63, 0x68, 0x73, 0x69, 0x61, 0x2d, //
0x70, 0x6b, 0x67, 0x3a, 0x2f, 0x2f, 0x66, 0x75, //
0x63, 0x68, 0x73, 0x69, 0x61, 0x2e, 0x63, 0x6f, //
0x6d, 0x2f, 0x66, 0x69, 0x64, 0x6c, 0x5f, 0x63, //
0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, //
0x6c, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x65, 0x73, //
0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, //
0x5f, 0x72, 0x75, 0x73, 0x74, 0x5f, 0x77, 0x72, //
0x69, 0x74, 0x65, 0x5f, 0x78, 0x75, 0x6e, 0x69, //
0x6f, 0x6e, 0x23, 0x6d, 0x65, 0x74, 0x61, 0x2f, //
0x66, 0x69, 0x64, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, //
0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, //
0x74, 0x79, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, //
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x72, //
0x75, 0x73, 0x74, 0x5f, 0x77, 0x72, 0x69, 0x74, //
0x65, 0x5f, 0x78, 0x75, 0x6e, 0x69, 0x6f, 0x6e, //
0x2e, 0x63, 0x6d, 0x78, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'CompatTable_v1',
CompatTable(
value: CompatTableValue(
unionMember: CompatUnion.withB(true),
arrayMember:
Uint32List.fromList([0x5129679d, 0x9491b48e, 0x93d21b51]),
tableMember: CompatTableString(s: 'AB'),
xunionMember: CompatXUnion.withS('CD')),
empty: ''),
kCompatTable_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x9d, 0x67, 0x29, 0x51, 0x8e, 0xb4, 0x91, 0x94, //
0x51, 0x1b, 0xd2, 0x93, 0x00, 0x00, 0x00, 0x00, //
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x41, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xa8, 0xef, 0xf8, 0x5a, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'MixedFields_v1',
MixedFieldsMessage(
header: TransactionHeader(
txId: 0xf3f2f1f0,
flags: Uint8List.fromList([0xf4, 0xf5, 0xf6]),
magicNumber: 0xf7,
ordinal: 0xfffefdfcfbfaf9f8),
body: MixedFieldsBody(
before: 0x4030201,
firstUnion: UnionSize8Align4.withVariant(0xc0b0a09),
middleStart: 0xb0a,
middleEnd: 0x102030405060708,
secondUnion: UnionSize8Align4.withVariant(0xc0b0a090),
after: 0x8070605)),
kMixedFieldsMessage_Type,
Uint8List.fromList([
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, //
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, //
0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x0a, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, //
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, //
0x90, 0xa0, 0xb0, 0xc0, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'TableWithXUnion_v1',
StructOfTableWithXUnion(
value: TableWithXUnion(member: CompatXUnion.withS('AB'))),
kStructOfTableWithXUnion_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0xa8, 0xef, 0xf8, 0x5a, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x41, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'UnionWithBoundString_v1',
UnionWithBoundStringStruct(
v: UnionWithBoundString.withBoundFiveStr('abcd')),
kUnionWithBoundStringStruct_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x61, 0x62, 0x63, 0x64, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'UnionMigration_SingleVariant_v1',
SingleVariantUnionStruct(u: SingleVariantUnion.withX(0x2a)),
kSingleVariantUnionStruct_Type,
Uint8List.fromList([
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
DecodeSuccessCase.run(
Decoders.v1,
'ReverseOrdinalUnion_v1',
ReverseOrdinalUnionStruct(u: ReverseOrdinalUnion.withX(0x2a)),
kReverseOrdinalUnionStruct_Type,
Uint8List.fromList([
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
]));
});
group('encode failure cases', () {
EncodeFailureCase.run(
Encoders.v1,
'StringExceedsLimit_v1',
Length2StringWrapper(length2String: 'abc'),
kLength2StringWrapper_Type,
fidl.FidlErrorCode.fidlStringTooLong);
EncodeFailureCase.run(
Encoders.v1,
'UnionWithBoundString_ExceedsBounds_v1',
UnionWithBoundStringStruct(
v: UnionWithBoundString.withBoundFiveStr('abcdef')),
kUnionWithBoundStringStruct_Type,
fidl.FidlErrorCode.fidlStringTooLong);
});
group('decode failure cases', () {});
});
}