[fidl] Generate unions as xunions
Test: fx run-test fidl_bindings_test
Test: fx run-test fidl_compatibility_test_topaz
Test: fx run-host-tests fidlgen_dart_backend_ir_test
Change-Id: If781e9d28e3e2d5639da54a50ec6833339c7e379
diff --git a/BUILD.gn b/BUILD.gn
index 2a289c1..81685ea 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -92,7 +92,6 @@
"//topaz/bin/fidl_bindings_test/server:fidl_bindings_test_server",
"//topaz/bin/fidl_bindings_test/test:fidl_bindings_test",
"//topaz/bin/fidl_compatibility_test:fidl_compatibility_test_topaz",
- "//topaz/bin/fidl_compatibility_test/dart:fidl_dart_compatibility_test_server",
"//topaz/bin/fidl_compatibility_test/dart:fidl_dart_write_xunion_compatibility_test_server",
"//topaz/bin/fidlgen_dart:fidlgen_dart_backend_ir_test($host_toolchain)",
"//topaz/bin/fidlgen_dart:fidlgen_dart_backend_test($host_toolchain)",
diff --git a/bin/fidl_bindings_test/test/test/conformance_test.dart b/bin/fidl_bindings_test/test/test/conformance_test.dart
index 158ea5f..0d786fb 100644
--- a/bin/fidl_bindings_test/test/test/conformance_test.dart
+++ b/bin/fidl_bindings_test/test/test/conformance_test.dart
@@ -16,412 +16,6 @@
group('conformance', () {
group('encode success cases', () {
EncodeSuccessCase.run(
- Encoders.old,
- '3ByteObjectAlignmentInStruct_old',
- ThreeByteInStruct(
- elem1: ThreeByte(elem1: 0x1, elem2: 0x2, elem3: 0x3),
- elem2: ThreeByte(elem1: 0x4, elem2: 0x5, elem3: 0x6),
- elem3: ThreeByte(elem1: 0x7, elem2: 0x8, elem3: 0x9)),
- kThreeByteInStruct_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- '5ByteObjectAlignmentInStruct_old',
- FiveByteInStruct(
- elem1: FiveByte(elem1: 0x1020304, elem2: 0x5),
- elem2: FiveByte(elem1: 0x6070809, elem2: 0xa),
- elem3: FiveByte(elem1: 0xb0c0d0e, elem2: 0xf)),
- kFiveByteInStruct_Type,
- Uint8List.fromList([
- 0x04, 0x03, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, //
- 0x09, 0x08, 0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, //
- 0x0e, 0x0d, 0x0c, 0x0b, 0x0f, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- '3ByteObjectAlignmentInVector_old',
- ThreeByteInVector(elems: [
- ThreeByte(elem1: 0x1, elem2: 0x2, elem3: 0x3),
- ThreeByte(elem1: 0x4, elem2: 0x5, elem3: 0x6),
- ThreeByte(elem1: 0x7, elem2: 0x8, elem3: 0x9)
- ]),
- kThreeByteInVector_Type,
- Uint8List.fromList([
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- '5ByteObjectAlignmentInVector_old',
- FiveByteInVector(elems: [
- FiveByte(elem1: 0x1020304, elem2: 0x5),
- FiveByte(elem1: 0x6070809, elem2: 0xa),
- FiveByte(elem1: 0xb0c0d0e, elem2: 0xf)
- ]),
- kFiveByteInVector_Type,
- Uint8List.fromList([
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x04, 0x03, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, //
- 0x09, 0x08, 0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, //
- 0x0e, 0x0d, 0x0c, 0x0b, 0x0f, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- '3ByteObjectAlignmentInArray_old',
- ThreeByteInArray(elems: [
- ThreeByte(elem1: 0x1, elem2: 0x2, elem3: 0x3),
- ThreeByte(elem1: 0x4, elem2: 0x5, elem3: 0x6),
- ThreeByte(elem1: 0x7, elem2: 0x8, elem3: 0x9)
- ]),
- kThreeByteInArray_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- '5ByteObjectAlignmentInArray_old',
- FiveByteInArray(elems: [
- FiveByte(elem1: 0x1020304, elem2: 0x5),
- FiveByte(elem1: 0x6070809, elem2: 0xa),
- FiveByte(elem1: 0xb0c0d0e, elem2: 0xf)
- ]),
- kFiveByteInArray_Type,
- Uint8List.fromList([
- 0x04, 0x03, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, //
- 0x09, 0x08, 0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, //
- 0x0e, 0x0d, 0x0c, 0x0b, 0x0f, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'EmptyStruct_old',
- EmptyStruct(),
- kEmptyStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'EmptyStructSandwich_old',
- EmptyStructSandwich(
- before: 'before', es: EmptyStruct(), after: 'after'),
- kEmptyStructSandwich_Type,
- Uint8List.fromList([
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint8Uint16Uint32Uint64_old',
- Uint8Uint16Uint32Uint64(
- f1: 0x1, f2: 0x203, f3: 0x4050607, f4: 0x8090a0b0c0d0e0f),
- kUint8Uint16Uint32Uint64_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x03, 0x02, 0x07, 0x06, 0x05, 0x04, //
- 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint64Uint32Uint16Uint8_old',
- Uint64Uint32Uint16Uint8(
- f1: 0x8090a0b0c0d0e0f, f2: 0x4050607, f3: 0x203, f4: 0x1),
- kUint64Uint32Uint16Uint8_Type,
- Uint8List.fromList([
- 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, //
- 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'SimpleTableEmpty_old',
- StructOfSimpleTable(table: SimpleTable()),
- kStructOfSimpleTable_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'SimpleTableXAndY_old',
- StructOfSimpleTable(table: SimpleTable(x: 0x2a, y: 0x43)),
- kStructOfSimpleTable_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, //
- 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, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'SimpleTableJustY_old',
- StructOfSimpleTable(table: SimpleTable(y: 0x43)),
- kStructOfSimpleTable_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, //
- 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, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'TableWithStringAndVectorNoVectorContent_old',
- StructOfTableWithStringAndVector(
- table: TableWithStringAndVector(foo: 'hello', bar: 0x1b)),
- kStructOfTableWithStringAndVector_Type,
- Uint8List.fromList([
- 0x02, 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, //
- 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, //
- 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'SimpleTableThenUint64_old',
- SimpleTableThenUint64(
- table: SimpleTable(x: 0x2a, y: 0x43), number: 0xdeadbeefdeadbeef),
- kSimpleTableThenUint64_Type,
- Uint8List.fromList([
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, //
- 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, //
- 0x00, 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, //
- 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'ReverseOrdinalTable_old',
- StructOfReverseOrdinalTable(
- table: ReverseOrdinalTable(x: 0xaa, y: 0xbb, z: 0xcc)),
- kStructOfReverseOrdinalTable_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, //
- 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, //
- 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'InlineXUnionInStruct_old',
- TestInlineXUnionInStruct(
- before: 'before',
- xu: SampleXUnion.withU(0xdeadbeef),
- after: 'after'),
- kTestInlineXUnionInStruct_Type,
- Uint8List.fromList([
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xb2, 0x56, 0x9c, 0x38, 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, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'OptionalXUnionInStructAbsent_old',
- TestOptionalXUnionInStruct(before: 'before', after: 'after'),
- kTestOptionalXUnionInStruct_Type,
- Uint8List.fromList([
- 0x06, 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, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'OptionalXUnionInStructPresent_old',
- TestOptionalXUnionInStruct(
- before: 'before',
- xu: SampleXUnion.withU(0xdeadbeef),
- after: 'after'),
- kTestOptionalXUnionInStruct_Type,
- Uint8List.fromList([
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xb2, 0x56, 0x9c, 0x38, 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, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'XUnionInTableXUnionAbsent_old',
- TestXUnionInTable(
- value: XUnionInTable(before: 'before', after: 'after')),
- kTestXUnionInTable_Type,
- Uint8List.fromList([
- 0x03, 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, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'XUnionInTableXUnionPresent_old',
- TestXUnionInTable(
- value: XUnionInTable(
- before: 'before',
- xu: SampleXUnion.withU(0xdeadbeef),
- after: 'after')),
- kTestXUnionInTable_Type,
- Uint8List.fromList([
- 0x03, 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, //
- 0x20, 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, //
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0xb2, 0x56, 0x9c, 0x38, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'StrictXUnion_old',
- TestStrictXUnionInStruct(xu: SampleStrictXUnion.withU(0xdeadbeef)),
- kTestStrictXUnionInStruct_Type,
- Uint8List.fromList([
- 0x72, 0xea, 0xe2, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'AddEthernetDeviceRequest_old',
- 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, //
- 0x01, 0x00, 0x00, 0x00, 0x01, 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, //
- 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, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'AddEthernetDeviceRequest_v1',
TestAddEthernetDeviceRequest(
@@ -450,67 +44,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'FileGetAttrResponse_old',
- FileGetAttrResponse(
- s: 0x7eadbeaf,
- attributes: NodeAttributes(
- mode: 0x962381a4,
- id: 0x1,
- contentSize: 0xe7,
- storageSize: 0xe7,
- linkCount: 0x1,
- creationTime: 0x8877665544332211,
- modificationTime: 0xffeeddccbbaa99)),
- kFileGetAttrResponse_Type,
- Uint8List.fromList([
- 0xaf, 0xbe, 0xad, 0x7e, 0x00, 0x00, 0x00, 0x00, //
- 0xa4, 0x81, 0x23, 0x96, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, //
- 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Optionals_old',
- 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, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 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,
'Optionals_v1',
StructWithOptionals(
@@ -550,419 +83,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Arrays_old',
- StructWithArrays(arrInt: Int32List.fromList([0x1, 0x2]), arrString: [
- 'a',
- 'b'
- ], arrNullableString: [
- 'c',
- null
- ], arrStruct: [
- StructWithInt(x: 0x1),
- StructWithInt(x: 0x2)
- ], arrNullableStruct: [
- null,
- StructWithInt(x: 0x1020304)
- ], arrArrInt: [
- Int32List.fromList([0x1, 0x2, 0x3]),
- Int32List.fromList([0x4, 0x5, 0x6])
- ]),
- kStructWithArrays_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 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, //
- 0x01, 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, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, //
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Vectors_old',
- StructWithVectors(
- vecEmpty: Int32List.fromList([]),
- vecInt: Int32List.fromList([0x1, 0x2]),
- vecString: [
- 'a',
- 'b'
- ],
- vecNullableString: [
- null,
- 'c',
- null
- ],
- vecStruct: [
- StructWithInt(x: 0x1)
- ],
- vecNullableStruct: [
- null,
- null,
- StructWithInt(x: 0x2)
- ],
- vecVecInt: [
- Int32List.fromList([0x1, 0x2]),
- Int32List.fromList([0x3])
- ]),
- kStructWithVectors_Type,
- Uint8List.fromList([
- 0x00, 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, //
- 0x02, 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, //
- 0x01, 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, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 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, //
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 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, //
- 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 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, 0xff, 0xff, 0xff, 0xff, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 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, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'BoolTrue_old',
- MyBool(value: true),
- kMyBool_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'BoolFalse_old',
- MyBool(value: false),
- kMyBool_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'ByteZero_old',
- MyByte(value: 0x0),
- kMyByte_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Byte255_old',
- MyByte(value: 0xff),
- kMyByte_Type,
- Uint8List.fromList([
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int8Min_old',
- MyInt8(value: -128),
- kMyInt8_Type,
- Uint8List.fromList([
- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int8Zero_old',
- MyInt8(value: 0x0),
- kMyInt8_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int8Max_old',
- MyInt8(value: 0x7f),
- kMyInt8_Type,
- Uint8List.fromList([
- 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int16Min_old',
- MyInt16(value: -32768),
- kMyInt16_Type,
- Uint8List.fromList([
- 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int16Zero_old',
- MyInt16(value: 0x0),
- kMyInt16_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int16Max_old',
- MyInt16(value: 0x7fff),
- kMyInt16_Type,
- Uint8List.fromList([
- 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int32Min_old',
- MyInt32(value: -2147483648),
- kMyInt32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int32Zero_old',
- MyInt32(value: 0x0),
- kMyInt32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int32Max_old',
- MyInt32(value: 0x7fffffff),
- kMyInt32_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int64Min_old',
- MyInt64(value: -9223372036854775808),
- kMyInt64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int64Zero_old',
- MyInt64(value: 0x0),
- kMyInt64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Int64Max_old',
- MyInt64(value: 0x7fffffffffffffff),
- kMyInt64_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint8Zero_old',
- MyUint8(value: 0x0),
- kMyUint8_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint8Max_old',
- MyUint8(value: 0xff),
- kMyUint8_Type,
- Uint8List.fromList([
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint16Zero_old',
- MyUint16(value: 0x0),
- kMyUint16_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint16Max_old',
- MyUint16(value: 0xffff),
- kMyUint16_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint32Zero_old',
- MyUint32(value: 0x0),
- kMyUint32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint32Max_old',
- MyUint32(value: 0xffffffff),
- kMyUint32_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint64Zero_old',
- MyUint64(value: 0x0),
- kMyUint64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Uint64Max_old',
- MyUint64(value: 0xffffffffffffffff),
- kMyUint64_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float32Zero_old',
- MyFloat32(value: 0),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float32One_old',
- MyFloat32(value: 1),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float32MinusOne_old',
- MyFloat32(value: -1),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float32Max_old',
- MyFloat32(value: 3.4028234663852886e+38),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float64Zero_old',
- MyFloat64(value: 0),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float64One_old',
- MyFloat64(value: 1),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float64MinusOne_old',
- MyFloat64(value: -1),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xbf, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Float64Max_old',
- MyFloat64(value: 1.7976931348623157e+308),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f, //
- ]));
-
- EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich1Case1_old',
- Sandwich1(
- before: 0x4030201,
- theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
- after: 0x8070605),
- kSandwich1_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1Case1_v1',
Sandwich1(
@@ -980,21 +100,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich1WithOptUnionPresent_old',
- Sandwich1WithOptUnion(
- before: 0x4030201,
- optUnion: UnionSize8Align4.withVariant(0xc0b0a09),
- after: 0x8070605),
- kSandwich1WithOptUnion_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1WithOptUnionPresent_v1',
Sandwich1WithOptUnion(
@@ -1012,17 +117,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich1WithOptUnionAbsent_old',
- 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich1WithOptUnionAbsent_v1',
Sandwich1WithOptUnion(before: 0x4030201, after: 0x8070605),
@@ -1036,21 +130,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich2Case1_old',
- Sandwich2(
- before: 0x4030201,
- theUnion: UnionSize12Align4.withVariant(
- Uint8List.fromList([0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5])),
- after: 0x8070605),
- kSandwich2_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, //
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x00, 0x00, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich2Case1_v1',
Sandwich2(
@@ -1069,23 +148,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich3Case1_old',
- 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, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich3Case1_v1',
Sandwich3(
@@ -1105,56 +167,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich4Case1_old',
- 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, 0x03, 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Case1_v1',
Sandwich4(
@@ -1208,24 +220,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich5Case1_old',
- Sandwich5(
- before: 0x4030201,
- unionOfUnion: UnionOfUnion.withSize8align4(
- UnionSize8Align4.withVariant(0xc0b0a09)),
- after: 0x8070605),
- kSandwich5_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- 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,
'Sandwich5Case1_v1',
Sandwich5(
@@ -1247,25 +241,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich5Case2_old',
- 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, //
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich5Case2_v1',
Sandwich5(
@@ -1289,24 +264,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case1_old',
- 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, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x06, 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,
'Sandwich6Case1_v1',
Sandwich6(
@@ -1327,23 +284,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case1AbsentVector_old',
- Sandwich6(
- before: 0x4030201,
- theUnion:
- UnionWithVector.withVectorOfUint8(Uint8List.fromList([])),
- after: 0x8070605),
- kSandwich6_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case1AbsentVector_v1',
Sandwich6(
@@ -1363,25 +303,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case2_old',
- Sandwich6(
- before: 0x4030201,
- theUnion: UnionWithVector.withS('soft migrations rock!'),
- after: 0x8070605),
- kSandwich6_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 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,
'Sandwich6Case2_v1',
Sandwich6(
@@ -1403,31 +324,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case3_old',
- 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, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x73, 0x6f, 0x66, 0x20, 0x6d, 0x69, 0x72, 0x61, //
- 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case3_v1',
Sandwich6(
@@ -1455,28 +351,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case4_old',
- 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, //
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x73, 0x6f, 0x66, 0x00, 0x20, 0x6d, 0x69, 0x00, //
- 0x72, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case4_v1',
Sandwich6(
@@ -1501,25 +375,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case5_old',
- 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, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 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, //
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case5_v1',
Sandwich6(
@@ -1541,27 +396,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case6_old',
- 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, //
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case6_v1',
Sandwich6(
@@ -1584,25 +418,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case7_old',
- 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, //
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa1, 0xa2, 0xa3, 0x00, 0xa4, 0xa5, 0xa6, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case7_v1',
Sandwich6(
@@ -1623,24 +438,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich6Case8_old',
- Sandwich6(
- before: 0x4030201,
- theUnion: UnionWithVector.withVectorUnion(
- [UnionSize8Align4.withVariant(0xc0b0a09)]),
- after: 0x8070605),
- kSandwich6_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich6Case8_v1',
Sandwich6(
@@ -1664,25 +461,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich7Case1_old',
- 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, 0x02, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich7Case1_v1',
Sandwich7(
@@ -1706,17 +484,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich7Case2_old',
- 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,
'Sandwich7Case2_v1',
Sandwich7(before: 0x14131211, after: 0x24232221),
@@ -1728,18 +495,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Regression1_old',
- 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,
'Regression1_v1',
Regression1(f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
@@ -1752,22 +507,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Regression2_old',
- 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,
'Regression2_v1',
Regression2(
@@ -1784,15 +523,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Regression3Absent_old',
- Regression3(),
- kRegression3_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Regression3Absent_v1',
Regression3(),
@@ -1802,24 +532,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Regression3Present_old',
- 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,
'Regression3Present_v1',
Regression3(
@@ -1838,22 +550,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Size5Alignment1Array_old',
- 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,
'Size5Alignment1Array_v1',
Size5Alignment1Array(a: [
@@ -1870,21 +566,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Size5Alignment4Array_old',
- 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,
'Size5Alignment4Array_v1',
Size5Alignment4Array(a: [
@@ -1900,22 +581,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Size5Alignment1Vector_old',
- 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,
'Size5Alignment1Vector_v1',
Size5Alignment1Vector(v: [
@@ -1932,21 +597,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Size5Alignment4Vector_old',
- 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,
'Size5Alignment4Vector_v1',
Size5Alignment4Vector(v: [
@@ -1962,29 +612,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Table_StructWithReservedSandwich_old',
- 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_StructWithReservedSandwich_v1',
TableStructWithReservedSandwichStruct(
@@ -2008,35 +635,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Table_StructWithUint32Sandwich_old',
- 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_StructWithUint32Sandwich_v1',
TableStructWithUint32SandwichStruct(
@@ -2066,26 +664,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Table_UnionWithVector_ReservedSandwich_old',
- 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, //
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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_ReservedSandwich_v1',
TableUnionWithVectorReservedSandwichStruct(
@@ -2108,34 +686,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Table_UnionWithVector_StructSandwich_old',
- 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, //
- 0x20, 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, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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,
'Table_UnionWithVector_StructSandwich_v1',
TableUnionWithVectorStructSandwichStruct(
@@ -2166,20 +716,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'XUnionWithStruct_old',
- 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,
'XUnionWithStruct_v1',
XUnionWithStructStruct(
@@ -2194,49 +730,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'ArrayStruct_old',
- 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([
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 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, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 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, //
- 0x01, 0x00, 0x00, 0x00, 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, //
- 0x01, 0x00, 0x00, 0x00, 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,
'ArrayStruct_v1',
ArrayStruct(unions: [
@@ -2289,15 +782,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'TransformerEmptyStruct_old',
- TransformerEmptyStruct(),
- kTransformerEmptyStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'TransformerEmptyStruct_v1',
TransformerEmptyStruct(),
@@ -2307,16 +791,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'EmptyStructUnion_old',
- EmptyStructUnionStruct(
- u: EmptyStructUnion.withEs(TransformerEmptyStruct())),
- kEmptyStructUnionStruct_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'EmptyStructUnion_v1',
EmptyStructUnionStruct(
@@ -2330,155 +804,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'NoCodingTablesStressor_old',
- 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, //
- 0x03, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, //
- 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, //
- 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, //
- 0x03, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, //
- 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, //
- 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, //
- 0x03, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, //
- 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, //
- 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
- 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'NoCodingTablesStressor_v1',
NoCodingTablesStressor(
@@ -2634,36 +959,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'OutOfLineSandwich1Case1_old',
- 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, 0x02, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08, //
- 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,
'OutOfLineSandwich1Case1_v1',
OutOfLineSandwich1(
@@ -2698,38 +993,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'OutOfLineSandwich1WithOptUnionPresent_old',
- 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, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- 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(
@@ -2764,32 +1027,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'OutOfLineSandwich1WithOptUnionAbsent_old',
- 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, //
- 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,
'OutOfLineSandwich1WithOptUnionAbsent_v1',
OutOfLineSandwich1WithOptUnion(
@@ -2818,26 +1055,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Regression4_old',
- 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,
'Regression4_v1',
Regression4(
@@ -2858,59 +1075,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich4Align8_old',
- 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, 0x03, 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Align8_v1',
Sandwich4Align8(
@@ -2967,60 +1131,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich4Align8WithPointer_old',
- 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, 0x03, 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'Sandwich4Align8WithPointer_v1',
Sandwich4Align8WithPointer(
@@ -3078,24 +1188,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich8Case1_old',
- Sandwich8(
- before: 0x4030201,
- unionOfUnion: UnionOfUnion.withSize8align4(
- UnionSize8Align4.withVariant(0xc0b0a09)),
- after: 0x8070605),
- kSandwich8_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- 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,
'Sandwich8Case1_v1',
Sandwich8(
@@ -3117,35 +1209,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'Sandwich9Case1_old',
- 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, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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,
'Sandwich9Case1_v1',
Sandwich9(
@@ -3177,27 +1240,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'SimpleTableArrayStruct_old',
- 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,
'SimpleTableArrayStruct_v1',
SimpleTableArrayStruct(theArray: [
@@ -3219,33 +1261,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'StringUnionVector_old',
- 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, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'StringUnionVector_v1',
StringUnionVector(theVector: [
@@ -3274,46 +1289,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'CreateComponentRequest_old',
- 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,
'CreateComponentRequest_v1',
CreateComponentRequest(
@@ -3354,19 +1329,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'UnionWithBoundString_old',
- UnionWithBoundStringStruct(
- v: UnionWithBoundString.withBoundFiveStr('abcd')),
- kUnionWithBoundStringStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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,
'UnionWithBoundString_v1',
UnionWithBoundStringStruct(
@@ -3382,15 +1344,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'UnionMigration_SingleVariant_old',
- SingleVariantUnionStruct(u: SingleVariantUnion.withX(0x2a)),
- kSingleVariantUnionStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'UnionMigration_SingleVariant_v1',
SingleVariantUnionStruct(u: SingleVariantUnion.withX(0x2a)),
@@ -3403,16 +1356,6 @@
]));
EncodeSuccessCase.run(
- Encoders.old,
- 'ReverseOrdinalUnion_old',
- ReverseOrdinalUnionStruct(u: ReverseOrdinalUnion.withX(0x2a)),
- kReverseOrdinalUnionStruct_Type,
- Uint8List.fromList([
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- EncodeSuccessCase.run(
Encoders.v1,
'ReverseOrdinalUnion_v1',
ReverseOrdinalUnionStruct(u: ReverseOrdinalUnion.withX(0x2a)),
@@ -3427,412 +1370,6 @@
group('decode success cases', () {
DecodeSuccessCase.run(
- Decoders.old,
- '3ByteObjectAlignmentInStruct_old',
- ThreeByteInStruct(
- elem1: ThreeByte(elem1: 0x1, elem2: 0x2, elem3: 0x3),
- elem2: ThreeByte(elem1: 0x4, elem2: 0x5, elem3: 0x6),
- elem3: ThreeByte(elem1: 0x7, elem2: 0x8, elem3: 0x9)),
- kThreeByteInStruct_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- '5ByteObjectAlignmentInStruct_old',
- FiveByteInStruct(
- elem1: FiveByte(elem1: 0x1020304, elem2: 0x5),
- elem2: FiveByte(elem1: 0x6070809, elem2: 0xa),
- elem3: FiveByte(elem1: 0xb0c0d0e, elem2: 0xf)),
- kFiveByteInStruct_Type,
- Uint8List.fromList([
- 0x04, 0x03, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, //
- 0x09, 0x08, 0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, //
- 0x0e, 0x0d, 0x0c, 0x0b, 0x0f, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- '3ByteObjectAlignmentInVector_old',
- ThreeByteInVector(elems: [
- ThreeByte(elem1: 0x1, elem2: 0x2, elem3: 0x3),
- ThreeByte(elem1: 0x4, elem2: 0x5, elem3: 0x6),
- ThreeByte(elem1: 0x7, elem2: 0x8, elem3: 0x9)
- ]),
- kThreeByteInVector_Type,
- Uint8List.fromList([
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- '5ByteObjectAlignmentInVector_old',
- FiveByteInVector(elems: [
- FiveByte(elem1: 0x1020304, elem2: 0x5),
- FiveByte(elem1: 0x6070809, elem2: 0xa),
- FiveByte(elem1: 0xb0c0d0e, elem2: 0xf)
- ]),
- kFiveByteInVector_Type,
- Uint8List.fromList([
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x04, 0x03, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, //
- 0x09, 0x08, 0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, //
- 0x0e, 0x0d, 0x0c, 0x0b, 0x0f, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- '3ByteObjectAlignmentInArray_old',
- ThreeByteInArray(elems: [
- ThreeByte(elem1: 0x1, elem2: 0x2, elem3: 0x3),
- ThreeByte(elem1: 0x4, elem2: 0x5, elem3: 0x6),
- ThreeByte(elem1: 0x7, elem2: 0x8, elem3: 0x9)
- ]),
- kThreeByteInArray_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, //
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- '5ByteObjectAlignmentInArray_old',
- FiveByteInArray(elems: [
- FiveByte(elem1: 0x1020304, elem2: 0x5),
- FiveByte(elem1: 0x6070809, elem2: 0xa),
- FiveByte(elem1: 0xb0c0d0e, elem2: 0xf)
- ]),
- kFiveByteInArray_Type,
- Uint8List.fromList([
- 0x04, 0x03, 0x02, 0x01, 0x05, 0x00, 0x00, 0x00, //
- 0x09, 0x08, 0x07, 0x06, 0x0a, 0x00, 0x00, 0x00, //
- 0x0e, 0x0d, 0x0c, 0x0b, 0x0f, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'EmptyStruct_old',
- EmptyStruct(),
- kEmptyStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'EmptyStructSandwich_old',
- EmptyStructSandwich(
- before: 'before', es: EmptyStruct(), after: 'after'),
- kEmptyStructSandwich_Type,
- Uint8List.fromList([
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint8Uint16Uint32Uint64_old',
- Uint8Uint16Uint32Uint64(
- f1: 0x1, f2: 0x203, f3: 0x4050607, f4: 0x8090a0b0c0d0e0f),
- kUint8Uint16Uint32Uint64_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x03, 0x02, 0x07, 0x06, 0x05, 0x04, //
- 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint64Uint32Uint16Uint8_old',
- Uint64Uint32Uint16Uint8(
- f1: 0x8090a0b0c0d0e0f, f2: 0x4050607, f3: 0x203, f4: 0x1),
- kUint64Uint32Uint16Uint8_Type,
- Uint8List.fromList([
- 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, //
- 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'SimpleTableEmpty_old',
- StructOfSimpleTable(table: SimpleTable()),
- kStructOfSimpleTable_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'SimpleTableXAndY_old',
- StructOfSimpleTable(table: SimpleTable(x: 0x2a, y: 0x43)),
- kStructOfSimpleTable_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, //
- 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, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'SimpleTableJustY_old',
- StructOfSimpleTable(table: SimpleTable(y: 0x43)),
- kStructOfSimpleTable_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, //
- 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, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'TableWithStringAndVectorNoVectorContent_old',
- StructOfTableWithStringAndVector(
- table: TableWithStringAndVector(foo: 'hello', bar: 0x1b)),
- kStructOfTableWithStringAndVector_Type,
- Uint8List.fromList([
- 0x02, 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, //
- 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, //
- 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'SimpleTableThenUint64_old',
- SimpleTableThenUint64(
- table: SimpleTable(x: 0x2a, y: 0x43), number: 0xdeadbeefdeadbeef),
- kSimpleTableThenUint64_Type,
- Uint8List.fromList([
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, //
- 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, //
- 0x00, 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, //
- 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'ReverseOrdinalTable_old',
- StructOfReverseOrdinalTable(
- table: ReverseOrdinalTable(x: 0xaa, y: 0xbb, z: 0xcc)),
- kStructOfReverseOrdinalTable_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, //
- 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, //
- 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'InlineXUnionInStruct_old',
- TestInlineXUnionInStruct(
- before: 'before',
- xu: SampleXUnion.withU(0xdeadbeef),
- after: 'after'),
- kTestInlineXUnionInStruct_Type,
- Uint8List.fromList([
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xb2, 0x56, 0x9c, 0x38, 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, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'OptionalXUnionInStructAbsent_old',
- TestOptionalXUnionInStruct(before: 'before', after: 'after'),
- kTestOptionalXUnionInStruct_Type,
- Uint8List.fromList([
- 0x06, 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, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'OptionalXUnionInStructPresent_old',
- TestOptionalXUnionInStruct(
- before: 'before',
- xu: SampleXUnion.withU(0xdeadbeef),
- after: 'after'),
- kTestOptionalXUnionInStruct_Type,
- Uint8List.fromList([
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xb2, 0x56, 0x9c, 0x38, 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, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'XUnionInTableXUnionAbsent_old',
- TestXUnionInTable(
- value: XUnionInTable(before: 'before', after: 'after')),
- kTestXUnionInTable_Type,
- Uint8List.fromList([
- 0x03, 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, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'XUnionInTableXUnionPresent_old',
- TestXUnionInTable(
- value: XUnionInTable(
- before: 'before',
- xu: SampleXUnion.withU(0xdeadbeef),
- after: 'after')),
- kTestXUnionInTable_Type,
- Uint8List.fromList([
- 0x03, 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, //
- 0x20, 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, //
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x00, 0x00, //
- 0xb2, 0x56, 0x9c, 0x38, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'StrictXUnion_old',
- TestStrictXUnionInStruct(xu: SampleStrictXUnion.withU(0xdeadbeef)),
- kTestStrictXUnionInStruct_Type,
- Uint8List.fromList([
- 0x72, 0xea, 0xe2, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xef, 0xbe, 0xad, 0xde, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'AddEthernetDeviceRequest_old',
- 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, //
- 0x01, 0x00, 0x00, 0x00, 0x01, 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, //
- 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, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'AddEthernetDeviceRequest_v1',
TestAddEthernetDeviceRequest(
@@ -3861,67 +1398,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'FileGetAttrResponse_old',
- FileGetAttrResponse(
- s: 0x7eadbeaf,
- attributes: NodeAttributes(
- mode: 0x962381a4,
- id: 0x1,
- contentSize: 0xe7,
- storageSize: 0xe7,
- linkCount: 0x1,
- creationTime: 0x8877665544332211,
- modificationTime: 0xffeeddccbbaa99)),
- kFileGetAttrResponse_Type,
- Uint8List.fromList([
- 0xaf, 0xbe, 0xad, 0x7e, 0x00, 0x00, 0x00, 0x00, //
- 0xa4, 0x81, 0x23, 0x96, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, //
- 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Optionals_old',
- 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, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 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,
'Optionals_v1',
StructWithOptionals(
@@ -3961,419 +1437,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Arrays_old',
- StructWithArrays(arrInt: Int32List.fromList([0x1, 0x2]), arrString: [
- 'a',
- 'b'
- ], arrNullableString: [
- 'c',
- null
- ], arrStruct: [
- StructWithInt(x: 0x1),
- StructWithInt(x: 0x2)
- ], arrNullableStruct: [
- null,
- StructWithInt(x: 0x1020304)
- ], arrArrInt: [
- Int32List.fromList([0x1, 0x2, 0x3]),
- Int32List.fromList([0x4, 0x5, 0x6])
- ]),
- kStructWithArrays_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 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, //
- 0x01, 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, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, //
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Vectors_old',
- StructWithVectors(
- vecEmpty: Int32List.fromList([]),
- vecInt: Int32List.fromList([0x1, 0x2]),
- vecString: [
- 'a',
- 'b'
- ],
- vecNullableString: [
- null,
- 'c',
- null
- ],
- vecStruct: [
- StructWithInt(x: 0x1)
- ],
- vecNullableStruct: [
- null,
- null,
- StructWithInt(x: 0x2)
- ],
- vecVecInt: [
- Int32List.fromList([0x1, 0x2]),
- Int32List.fromList([0x3])
- ]),
- kStructWithVectors_Type,
- Uint8List.fromList([
- 0x00, 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, //
- 0x02, 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, //
- 0x01, 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, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 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, //
- 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 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, //
- 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 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, 0xff, 0xff, 0xff, 0xff, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 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, //
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'BoolTrue_old',
- MyBool(value: true),
- kMyBool_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'BoolFalse_old',
- MyBool(value: false),
- kMyBool_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'ByteZero_old',
- MyByte(value: 0x0),
- kMyByte_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Byte255_old',
- MyByte(value: 0xff),
- kMyByte_Type,
- Uint8List.fromList([
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int8Min_old',
- MyInt8(value: -128),
- kMyInt8_Type,
- Uint8List.fromList([
- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int8Zero_old',
- MyInt8(value: 0x0),
- kMyInt8_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int8Max_old',
- MyInt8(value: 0x7f),
- kMyInt8_Type,
- Uint8List.fromList([
- 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int16Min_old',
- MyInt16(value: -32768),
- kMyInt16_Type,
- Uint8List.fromList([
- 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int16Zero_old',
- MyInt16(value: 0x0),
- kMyInt16_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int16Max_old',
- MyInt16(value: 0x7fff),
- kMyInt16_Type,
- Uint8List.fromList([
- 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int32Min_old',
- MyInt32(value: -2147483648),
- kMyInt32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int32Zero_old',
- MyInt32(value: 0x0),
- kMyInt32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int32Max_old',
- MyInt32(value: 0x7fffffff),
- kMyInt32_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int64Min_old',
- MyInt64(value: -9223372036854775808),
- kMyInt64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int64Zero_old',
- MyInt64(value: 0x0),
- kMyInt64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Int64Max_old',
- MyInt64(value: 0x7fffffffffffffff),
- kMyInt64_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint8Zero_old',
- MyUint8(value: 0x0),
- kMyUint8_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint8Max_old',
- MyUint8(value: 0xff),
- kMyUint8_Type,
- Uint8List.fromList([
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint16Zero_old',
- MyUint16(value: 0x0),
- kMyUint16_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint16Max_old',
- MyUint16(value: 0xffff),
- kMyUint16_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint32Zero_old',
- MyUint32(value: 0x0),
- kMyUint32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint32Max_old',
- MyUint32(value: 0xffffffff),
- kMyUint32_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint64Zero_old',
- MyUint64(value: 0x0),
- kMyUint64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Uint64Max_old',
- MyUint64(value: 0xffffffffffffffff),
- kMyUint64_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float32Zero_old',
- MyFloat32(value: 0),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float32One_old',
- MyFloat32(value: 1),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float32MinusOne_old',
- MyFloat32(value: -1),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float32Max_old',
- MyFloat32(value: 3.4028234663852886e+38),
- kMyFloat32_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float64Zero_old',
- MyFloat64(value: 0),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float64One_old',
- MyFloat64(value: 1),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float64MinusOne_old',
- MyFloat64(value: -1),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xbf, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Float64Max_old',
- MyFloat64(value: 1.7976931348623157e+308),
- kMyFloat64_Type,
- Uint8List.fromList([
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f, //
- ]));
-
- DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich1Case1_old',
- Sandwich1(
- before: 0x4030201,
- theUnion: UnionSize8Align4.withVariant(0xc0b0a09),
- after: 0x8070605),
- kSandwich1_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1Case1_v1',
Sandwich1(
@@ -4391,21 +1454,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich1WithOptUnionPresent_old',
- Sandwich1WithOptUnion(
- before: 0x4030201,
- optUnion: UnionSize8Align4.withVariant(0xc0b0a09),
- after: 0x8070605),
- kSandwich1WithOptUnion_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1WithOptUnionPresent_v1',
Sandwich1WithOptUnion(
@@ -4423,17 +1471,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich1WithOptUnionAbsent_old',
- 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich1WithOptUnionAbsent_v1',
Sandwich1WithOptUnion(before: 0x4030201, after: 0x8070605),
@@ -4447,21 +1484,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich2Case1_old',
- Sandwich2(
- before: 0x4030201,
- theUnion: UnionSize12Align4.withVariant(
- Uint8List.fromList([0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5])),
- after: 0x8070605),
- kSandwich2_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, //
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x00, 0x00, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich2Case1_v1',
Sandwich2(
@@ -4480,23 +1502,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich3Case1_old',
- 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, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich3Case1_v1',
Sandwich3(
@@ -4516,56 +1521,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich4Case1_old',
- 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, 0x03, 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Case1_v1',
Sandwich4(
@@ -4619,24 +1574,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich5Case1_old',
- Sandwich5(
- before: 0x4030201,
- unionOfUnion: UnionOfUnion.withSize8align4(
- UnionSize8Align4.withVariant(0xc0b0a09)),
- after: 0x8070605),
- kSandwich5_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- 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,
'Sandwich5Case1_v1',
Sandwich5(
@@ -4658,25 +1595,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich5Case2_old',
- 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, //
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, //
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich5Case2_v1',
Sandwich5(
@@ -4700,24 +1618,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case1_old',
- 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, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x06, 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,
'Sandwich6Case1_v1',
Sandwich6(
@@ -4738,23 +1638,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case1AbsentVector_old',
- Sandwich6(
- before: 0x4030201,
- theUnion:
- UnionWithVector.withVectorOfUint8(Uint8List.fromList([])),
- after: 0x8070605),
- kSandwich6_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case1AbsentVector_v1',
Sandwich6(
@@ -4774,25 +1657,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case2_old',
- Sandwich6(
- before: 0x4030201,
- theUnion: UnionWithVector.withS('soft migrations rock!'),
- after: 0x8070605),
- kSandwich6_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 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,
'Sandwich6Case2_v1',
Sandwich6(
@@ -4814,31 +1678,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case3_old',
- 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, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x73, 0x6f, 0x66, 0x20, 0x6d, 0x69, 0x72, 0x61, //
- 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case3_v1',
Sandwich6(
@@ -4866,28 +1705,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case4_old',
- 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, //
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x73, 0x6f, 0x66, 0x00, 0x20, 0x6d, 0x69, 0x00, //
- 0x72, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case4_v1',
Sandwich6(
@@ -4912,25 +1729,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case5_old',
- 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, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 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, //
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case5_v1',
Sandwich6(
@@ -4952,27 +1750,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case6_old',
- 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, //
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case6_v1',
Sandwich6(
@@ -4995,25 +1772,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case7_old',
- 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, //
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xa1, 0xa2, 0xa3, 0x00, 0xa4, 0xa5, 0xa6, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case7_v1',
Sandwich6(
@@ -5034,24 +1792,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich6Case8_old',
- Sandwich6(
- before: 0x4030201,
- theUnion: UnionWithVector.withVectorUnion(
- [UnionSize8Align4.withVariant(0xc0b0a09)]),
- after: 0x8070605),
- kSandwich6_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich6Case8_v1',
Sandwich6(
@@ -5075,25 +1815,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich7Case1_old',
- 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, 0x02, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich7Case1_v1',
Sandwich7(
@@ -5117,17 +1838,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich7Case2_old',
- 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,
'Sandwich7Case2_v1',
Sandwich7(before: 0x14131211, after: 0x24232221),
@@ -5139,18 +1849,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Regression1_old',
- 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,
'Regression1_v1',
Regression1(f1: 0x1, f2: 0x2, f3: 0x3, f4: 0x4, f5: 0x5, f6: 0x6),
@@ -5163,22 +1861,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Regression2_old',
- 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,
'Regression2_v1',
Regression2(
@@ -5195,15 +1877,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Regression3Absent_old',
- Regression3(),
- kRegression3_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Regression3Absent_v1',
Regression3(),
@@ -5213,24 +1886,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Regression3Present_old',
- 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,
'Regression3Present_v1',
Regression3(
@@ -5249,22 +1904,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Size5Alignment1Array_old',
- 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,
'Size5Alignment1Array_v1',
Size5Alignment1Array(a: [
@@ -5281,21 +1920,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Size5Alignment4Array_old',
- 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,
'Size5Alignment4Array_v1',
Size5Alignment4Array(a: [
@@ -5311,22 +1935,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Size5Alignment1Vector_old',
- 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,
'Size5Alignment1Vector_v1',
Size5Alignment1Vector(v: [
@@ -5343,21 +1951,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Size5Alignment4Vector_old',
- 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,
'Size5Alignment4Vector_v1',
Size5Alignment4Vector(v: [
@@ -5373,29 +1966,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Table_StructWithReservedSandwich_old',
- 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_StructWithReservedSandwich_v1',
TableStructWithReservedSandwichStruct(
@@ -5419,35 +1989,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Table_StructWithUint32Sandwich_old',
- 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_StructWithUint32Sandwich_v1',
TableStructWithUint32SandwichStruct(
@@ -5477,26 +2018,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Table_UnionWithVector_ReservedSandwich_old',
- 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, //
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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_ReservedSandwich_v1',
TableUnionWithVectorReservedSandwichStruct(
@@ -5519,34 +2040,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Table_UnionWithVector_StructSandwich_old',
- 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, //
- 0x20, 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, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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,
'Table_UnionWithVector_StructSandwich_v1',
TableUnionWithVectorStructSandwichStruct(
@@ -5577,20 +2070,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'XUnionWithStruct_old',
- 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,
'XUnionWithStruct_v1',
XUnionWithStructStruct(
@@ -5605,49 +2084,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'ArrayStruct_old',
- 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([
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 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, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 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, //
- 0x01, 0x00, 0x00, 0x00, 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, //
- 0x01, 0x00, 0x00, 0x00, 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,
'ArrayStruct_v1',
ArrayStruct(unions: [
@@ -5700,15 +2136,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'TransformerEmptyStruct_old',
- TransformerEmptyStruct(),
- kTransformerEmptyStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'TransformerEmptyStruct_v1',
TransformerEmptyStruct(),
@@ -5718,16 +2145,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'EmptyStructUnion_old',
- EmptyStructUnionStruct(
- u: EmptyStructUnion.withEs(TransformerEmptyStruct())),
- kEmptyStructUnionStruct_Type,
- Uint8List.fromList([
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'EmptyStructUnion_v1',
EmptyStructUnionStruct(
@@ -5741,155 +2158,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'NoCodingTablesStressor_old',
- 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, //
- 0x03, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, //
- 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, //
- 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, //
- 0x03, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, //
- 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, //
- 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, //
- 0x03, 0x00, 0x00, 0x00, 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, 0x00, 0x00, 0x00, 0x00, //
- 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, //
- 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
- 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'NoCodingTablesStressor_v1',
NoCodingTablesStressor(
@@ -6045,36 +2313,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'OutOfLineSandwich1Case1_old',
- 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, 0x02, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08, //
- 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,
'OutOfLineSandwich1Case1_v1',
OutOfLineSandwich1(
@@ -6109,38 +2347,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'OutOfLineSandwich1WithOptUnionPresent_old',
- 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, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- 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(
@@ -6175,32 +2381,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'OutOfLineSandwich1WithOptUnionAbsent_old',
- 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, //
- 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,
'OutOfLineSandwich1WithOptUnionAbsent_v1',
OutOfLineSandwich1WithOptUnion(
@@ -6229,26 +2409,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Regression4_old',
- 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,
'Regression4_v1',
Regression4(
@@ -6269,59 +2429,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich4Align8_old',
- 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, 0x03, 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Align8_v1',
Sandwich4Align8(
@@ -6378,60 +2485,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich4Align8WithPointer_old',
- 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, 0x03, 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, //
- 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'Sandwich4Align8WithPointer_v1',
Sandwich4Align8WithPointer(
@@ -6489,24 +2542,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich8Case1_old',
- Sandwich8(
- before: 0x4030201,
- unionOfUnion: UnionOfUnion.withSize8align4(
- UnionSize8Align4.withVariant(0xc0b0a09)),
- after: 0x8070605),
- kSandwich8_Type,
- Uint8List.fromList([
- 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, //
- 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,
'Sandwich8Case1_v1',
Sandwich8(
@@ -6528,35 +2563,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'Sandwich9Case1_old',
- 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, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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,
'Sandwich9Case1_v1',
Sandwich9(
@@ -6588,27 +2594,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'SimpleTableArrayStruct_old',
- 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,
'SimpleTableArrayStruct_v1',
SimpleTableArrayStruct(theArray: [
@@ -6630,33 +2615,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'StringUnionVector_old',
- 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, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'StringUnionVector_v1',
StringUnionVector(theVector: [
@@ -6685,46 +2643,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'CreateComponentRequest_old',
- 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,
'CreateComponentRequest_v1',
CreateComponentRequest(
@@ -6765,19 +2683,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'UnionWithBoundString_old',
- UnionWithBoundStringStruct(
- v: UnionWithBoundString.withBoundFiveStr('abcd')),
- kUnionWithBoundStringStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 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,
'UnionWithBoundString_v1',
UnionWithBoundStringStruct(
@@ -6793,15 +2698,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'UnionMigration_SingleVariant_old',
- SingleVariantUnionStruct(u: SingleVariantUnion.withX(0x2a)),
- kSingleVariantUnionStruct_Type,
- Uint8List.fromList([
- 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'UnionMigration_SingleVariant_v1',
SingleVariantUnionStruct(u: SingleVariantUnion.withX(0x2a)),
@@ -6814,16 +2710,6 @@
]));
DecodeSuccessCase.run(
- Decoders.old,
- 'ReverseOrdinalUnion_old',
- ReverseOrdinalUnionStruct(u: ReverseOrdinalUnion.withX(0x2a)),
- kReverseOrdinalUnionStruct_Type,
- Uint8List.fromList([
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]));
-
- DecodeSuccessCase.run(
Decoders.v1,
'ReverseOrdinalUnion_v1',
ReverseOrdinalUnionStruct(u: ReverseOrdinalUnion.withX(0x2a)),
@@ -6838,13 +2724,6 @@
group('encode failure cases', () {
EncodeFailureCase.run(
- Encoders.old,
- 'StringExceedsLimit_old',
- Length2StringWrapper(length2String: 'abc'),
- kLength2StringWrapper_Type,
- fidl.FidlErrorCode.fidlStringTooLong);
-
- EncodeFailureCase.run(
Encoders.v1,
'StringExceedsLimit_v1',
Length2StringWrapper(length2String: 'abc'),
@@ -6852,14 +2731,6 @@
fidl.FidlErrorCode.fidlStringTooLong);
EncodeFailureCase.run(
- Encoders.old,
- 'UnionWithBoundString_ExceedsBounds_old',
- UnionWithBoundStringStruct(
- v: UnionWithBoundString.withBoundFiveStr('abcdef')),
- kUnionWithBoundStringStruct_Type,
- fidl.FidlErrorCode.fidlStringTooLong);
-
- EncodeFailureCase.run(
Encoders.v1,
'UnionWithBoundString_ExceedsBounds_v1',
UnionWithBoundStringStruct(
@@ -6868,28 +2739,6 @@
fidl.FidlErrorCode.fidlStringTooLong);
});
- group('decode failure cases', () {
- DecodeFailureCase.run(
- Decoders.old,
- 'StrictXUnion Field Unknown_old',
- kTestStrictXUnionInStruct_Type,
- Uint8List.fromList([
- 0x11, 0xba, 0x5e, 0xba, 0x00, 0x00, 0x00, 0x00, //
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //
- 0xde, 0xad, 0xbe, 0xef, 0x5c, 0xa1, 0xab, 0x1e, //
- ]),
- fidl.FidlErrorCode.fidlStrictXUnionUnknownField);
-
- DecodeFailureCase.run(
- Decoders.old,
- 'NonEmptyStringWithNullPtrBody_old',
- kStringWrapper_Type,
- Uint8List.fromList([
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
- ]),
- fidl.FidlErrorCode.fidlNonNullableTypeWithNullValue);
- });
+ group('decode failure cases', () {});
});
}
diff --git a/bin/fidl_bindings_test/test/test/conformance_test_types.dart b/bin/fidl_bindings_test/test/test/conformance_test_types.dart
index a38d316..d2e97fc 100644
--- a/bin/fidl_bindings_test/test/test/conformance_test_types.dart
+++ b/bin/fidl_bindings_test/test/test/conformance_test_types.dart
@@ -42,34 +42,42 @@
// ignore_for_file: avoid_unused_constructor_parameters
enum IpAddressConfigTag {
- paddingSize24Align4,
- dhcp,
+ paddingSize24Align4, // 0x1
+ dhcp, // 0x2
}
-class IpAddressConfig extends $fidl.Union {
+const Map<int, IpAddressConfigTag> _IpAddressConfigTag_map = {
+ 1: IpAddressConfigTag.paddingSize24Align4,
+ 2: IpAddressConfigTag.dhcp,
+};
+
+class IpAddressConfig extends $fidl.XUnion {
const IpAddressConfig.withPaddingSize24Align4(Uint32List value)
- : _data = value,
- _tag = IpAddressConfigTag.paddingSize24Align4;
+ : _ordinal = 1,
+ _data = value;
const IpAddressConfig.withDhcp(bool value)
- : _data = value,
- _tag = IpAddressConfigTag.dhcp;
+ : _ordinal = 2,
+ _data = value;
- IpAddressConfig._(IpAddressConfigTag tag, Object data)
- : _tag = tag,
+ IpAddressConfig._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final IpAddressConfigTag _tag;
+ final int _ordinal;
final _data;
+
+ IpAddressConfigTag get $tag => _IpAddressConfigTag_map[_ordinal];
+
Uint32List get paddingSize24Align4 {
- if (_tag != IpAddressConfigTag.paddingSize24Align4) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
bool get dhcp {
- if (_tag != IpAddressConfigTag.dhcp) {
+ if (_ordinal != 2) {
return null;
}
return _data;
@@ -77,1475 +85,117 @@
@override
String toString() {
- switch (_tag) {
- case IpAddressConfigTag.paddingSize24Align4:
- return r'IpAddressConfig.paddingSize24Align4($paddingSize24Align4)';
- case IpAddressConfigTag.dhcp:
- return r'IpAddressConfig.dhcp($dhcp)';
+ switch (_ordinal) {
+ case 1:
+ return 'IpAddressConfig.paddingSize24Align4($paddingSize24Align4)';
+ case 2:
+ return 'IpAddressConfig.dhcp($dhcp)';
default:
return null;
}
}
- IpAddressConfigTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- IpAddressConfigTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static IpAddressConfig _ctor(int index, Object data) {
- return IpAddressConfig._(IpAddressConfigTag.values[index], data);
+ static IpAddressConfig _ctor(int ordinal, Object data) {
+ return IpAddressConfig._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<IpAddressConfig> kIpAddressConfig_Type =
- $fidl.UnionType<IpAddressConfig>(
- inlineSizeOld: 28,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<Uint32List>(
- type: $fidl.ArrayType<Uint32List>(
- element: $fidl.Uint32Type(), elementCount: 6),
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<bool>(
- type: $fidl.BoolType(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
+const $fidl.XUnionType<IpAddressConfig> kIpAddressConfig_Type =
+ $fidl.XUnionType<IpAddressConfig>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.ArrayType<Uint32List>(
+ element: $fidl.Uint32Type(), elementCount: 6),
+ 2: $fidl.BoolType(),
+ },
ctor: IpAddressConfig._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- },
+ nullable: false,
+ flexible: false,
);
-
-enum UnionWithBoundStringTag {
- boundFiveStr,
-}
-
-class UnionWithBoundString extends $fidl.Union {
- const UnionWithBoundString.withBoundFiveStr(String value)
- : _data = value,
- _tag = UnionWithBoundStringTag.boundFiveStr;
-
- UnionWithBoundString._(UnionWithBoundStringTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionWithBoundStringTag _tag;
- final _data;
- String get boundFiveStr {
- if (_tag != UnionWithBoundStringTag.boundFiveStr) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionWithBoundStringTag.boundFiveStr:
- return r'UnionWithBoundString.boundFiveStr($boundFiveStr)';
- default:
- return null;
- }
- }
-
- UnionWithBoundStringTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionWithBoundStringTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionWithBoundString _ctor(int index, Object data) {
- return UnionWithBoundString._(UnionWithBoundStringTag.values[index], data);
- }
-}
-
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionWithBoundString> kUnionWithBoundString_Type =
- $fidl.UnionType<UnionWithBoundString>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: 5, nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionWithBoundString._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<IpAddressConfig> kIpAddressConfig_OptType =
+ $fidl.XUnionType<IpAddressConfig>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.ArrayType<Uint32List>(
+ element: $fidl.Uint32Type(), elementCount: 6),
+ 2: $fidl.BoolType(),
},
-);
-
-enum SingleVariantUnionTag {
- x,
-}
-
-class SingleVariantUnion extends $fidl.Union {
- const SingleVariantUnion.withX(int value)
- : _data = value,
- _tag = SingleVariantUnionTag.x;
-
- SingleVariantUnion._(SingleVariantUnionTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final SingleVariantUnionTag _tag;
- final _data;
- int get x {
- if (_tag != SingleVariantUnionTag.x) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case SingleVariantUnionTag.x:
- return r'SingleVariantUnion.x($x)';
- default:
- return null;
- }
- }
-
- SingleVariantUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- SingleVariantUnionTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static SingleVariantUnion _ctor(int index, Object data) {
- return SingleVariantUnion._(SingleVariantUnionTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<SingleVariantUnion> kSingleVariantUnion_Type =
- $fidl.UnionType<SingleVariantUnion>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: SingleVariantUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- },
-);
-
-enum ReverseOrdinalUnionTag {
- z,
- y,
- x,
-}
-
-class ReverseOrdinalUnion extends $fidl.Union {
- const ReverseOrdinalUnion.withZ(int value)
- : _data = value,
- _tag = ReverseOrdinalUnionTag.z;
-
- const ReverseOrdinalUnion.withY(bool value)
- : _data = value,
- _tag = ReverseOrdinalUnionTag.y;
-
- const ReverseOrdinalUnion.withX(int value)
- : _data = value,
- _tag = ReverseOrdinalUnionTag.x;
-
- ReverseOrdinalUnion._(ReverseOrdinalUnionTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final ReverseOrdinalUnionTag _tag;
- final _data;
- int get z {
- if (_tag != ReverseOrdinalUnionTag.z) {
- return null;
- }
- return _data;
- }
-
- bool get y {
- if (_tag != ReverseOrdinalUnionTag.y) {
- return null;
- }
- return _data;
- }
-
- int get x {
- if (_tag != ReverseOrdinalUnionTag.x) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case ReverseOrdinalUnionTag.z:
- return r'ReverseOrdinalUnion.z($z)';
- case ReverseOrdinalUnionTag.y:
- return r'ReverseOrdinalUnion.y($y)';
- case ReverseOrdinalUnionTag.x:
- return r'ReverseOrdinalUnion.x($x)';
- default:
- return null;
- }
- }
-
- ReverseOrdinalUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- ReverseOrdinalUnionTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static ReverseOrdinalUnion _ctor(int index, Object data) {
- return ReverseOrdinalUnion._(ReverseOrdinalUnionTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<ReverseOrdinalUnion> kReverseOrdinalUnion_Type =
- $fidl.UnionType<ReverseOrdinalUnion>(
- inlineSizeOld: 16,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<bool>(
- type: $fidl.BoolType(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Int64Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- ],
- ctor: ReverseOrdinalUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 4: 2,
- },
-);
-
-enum UnionWithEmptyStructTag {
- s,
- forceAlignmentOf8,
-}
-
-class UnionWithEmptyStruct extends $fidl.Union {
- const UnionWithEmptyStruct.withS(EmptyStruct value)
- : _data = value,
- _tag = UnionWithEmptyStructTag.s;
-
- const UnionWithEmptyStruct.withForceAlignmentOf8(int value)
- : _data = value,
- _tag = UnionWithEmptyStructTag.forceAlignmentOf8;
-
- UnionWithEmptyStruct._(UnionWithEmptyStructTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionWithEmptyStructTag _tag;
- final _data;
- EmptyStruct get s {
- if (_tag != UnionWithEmptyStructTag.s) {
- return null;
- }
- return _data;
- }
-
- int get forceAlignmentOf8 {
- if (_tag != UnionWithEmptyStructTag.forceAlignmentOf8) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionWithEmptyStructTag.s:
- return r'UnionWithEmptyStruct.s($s)';
- case UnionWithEmptyStructTag.forceAlignmentOf8:
- return r'UnionWithEmptyStruct.forceAlignmentOf8($forceAlignmentOf8)';
- default:
- return null;
- }
- }
-
- UnionWithEmptyStructTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionWithEmptyStructTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionWithEmptyStruct _ctor(int index, Object data) {
- return UnionWithEmptyStruct._(UnionWithEmptyStructTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionWithEmptyStruct> kUnionWithEmptyStruct_Type =
- $fidl.UnionType<UnionWithEmptyStruct>(
- inlineSizeOld: 16,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<EmptyStruct>(
- type: kEmptyStruct_Type, offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint64Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- ],
- ctor: UnionWithEmptyStruct._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- },
-);
-
-enum UnionSize8Align4Tag {
- unused1,
- unused2,
- variant,
-}
-
-class UnionSize8Align4 extends $fidl.Union {
- const UnionSize8Align4.withUnused1(int value)
- : _data = value,
- _tag = UnionSize8Align4Tag.unused1;
-
- const UnionSize8Align4.withUnused2(int value)
- : _data = value,
- _tag = UnionSize8Align4Tag.unused2;
-
- const UnionSize8Align4.withVariant(int value)
- : _data = value,
- _tag = UnionSize8Align4Tag.variant;
-
- UnionSize8Align4._(UnionSize8Align4Tag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionSize8Align4Tag _tag;
- final _data;
- int get unused1 {
- if (_tag != UnionSize8Align4Tag.unused1) {
- return null;
- }
- return _data;
- }
-
- int get unused2 {
- if (_tag != UnionSize8Align4Tag.unused2) {
- return null;
- }
- return _data;
- }
-
- int get variant {
- if (_tag != UnionSize8Align4Tag.variant) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionSize8Align4Tag.unused1:
- return r'UnionSize8Align4.unused1($unused1)';
- case UnionSize8Align4Tag.unused2:
- return r'UnionSize8Align4.unused2($unused2)';
- case UnionSize8Align4Tag.variant:
- return r'UnionSize8Align4.variant($variant)';
- default:
- return null;
- }
- }
-
- UnionSize8Align4Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize8Align4Tag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionSize8Align4 _ctor(int index, Object data) {
- return UnionSize8Align4._(UnionSize8Align4Tag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize8Align4> kUnionSize8Align4_Type =
- $fidl.UnionType<UnionSize8Align4>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize8Align4._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- },
-);
-
-enum UnionSize12Align4Tag {
- unused1,
- unused2,
- unused3,
- variant,
-}
-
-class UnionSize12Align4 extends $fidl.Union {
- const UnionSize12Align4.withUnused1(int value)
- : _data = value,
- _tag = UnionSize12Align4Tag.unused1;
-
- const UnionSize12Align4.withUnused2(int value)
- : _data = value,
- _tag = UnionSize12Align4Tag.unused2;
-
- const UnionSize12Align4.withUnused3(int value)
- : _data = value,
- _tag = UnionSize12Align4Tag.unused3;
-
- const UnionSize12Align4.withVariant(Uint8List value)
- : _data = value,
- _tag = UnionSize12Align4Tag.variant;
-
- UnionSize12Align4._(UnionSize12Align4Tag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionSize12Align4Tag _tag;
- final _data;
- int get unused1 {
- if (_tag != UnionSize12Align4Tag.unused1) {
- return null;
- }
- return _data;
- }
-
- int get unused2 {
- if (_tag != UnionSize12Align4Tag.unused2) {
- return null;
- }
- return _data;
- }
-
- int get unused3 {
- if (_tag != UnionSize12Align4Tag.unused3) {
- return null;
- }
- return _data;
- }
-
- Uint8List get variant {
- if (_tag != UnionSize12Align4Tag.variant) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionSize12Align4Tag.unused1:
- return r'UnionSize12Align4.unused1($unused1)';
- case UnionSize12Align4Tag.unused2:
- return r'UnionSize12Align4.unused2($unused2)';
- case UnionSize12Align4Tag.unused3:
- return r'UnionSize12Align4.unused3($unused3)';
- case UnionSize12Align4Tag.variant:
- return r'UnionSize12Align4.variant($variant)';
- default:
- return null;
- }
- }
-
- UnionSize12Align4Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize12Align4Tag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionSize12Align4 _ctor(int index, Object data) {
- return UnionSize12Align4._(UnionSize12Align4Tag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize12Align4> kUnionSize12Align4_Type =
- $fidl.UnionType<UnionSize12Align4>(
- inlineSizeOld: 12,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<Uint8List>(
- type: $fidl.ArrayType<Uint8List>(
- element: $fidl.Uint8Type(), elementCount: 6),
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize12Align4._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- 4: 3,
- },
-);
-
-enum UnionSize24Align8Tag {
- unused1,
- unused2,
- unused3,
- variant,
-}
-
-class UnionSize24Align8 extends $fidl.Union {
- const UnionSize24Align8.withUnused1(int value)
- : _data = value,
- _tag = UnionSize24Align8Tag.unused1;
-
- const UnionSize24Align8.withUnused2(int value)
- : _data = value,
- _tag = UnionSize24Align8Tag.unused2;
-
- const UnionSize24Align8.withUnused3(int value)
- : _data = value,
- _tag = UnionSize24Align8Tag.unused3;
-
- const UnionSize24Align8.withVariant(StructSize16Align8 value)
- : _data = value,
- _tag = UnionSize24Align8Tag.variant;
-
- UnionSize24Align8._(UnionSize24Align8Tag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionSize24Align8Tag _tag;
- final _data;
- int get unused1 {
- if (_tag != UnionSize24Align8Tag.unused1) {
- return null;
- }
- return _data;
- }
-
- int get unused2 {
- if (_tag != UnionSize24Align8Tag.unused2) {
- return null;
- }
- return _data;
- }
-
- int get unused3 {
- if (_tag != UnionSize24Align8Tag.unused3) {
- return null;
- }
- return _data;
- }
-
- StructSize16Align8 get variant {
- if (_tag != UnionSize24Align8Tag.variant) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionSize24Align8Tag.unused1:
- return r'UnionSize24Align8.unused1($unused1)';
- case UnionSize24Align8Tag.unused2:
- return r'UnionSize24Align8.unused2($unused2)';
- case UnionSize24Align8Tag.unused3:
- return r'UnionSize24Align8.unused3($unused3)';
- case UnionSize24Align8Tag.variant:
- return r'UnionSize24Align8.variant($variant)';
- default:
- return null;
- }
- }
-
- UnionSize24Align8Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize24Align8Tag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionSize24Align8 _ctor(int index, Object data) {
- return UnionSize24Align8._(UnionSize24Align8Tag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize24Align8> kUnionSize24Align8_Type =
- $fidl.UnionType<UnionSize24Align8>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<StructSize16Align8>(
- type: kStructSize16Align8_Type,
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize24Align8._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- 4: 3,
- },
-);
-
-enum UnionSize36Align4Tag {
- unused1,
- unused2,
- unused3,
- variant,
-}
-
-class UnionSize36Align4 extends $fidl.Union {
- const UnionSize36Align4.withUnused1(int value)
- : _data = value,
- _tag = UnionSize36Align4Tag.unused1;
-
- const UnionSize36Align4.withUnused2(int value)
- : _data = value,
- _tag = UnionSize36Align4Tag.unused2;
-
- const UnionSize36Align4.withUnused3(int value)
- : _data = value,
- _tag = UnionSize36Align4Tag.unused3;
-
- const UnionSize36Align4.withVariant(Uint8List value)
- : _data = value,
- _tag = UnionSize36Align4Tag.variant;
-
- UnionSize36Align4._(UnionSize36Align4Tag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionSize36Align4Tag _tag;
- final _data;
- int get unused1 {
- if (_tag != UnionSize36Align4Tag.unused1) {
- return null;
- }
- return _data;
- }
-
- int get unused2 {
- if (_tag != UnionSize36Align4Tag.unused2) {
- return null;
- }
- return _data;
- }
-
- int get unused3 {
- if (_tag != UnionSize36Align4Tag.unused3) {
- return null;
- }
- return _data;
- }
-
- Uint8List get variant {
- if (_tag != UnionSize36Align4Tag.variant) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionSize36Align4Tag.unused1:
- return r'UnionSize36Align4.unused1($unused1)';
- case UnionSize36Align4Tag.unused2:
- return r'UnionSize36Align4.unused2($unused2)';
- case UnionSize36Align4Tag.unused3:
- return r'UnionSize36Align4.unused3($unused3)';
- case UnionSize36Align4Tag.variant:
- return r'UnionSize36Align4.variant($variant)';
- default:
- return null;
- }
- }
-
- UnionSize36Align4Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize36Align4Tag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionSize36Align4 _ctor(int index, Object data) {
- return UnionSize36Align4._(UnionSize36Align4Tag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize36Align4> kUnionSize36Align4_Type =
- $fidl.UnionType<UnionSize36Align4>(
- inlineSizeOld: 36,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<Uint8List>(
- type: $fidl.ArrayType<Uint8List>(
- element: $fidl.Uint8Type(), elementCount: 32),
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize36Align4._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- 4: 3,
- },
-);
-
-enum UnionOfUnionTag {
- unused1,
- size8align4,
- size12align4,
- unused2,
- size24align8,
-}
-
-class UnionOfUnion extends $fidl.Union {
- const UnionOfUnion.withUnused1(int value)
- : _data = value,
- _tag = UnionOfUnionTag.unused1;
-
- const UnionOfUnion.withSize8align4(UnionSize8Align4 value)
- : _data = value,
- _tag = UnionOfUnionTag.size8align4;
-
- const UnionOfUnion.withSize12align4(UnionSize12Align4 value)
- : _data = value,
- _tag = UnionOfUnionTag.size12align4;
-
- const UnionOfUnion.withUnused2(int value)
- : _data = value,
- _tag = UnionOfUnionTag.unused2;
-
- const UnionOfUnion.withSize24align8(UnionSize24Align8 value)
- : _data = value,
- _tag = UnionOfUnionTag.size24align8;
-
- UnionOfUnion._(UnionOfUnionTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionOfUnionTag _tag;
- final _data;
- int get unused1 {
- if (_tag != UnionOfUnionTag.unused1) {
- return null;
- }
- return _data;
- }
-
- UnionSize8Align4 get size8align4 {
- if (_tag != UnionOfUnionTag.size8align4) {
- return null;
- }
- return _data;
- }
-
- UnionSize12Align4 get size12align4 {
- if (_tag != UnionOfUnionTag.size12align4) {
- return null;
- }
- return _data;
- }
-
- int get unused2 {
- if (_tag != UnionOfUnionTag.unused2) {
- return null;
- }
- return _data;
- }
-
- UnionSize24Align8 get size24align8 {
- if (_tag != UnionOfUnionTag.size24align8) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionOfUnionTag.unused1:
- return r'UnionOfUnion.unused1($unused1)';
- case UnionOfUnionTag.size8align4:
- return r'UnionOfUnion.size8align4($size8align4)';
- case UnionOfUnionTag.size12align4:
- return r'UnionOfUnion.size12align4($size12align4)';
- case UnionOfUnionTag.unused2:
- return r'UnionOfUnion.unused2($unused2)';
- case UnionOfUnionTag.size24align8:
- return r'UnionOfUnion.size24align8($size24align8)';
- default:
- return null;
- }
- }
-
- UnionOfUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionOfUnionTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionOfUnion _ctor(int index, Object data) {
- return UnionOfUnion._(UnionOfUnionTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionOfUnion> kUnionOfUnion_Type =
- $fidl.UnionType<UnionOfUnion>(
- inlineSizeOld: 32,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<UnionSize8Align4>(
- type: kUnionSize8Align4_Type, offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<UnionSize12Align4>(
- type: kUnionSize12Align4_Type, offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<UnionSize24Align8>(
- type: kUnionSize24Align8_Type, offsetOld: 8, offsetV1: -1 /* unused */),
- ],
- ctor: UnionOfUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- 4: 3,
- 5: 4,
- },
-);
-
-enum UnionWithVectorTag {
- unused,
- vectorOfUint8,
- s,
- vectorS3A1,
- vectorS3A2,
- handles,
- arrayS3A1,
- arrayS3A2,
- vectorUnion,
-}
-
-class UnionWithVector extends $fidl.Union {
- const UnionWithVector.withUnused(int value)
- : _data = value,
- _tag = UnionWithVectorTag.unused;
-
- const UnionWithVector.withVectorOfUint8(Uint8List value)
- : _data = value,
- _tag = UnionWithVectorTag.vectorOfUint8;
-
- const UnionWithVector.withS(String value)
- : _data = value,
- _tag = UnionWithVectorTag.s;
-
- const UnionWithVector.withVectorS3A1(List<StructSize3Align1> value)
- : _data = value,
- _tag = UnionWithVectorTag.vectorS3A1;
-
- const UnionWithVector.withVectorS3A2(List<StructSize3Align2> value)
- : _data = value,
- _tag = UnionWithVectorTag.vectorS3A2;
-
- const UnionWithVector.withHandles(Uint32List value)
- : _data = value,
- _tag = UnionWithVectorTag.handles;
-
- const UnionWithVector.withArrayS3A1(List<StructSize3Align1> value)
- : _data = value,
- _tag = UnionWithVectorTag.arrayS3A1;
-
- const UnionWithVector.withArrayS3A2(List<StructSize3Align2> value)
- : _data = value,
- _tag = UnionWithVectorTag.arrayS3A2;
-
- const UnionWithVector.withVectorUnion(List<UnionSize8Align4> value)
- : _data = value,
- _tag = UnionWithVectorTag.vectorUnion;
-
- UnionWithVector._(UnionWithVectorTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionWithVectorTag _tag;
- final _data;
- int get unused {
- if (_tag != UnionWithVectorTag.unused) {
- return null;
- }
- return _data;
- }
-
- Uint8List get vectorOfUint8 {
- if (_tag != UnionWithVectorTag.vectorOfUint8) {
- return null;
- }
- return _data;
- }
-
- String get s {
- if (_tag != UnionWithVectorTag.s) {
- return null;
- }
- return _data;
- }
-
- List<StructSize3Align1> get vectorS3A1 {
- if (_tag != UnionWithVectorTag.vectorS3A1) {
- return null;
- }
- return _data;
- }
-
- List<StructSize3Align2> get vectorS3A2 {
- if (_tag != UnionWithVectorTag.vectorS3A2) {
- return null;
- }
- return _data;
- }
-
- Uint32List get handles {
- if (_tag != UnionWithVectorTag.handles) {
- return null;
- }
- return _data;
- }
-
- List<StructSize3Align1> get arrayS3A1 {
- if (_tag != UnionWithVectorTag.arrayS3A1) {
- return null;
- }
- return _data;
- }
-
- List<StructSize3Align2> get arrayS3A2 {
- if (_tag != UnionWithVectorTag.arrayS3A2) {
- return null;
- }
- return _data;
- }
-
- List<UnionSize8Align4> get vectorUnion {
- if (_tag != UnionWithVectorTag.vectorUnion) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionWithVectorTag.unused:
- return r'UnionWithVector.unused($unused)';
- case UnionWithVectorTag.vectorOfUint8:
- return r'UnionWithVector.vectorOfUint8($vectorOfUint8)';
- case UnionWithVectorTag.s:
- return r'UnionWithVector.s($s)';
- case UnionWithVectorTag.vectorS3A1:
- return r'UnionWithVector.vectorS3A1($vectorS3A1)';
- case UnionWithVectorTag.vectorS3A2:
- return r'UnionWithVector.vectorS3A2($vectorS3A2)';
- case UnionWithVectorTag.handles:
- return r'UnionWithVector.handles($handles)';
- case UnionWithVectorTag.arrayS3A1:
- return r'UnionWithVector.arrayS3A1($arrayS3A1)';
- case UnionWithVectorTag.arrayS3A2:
- return r'UnionWithVector.arrayS3A2($arrayS3A2)';
- case UnionWithVectorTag.vectorUnion:
- return r'UnionWithVector.vectorUnion($vectorUnion)';
- default:
- return null;
- }
- }
-
- UnionWithVectorTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionWithVectorTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionWithVector _ctor(int index, Object data) {
- return UnionWithVector._(UnionWithVectorTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionWithVector> kUnionWithVector_Type =
- $fidl.UnionType<UnionWithVector>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<Uint8List>(
- type: $fidl.VectorType<Uint8List>(
- element: $fidl.Uint8Type(),
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<List<StructSize3Align1>>(
- type: $fidl.VectorType<List<StructSize3Align1>>(
- element: kStructSize3Align1_Type,
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<List<StructSize3Align2>>(
- type: $fidl.VectorType<List<StructSize3Align2>>(
- element: kStructSize3Align2_Type,
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<Uint32List>(
- type: $fidl.VectorType<Uint32List>(
- element: $fidl.Uint32Type(),
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<List<StructSize3Align1>>(
- type: $fidl.ArrayType<List<StructSize3Align1>>(
- element: kStructSize3Align1_Type, elementCount: 2),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<List<StructSize3Align2>>(
- type: $fidl.ArrayType<List<StructSize3Align2>>(
- element: kStructSize3Align2_Type, elementCount: 2),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<List<UnionSize8Align4>>(
- type: $fidl.VectorType<List<UnionSize8Align4>>(
- element: kUnionSize8Align4_Type,
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionWithVector._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- 4: 3,
- 5: 4,
- 6: 5,
- 7: 6,
- 8: 7,
- 9: 8,
- },
-);
-
-enum StringUnionTag {
- unused,
- s,
- u8,
-}
-
-class StringUnion extends $fidl.Union {
- const StringUnion.withUnused(int value)
- : _data = value,
- _tag = StringUnionTag.unused;
-
- const StringUnion.withS(String value)
- : _data = value,
- _tag = StringUnionTag.s;
-
- const StringUnion.withU8(int value)
- : _data = value,
- _tag = StringUnionTag.u8;
-
- StringUnion._(StringUnionTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final StringUnionTag _tag;
- final _data;
- int get unused {
- if (_tag != StringUnionTag.unused) {
- return null;
- }
- return _data;
- }
-
- String get s {
- if (_tag != StringUnionTag.s) {
- return null;
- }
- return _data;
- }
-
- int get u8 {
- if (_tag != StringUnionTag.u8) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case StringUnionTag.unused:
- return r'StringUnion.unused($unused)';
- case StringUnionTag.s:
- return r'StringUnion.s($s)';
- case StringUnionTag.u8:
- return r'StringUnion.u8($u8)';
- default:
- return null;
- }
- }
-
- StringUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- StringUnionTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static StringUnion _ctor(int index, Object data) {
- return StringUnion._(StringUnionTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<StringUnion> kStringUnion_Type =
- $fidl.UnionType<StringUnion>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- ],
- ctor: StringUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- },
-);
-
-enum EmptyStructUnionTag {
- unused,
- es,
-}
-
-class EmptyStructUnion extends $fidl.Union {
- const EmptyStructUnion.withUnused(int value)
- : _data = value,
- _tag = EmptyStructUnionTag.unused;
-
- const EmptyStructUnion.withEs(TransformerEmptyStruct value)
- : _data = value,
- _tag = EmptyStructUnionTag.es;
-
- EmptyStructUnion._(EmptyStructUnionTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final EmptyStructUnionTag _tag;
- final _data;
- int get unused {
- if (_tag != EmptyStructUnionTag.unused) {
- return null;
- }
- return _data;
- }
-
- TransformerEmptyStruct get es {
- if (_tag != EmptyStructUnionTag.es) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case EmptyStructUnionTag.unused:
- return r'EmptyStructUnion.unused($unused)';
- case EmptyStructUnionTag.es:
- return r'EmptyStructUnion.es($es)';
- default:
- return null;
- }
- }
-
- EmptyStructUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- EmptyStructUnionTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static EmptyStructUnion _ctor(int index, Object data) {
- return EmptyStructUnion._(EmptyStructUnionTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<EmptyStructUnion> kEmptyStructUnion_Type =
- $fidl.UnionType<EmptyStructUnion>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<TransformerEmptyStruct>(
- type: kTransformerEmptyStruct_Type,
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- ],
- ctor: EmptyStructUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- },
-);
-
-enum UnionWithVectorOfVectorsTag {
- v,
-}
-
-class UnionWithVectorOfVectors extends $fidl.Union {
- const UnionWithVectorOfVectors.withV(List<List<StructSize3Align1>> value)
- : _data = value,
- _tag = UnionWithVectorOfVectorsTag.v;
-
- UnionWithVectorOfVectors._(UnionWithVectorOfVectorsTag tag, Object data)
- : _tag = tag,
- _data = data;
-
- final UnionWithVectorOfVectorsTag _tag;
- final _data;
- List<List<StructSize3Align1>> get v {
- if (_tag != UnionWithVectorOfVectorsTag.v) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_tag) {
- case UnionWithVectorOfVectorsTag.v:
- return r'UnionWithVectorOfVectors.v($v)';
- default:
- return null;
- }
- }
-
- UnionWithVectorOfVectorsTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionWithVectorOfVectorsTag get tag => _tag;
-
- @override
- int get $index => _tag.index;
-
- @override
- Object get $data => _data;
-
- static UnionWithVectorOfVectors _ctor(int index, Object data) {
- return UnionWithVectorOfVectors._(
- UnionWithVectorOfVectorsTag.values[index], data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionWithVectorOfVectors> kUnionWithVectorOfVectors_Type =
- $fidl.UnionType<UnionWithVectorOfVectors>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<List<List<StructSize3Align1>>>(
- type: $fidl.VectorType<List<List<StructSize3Align1>>>(
- element: $fidl.VectorType<List<StructSize3Align1>>(
- element: $fidl.PointerType<StructSize3Align1>(
- element: kStructSize3Align1_Type),
- maybeElementCount: null,
- nullable: false),
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionWithVectorOfVectors._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- },
+ ctor: IpAddressConfig._ctor,
+ nullable: true,
+ flexible: false,
);
enum SimpleUnionTag {
- i32,
- i64,
- s,
- str,
+ i32, // 0x1
+ i64, // 0x2
+ s, // 0x3
+ str, // 0x4
}
-class SimpleUnion extends $fidl.Union {
+const Map<int, SimpleUnionTag> _SimpleUnionTag_map = {
+ 1: SimpleUnionTag.i32,
+ 2: SimpleUnionTag.i64,
+ 3: SimpleUnionTag.s,
+ 4: SimpleUnionTag.str,
+};
+
+class SimpleUnion extends $fidl.XUnion {
const SimpleUnion.withI32(int value)
- : _data = value,
- _tag = SimpleUnionTag.i32;
+ : _ordinal = 1,
+ _data = value;
const SimpleUnion.withI64(int value)
- : _data = value,
- _tag = SimpleUnionTag.i64;
+ : _ordinal = 2,
+ _data = value;
const SimpleUnion.withS(Int64Struct value)
- : _data = value,
- _tag = SimpleUnionTag.s;
+ : _ordinal = 3,
+ _data = value;
const SimpleUnion.withStr(String value)
- : _data = value,
- _tag = SimpleUnionTag.str;
+ : _ordinal = 4,
+ _data = value;
- SimpleUnion._(SimpleUnionTag tag, Object data)
- : _tag = tag,
+ SimpleUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final SimpleUnionTag _tag;
+ final int _ordinal;
final _data;
+
+ SimpleUnionTag get $tag => _SimpleUnionTag_map[_ordinal];
+
int get i32 {
- if (_tag != SimpleUnionTag.i32) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
int get i64 {
- if (_tag != SimpleUnionTag.i64) {
+ if (_ordinal != 2) {
return null;
}
return _data;
}
Int64Struct get s {
- if (_tag != SimpleUnionTag.s) {
+ if (_ordinal != 3) {
return null;
}
return _data;
}
String get str {
- if (_tag != SimpleUnionTag.str) {
+ if (_ordinal != 4) {
return null;
}
return _data;
@@ -1553,60 +203,1760 @@
@override
String toString() {
- switch (_tag) {
- case SimpleUnionTag.i32:
- return r'SimpleUnion.i32($i32)';
- case SimpleUnionTag.i64:
- return r'SimpleUnion.i64($i64)';
- case SimpleUnionTag.s:
- return r'SimpleUnion.s($s)';
- case SimpleUnionTag.str:
- return r'SimpleUnion.str($str)';
+ switch (_ordinal) {
+ case 1:
+ return 'SimpleUnion.i32($i32)';
+ case 2:
+ return 'SimpleUnion.i64($i64)';
+ case 3:
+ return 'SimpleUnion.s($s)';
+ case 4:
+ return 'SimpleUnion.str($str)';
default:
return null;
}
}
- SimpleUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- SimpleUnionTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static SimpleUnion _ctor(int index, Object data) {
- return SimpleUnion._(SimpleUnionTag.values[index], data);
+ static SimpleUnion _ctor(int ordinal, Object data) {
+ return SimpleUnion._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<SimpleUnion> kSimpleUnion_Type =
- $fidl.UnionType<SimpleUnion>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Int32Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Int64Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<Int64Struct>(
- type: kInt64Struct_Type, offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: SimpleUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
- 4: 3,
+const $fidl.XUnionType<SimpleUnion> kSimpleUnion_Type =
+ $fidl.XUnionType<SimpleUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ 2: $fidl.Int64Type(),
+ 3: kInt64Struct_Type,
+ 4: $fidl.StringType(maybeElementCount: null, nullable: false),
},
+ ctor: SimpleUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SimpleUnion> kSimpleUnion_OptType =
+ $fidl.XUnionType<SimpleUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ 2: $fidl.Int64Type(),
+ 3: kInt64Struct_Type,
+ 4: $fidl.StringType(maybeElementCount: null, nullable: false),
+ },
+ ctor: SimpleUnion._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionWithBoundStringTag {
+ boundFiveStr, // 0x1
+}
+
+const Map<int, UnionWithBoundStringTag> _UnionWithBoundStringTag_map = {
+ 1: UnionWithBoundStringTag.boundFiveStr,
+};
+
+class UnionWithBoundString extends $fidl.XUnion {
+ const UnionWithBoundString.withBoundFiveStr(String value)
+ : _ordinal = 1,
+ _data = value;
+
+ UnionWithBoundString._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionWithBoundStringTag get $tag => _UnionWithBoundStringTag_map[_ordinal];
+
+ String get boundFiveStr {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionWithBoundString.boundFiveStr($boundFiveStr)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionWithBoundString _ctor(int ordinal, Object data) {
+ return UnionWithBoundString._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithBoundString> kUnionWithBoundString_Type =
+ $fidl.XUnionType<UnionWithBoundString>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.StringType(maybeElementCount: 5, nullable: false),
+ },
+ ctor: UnionWithBoundString._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithBoundString> kUnionWithBoundString_OptType =
+ $fidl.XUnionType<UnionWithBoundString>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.StringType(maybeElementCount: 5, nullable: false),
+ },
+ ctor: UnionWithBoundString._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum SingleVariantUnionTag {
+ x, // 0x1
+}
+
+const Map<int, SingleVariantUnionTag> _SingleVariantUnionTag_map = {
+ 1: SingleVariantUnionTag.x,
+};
+
+class SingleVariantUnion extends $fidl.XUnion {
+ const SingleVariantUnion.withX(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ SingleVariantUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ SingleVariantUnionTag get $tag => _SingleVariantUnionTag_map[_ordinal];
+
+ int get x {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'SingleVariantUnion.x($x)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static SingleVariantUnion _ctor(int ordinal, Object data) {
+ return SingleVariantUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SingleVariantUnion> kSingleVariantUnion_Type =
+ $fidl.XUnionType<SingleVariantUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ },
+ ctor: SingleVariantUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SingleVariantUnion> kSingleVariantUnion_OptType =
+ $fidl.XUnionType<SingleVariantUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ },
+ ctor: SingleVariantUnion._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum ReverseOrdinalUnionTag {
+ z, // 0x1
+ y, // 0x2
+ x, // 0x4
+}
+
+const Map<int, ReverseOrdinalUnionTag> _ReverseOrdinalUnionTag_map = {
+ 1: ReverseOrdinalUnionTag.z,
+ 2: ReverseOrdinalUnionTag.y,
+ 4: ReverseOrdinalUnionTag.x,
+};
+
+class ReverseOrdinalUnion extends $fidl.XUnion {
+ const ReverseOrdinalUnion.withZ(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const ReverseOrdinalUnion.withY(bool value)
+ : _ordinal = 2,
+ _data = value;
+
+ const ReverseOrdinalUnion.withX(int value)
+ : _ordinal = 4,
+ _data = value;
+
+ ReverseOrdinalUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ ReverseOrdinalUnionTag get $tag => _ReverseOrdinalUnionTag_map[_ordinal];
+
+ int get z {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ bool get y {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get x {
+ if (_ordinal != 4) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'ReverseOrdinalUnion.z($z)';
+ case 2:
+ return 'ReverseOrdinalUnion.y($y)';
+ case 4:
+ return 'ReverseOrdinalUnion.x($x)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static ReverseOrdinalUnion _ctor(int ordinal, Object data) {
+ return ReverseOrdinalUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<ReverseOrdinalUnion> kReverseOrdinalUnion_Type =
+ $fidl.XUnionType<ReverseOrdinalUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ 2: $fidl.BoolType(),
+ 4: $fidl.Int64Type(),
+ },
+ ctor: ReverseOrdinalUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<ReverseOrdinalUnion> kReverseOrdinalUnion_OptType =
+ $fidl.XUnionType<ReverseOrdinalUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ 2: $fidl.BoolType(),
+ 4: $fidl.Int64Type(),
+ },
+ ctor: ReverseOrdinalUnion._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionWithEmptyStructTag {
+ s, // 0x1
+ forceAlignmentOf8, // 0x2
+}
+
+const Map<int, UnionWithEmptyStructTag> _UnionWithEmptyStructTag_map = {
+ 1: UnionWithEmptyStructTag.s,
+ 2: UnionWithEmptyStructTag.forceAlignmentOf8,
+};
+
+class UnionWithEmptyStruct extends $fidl.XUnion {
+ const UnionWithEmptyStruct.withS(EmptyStruct value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionWithEmptyStruct.withForceAlignmentOf8(int value)
+ : _ordinal = 2,
+ _data = value;
+
+ UnionWithEmptyStruct._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionWithEmptyStructTag get $tag => _UnionWithEmptyStructTag_map[_ordinal];
+
+ EmptyStruct get s {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get forceAlignmentOf8 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionWithEmptyStruct.s($s)';
+ case 2:
+ return 'UnionWithEmptyStruct.forceAlignmentOf8($forceAlignmentOf8)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionWithEmptyStruct _ctor(int ordinal, Object data) {
+ return UnionWithEmptyStruct._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithEmptyStruct> kUnionWithEmptyStruct_Type =
+ $fidl.XUnionType<UnionWithEmptyStruct>(
+ members: <int, $fidl.FidlType>{
+ 1: kEmptyStruct_Type,
+ 2: $fidl.Uint64Type(),
+ },
+ ctor: UnionWithEmptyStruct._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithEmptyStruct> kUnionWithEmptyStruct_OptType =
+ $fidl.XUnionType<UnionWithEmptyStruct>(
+ members: <int, $fidl.FidlType>{
+ 1: kEmptyStruct_Type,
+ 2: $fidl.Uint64Type(),
+ },
+ ctor: UnionWithEmptyStruct._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionSize8Align4Tag {
+ unused1, // 0x1
+ unused2, // 0x2
+ variant, // 0x3
+}
+
+const Map<int, UnionSize8Align4Tag> _UnionSize8Align4Tag_map = {
+ 1: UnionSize8Align4Tag.unused1,
+ 2: UnionSize8Align4Tag.unused2,
+ 3: UnionSize8Align4Tag.variant,
+};
+
+class UnionSize8Align4 extends $fidl.XUnion {
+ const UnionSize8Align4.withUnused1(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionSize8Align4.withUnused2(int value)
+ : _ordinal = 2,
+ _data = value;
+
+ const UnionSize8Align4.withVariant(int value)
+ : _ordinal = 3,
+ _data = value;
+
+ UnionSize8Align4._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionSize8Align4Tag get $tag => _UnionSize8Align4Tag_map[_ordinal];
+
+ int get unused1 {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused2 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get variant {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize8Align4.unused1($unused1)';
+ case 2:
+ return 'UnionSize8Align4.unused2($unused2)';
+ case 3:
+ return 'UnionSize8Align4.variant($variant)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionSize8Align4 _ctor(int ordinal, Object data) {
+ return UnionSize8Align4._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize8Align4> kUnionSize8Align4_Type =
+ $fidl.XUnionType<UnionSize8Align4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint32Type(),
+ },
+ ctor: UnionSize8Align4._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize8Align4> kUnionSize8Align4_OptType =
+ $fidl.XUnionType<UnionSize8Align4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint32Type(),
+ },
+ ctor: UnionSize8Align4._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionSize12Align4Tag {
+ unused1, // 0x1
+ unused2, // 0x2
+ unused3, // 0x3
+ variant, // 0x4
+}
+
+const Map<int, UnionSize12Align4Tag> _UnionSize12Align4Tag_map = {
+ 1: UnionSize12Align4Tag.unused1,
+ 2: UnionSize12Align4Tag.unused2,
+ 3: UnionSize12Align4Tag.unused3,
+ 4: UnionSize12Align4Tag.variant,
+};
+
+class UnionSize12Align4 extends $fidl.XUnion {
+ const UnionSize12Align4.withUnused1(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionSize12Align4.withUnused2(int value)
+ : _ordinal = 2,
+ _data = value;
+
+ const UnionSize12Align4.withUnused3(int value)
+ : _ordinal = 3,
+ _data = value;
+
+ const UnionSize12Align4.withVariant(Uint8List value)
+ : _ordinal = 4,
+ _data = value;
+
+ UnionSize12Align4._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionSize12Align4Tag get $tag => _UnionSize12Align4Tag_map[_ordinal];
+
+ int get unused1 {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused2 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused3 {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ Uint8List get variant {
+ if (_ordinal != 4) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize12Align4.unused1($unused1)';
+ case 2:
+ return 'UnionSize12Align4.unused2($unused2)';
+ case 3:
+ return 'UnionSize12Align4.unused3($unused3)';
+ case 4:
+ return 'UnionSize12Align4.variant($variant)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionSize12Align4 _ctor(int ordinal, Object data) {
+ return UnionSize12Align4._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize12Align4> kUnionSize12Align4_Type =
+ $fidl.XUnionType<UnionSize12Align4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint8Type(),
+ 4: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 6),
+ },
+ ctor: UnionSize12Align4._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize12Align4> kUnionSize12Align4_OptType =
+ $fidl.XUnionType<UnionSize12Align4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint8Type(),
+ 4: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 6),
+ },
+ ctor: UnionSize12Align4._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionSize24Align8Tag {
+ unused1, // 0x1
+ unused2, // 0x2
+ unused3, // 0x3
+ variant, // 0x4
+}
+
+const Map<int, UnionSize24Align8Tag> _UnionSize24Align8Tag_map = {
+ 1: UnionSize24Align8Tag.unused1,
+ 2: UnionSize24Align8Tag.unused2,
+ 3: UnionSize24Align8Tag.unused3,
+ 4: UnionSize24Align8Tag.variant,
+};
+
+class UnionSize24Align8 extends $fidl.XUnion {
+ const UnionSize24Align8.withUnused1(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionSize24Align8.withUnused2(int value)
+ : _ordinal = 2,
+ _data = value;
+
+ const UnionSize24Align8.withUnused3(int value)
+ : _ordinal = 3,
+ _data = value;
+
+ const UnionSize24Align8.withVariant(StructSize16Align8 value)
+ : _ordinal = 4,
+ _data = value;
+
+ UnionSize24Align8._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionSize24Align8Tag get $tag => _UnionSize24Align8Tag_map[_ordinal];
+
+ int get unused1 {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused2 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused3 {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ StructSize16Align8 get variant {
+ if (_ordinal != 4) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize24Align8.unused1($unused1)';
+ case 2:
+ return 'UnionSize24Align8.unused2($unused2)';
+ case 3:
+ return 'UnionSize24Align8.unused3($unused3)';
+ case 4:
+ return 'UnionSize24Align8.variant($variant)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionSize24Align8 _ctor(int ordinal, Object data) {
+ return UnionSize24Align8._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize24Align8> kUnionSize24Align8_Type =
+ $fidl.XUnionType<UnionSize24Align8>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint8Type(),
+ 4: kStructSize16Align8_Type,
+ },
+ ctor: UnionSize24Align8._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize24Align8> kUnionSize24Align8_OptType =
+ $fidl.XUnionType<UnionSize24Align8>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint8Type(),
+ 4: kStructSize16Align8_Type,
+ },
+ ctor: UnionSize24Align8._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionSize36Align4Tag {
+ unused1, // 0x1
+ unused2, // 0x2
+ unused3, // 0x3
+ variant, // 0x4
+}
+
+const Map<int, UnionSize36Align4Tag> _UnionSize36Align4Tag_map = {
+ 1: UnionSize36Align4Tag.unused1,
+ 2: UnionSize36Align4Tag.unused2,
+ 3: UnionSize36Align4Tag.unused3,
+ 4: UnionSize36Align4Tag.variant,
+};
+
+class UnionSize36Align4 extends $fidl.XUnion {
+ const UnionSize36Align4.withUnused1(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionSize36Align4.withUnused2(int value)
+ : _ordinal = 2,
+ _data = value;
+
+ const UnionSize36Align4.withUnused3(int value)
+ : _ordinal = 3,
+ _data = value;
+
+ const UnionSize36Align4.withVariant(Uint8List value)
+ : _ordinal = 4,
+ _data = value;
+
+ UnionSize36Align4._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionSize36Align4Tag get $tag => _UnionSize36Align4Tag_map[_ordinal];
+
+ int get unused1 {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused2 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused3 {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ Uint8List get variant {
+ if (_ordinal != 4) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize36Align4.unused1($unused1)';
+ case 2:
+ return 'UnionSize36Align4.unused2($unused2)';
+ case 3:
+ return 'UnionSize36Align4.unused3($unused3)';
+ case 4:
+ return 'UnionSize36Align4.variant($variant)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionSize36Align4 _ctor(int ordinal, Object data) {
+ return UnionSize36Align4._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize36Align4> kUnionSize36Align4_Type =
+ $fidl.XUnionType<UnionSize36Align4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint8Type(),
+ 4: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 32),
+ },
+ ctor: UnionSize36Align4._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize36Align4> kUnionSize36Align4_OptType =
+ $fidl.XUnionType<UnionSize36Align4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.Uint8Type(),
+ 3: $fidl.Uint8Type(),
+ 4: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 32),
+ },
+ ctor: UnionSize36Align4._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionOfUnionTag {
+ unused1, // 0x1
+ size8align4, // 0x2
+ size12align4, // 0x3
+ unused2, // 0x4
+ size24align8, // 0x5
+}
+
+const Map<int, UnionOfUnionTag> _UnionOfUnionTag_map = {
+ 1: UnionOfUnionTag.unused1,
+ 2: UnionOfUnionTag.size8align4,
+ 3: UnionOfUnionTag.size12align4,
+ 4: UnionOfUnionTag.unused2,
+ 5: UnionOfUnionTag.size24align8,
+};
+
+class UnionOfUnion extends $fidl.XUnion {
+ const UnionOfUnion.withUnused1(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionOfUnion.withSize8align4(UnionSize8Align4 value)
+ : _ordinal = 2,
+ _data = value;
+
+ const UnionOfUnion.withSize12align4(UnionSize12Align4 value)
+ : _ordinal = 3,
+ _data = value;
+
+ const UnionOfUnion.withUnused2(int value)
+ : _ordinal = 4,
+ _data = value;
+
+ const UnionOfUnion.withSize24align8(UnionSize24Align8 value)
+ : _ordinal = 5,
+ _data = value;
+
+ UnionOfUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionOfUnionTag get $tag => _UnionOfUnionTag_map[_ordinal];
+
+ int get unused1 {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ UnionSize8Align4 get size8align4 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ UnionSize12Align4 get size12align4 {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get unused2 {
+ if (_ordinal != 4) {
+ return null;
+ }
+ return _data;
+ }
+
+ UnionSize24Align8 get size24align8 {
+ if (_ordinal != 5) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionOfUnion.unused1($unused1)';
+ case 2:
+ return 'UnionOfUnion.size8align4($size8align4)';
+ case 3:
+ return 'UnionOfUnion.size12align4($size12align4)';
+ case 4:
+ return 'UnionOfUnion.unused2($unused2)';
+ case 5:
+ return 'UnionOfUnion.size24align8($size24align8)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionOfUnion _ctor(int ordinal, Object data) {
+ return UnionOfUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionOfUnion> kUnionOfUnion_Type =
+ $fidl.XUnionType<UnionOfUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: kUnionSize8Align4_Type,
+ 3: kUnionSize12Align4_Type,
+ 4: $fidl.Uint8Type(),
+ 5: kUnionSize24Align8_Type,
+ },
+ ctor: UnionOfUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionOfUnion> kUnionOfUnion_OptType =
+ $fidl.XUnionType<UnionOfUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: kUnionSize8Align4_Type,
+ 3: kUnionSize12Align4_Type,
+ 4: $fidl.Uint8Type(),
+ 5: kUnionSize24Align8_Type,
+ },
+ ctor: UnionOfUnion._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionWithVectorTag {
+ unused, // 0x1
+ vectorOfUint8, // 0x2
+ s, // 0x3
+ vectorS3A1, // 0x4
+ vectorS3A2, // 0x5
+ handles, // 0x6
+ arrayS3A1, // 0x7
+ arrayS3A2, // 0x8
+ vectorUnion, // 0x9
+}
+
+const Map<int, UnionWithVectorTag> _UnionWithVectorTag_map = {
+ 1: UnionWithVectorTag.unused,
+ 2: UnionWithVectorTag.vectorOfUint8,
+ 3: UnionWithVectorTag.s,
+ 4: UnionWithVectorTag.vectorS3A1,
+ 5: UnionWithVectorTag.vectorS3A2,
+ 6: UnionWithVectorTag.handles,
+ 7: UnionWithVectorTag.arrayS3A1,
+ 8: UnionWithVectorTag.arrayS3A2,
+ 9: UnionWithVectorTag.vectorUnion,
+};
+
+class UnionWithVector extends $fidl.XUnion {
+ const UnionWithVector.withUnused(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const UnionWithVector.withVectorOfUint8(Uint8List value)
+ : _ordinal = 2,
+ _data = value;
+
+ const UnionWithVector.withS(String value)
+ : _ordinal = 3,
+ _data = value;
+
+ const UnionWithVector.withVectorS3A1(List<StructSize3Align1> value)
+ : _ordinal = 4,
+ _data = value;
+
+ const UnionWithVector.withVectorS3A2(List<StructSize3Align2> value)
+ : _ordinal = 5,
+ _data = value;
+
+ const UnionWithVector.withHandles(Uint32List value)
+ : _ordinal = 6,
+ _data = value;
+
+ const UnionWithVector.withArrayS3A1(List<StructSize3Align1> value)
+ : _ordinal = 7,
+ _data = value;
+
+ const UnionWithVector.withArrayS3A2(List<StructSize3Align2> value)
+ : _ordinal = 8,
+ _data = value;
+
+ const UnionWithVector.withVectorUnion(List<UnionSize8Align4> value)
+ : _ordinal = 9,
+ _data = value;
+
+ UnionWithVector._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionWithVectorTag get $tag => _UnionWithVectorTag_map[_ordinal];
+
+ int get unused {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ Uint8List get vectorOfUint8 {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ String get s {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ List<StructSize3Align1> get vectorS3A1 {
+ if (_ordinal != 4) {
+ return null;
+ }
+ return _data;
+ }
+
+ List<StructSize3Align2> get vectorS3A2 {
+ if (_ordinal != 5) {
+ return null;
+ }
+ return _data;
+ }
+
+ Uint32List get handles {
+ if (_ordinal != 6) {
+ return null;
+ }
+ return _data;
+ }
+
+ List<StructSize3Align1> get arrayS3A1 {
+ if (_ordinal != 7) {
+ return null;
+ }
+ return _data;
+ }
+
+ List<StructSize3Align2> get arrayS3A2 {
+ if (_ordinal != 8) {
+ return null;
+ }
+ return _data;
+ }
+
+ List<UnionSize8Align4> get vectorUnion {
+ if (_ordinal != 9) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionWithVector.unused($unused)';
+ case 2:
+ return 'UnionWithVector.vectorOfUint8($vectorOfUint8)';
+ case 3:
+ return 'UnionWithVector.s($s)';
+ case 4:
+ return 'UnionWithVector.vectorS3A1($vectorS3A1)';
+ case 5:
+ return 'UnionWithVector.vectorS3A2($vectorS3A2)';
+ case 6:
+ return 'UnionWithVector.handles($handles)';
+ case 7:
+ return 'UnionWithVector.arrayS3A1($arrayS3A1)';
+ case 8:
+ return 'UnionWithVector.arrayS3A2($arrayS3A2)';
+ case 9:
+ return 'UnionWithVector.vectorUnion($vectorUnion)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionWithVector _ctor(int ordinal, Object data) {
+ return UnionWithVector._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithVector> kUnionWithVector_Type =
+ $fidl.XUnionType<UnionWithVector>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.VectorType<Uint8List>(
+ element: $fidl.Uint8Type(), maybeElementCount: null, nullable: false),
+ 3: $fidl.StringType(maybeElementCount: null, nullable: false),
+ 4: $fidl.VectorType<List<StructSize3Align1>>(
+ element: kStructSize3Align1_Type,
+ maybeElementCount: null,
+ nullable: false),
+ 5: $fidl.VectorType<List<StructSize3Align2>>(
+ element: kStructSize3Align2_Type,
+ maybeElementCount: null,
+ nullable: false),
+ 6: $fidl.VectorType<Uint32List>(
+ element: $fidl.Uint32Type(), maybeElementCount: null, nullable: false),
+ 7: $fidl.ArrayType<List<StructSize3Align1>>(
+ element: kStructSize3Align1_Type, elementCount: 2),
+ 8: $fidl.ArrayType<List<StructSize3Align2>>(
+ element: kStructSize3Align2_Type, elementCount: 2),
+ 9: $fidl.VectorType<List<UnionSize8Align4>>(
+ element: kUnionSize8Align4_Type,
+ maybeElementCount: null,
+ nullable: false),
+ },
+ ctor: UnionWithVector._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithVector> kUnionWithVector_OptType =
+ $fidl.XUnionType<UnionWithVector>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.VectorType<Uint8List>(
+ element: $fidl.Uint8Type(), maybeElementCount: null, nullable: false),
+ 3: $fidl.StringType(maybeElementCount: null, nullable: false),
+ 4: $fidl.VectorType<List<StructSize3Align1>>(
+ element: kStructSize3Align1_Type,
+ maybeElementCount: null,
+ nullable: false),
+ 5: $fidl.VectorType<List<StructSize3Align2>>(
+ element: kStructSize3Align2_Type,
+ maybeElementCount: null,
+ nullable: false),
+ 6: $fidl.VectorType<Uint32List>(
+ element: $fidl.Uint32Type(), maybeElementCount: null, nullable: false),
+ 7: $fidl.ArrayType<List<StructSize3Align1>>(
+ element: kStructSize3Align1_Type, elementCount: 2),
+ 8: $fidl.ArrayType<List<StructSize3Align2>>(
+ element: kStructSize3Align2_Type, elementCount: 2),
+ 9: $fidl.VectorType<List<UnionSize8Align4>>(
+ element: kUnionSize8Align4_Type,
+ maybeElementCount: null,
+ nullable: false),
+ },
+ ctor: UnionWithVector._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum StringUnionTag {
+ unused, // 0x1
+ s, // 0x2
+ u8, // 0x3
+}
+
+const Map<int, StringUnionTag> _StringUnionTag_map = {
+ 1: StringUnionTag.unused,
+ 2: StringUnionTag.s,
+ 3: StringUnionTag.u8,
+};
+
+class StringUnion extends $fidl.XUnion {
+ const StringUnion.withUnused(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const StringUnion.withS(String value)
+ : _ordinal = 2,
+ _data = value;
+
+ const StringUnion.withU8(int value)
+ : _ordinal = 3,
+ _data = value;
+
+ StringUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ StringUnionTag get $tag => _StringUnionTag_map[_ordinal];
+
+ int get unused {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ String get s {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ int get u8 {
+ if (_ordinal != 3) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'StringUnion.unused($unused)';
+ case 2:
+ return 'StringUnion.s($s)';
+ case 3:
+ return 'StringUnion.u8($u8)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static StringUnion _ctor(int ordinal, Object data) {
+ return StringUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<StringUnion> kStringUnion_Type =
+ $fidl.XUnionType<StringUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.StringType(maybeElementCount: null, nullable: false),
+ 3: $fidl.Uint8Type(),
+ },
+ ctor: StringUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<StringUnion> kStringUnion_OptType =
+ $fidl.XUnionType<StringUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: $fidl.StringType(maybeElementCount: null, nullable: false),
+ 3: $fidl.Uint8Type(),
+ },
+ ctor: StringUnion._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum EmptyStructUnionTag {
+ unused, // 0x1
+ es, // 0x2
+}
+
+const Map<int, EmptyStructUnionTag> _EmptyStructUnionTag_map = {
+ 1: EmptyStructUnionTag.unused,
+ 2: EmptyStructUnionTag.es,
+};
+
+class EmptyStructUnion extends $fidl.XUnion {
+ const EmptyStructUnion.withUnused(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ const EmptyStructUnion.withEs(TransformerEmptyStruct value)
+ : _ordinal = 2,
+ _data = value;
+
+ EmptyStructUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ EmptyStructUnionTag get $tag => _EmptyStructUnionTag_map[_ordinal];
+
+ int get unused {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ TransformerEmptyStruct get es {
+ if (_ordinal != 2) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'EmptyStructUnion.unused($unused)';
+ case 2:
+ return 'EmptyStructUnion.es($es)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static EmptyStructUnion _ctor(int ordinal, Object data) {
+ return EmptyStructUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<EmptyStructUnion> kEmptyStructUnion_Type =
+ $fidl.XUnionType<EmptyStructUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: kTransformerEmptyStruct_Type,
+ },
+ ctor: EmptyStructUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<EmptyStructUnion> kEmptyStructUnion_OptType =
+ $fidl.XUnionType<EmptyStructUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint8Type(),
+ 2: kTransformerEmptyStruct_Type,
+ },
+ ctor: EmptyStructUnion._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum UnionWithVectorOfVectorsTag {
+ v, // 0x1
+}
+
+const Map<int, UnionWithVectorOfVectorsTag> _UnionWithVectorOfVectorsTag_map = {
+ 1: UnionWithVectorOfVectorsTag.v,
+};
+
+class UnionWithVectorOfVectors extends $fidl.XUnion {
+ const UnionWithVectorOfVectors.withV(List<List<StructSize3Align1>> value)
+ : _ordinal = 1,
+ _data = value;
+
+ UnionWithVectorOfVectors._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ UnionWithVectorOfVectorsTag get $tag =>
+ _UnionWithVectorOfVectorsTag_map[_ordinal];
+
+ List<List<StructSize3Align1>> get v {
+ if (_ordinal != 1) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 1:
+ return 'UnionWithVectorOfVectors.v($v)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static UnionWithVectorOfVectors _ctor(int ordinal, Object data) {
+ return UnionWithVectorOfVectors._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithVectorOfVectors>
+ kUnionWithVectorOfVectors_Type = $fidl.XUnionType<UnionWithVectorOfVectors>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.VectorType<List<List<StructSize3Align1>>>(
+ element: $fidl.VectorType<List<StructSize3Align1>>(
+ element: $fidl.PointerType<StructSize3Align1>(
+ element: kStructSize3Align1_Type),
+ maybeElementCount: null,
+ nullable: false),
+ maybeElementCount: null,
+ nullable: false),
+ },
+ ctor: UnionWithVectorOfVectors._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionWithVectorOfVectors>
+ kUnionWithVectorOfVectors_OptType =
+ $fidl.XUnionType<UnionWithVectorOfVectors>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.VectorType<List<List<StructSize3Align1>>>(
+ element: $fidl.VectorType<List<StructSize3Align1>>(
+ element: $fidl.PointerType<StructSize3Align1>(
+ element: kStructSize3Align1_Type),
+ maybeElementCount: null,
+ nullable: false),
+ maybeElementCount: null,
+ nullable: false),
+ },
+ ctor: UnionWithVectorOfVectors._ctor,
+ nullable: true,
+ flexible: false,
+);
+
+enum SampleXUnionTag {
+ $unknown,
+ u, // 0x389c56b2
+ su, // 0x792f4f1d
+ st, // 0x21de8d5
+}
+
+const Map<int, SampleXUnionTag> _SampleXUnionTag_map = {
+ 949769906: SampleXUnionTag.u,
+ 2033143581: SampleXUnionTag.su,
+ 35514581: SampleXUnionTag.st,
+};
+
+class SampleXUnion extends $fidl.XUnion {
+ const SampleXUnion.withU(int value)
+ : _ordinal = 949769906,
+ _data = value;
+
+ const SampleXUnion.withSu(SimpleUnion value)
+ : _ordinal = 2033143581,
+ _data = value;
+
+ const SampleXUnion.withSt(SimpleTable value)
+ : _ordinal = 35514581,
+ _data = value;
+
+ SampleXUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ SampleXUnionTag get $tag {
+ final SampleXUnionTag $rawtag = _SampleXUnionTag_map[_ordinal];
+ return $rawtag == null ? SampleXUnionTag.$unknown : $rawtag;
+ }
+
+ int get u {
+ if (_ordinal != 949769906) {
+ return null;
+ }
+ return _data;
+ }
+
+ SimpleUnion get su {
+ if (_ordinal != 2033143581) {
+ return null;
+ }
+ return _data;
+ }
+
+ SimpleTable get st {
+ if (_ordinal != 35514581) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 949769906:
+ return 'SampleXUnion.u($u)';
+ case 2033143581:
+ return 'SampleXUnion.su($su)';
+ case 35514581:
+ return 'SampleXUnion.st($st)';
+ default:
+ return 'SampleXUnion.<UNKNOWN>';
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static SampleXUnion _ctor(int ordinal, Object data) {
+ return SampleXUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SampleXUnion> kSampleXUnion_Type =
+ $fidl.XUnionType<SampleXUnion>(
+ members: <int, $fidl.FidlType>{
+ 949769906: $fidl.Uint32Type(),
+ 2033143581: kSimpleUnion_Type,
+ 35514581: kSimpleTable_Type,
+ },
+ ctor: SampleXUnion._ctor,
+ nullable: false,
+ flexible: true,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SampleXUnion> kSampleXUnion_OptType =
+ $fidl.XUnionType<SampleXUnion>(
+ members: <int, $fidl.FidlType>{
+ 949769906: $fidl.Uint32Type(),
+ 2033143581: kSimpleUnion_Type,
+ 35514581: kSimpleTable_Type,
+ },
+ ctor: SampleXUnion._ctor,
+ nullable: true,
+ flexible: true,
+);
+
+enum SampleStrictXUnionTag {
+ u, // 0x8e2ea72
+ su, // 0x27f3a73b
+ st, // 0x372354ef
+}
+
+const Map<int, SampleStrictXUnionTag> _SampleStrictXUnionTag_map = {
+ 149088882: SampleStrictXUnionTag.u,
+ 670279483: SampleStrictXUnionTag.su,
+ 925062383: SampleStrictXUnionTag.st,
+};
+
+class SampleStrictXUnion extends $fidl.XUnion {
+ const SampleStrictXUnion.withU(int value)
+ : _ordinal = 149088882,
+ _data = value;
+
+ const SampleStrictXUnion.withSu(SimpleUnion value)
+ : _ordinal = 670279483,
+ _data = value;
+
+ const SampleStrictXUnion.withSt(SimpleTable value)
+ : _ordinal = 925062383,
+ _data = value;
+
+ SampleStrictXUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
+ _data = data;
+
+ final int _ordinal;
+ final _data;
+
+ SampleStrictXUnionTag get $tag => _SampleStrictXUnionTag_map[_ordinal];
+
+ int get u {
+ if (_ordinal != 149088882) {
+ return null;
+ }
+ return _data;
+ }
+
+ SimpleUnion get su {
+ if (_ordinal != 670279483) {
+ return null;
+ }
+ return _data;
+ }
+
+ SimpleTable get st {
+ if (_ordinal != 925062383) {
+ return null;
+ }
+ return _data;
+ }
+
+ @override
+ String toString() {
+ switch (_ordinal) {
+ case 149088882:
+ return 'SampleStrictXUnion.u($u)';
+ case 670279483:
+ return 'SampleStrictXUnion.su($su)';
+ case 925062383:
+ return 'SampleStrictXUnion.st($st)';
+ default:
+ return null;
+ }
+ }
+
+ @override
+ int get $ordinal => _ordinal;
+
+ @override
+ Object get $data => _data;
+
+ static SampleStrictXUnion _ctor(int ordinal, Object data) {
+ return SampleStrictXUnion._(ordinal, data);
+ }
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SampleStrictXUnion> kSampleStrictXUnion_Type =
+ $fidl.XUnionType<SampleStrictXUnion>(
+ members: <int, $fidl.FidlType>{
+ 149088882: $fidl.Uint32Type(),
+ 670279483: kSimpleUnion_Type,
+ 925062383: kSimpleTable_Type,
+ },
+ ctor: SampleStrictXUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<SampleStrictXUnion> kSampleStrictXUnion_OptType =
+ $fidl.XUnionType<SampleStrictXUnion>(
+ members: <int, $fidl.FidlType>{
+ 149088882: $fidl.Uint32Type(),
+ 670279483: kSimpleUnion_Type,
+ 925062383: kSimpleTable_Type,
+ },
+ ctor: SampleStrictXUnion._ctor,
+ nullable: true,
+ flexible: false,
);
enum XUnionWithEmptyStructTag {
@@ -1935,224 +2285,6 @@
flexible: true,
);
-enum SampleXUnionTag {
- $unknown,
- u, // 0x389c56b2
- su, // 0x792f4f1d
- st, // 0x21de8d5
-}
-
-const Map<int, SampleXUnionTag> _SampleXUnionTag_map = {
- 949769906: SampleXUnionTag.u,
- 2033143581: SampleXUnionTag.su,
- 35514581: SampleXUnionTag.st,
-};
-
-class SampleXUnion extends $fidl.XUnion {
- const SampleXUnion.withU(int value)
- : _ordinal = 949769906,
- _data = value;
-
- const SampleXUnion.withSu(SimpleUnion value)
- : _ordinal = 2033143581,
- _data = value;
-
- const SampleXUnion.withSt(SimpleTable value)
- : _ordinal = 35514581,
- _data = value;
-
- SampleXUnion._(int ordinal, Object data)
- : _ordinal = ordinal,
- _data = data;
-
- final int _ordinal;
- final _data;
-
- SampleXUnionTag get $tag {
- final SampleXUnionTag $rawtag = _SampleXUnionTag_map[_ordinal];
- return $rawtag == null ? SampleXUnionTag.$unknown : $rawtag;
- }
-
- int get u {
- if (_ordinal != 949769906) {
- return null;
- }
- return _data;
- }
-
- SimpleUnion get su {
- if (_ordinal != 2033143581) {
- return null;
- }
- return _data;
- }
-
- SimpleTable get st {
- if (_ordinal != 35514581) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_ordinal) {
- case 949769906:
- return 'SampleXUnion.u($u)';
- case 2033143581:
- return 'SampleXUnion.su($su)';
- case 35514581:
- return 'SampleXUnion.st($st)';
- default:
- return 'SampleXUnion.<UNKNOWN>';
- }
- }
-
- @override
- int get $ordinal => _ordinal;
-
- @override
- Object get $data => _data;
-
- static SampleXUnion _ctor(int ordinal, Object data) {
- return SampleXUnion._(ordinal, data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.XUnionType<SampleXUnion> kSampleXUnion_Type =
- $fidl.XUnionType<SampleXUnion>(
- members: <int, $fidl.FidlType>{
- 949769906: $fidl.Uint32Type(),
- 2033143581: kSimpleUnion_Type,
- 35514581: kSimpleTable_Type,
- },
- ctor: SampleXUnion._ctor,
- nullable: false,
- flexible: true,
-);
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.XUnionType<SampleXUnion> kSampleXUnion_OptType =
- $fidl.XUnionType<SampleXUnion>(
- members: <int, $fidl.FidlType>{
- 949769906: $fidl.Uint32Type(),
- 2033143581: kSimpleUnion_Type,
- 35514581: kSimpleTable_Type,
- },
- ctor: SampleXUnion._ctor,
- nullable: true,
- flexible: true,
-);
-
-enum SampleStrictXUnionTag {
- u, // 0x8e2ea72
- su, // 0x27f3a73b
- st, // 0x372354ef
-}
-
-const Map<int, SampleStrictXUnionTag> _SampleStrictXUnionTag_map = {
- 149088882: SampleStrictXUnionTag.u,
- 670279483: SampleStrictXUnionTag.su,
- 925062383: SampleStrictXUnionTag.st,
-};
-
-class SampleStrictXUnion extends $fidl.XUnion {
- const SampleStrictXUnion.withU(int value)
- : _ordinal = 149088882,
- _data = value;
-
- const SampleStrictXUnion.withSu(SimpleUnion value)
- : _ordinal = 670279483,
- _data = value;
-
- const SampleStrictXUnion.withSt(SimpleTable value)
- : _ordinal = 925062383,
- _data = value;
-
- SampleStrictXUnion._(int ordinal, Object data)
- : _ordinal = ordinal,
- _data = data;
-
- final int _ordinal;
- final _data;
-
- SampleStrictXUnionTag get $tag => _SampleStrictXUnionTag_map[_ordinal];
-
- int get u {
- if (_ordinal != 149088882) {
- return null;
- }
- return _data;
- }
-
- SimpleUnion get su {
- if (_ordinal != 670279483) {
- return null;
- }
- return _data;
- }
-
- SimpleTable get st {
- if (_ordinal != 925062383) {
- return null;
- }
- return _data;
- }
-
- @override
- String toString() {
- switch (_ordinal) {
- case 149088882:
- return 'SampleStrictXUnion.u($u)';
- case 670279483:
- return 'SampleStrictXUnion.su($su)';
- case 925062383:
- return 'SampleStrictXUnion.st($st)';
- default:
- return null;
- }
- }
-
- @override
- int get $ordinal => _ordinal;
-
- @override
- Object get $data => _data;
-
- static SampleStrictXUnion _ctor(int ordinal, Object data) {
- return SampleStrictXUnion._(ordinal, data);
- }
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.XUnionType<SampleStrictXUnion> kSampleStrictXUnion_Type =
- $fidl.XUnionType<SampleStrictXUnion>(
- members: <int, $fidl.FidlType>{
- 149088882: $fidl.Uint32Type(),
- 670279483: kSimpleUnion_Type,
- 925062383: kSimpleTable_Type,
- },
- ctor: SampleStrictXUnion._ctor,
- nullable: false,
- flexible: false,
-);
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.XUnionType<SampleStrictXUnion> kSampleStrictXUnion_OptType =
- $fidl.XUnionType<SampleStrictXUnion>(
- members: <int, $fidl.FidlType>{
- 149088882: $fidl.Uint32Type(),
- 670279483: kSimpleUnion_Type,
- 925062383: kSimpleTable_Type,
- },
- ctor: SampleStrictXUnion._ctor,
- nullable: true,
- flexible: false,
-);
-
class TestXUnionInTable extends $fidl.Struct {
const TestXUnionInTable({
@required this.value,
@@ -2485,6 +2617,482 @@
ctor: FileGetAttrResponse._ctor,
);
+class StructOfSimpleTable extends $fidl.Struct {
+ const StructOfSimpleTable({
+ @required this.table,
+ });
+ StructOfSimpleTable.clone(
+ StructOfSimpleTable $orig, {
+ SimpleTable table,
+ }) : this(
+ table: table ?? $orig.table,
+ );
+
+ StructOfSimpleTable._(List<Object> argv) : table = argv[0];
+ final SimpleTable table;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ table,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'StructOfSimpleTable' r'(table: ' + table.toString() + r')';
+ }
+
+ static StructOfSimpleTable _ctor(List<Object> argv) =>
+ StructOfSimpleTable._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<StructOfSimpleTable> kStructOfSimpleTable_Type =
+ $fidl.StructType<StructOfSimpleTable>(
+ inlineSizeOld: 16,
+ inlineSizeV1: 16,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<SimpleTable>(
+ type: kSimpleTable_Type, offsetOld: 0, offsetV1: 0),
+ ],
+ ctor: StructOfSimpleTable._ctor,
+);
+
+class SimpleTableThenUint64 extends $fidl.Struct {
+ const SimpleTableThenUint64({
+ @required this.table,
+ @required this.number,
+ });
+ SimpleTableThenUint64.clone(
+ SimpleTableThenUint64 $orig, {
+ SimpleTable table,
+ int number,
+ }) : this(
+ table: table ?? $orig.table,
+ number: number ?? $orig.number,
+ );
+
+ SimpleTableThenUint64._(List<Object> argv)
+ : table = argv[0],
+ number = argv[1];
+ final SimpleTable table;
+ final int number;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ table,
+ number,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'SimpleTableThenUint64' r'(table: ' +
+ table.toString() +
+ r', number: ' +
+ number.toString() +
+ r')';
+ }
+
+ static SimpleTableThenUint64 _ctor(List<Object> argv) =>
+ SimpleTableThenUint64._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<SimpleTableThenUint64> kSimpleTableThenUint64_Type =
+ $fidl.StructType<SimpleTableThenUint64>(
+ inlineSizeOld: 24,
+ inlineSizeV1: 24,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<SimpleTable>(
+ type: kSimpleTable_Type, offsetOld: 0, offsetV1: 0),
+ $fidl.MemberType<int>(
+ type: $fidl.Uint64Type(), offsetOld: 16, offsetV1: 16),
+ ],
+ ctor: SimpleTableThenUint64._ctor,
+);
+
+class StructOfTableWithStringAndVector extends $fidl.Struct {
+ const StructOfTableWithStringAndVector({
+ @required this.table,
+ });
+ StructOfTableWithStringAndVector.clone(
+ StructOfTableWithStringAndVector $orig, {
+ TableWithStringAndVector table,
+ }) : this(
+ table: table ?? $orig.table,
+ );
+
+ StructOfTableWithStringAndVector._(List<Object> argv) : table = argv[0];
+ final TableWithStringAndVector table;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ table,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'StructOfTableWithStringAndVector' r'(table: ' +
+ table.toString() +
+ r')';
+ }
+
+ static StructOfTableWithStringAndVector _ctor(List<Object> argv) =>
+ StructOfTableWithStringAndVector._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<StructOfTableWithStringAndVector>
+ kStructOfTableWithStringAndVector_Type =
+ $fidl.StructType<StructOfTableWithStringAndVector>(
+ inlineSizeOld: 16,
+ inlineSizeV1: 16,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<TableWithStringAndVector>(
+ type: kTableWithStringAndVector_Type, offsetOld: 0, offsetV1: 0),
+ ],
+ ctor: StructOfTableWithStringAndVector._ctor,
+);
+
+class StructOfReverseOrdinalTable extends $fidl.Struct {
+ const StructOfReverseOrdinalTable({
+ @required this.table,
+ });
+ StructOfReverseOrdinalTable.clone(
+ StructOfReverseOrdinalTable $orig, {
+ ReverseOrdinalTable table,
+ }) : this(
+ table: table ?? $orig.table,
+ );
+
+ StructOfReverseOrdinalTable._(List<Object> argv) : table = argv[0];
+ final ReverseOrdinalTable table;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ table,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'StructOfReverseOrdinalTable' r'(table: ' + table.toString() + r')';
+ }
+
+ static StructOfReverseOrdinalTable _ctor(List<Object> argv) =>
+ StructOfReverseOrdinalTable._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<StructOfReverseOrdinalTable>
+ kStructOfReverseOrdinalTable_Type =
+ $fidl.StructType<StructOfReverseOrdinalTable>(
+ inlineSizeOld: 16,
+ inlineSizeV1: 16,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<ReverseOrdinalTable>(
+ type: kReverseOrdinalTable_Type, offsetOld: 0, offsetV1: 0),
+ ],
+ ctor: StructOfReverseOrdinalTable._ctor,
+);
+
+class Int64Struct extends $fidl.Struct {
+ const Int64Struct({
+ @required this.x,
+ });
+ Int64Struct.clone(
+ Int64Struct $orig, {
+ int x,
+ }) : this(
+ x: x ?? $orig.x,
+ );
+
+ Int64Struct._(List<Object> argv) : x = argv[0];
+ final int x;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ x,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'Int64Struct' r'(x: ' + x.toString() + r')';
+ }
+
+ static Int64Struct _ctor(List<Object> argv) => Int64Struct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<Int64Struct> kInt64Struct_Type =
+ $fidl.StructType<Int64Struct>(
+ inlineSizeOld: 8,
+ inlineSizeV1: 8,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<int>(type: $fidl.Int64Type(), offsetOld: 0, offsetV1: 0),
+ ],
+ ctor: Int64Struct._ctor,
+);
+
+class TestInlineXUnionInStruct extends $fidl.Struct {
+ const TestInlineXUnionInStruct({
+ @required this.before,
+ @required this.xu,
+ @required this.after,
+ });
+ TestInlineXUnionInStruct.clone(
+ TestInlineXUnionInStruct $orig, {
+ String before,
+ SampleXUnion xu,
+ String after,
+ }) : this(
+ before: before ?? $orig.before,
+ xu: xu ?? $orig.xu,
+ after: after ?? $orig.after,
+ );
+
+ TestInlineXUnionInStruct._(List<Object> argv)
+ : before = argv[0],
+ xu = argv[1],
+ after = argv[2];
+ final String before;
+ final SampleXUnion xu;
+ final String after;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ before,
+ xu,
+ after,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'TestInlineXUnionInStruct' r'(before: ' +
+ before.toString() +
+ r', xu: ' +
+ xu.toString() +
+ r', after: ' +
+ after.toString() +
+ r')';
+ }
+
+ static TestInlineXUnionInStruct _ctor(List<Object> argv) =>
+ TestInlineXUnionInStruct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<TestInlineXUnionInStruct>
+ kTestInlineXUnionInStruct_Type = $fidl.StructType<TestInlineXUnionInStruct>(
+ inlineSizeOld: 56,
+ inlineSizeV1: 56,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<String>(
+ type: $fidl.StringType(maybeElementCount: null, nullable: false),
+ offsetOld: 0,
+ offsetV1: 0),
+ $fidl.MemberType<SampleXUnion>(
+ type: kSampleXUnion_Type, offsetOld: 16, offsetV1: 16),
+ $fidl.MemberType<String>(
+ type: $fidl.StringType(maybeElementCount: null, nullable: false),
+ offsetOld: 40,
+ offsetV1: 40),
+ ],
+ ctor: TestInlineXUnionInStruct._ctor,
+);
+
+class TestOptionalXUnionInStruct extends $fidl.Struct {
+ const TestOptionalXUnionInStruct({
+ @required this.before,
+ this.xu,
+ @required this.after,
+ });
+ TestOptionalXUnionInStruct.clone(
+ TestOptionalXUnionInStruct $orig, {
+ String before,
+ SampleXUnion xu,
+ String after,
+ }) : this(
+ before: before ?? $orig.before,
+ xu: xu ?? $orig.xu,
+ after: after ?? $orig.after,
+ );
+
+ TestOptionalXUnionInStruct.cloneWithout(
+ TestOptionalXUnionInStruct $orig, {
+ bool xu,
+ }) : this(
+ before: $orig.before,
+ xu: xu ? null : $orig.xu,
+ after: $orig.after,
+ );
+
+ TestOptionalXUnionInStruct._(List<Object> argv)
+ : before = argv[0],
+ xu = argv[1],
+ after = argv[2];
+ final String before;
+ final SampleXUnion xu;
+ final String after;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ before,
+ xu,
+ after,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'TestOptionalXUnionInStruct' r'(before: ' +
+ before.toString() +
+ r', xu: ' +
+ xu.toString() +
+ r', after: ' +
+ after.toString() +
+ r')';
+ }
+
+ static TestOptionalXUnionInStruct _ctor(List<Object> argv) =>
+ TestOptionalXUnionInStruct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<TestOptionalXUnionInStruct>
+ kTestOptionalXUnionInStruct_Type =
+ $fidl.StructType<TestOptionalXUnionInStruct>(
+ inlineSizeOld: 56,
+ inlineSizeV1: 56,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<String>(
+ type: $fidl.StringType(maybeElementCount: null, nullable: false),
+ offsetOld: 0,
+ offsetV1: 0),
+ $fidl.MemberType<SampleXUnion>(
+ type: kSampleXUnion_OptType, offsetOld: 16, offsetV1: 16),
+ $fidl.MemberType<String>(
+ type: $fidl.StringType(maybeElementCount: null, nullable: false),
+ offsetOld: 40,
+ offsetV1: 40),
+ ],
+ ctor: TestOptionalXUnionInStruct._ctor,
+);
+
+class TestStrictXUnionInStruct extends $fidl.Struct {
+ const TestStrictXUnionInStruct({
+ @required this.xu,
+ });
+ TestStrictXUnionInStruct.clone(
+ TestStrictXUnionInStruct $orig, {
+ SampleStrictXUnion xu,
+ }) : this(
+ xu: xu ?? $orig.xu,
+ );
+
+ TestStrictXUnionInStruct._(List<Object> argv) : xu = argv[0];
+ final SampleStrictXUnion xu;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ xu,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'TestStrictXUnionInStruct' r'(xu: ' + xu.toString() + r')';
+ }
+
+ static TestStrictXUnionInStruct _ctor(List<Object> argv) =>
+ TestStrictXUnionInStruct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<TestStrictXUnionInStruct>
+ kTestStrictXUnionInStruct_Type = $fidl.StructType<TestStrictXUnionInStruct>(
+ inlineSizeOld: 24,
+ inlineSizeV1: 24,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<SampleStrictXUnion>(
+ type: kSampleStrictXUnion_Type, offsetOld: 0, offsetV1: 0),
+ ],
+ ctor: TestStrictXUnionInStruct._ctor,
+);
+
+class TestFlexibleXUnionInStruct extends $fidl.Struct {
+ const TestFlexibleXUnionInStruct({
+ @required this.xu,
+ });
+ TestFlexibleXUnionInStruct.clone(
+ TestFlexibleXUnionInStruct $orig, {
+ SampleXUnion xu,
+ }) : this(
+ xu: xu ?? $orig.xu,
+ );
+
+ TestFlexibleXUnionInStruct._(List<Object> argv) : xu = argv[0];
+ final SampleXUnion xu;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ xu,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'TestFlexibleXUnionInStruct' r'(xu: ' + xu.toString() + r')';
+ }
+
+ static TestFlexibleXUnionInStruct _ctor(List<Object> argv) =>
+ TestFlexibleXUnionInStruct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<TestFlexibleXUnionInStruct>
+ kTestFlexibleXUnionInStruct_Type =
+ $fidl.StructType<TestFlexibleXUnionInStruct>(
+ inlineSizeOld: 24,
+ inlineSizeV1: 24,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<SampleXUnion>(
+ type: kSampleXUnion_Type, offsetOld: 0, offsetV1: 0),
+ ],
+ ctor: TestFlexibleXUnionInStruct._ctor,
+);
+
class UnionWithBoundStringStruct extends $fidl.Struct {
const UnionWithBoundStringStruct({
@required this.v,
@@ -3280,628 +3888,128 @@
ctor: StringWrapper._ctor,
);
-class StructOfSimpleTable extends $fidl.Struct {
- const StructOfSimpleTable({
- @required this.table,
+class StructWithOptionals extends $fidl.Struct {
+ const StructWithOptionals({
+ @required this.s,
+ this.s2,
+ @required this.t,
+ @required this.xu,
+ this.xu2,
+ @required this.u,
+ this.u2,
});
- StructOfSimpleTable.clone(
- StructOfSimpleTable $orig, {
- SimpleTable table,
+ StructWithOptionals.clone(
+ StructWithOptionals $orig, {
+ EmptyStruct s,
+ EmptyStruct s2,
+ TableWithEmptyStruct t,
+ XUnionWithEmptyStruct xu,
+ XUnionWithEmptyStruct xu2,
+ UnionWithEmptyStruct u,
+ UnionWithEmptyStruct u2,
}) : this(
- table: table ?? $orig.table,
+ s: s ?? $orig.s,
+ s2: s2 ?? $orig.s2,
+ t: t ?? $orig.t,
+ xu: xu ?? $orig.xu,
+ xu2: xu2 ?? $orig.xu2,
+ u: u ?? $orig.u,
+ u2: u2 ?? $orig.u2,
);
- StructOfSimpleTable._(List<Object> argv) : table = argv[0];
- final SimpleTable table;
+ StructWithOptionals.cloneWithout(
+ StructWithOptionals $orig, {
+ bool s2,
+ bool xu2,
+ bool u2,
+ }) : this(
+ s: $orig.s,
+ s2: s2 ? null : $orig.s2,
+ t: $orig.t,
+ xu: $orig.xu,
+ xu2: xu2 ? null : $orig.xu2,
+ u: $orig.u,
+ u2: u2 ? null : $orig.u2,
+ );
+
+ StructWithOptionals._(List<Object> argv)
+ : s = argv[0],
+ s2 = argv[1],
+ t = argv[2],
+ xu = argv[3],
+ xu2 = argv[4],
+ u = argv[5],
+ u2 = argv[6];
+ final EmptyStruct s;
+ final EmptyStruct s2;
+ final TableWithEmptyStruct t;
+ final XUnionWithEmptyStruct xu;
+ final XUnionWithEmptyStruct xu2;
+ final UnionWithEmptyStruct u;
+ final UnionWithEmptyStruct u2;
@override
List<Object> get $fields {
return <Object>[
- table,
+ s,
+ s2,
+ t,
+ xu,
+ xu2,
+ u,
+ u2,
];
}
@override
String toString() {
// ignore: prefer_interpolation_to_compose_strings
- return r'StructOfSimpleTable' r'(table: ' + table.toString() + r')';
- }
-
- static StructOfSimpleTable _ctor(List<Object> argv) =>
- StructOfSimpleTable._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<StructOfSimpleTable> kStructOfSimpleTable_Type =
- $fidl.StructType<StructOfSimpleTable>(
- inlineSizeOld: 16,
- inlineSizeV1: 16,
- members: <$fidl.MemberType>[
- $fidl.MemberType<SimpleTable>(
- type: kSimpleTable_Type, offsetOld: 0, offsetV1: 0),
- ],
- ctor: StructOfSimpleTable._ctor,
-);
-
-class SimpleTableThenUint64 extends $fidl.Struct {
- const SimpleTableThenUint64({
- @required this.table,
- @required this.number,
- });
- SimpleTableThenUint64.clone(
- SimpleTableThenUint64 $orig, {
- SimpleTable table,
- int number,
- }) : this(
- table: table ?? $orig.table,
- number: number ?? $orig.number,
- );
-
- SimpleTableThenUint64._(List<Object> argv)
- : table = argv[0],
- number = argv[1];
- final SimpleTable table;
- final int number;
-
- @override
- List<Object> get $fields {
- return <Object>[
- table,
- number,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'SimpleTableThenUint64' r'(table: ' +
- table.toString() +
- r', number: ' +
- number.toString() +
+ return r'StructWithOptionals' r'(s: ' +
+ s.toString() +
+ r', s2: ' +
+ s2.toString() +
+ r', t: ' +
+ t.toString() +
+ r', xu: ' +
+ xu.toString() +
+ r', xu2: ' +
+ xu2.toString() +
+ r', u: ' +
+ u.toString() +
+ r', u2: ' +
+ u2.toString() +
r')';
}
- static SimpleTableThenUint64 _ctor(List<Object> argv) =>
- SimpleTableThenUint64._(argv);
+ static StructWithOptionals _ctor(List<Object> argv) =>
+ StructWithOptionals._(argv);
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.StructType<SimpleTableThenUint64> kSimpleTableThenUint64_Type =
- $fidl.StructType<SimpleTableThenUint64>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
+const $fidl.StructType<StructWithOptionals> kStructWithOptionals_Type =
+ $fidl.StructType<StructWithOptionals>(
+ inlineSizeOld: 104,
+ inlineSizeV1: 128,
members: <$fidl.MemberType>[
- $fidl.MemberType<SimpleTable>(
- type: kSimpleTable_Type, offsetOld: 0, offsetV1: 0),
- $fidl.MemberType<int>(
- type: $fidl.Uint64Type(), offsetOld: 16, offsetV1: 16),
+ $fidl.MemberType<EmptyStruct>(
+ type: kEmptyStruct_Type, offsetOld: 0, offsetV1: 0),
+ $fidl.MemberType<EmptyStruct>(
+ type: $fidl.PointerType<EmptyStruct>(element: kEmptyStruct_Type),
+ offsetOld: 8,
+ offsetV1: 8),
+ $fidl.MemberType<TableWithEmptyStruct>(
+ type: kTableWithEmptyStruct_Type, offsetOld: 16, offsetV1: 16),
+ $fidl.MemberType<XUnionWithEmptyStruct>(
+ type: kXUnionWithEmptyStruct_Type, offsetOld: 32, offsetV1: 32),
+ $fidl.MemberType<XUnionWithEmptyStruct>(
+ type: kXUnionWithEmptyStruct_OptType, offsetOld: 56, offsetV1: 56),
+ $fidl.MemberType<UnionWithEmptyStruct>(
+ type: kUnionWithEmptyStruct_Type, offsetOld: 80, offsetV1: 80),
+ $fidl.MemberType<UnionWithEmptyStruct>(
+ type: kUnionWithEmptyStruct_OptType, offsetOld: 96, offsetV1: 104),
],
- ctor: SimpleTableThenUint64._ctor,
-);
-
-class StructOfTableWithStringAndVector extends $fidl.Struct {
- const StructOfTableWithStringAndVector({
- @required this.table,
- });
- StructOfTableWithStringAndVector.clone(
- StructOfTableWithStringAndVector $orig, {
- TableWithStringAndVector table,
- }) : this(
- table: table ?? $orig.table,
- );
-
- StructOfTableWithStringAndVector._(List<Object> argv) : table = argv[0];
- final TableWithStringAndVector table;
-
- @override
- List<Object> get $fields {
- return <Object>[
- table,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'StructOfTableWithStringAndVector' r'(table: ' +
- table.toString() +
- r')';
- }
-
- static StructOfTableWithStringAndVector _ctor(List<Object> argv) =>
- StructOfTableWithStringAndVector._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<StructOfTableWithStringAndVector>
- kStructOfTableWithStringAndVector_Type =
- $fidl.StructType<StructOfTableWithStringAndVector>(
- inlineSizeOld: 16,
- inlineSizeV1: 16,
- members: <$fidl.MemberType>[
- $fidl.MemberType<TableWithStringAndVector>(
- type: kTableWithStringAndVector_Type, offsetOld: 0, offsetV1: 0),
- ],
- ctor: StructOfTableWithStringAndVector._ctor,
-);
-
-class StructOfReverseOrdinalTable extends $fidl.Struct {
- const StructOfReverseOrdinalTable({
- @required this.table,
- });
- StructOfReverseOrdinalTable.clone(
- StructOfReverseOrdinalTable $orig, {
- ReverseOrdinalTable table,
- }) : this(
- table: table ?? $orig.table,
- );
-
- StructOfReverseOrdinalTable._(List<Object> argv) : table = argv[0];
- final ReverseOrdinalTable table;
-
- @override
- List<Object> get $fields {
- return <Object>[
- table,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'StructOfReverseOrdinalTable' r'(table: ' + table.toString() + r')';
- }
-
- static StructOfReverseOrdinalTable _ctor(List<Object> argv) =>
- StructOfReverseOrdinalTable._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<StructOfReverseOrdinalTable>
- kStructOfReverseOrdinalTable_Type =
- $fidl.StructType<StructOfReverseOrdinalTable>(
- inlineSizeOld: 16,
- inlineSizeV1: 16,
- members: <$fidl.MemberType>[
- $fidl.MemberType<ReverseOrdinalTable>(
- type: kReverseOrdinalTable_Type, offsetOld: 0, offsetV1: 0),
- ],
- ctor: StructOfReverseOrdinalTable._ctor,
-);
-
-class ThreeByte extends $fidl.Struct {
- const ThreeByte({
- @required this.elem1,
- @required this.elem2,
- @required this.elem3,
- });
- ThreeByte.clone(
- ThreeByte $orig, {
- int elem1,
- int elem2,
- int elem3,
- }) : this(
- elem1: elem1 ?? $orig.elem1,
- elem2: elem2 ?? $orig.elem2,
- elem3: elem3 ?? $orig.elem3,
- );
-
- ThreeByte._(List<Object> argv)
- : elem1 = argv[0],
- elem2 = argv[1],
- elem3 = argv[2];
- final int elem1;
- final int elem2;
- final int elem3;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elem1,
- elem2,
- elem3,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'ThreeByte' r'(elem1: ' +
- elem1.toString() +
- r', elem2: ' +
- elem2.toString() +
- r', elem3: ' +
- elem3.toString() +
- r')';
- }
-
- static ThreeByte _ctor(List<Object> argv) => ThreeByte._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<ThreeByte> kThreeByte_Type = $fidl.StructType<ThreeByte>(
- inlineSizeOld: 3,
- inlineSizeV1: 3,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 0, offsetV1: 0),
- $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 1, offsetV1: 1),
- $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 2, offsetV1: 2),
- ],
- ctor: ThreeByte._ctor,
-);
-
-class FiveByte extends $fidl.Struct {
- const FiveByte({
- @required this.elem1,
- @required this.elem2,
- });
- FiveByte.clone(
- FiveByte $orig, {
- int elem1,
- int elem2,
- }) : this(
- elem1: elem1 ?? $orig.elem1,
- elem2: elem2 ?? $orig.elem2,
- );
-
- FiveByte._(List<Object> argv)
- : elem1 = argv[0],
- elem2 = argv[1];
- final int elem1;
- final int elem2;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elem1,
- elem2,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'FiveByte' r'(elem1: ' +
- elem1.toString() +
- r', elem2: ' +
- elem2.toString() +
- r')';
- }
-
- static FiveByte _ctor(List<Object> argv) => FiveByte._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<FiveByte> kFiveByte_Type = $fidl.StructType<FiveByte>(
- inlineSizeOld: 8,
- inlineSizeV1: 8,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(type: $fidl.Uint32Type(), offsetOld: 0, offsetV1: 0),
- $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: 4),
- ],
- ctor: FiveByte._ctor,
-);
-
-class ThreeByteInStruct extends $fidl.Struct {
- const ThreeByteInStruct({
- @required this.elem1,
- @required this.elem2,
- @required this.elem3,
- });
- ThreeByteInStruct.clone(
- ThreeByteInStruct $orig, {
- ThreeByte elem1,
- ThreeByte elem2,
- ThreeByte elem3,
- }) : this(
- elem1: elem1 ?? $orig.elem1,
- elem2: elem2 ?? $orig.elem2,
- elem3: elem3 ?? $orig.elem3,
- );
-
- ThreeByteInStruct._(List<Object> argv)
- : elem1 = argv[0],
- elem2 = argv[1],
- elem3 = argv[2];
- final ThreeByte elem1;
- final ThreeByte elem2;
- final ThreeByte elem3;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elem1,
- elem2,
- elem3,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'ThreeByteInStruct' r'(elem1: ' +
- elem1.toString() +
- r', elem2: ' +
- elem2.toString() +
- r', elem3: ' +
- elem3.toString() +
- r')';
- }
-
- static ThreeByteInStruct _ctor(List<Object> argv) =>
- ThreeByteInStruct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<ThreeByteInStruct> kThreeByteInStruct_Type =
- $fidl.StructType<ThreeByteInStruct>(
- inlineSizeOld: 9,
- inlineSizeV1: 9,
- members: <$fidl.MemberType>[
- $fidl.MemberType<ThreeByte>(
- type: kThreeByte_Type, offsetOld: 0, offsetV1: 0),
- $fidl.MemberType<ThreeByte>(
- type: kThreeByte_Type, offsetOld: 3, offsetV1: 3),
- $fidl.MemberType<ThreeByte>(
- type: kThreeByte_Type, offsetOld: 6, offsetV1: 6),
- ],
- ctor: ThreeByteInStruct._ctor,
-);
-
-class FiveByteInStruct extends $fidl.Struct {
- const FiveByteInStruct({
- @required this.elem1,
- @required this.elem2,
- @required this.elem3,
- });
- FiveByteInStruct.clone(
- FiveByteInStruct $orig, {
- FiveByte elem1,
- FiveByte elem2,
- FiveByte elem3,
- }) : this(
- elem1: elem1 ?? $orig.elem1,
- elem2: elem2 ?? $orig.elem2,
- elem3: elem3 ?? $orig.elem3,
- );
-
- FiveByteInStruct._(List<Object> argv)
- : elem1 = argv[0],
- elem2 = argv[1],
- elem3 = argv[2];
- final FiveByte elem1;
- final FiveByte elem2;
- final FiveByte elem3;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elem1,
- elem2,
- elem3,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'FiveByteInStruct' r'(elem1: ' +
- elem1.toString() +
- r', elem2: ' +
- elem2.toString() +
- r', elem3: ' +
- elem3.toString() +
- r')';
- }
-
- static FiveByteInStruct _ctor(List<Object> argv) => FiveByteInStruct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<FiveByteInStruct> kFiveByteInStruct_Type =
- $fidl.StructType<FiveByteInStruct>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<FiveByte>(type: kFiveByte_Type, offsetOld: 0, offsetV1: 0),
- $fidl.MemberType<FiveByte>(type: kFiveByte_Type, offsetOld: 8, offsetV1: 8),
- $fidl.MemberType<FiveByte>(
- type: kFiveByte_Type, offsetOld: 16, offsetV1: 16),
- ],
- ctor: FiveByteInStruct._ctor,
-);
-
-class ThreeByteInVector extends $fidl.Struct {
- const ThreeByteInVector({
- @required this.elems,
- });
- ThreeByteInVector.clone(
- ThreeByteInVector $orig, {
- List<ThreeByte> elems,
- }) : this(
- elems: elems ?? $orig.elems,
- );
-
- ThreeByteInVector._(List<Object> argv) : elems = argv[0];
- final List<ThreeByte> elems;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elems,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'ThreeByteInVector' r'(elems: ' + elems.toString() + r')';
- }
-
- static ThreeByteInVector _ctor(List<Object> argv) =>
- ThreeByteInVector._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<ThreeByteInVector> kThreeByteInVector_Type =
- $fidl.StructType<ThreeByteInVector>(
- inlineSizeOld: 16,
- inlineSizeV1: 16,
- members: <$fidl.MemberType>[
- $fidl.MemberType<List<ThreeByte>>(
- type: $fidl.VectorType<List<ThreeByte>>(
- element: kThreeByte_Type, maybeElementCount: null, nullable: false),
- offsetOld: 0,
- offsetV1: 0),
- ],
- ctor: ThreeByteInVector._ctor,
-);
-
-class FiveByteInVector extends $fidl.Struct {
- const FiveByteInVector({
- @required this.elems,
- });
- FiveByteInVector.clone(
- FiveByteInVector $orig, {
- List<FiveByte> elems,
- }) : this(
- elems: elems ?? $orig.elems,
- );
-
- FiveByteInVector._(List<Object> argv) : elems = argv[0];
- final List<FiveByte> elems;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elems,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'FiveByteInVector' r'(elems: ' + elems.toString() + r')';
- }
-
- static FiveByteInVector _ctor(List<Object> argv) => FiveByteInVector._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<FiveByteInVector> kFiveByteInVector_Type =
- $fidl.StructType<FiveByteInVector>(
- inlineSizeOld: 16,
- inlineSizeV1: 16,
- members: <$fidl.MemberType>[
- $fidl.MemberType<List<FiveByte>>(
- type: $fidl.VectorType<List<FiveByte>>(
- element: kFiveByte_Type, maybeElementCount: null, nullable: false),
- offsetOld: 0,
- offsetV1: 0),
- ],
- ctor: FiveByteInVector._ctor,
-);
-
-class ThreeByteInArray extends $fidl.Struct {
- const ThreeByteInArray({
- @required this.elems,
- });
- ThreeByteInArray.clone(
- ThreeByteInArray $orig, {
- List<ThreeByte> elems,
- }) : this(
- elems: elems ?? $orig.elems,
- );
-
- ThreeByteInArray._(List<Object> argv) : elems = argv[0];
- final List<ThreeByte> elems;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elems,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'ThreeByteInArray' r'(elems: ' + elems.toString() + r')';
- }
-
- static ThreeByteInArray _ctor(List<Object> argv) => ThreeByteInArray._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<ThreeByteInArray> kThreeByteInArray_Type =
- $fidl.StructType<ThreeByteInArray>(
- inlineSizeOld: 9,
- inlineSizeV1: 9,
- members: <$fidl.MemberType>[
- $fidl.MemberType<List<ThreeByte>>(
- type: $fidl.ArrayType<List<ThreeByte>>(
- element: kThreeByte_Type, elementCount: 3),
- offsetOld: 0,
- offsetV1: 0),
- ],
- ctor: ThreeByteInArray._ctor,
-);
-
-class FiveByteInArray extends $fidl.Struct {
- const FiveByteInArray({
- @required this.elems,
- });
- FiveByteInArray.clone(
- FiveByteInArray $orig, {
- List<FiveByte> elems,
- }) : this(
- elems: elems ?? $orig.elems,
- );
-
- FiveByteInArray._(List<Object> argv) : elems = argv[0];
- final List<FiveByte> elems;
-
- @override
- List<Object> get $fields {
- return <Object>[
- elems,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'FiveByteInArray' r'(elems: ' + elems.toString() + r')';
- }
-
- static FiveByteInArray _ctor(List<Object> argv) => FiveByteInArray._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<FiveByteInArray> kFiveByteInArray_Type =
- $fidl.StructType<FiveByteInArray>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<List<FiveByte>>(
- type: $fidl.ArrayType<List<FiveByte>>(
- element: kFiveByte_Type, elementCount: 3),
- offsetOld: 0,
- offsetV1: 0),
- ],
- ctor: FiveByteInArray._ctor,
+ ctor: StructWithOptionals._ctor,
);
class MyBool extends $fidl.Struct {
@@ -4398,131 +4506,435 @@
ctor: MyFloat64._ctor,
);
-class StructWithOptionals extends $fidl.Struct {
- const StructWithOptionals({
- @required this.s,
- this.s2,
- @required this.t,
- @required this.xu,
- this.xu2,
- @required this.u,
- this.u2,
+class ThreeByte extends $fidl.Struct {
+ const ThreeByte({
+ @required this.elem1,
+ @required this.elem2,
+ @required this.elem3,
});
- StructWithOptionals.clone(
- StructWithOptionals $orig, {
- EmptyStruct s,
- EmptyStruct s2,
- TableWithEmptyStruct t,
- XUnionWithEmptyStruct xu,
- XUnionWithEmptyStruct xu2,
- UnionWithEmptyStruct u,
- UnionWithEmptyStruct u2,
+ ThreeByte.clone(
+ ThreeByte $orig, {
+ int elem1,
+ int elem2,
+ int elem3,
}) : this(
- s: s ?? $orig.s,
- s2: s2 ?? $orig.s2,
- t: t ?? $orig.t,
- xu: xu ?? $orig.xu,
- xu2: xu2 ?? $orig.xu2,
- u: u ?? $orig.u,
- u2: u2 ?? $orig.u2,
+ elem1: elem1 ?? $orig.elem1,
+ elem2: elem2 ?? $orig.elem2,
+ elem3: elem3 ?? $orig.elem3,
);
- StructWithOptionals.cloneWithout(
- StructWithOptionals $orig, {
- bool s2,
- bool xu2,
- bool u2,
- }) : this(
- s: $orig.s,
- s2: s2 ? null : $orig.s2,
- t: $orig.t,
- xu: $orig.xu,
- xu2: xu2 ? null : $orig.xu2,
- u: $orig.u,
- u2: u2 ? null : $orig.u2,
- );
-
- StructWithOptionals._(List<Object> argv)
- : s = argv[0],
- s2 = argv[1],
- t = argv[2],
- xu = argv[3],
- xu2 = argv[4],
- u = argv[5],
- u2 = argv[6];
- final EmptyStruct s;
- final EmptyStruct s2;
- final TableWithEmptyStruct t;
- final XUnionWithEmptyStruct xu;
- final XUnionWithEmptyStruct xu2;
- final UnionWithEmptyStruct u;
- final UnionWithEmptyStruct u2;
+ ThreeByte._(List<Object> argv)
+ : elem1 = argv[0],
+ elem2 = argv[1],
+ elem3 = argv[2];
+ final int elem1;
+ final int elem2;
+ final int elem3;
@override
List<Object> get $fields {
return <Object>[
- s,
- s2,
- t,
- xu,
- xu2,
- u,
- u2,
+ elem1,
+ elem2,
+ elem3,
];
}
@override
String toString() {
// ignore: prefer_interpolation_to_compose_strings
- return r'StructWithOptionals' r'(s: ' +
- s.toString() +
- r', s2: ' +
- s2.toString() +
- r', t: ' +
- t.toString() +
- r', xu: ' +
- xu.toString() +
- r', xu2: ' +
- xu2.toString() +
- r', u: ' +
- u.toString() +
- r', u2: ' +
- u2.toString() +
+ return r'ThreeByte' r'(elem1: ' +
+ elem1.toString() +
+ r', elem2: ' +
+ elem2.toString() +
+ r', elem3: ' +
+ elem3.toString() +
r')';
}
- static StructWithOptionals _ctor(List<Object> argv) =>
- StructWithOptionals._(argv);
+ static ThreeByte _ctor(List<Object> argv) => ThreeByte._(argv);
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.StructType<StructWithOptionals> kStructWithOptionals_Type =
- $fidl.StructType<StructWithOptionals>(
- inlineSizeOld: 104,
- inlineSizeV1: 128,
+const $fidl.StructType<ThreeByte> kThreeByte_Type = $fidl.StructType<ThreeByte>(
+ inlineSizeOld: 3,
+ inlineSizeV1: 3,
members: <$fidl.MemberType>[
- $fidl.MemberType<EmptyStruct>(
- type: kEmptyStruct_Type, offsetOld: 0, offsetV1: 0),
- $fidl.MemberType<EmptyStruct>(
- type: $fidl.PointerType<EmptyStruct>(element: kEmptyStruct_Type),
- offsetOld: 8,
- offsetV1: 8),
- $fidl.MemberType<TableWithEmptyStruct>(
- type: kTableWithEmptyStruct_Type, offsetOld: 16, offsetV1: 16),
- $fidl.MemberType<XUnionWithEmptyStruct>(
- type: kXUnionWithEmptyStruct_Type, offsetOld: 32, offsetV1: 32),
- $fidl.MemberType<XUnionWithEmptyStruct>(
- type: kXUnionWithEmptyStruct_OptType, offsetOld: 56, offsetV1: 56),
- $fidl.MemberType<UnionWithEmptyStruct>(
- type: kUnionWithEmptyStruct_Type, offsetOld: 80, offsetV1: 80),
- $fidl.MemberType<UnionWithEmptyStruct>(
- type: $fidl.OptUnionType<UnionWithEmptyStruct>(
- element: kUnionWithEmptyStruct_Type),
- offsetOld: 96,
- offsetV1: 104),
+ $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 0, offsetV1: 0),
+ $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 1, offsetV1: 1),
+ $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 2, offsetV1: 2),
],
- ctor: StructWithOptionals._ctor,
+ ctor: ThreeByte._ctor,
+);
+
+class FiveByte extends $fidl.Struct {
+ const FiveByte({
+ @required this.elem1,
+ @required this.elem2,
+ });
+ FiveByte.clone(
+ FiveByte $orig, {
+ int elem1,
+ int elem2,
+ }) : this(
+ elem1: elem1 ?? $orig.elem1,
+ elem2: elem2 ?? $orig.elem2,
+ );
+
+ FiveByte._(List<Object> argv)
+ : elem1 = argv[0],
+ elem2 = argv[1];
+ final int elem1;
+ final int elem2;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elem1,
+ elem2,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'FiveByte' r'(elem1: ' +
+ elem1.toString() +
+ r', elem2: ' +
+ elem2.toString() +
+ r')';
+ }
+
+ static FiveByte _ctor(List<Object> argv) => FiveByte._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<FiveByte> kFiveByte_Type = $fidl.StructType<FiveByte>(
+ inlineSizeOld: 8,
+ inlineSizeV1: 8,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<int>(type: $fidl.Uint32Type(), offsetOld: 0, offsetV1: 0),
+ $fidl.MemberType<int>(type: $fidl.Uint8Type(), offsetOld: 4, offsetV1: 4),
+ ],
+ ctor: FiveByte._ctor,
+);
+
+class ThreeByteInStruct extends $fidl.Struct {
+ const ThreeByteInStruct({
+ @required this.elem1,
+ @required this.elem2,
+ @required this.elem3,
+ });
+ ThreeByteInStruct.clone(
+ ThreeByteInStruct $orig, {
+ ThreeByte elem1,
+ ThreeByte elem2,
+ ThreeByte elem3,
+ }) : this(
+ elem1: elem1 ?? $orig.elem1,
+ elem2: elem2 ?? $orig.elem2,
+ elem3: elem3 ?? $orig.elem3,
+ );
+
+ ThreeByteInStruct._(List<Object> argv)
+ : elem1 = argv[0],
+ elem2 = argv[1],
+ elem3 = argv[2];
+ final ThreeByte elem1;
+ final ThreeByte elem2;
+ final ThreeByte elem3;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elem1,
+ elem2,
+ elem3,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'ThreeByteInStruct' r'(elem1: ' +
+ elem1.toString() +
+ r', elem2: ' +
+ elem2.toString() +
+ r', elem3: ' +
+ elem3.toString() +
+ r')';
+ }
+
+ static ThreeByteInStruct _ctor(List<Object> argv) =>
+ ThreeByteInStruct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<ThreeByteInStruct> kThreeByteInStruct_Type =
+ $fidl.StructType<ThreeByteInStruct>(
+ inlineSizeOld: 9,
+ inlineSizeV1: 9,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<ThreeByte>(
+ type: kThreeByte_Type, offsetOld: 0, offsetV1: 0),
+ $fidl.MemberType<ThreeByte>(
+ type: kThreeByte_Type, offsetOld: 3, offsetV1: 3),
+ $fidl.MemberType<ThreeByte>(
+ type: kThreeByte_Type, offsetOld: 6, offsetV1: 6),
+ ],
+ ctor: ThreeByteInStruct._ctor,
+);
+
+class FiveByteInStruct extends $fidl.Struct {
+ const FiveByteInStruct({
+ @required this.elem1,
+ @required this.elem2,
+ @required this.elem3,
+ });
+ FiveByteInStruct.clone(
+ FiveByteInStruct $orig, {
+ FiveByte elem1,
+ FiveByte elem2,
+ FiveByte elem3,
+ }) : this(
+ elem1: elem1 ?? $orig.elem1,
+ elem2: elem2 ?? $orig.elem2,
+ elem3: elem3 ?? $orig.elem3,
+ );
+
+ FiveByteInStruct._(List<Object> argv)
+ : elem1 = argv[0],
+ elem2 = argv[1],
+ elem3 = argv[2];
+ final FiveByte elem1;
+ final FiveByte elem2;
+ final FiveByte elem3;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elem1,
+ elem2,
+ elem3,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'FiveByteInStruct' r'(elem1: ' +
+ elem1.toString() +
+ r', elem2: ' +
+ elem2.toString() +
+ r', elem3: ' +
+ elem3.toString() +
+ r')';
+ }
+
+ static FiveByteInStruct _ctor(List<Object> argv) => FiveByteInStruct._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<FiveByteInStruct> kFiveByteInStruct_Type =
+ $fidl.StructType<FiveByteInStruct>(
+ inlineSizeOld: 24,
+ inlineSizeV1: 24,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<FiveByte>(type: kFiveByte_Type, offsetOld: 0, offsetV1: 0),
+ $fidl.MemberType<FiveByte>(type: kFiveByte_Type, offsetOld: 8, offsetV1: 8),
+ $fidl.MemberType<FiveByte>(
+ type: kFiveByte_Type, offsetOld: 16, offsetV1: 16),
+ ],
+ ctor: FiveByteInStruct._ctor,
+);
+
+class ThreeByteInVector extends $fidl.Struct {
+ const ThreeByteInVector({
+ @required this.elems,
+ });
+ ThreeByteInVector.clone(
+ ThreeByteInVector $orig, {
+ List<ThreeByte> elems,
+ }) : this(
+ elems: elems ?? $orig.elems,
+ );
+
+ ThreeByteInVector._(List<Object> argv) : elems = argv[0];
+ final List<ThreeByte> elems;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elems,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'ThreeByteInVector' r'(elems: ' + elems.toString() + r')';
+ }
+
+ static ThreeByteInVector _ctor(List<Object> argv) =>
+ ThreeByteInVector._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<ThreeByteInVector> kThreeByteInVector_Type =
+ $fidl.StructType<ThreeByteInVector>(
+ inlineSizeOld: 16,
+ inlineSizeV1: 16,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<List<ThreeByte>>(
+ type: $fidl.VectorType<List<ThreeByte>>(
+ element: kThreeByte_Type, maybeElementCount: null, nullable: false),
+ offsetOld: 0,
+ offsetV1: 0),
+ ],
+ ctor: ThreeByteInVector._ctor,
+);
+
+class FiveByteInVector extends $fidl.Struct {
+ const FiveByteInVector({
+ @required this.elems,
+ });
+ FiveByteInVector.clone(
+ FiveByteInVector $orig, {
+ List<FiveByte> elems,
+ }) : this(
+ elems: elems ?? $orig.elems,
+ );
+
+ FiveByteInVector._(List<Object> argv) : elems = argv[0];
+ final List<FiveByte> elems;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elems,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'FiveByteInVector' r'(elems: ' + elems.toString() + r')';
+ }
+
+ static FiveByteInVector _ctor(List<Object> argv) => FiveByteInVector._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<FiveByteInVector> kFiveByteInVector_Type =
+ $fidl.StructType<FiveByteInVector>(
+ inlineSizeOld: 16,
+ inlineSizeV1: 16,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<List<FiveByte>>(
+ type: $fidl.VectorType<List<FiveByte>>(
+ element: kFiveByte_Type, maybeElementCount: null, nullable: false),
+ offsetOld: 0,
+ offsetV1: 0),
+ ],
+ ctor: FiveByteInVector._ctor,
+);
+
+class ThreeByteInArray extends $fidl.Struct {
+ const ThreeByteInArray({
+ @required this.elems,
+ });
+ ThreeByteInArray.clone(
+ ThreeByteInArray $orig, {
+ List<ThreeByte> elems,
+ }) : this(
+ elems: elems ?? $orig.elems,
+ );
+
+ ThreeByteInArray._(List<Object> argv) : elems = argv[0];
+ final List<ThreeByte> elems;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elems,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'ThreeByteInArray' r'(elems: ' + elems.toString() + r')';
+ }
+
+ static ThreeByteInArray _ctor(List<Object> argv) => ThreeByteInArray._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<ThreeByteInArray> kThreeByteInArray_Type =
+ $fidl.StructType<ThreeByteInArray>(
+ inlineSizeOld: 9,
+ inlineSizeV1: 9,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<List<ThreeByte>>(
+ type: $fidl.ArrayType<List<ThreeByte>>(
+ element: kThreeByte_Type, elementCount: 3),
+ offsetOld: 0,
+ offsetV1: 0),
+ ],
+ ctor: ThreeByteInArray._ctor,
+);
+
+class FiveByteInArray extends $fidl.Struct {
+ const FiveByteInArray({
+ @required this.elems,
+ });
+ FiveByteInArray.clone(
+ FiveByteInArray $orig, {
+ List<FiveByte> elems,
+ }) : this(
+ elems: elems ?? $orig.elems,
+ );
+
+ FiveByteInArray._(List<Object> argv) : elems = argv[0];
+ final List<FiveByte> elems;
+
+ @override
+ List<Object> get $fields {
+ return <Object>[
+ elems,
+ ];
+ }
+
+ @override
+ String toString() {
+ // ignore: prefer_interpolation_to_compose_strings
+ return r'FiveByteInArray' r'(elems: ' + elems.toString() + r')';
+ }
+
+ static FiveByteInArray _ctor(List<Object> argv) => FiveByteInArray._(argv);
+}
+
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.StructType<FiveByteInArray> kFiveByteInArray_Type =
+ $fidl.StructType<FiveByteInArray>(
+ inlineSizeOld: 24,
+ inlineSizeV1: 24,
+ members: <$fidl.MemberType>[
+ $fidl.MemberType<List<FiveByte>>(
+ type: $fidl.ArrayType<List<FiveByte>>(
+ element: kFiveByte_Type, elementCount: 3),
+ offsetOld: 0,
+ offsetV1: 0),
+ ],
+ ctor: FiveByteInArray._ctor,
);
class StructSize16Align8 extends $fidl.Struct {
@@ -4712,10 +5124,7 @@
members: <$fidl.MemberType>[
$fidl.MemberType<int>(type: $fidl.Uint32Type(), offsetOld: 0, offsetV1: 0),
$fidl.MemberType<UnionSize8Align4>(
- type: $fidl.OptUnionType<UnionSize8Align4>(
- element: kUnionSize8Align4_Type),
- offsetOld: 8,
- offsetV1: 8),
+ type: kUnionSize8Align4_OptType, offsetOld: 8, offsetV1: 8),
$fidl.MemberType<int>(
type: $fidl.Uint32Type(), offsetOld: 16, offsetV1: 32),
],
@@ -6113,9 +6522,7 @@
offsetV1: 0),
$fidl.MemberType<List<StringUnion>>(
type: $fidl.ArrayType<List<StringUnion>>(
- element:
- $fidl.OptUnionType<StringUnion>(element: kStringUnion_Type),
- elementCount: 3),
+ element: kStringUnion_OptType, elementCount: 3),
offsetOld: 72,
offsetV1: 72),
],
@@ -6986,8 +7393,7 @@
members: <$fidl.MemberType>[
$fidl.MemberType<List<StringUnion>>(
type: $fidl.VectorType<List<StringUnion>>(
- element:
- $fidl.OptUnionType<StringUnion>(element: kStringUnion_Type),
+ element: kStringUnion_OptType,
maybeElementCount: 3,
nullable: false),
offsetOld: 0,
@@ -7196,289 +7602,6 @@
ctor: CreateComponentRequest._ctor,
);
-class Int64Struct extends $fidl.Struct {
- const Int64Struct({
- @required this.x,
- });
- Int64Struct.clone(
- Int64Struct $orig, {
- int x,
- }) : this(
- x: x ?? $orig.x,
- );
-
- Int64Struct._(List<Object> argv) : x = argv[0];
- final int x;
-
- @override
- List<Object> get $fields {
- return <Object>[
- x,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'Int64Struct' r'(x: ' + x.toString() + r')';
- }
-
- static Int64Struct _ctor(List<Object> argv) => Int64Struct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<Int64Struct> kInt64Struct_Type =
- $fidl.StructType<Int64Struct>(
- inlineSizeOld: 8,
- inlineSizeV1: 8,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(type: $fidl.Int64Type(), offsetOld: 0, offsetV1: 0),
- ],
- ctor: Int64Struct._ctor,
-);
-
-class TestInlineXUnionInStruct extends $fidl.Struct {
- const TestInlineXUnionInStruct({
- @required this.before,
- @required this.xu,
- @required this.after,
- });
- TestInlineXUnionInStruct.clone(
- TestInlineXUnionInStruct $orig, {
- String before,
- SampleXUnion xu,
- String after,
- }) : this(
- before: before ?? $orig.before,
- xu: xu ?? $orig.xu,
- after: after ?? $orig.after,
- );
-
- TestInlineXUnionInStruct._(List<Object> argv)
- : before = argv[0],
- xu = argv[1],
- after = argv[2];
- final String before;
- final SampleXUnion xu;
- final String after;
-
- @override
- List<Object> get $fields {
- return <Object>[
- before,
- xu,
- after,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'TestInlineXUnionInStruct' r'(before: ' +
- before.toString() +
- r', xu: ' +
- xu.toString() +
- r', after: ' +
- after.toString() +
- r')';
- }
-
- static TestInlineXUnionInStruct _ctor(List<Object> argv) =>
- TestInlineXUnionInStruct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<TestInlineXUnionInStruct>
- kTestInlineXUnionInStruct_Type = $fidl.StructType<TestInlineXUnionInStruct>(
- inlineSizeOld: 56,
- inlineSizeV1: 56,
- members: <$fidl.MemberType>[
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 0,
- offsetV1: 0),
- $fidl.MemberType<SampleXUnion>(
- type: kSampleXUnion_Type, offsetOld: 16, offsetV1: 16),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 40,
- offsetV1: 40),
- ],
- ctor: TestInlineXUnionInStruct._ctor,
-);
-
-class TestOptionalXUnionInStruct extends $fidl.Struct {
- const TestOptionalXUnionInStruct({
- @required this.before,
- this.xu,
- @required this.after,
- });
- TestOptionalXUnionInStruct.clone(
- TestOptionalXUnionInStruct $orig, {
- String before,
- SampleXUnion xu,
- String after,
- }) : this(
- before: before ?? $orig.before,
- xu: xu ?? $orig.xu,
- after: after ?? $orig.after,
- );
-
- TestOptionalXUnionInStruct.cloneWithout(
- TestOptionalXUnionInStruct $orig, {
- bool xu,
- }) : this(
- before: $orig.before,
- xu: xu ? null : $orig.xu,
- after: $orig.after,
- );
-
- TestOptionalXUnionInStruct._(List<Object> argv)
- : before = argv[0],
- xu = argv[1],
- after = argv[2];
- final String before;
- final SampleXUnion xu;
- final String after;
-
- @override
- List<Object> get $fields {
- return <Object>[
- before,
- xu,
- after,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'TestOptionalXUnionInStruct' r'(before: ' +
- before.toString() +
- r', xu: ' +
- xu.toString() +
- r', after: ' +
- after.toString() +
- r')';
- }
-
- static TestOptionalXUnionInStruct _ctor(List<Object> argv) =>
- TestOptionalXUnionInStruct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<TestOptionalXUnionInStruct>
- kTestOptionalXUnionInStruct_Type =
- $fidl.StructType<TestOptionalXUnionInStruct>(
- inlineSizeOld: 56,
- inlineSizeV1: 56,
- members: <$fidl.MemberType>[
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 0,
- offsetV1: 0),
- $fidl.MemberType<SampleXUnion>(
- type: kSampleXUnion_OptType, offsetOld: 16, offsetV1: 16),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 40,
- offsetV1: 40),
- ],
- ctor: TestOptionalXUnionInStruct._ctor,
-);
-
-class TestStrictXUnionInStruct extends $fidl.Struct {
- const TestStrictXUnionInStruct({
- @required this.xu,
- });
- TestStrictXUnionInStruct.clone(
- TestStrictXUnionInStruct $orig, {
- SampleStrictXUnion xu,
- }) : this(
- xu: xu ?? $orig.xu,
- );
-
- TestStrictXUnionInStruct._(List<Object> argv) : xu = argv[0];
- final SampleStrictXUnion xu;
-
- @override
- List<Object> get $fields {
- return <Object>[
- xu,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'TestStrictXUnionInStruct' r'(xu: ' + xu.toString() + r')';
- }
-
- static TestStrictXUnionInStruct _ctor(List<Object> argv) =>
- TestStrictXUnionInStruct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<TestStrictXUnionInStruct>
- kTestStrictXUnionInStruct_Type = $fidl.StructType<TestStrictXUnionInStruct>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<SampleStrictXUnion>(
- type: kSampleStrictXUnion_Type, offsetOld: 0, offsetV1: 0),
- ],
- ctor: TestStrictXUnionInStruct._ctor,
-);
-
-class TestFlexibleXUnionInStruct extends $fidl.Struct {
- const TestFlexibleXUnionInStruct({
- @required this.xu,
- });
- TestFlexibleXUnionInStruct.clone(
- TestFlexibleXUnionInStruct $orig, {
- SampleXUnion xu,
- }) : this(
- xu: xu ?? $orig.xu,
- );
-
- TestFlexibleXUnionInStruct._(List<Object> argv) : xu = argv[0];
- final SampleXUnion xu;
-
- @override
- List<Object> get $fields {
- return <Object>[
- xu,
- ];
- }
-
- @override
- String toString() {
- // ignore: prefer_interpolation_to_compose_strings
- return r'TestFlexibleXUnionInStruct' r'(xu: ' + xu.toString() + r')';
- }
-
- static TestFlexibleXUnionInStruct _ctor(List<Object> argv) =>
- TestFlexibleXUnionInStruct._(argv);
-}
-
-// See FIDL-308:
-// ignore: recursive_compile_time_constant
-const $fidl.StructType<TestFlexibleXUnionInStruct>
- kTestFlexibleXUnionInStruct_Type =
- $fidl.StructType<TestFlexibleXUnionInStruct>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<SampleXUnion>(
- type: kSampleXUnion_Type, offsetOld: 0, offsetV1: 0),
- ],
- ctor: TestFlexibleXUnionInStruct._ctor,
-);
-
class XUnionInTable extends $fidl.Table {
const XUnionInTable({
this.before,
diff --git a/bin/fidl_compatibility_test/dart/BUILD.gn b/bin/fidl_compatibility_test/dart/BUILD.gn
index 74806ff..cfaab91c 100644
--- a/bin/fidl_compatibility_test/dart/BUILD.gn
+++ b/bin/fidl_compatibility_test/dart/BUILD.gn
@@ -4,24 +4,7 @@
import("//topaz/runtime/dart_runner/dart_app.gni")
-dart_app("fidl_dart_compatibility_test_server") {
- main_dart = "lib/main.dart"
-
- meta = [
- {
- path = rebase_path("meta/fidl_dart_compatibility_test_server.cmx")
- dest = "fidl_dart_compatibility_test_server.cmx"
- },
- ]
-
- source_dir = "."
- sources = []
- deps = [
- "//garnet/public/lib/fidl/compatibility_test:compatibility_test_service",
- "//topaz/public/dart/fuchsia_services",
- ]
-}
-
+# TODO(fxb/43211) cleanup "write_xunion" bits
dart_app("fidl_dart_write_xunion_compatibility_test_server") {
main_dart = "lib/main.dart"
diff --git a/bin/fidl_compatibility_test/dart/meta/fidl_dart_compatibility_test_server.cmx b/bin/fidl_compatibility_test/dart/meta/fidl_dart_compatibility_test_server.cmx
deleted file mode 100644
index d3fa486..0000000
--- a/bin/fidl_compatibility_test/dart/meta/fidl_dart_compatibility_test_server.cmx
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "program": {
- "data": "data/fidl_dart_compatibility_test_server"
- },
- "sandbox": {
- "services": [
- "fuchsia.logger.LogSink",
- "fuchsia.sys.Launcher",
- "fuchsia.sys.Environment"
- ]
- }
-}
diff --git a/bin/fidl_compatibility_test/meta/fidl_compatibility_test_topaz.cmx b/bin/fidl_compatibility_test/meta/fidl_compatibility_test_topaz.cmx
index 45c20e5..0991404 100644
--- a/bin/fidl_compatibility_test/meta/fidl_compatibility_test_topaz.cmx
+++ b/bin/fidl_compatibility_test/meta/fidl_compatibility_test_topaz.cmx
@@ -1,7 +1,6 @@
{
"program": {
"args": [
- "fuchsia-pkg://fuchsia.com/fidl_dart_compatibility_test_server#meta/fidl_dart_compatibility_test_server.cmx",
"fuchsia-pkg://fuchsia.com/fidl_dart_write_xunion_compatibility_test_server#meta/fidl_dart_write_xunion_compatibility_test_server.cmx"
],
"binary": "test/fidl_compatibility_test_topaz"
diff --git a/bin/fidlgen_dart/backend/ir/ir.go b/bin/fidlgen_dart/backend/ir/ir.go
index 3cb4ba4..58663ee 100644
--- a/bin/fidlgen_dart/backend/ir/ir.go
+++ b/bin/fidlgen_dart/backend/ir/ir.go
@@ -776,11 +776,10 @@
r.AsyncDecl = r.SyncDecl
if val.Nullable {
switch r.declType {
+ case types.UnionDeclType:
+ fallthrough
case types.XUnionDeclType:
r.typeExpr = c.optTypeSymbolForCompoundIdentifier(types.ParseCompoundIdentifier(val.Identifier))
- case types.UnionDeclType:
- r.typeExpr = fmt.Sprintf("$fidl.OptUnionType<%s>(element: %s)",
- t, c.typeSymbolForCompoundIdentifier(types.ParseCompoundIdentifier(val.Identifier)))
default:
r.typeExpr = fmt.Sprintf("$fidl.PointerType<%s>(element: %s)",
t, c.typeSymbolForCompoundIdentifier(types.ParseCompoundIdentifier(val.Identifier)))
@@ -1266,7 +1265,8 @@
}
for _, v := range r.Unions {
- root.Unions = append(root.Unions, c.compileUnion(v))
+ vConverted := types.ConvertUnionToXUnion(v)
+ root.XUnions = append(root.XUnions, c.compileXUnion(vConverted))
}
for _, v := range r.XUnions {
diff --git a/bin/fidlgen_dart/backend/ir/ir_test.go b/bin/fidlgen_dart/backend/ir/ir_test.go
index 8a309f5..84d4dc7 100644
--- a/bin/fidlgen_dart/backend/ir/ir_test.go
+++ b/bin/fidlgen_dart/backend/ir/ir_test.go
@@ -101,7 +101,7 @@
cases := []struct {
name string
input types.Union
- expected Union
+ expected XUnion
}{
{
name: "SingleInt64",
@@ -137,10 +137,10 @@
MaxHandles: 0,
MaxOutOfLine: 4294967295,
},
- expected: Union{
+ expected: XUnion{
Name: "Test",
TagName: "TestTag",
- Members: []UnionMember{
+ Members: []XUnionMember{
{
Type: Type{
Decl: "int",
@@ -149,15 +149,17 @@
typedDataDecl: "Int64List",
typeExpr: "$fidl.Int64Type()",
},
- Name: "i",
- XUnionOrdinal: 0xdeadbeef,
- CtorName: "I",
- Tag: "i",
- typeExpr: "$fidl.MemberType<int>(type: $fidl.Int64Type(), offsetOld: 0, offsetV1: -1 /* unused */)",
+ Name: "i",
+ Ordinal: 0xdeadbeef,
+ CtorName: "I",
+ Tag: "i",
},
},
- TypeSymbol: "kTest_Type",
- TypeExpr: "$fidl.UnionType<Test>(\n inlineSizeOld: 0,\n inlineSizeV1: 0,\n members: <$fidl.MemberType>[\n $fidl.MemberType<int>(type: $fidl.Int64Type(), offsetOld: 0, offsetV1: -1 /* unused */),\n ],\n ctor: Test._ctor,\n ordinalToIndex: <int, int>{\n 3735928559: 0,\n },\n)",
+ TypeSymbol: "kTest_Type",
+ TypeExpr: "$fidl.XUnionType<Test>(\n members: <int, $fidl.FidlType>{\n 3735928559: $fidl.Int64Type(),\n },\n ctor: Test._ctor,\n nullable: false,\n flexible: false,\n)",
+ OptTypeSymbol: "kTest_OptType",
+ OptTypeExpr: "$fidl.XUnionType<Test>(\nmembers: <int, $fidl.FidlType>{\n 3735928559: $fidl.Int64Type(),\n },\nctor: Test._ctor,\nnullable: true,\nflexible: false,\n)",
+ Strictness: true,
},
},
}
@@ -170,9 +172,9 @@
},
}
result := Compile(root)
- actual := result.Unions[0]
+ actual := result.XUnions[0]
- if diff := cmp.Diff(ex.expected, actual, cmp.AllowUnexported(UnionMember{}, Type{})); diff != "" {
+ if diff := cmp.Diff(ex.expected, actual, cmp.AllowUnexported(XUnionMember{}, Type{})); diff != "" {
t.Errorf("expected != actual (-want +got)\n%s", diff)
}
})
diff --git a/bin/fidlgen_dart/backend/templates/interface.tmpl.go b/bin/fidlgen_dart/backend/templates/interface.tmpl.go
index 1b5a50c..2c84c2b 100644
--- a/bin/fidlgen_dart/backend/templates/interface.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/interface.tmpl.go
@@ -557,7 +557,7 @@
// ignore: prefer_const_declarations
final $response = {{- template "DecodeResponse" . -}};
{{ if .Response.HasError }}
- if ($response.tag == {{ .Response.ResultType.TagName }}.response) {
+ if ($response.$tag == {{ .Response.ResultType.TagName }}.response) {
{{ if .AsyncResponseClass }}
$completer.complete(
{{ .AsyncResponseClass }}(
diff --git a/bin/fidlgen_dart/backend/templates/union.tmpl.go b/bin/fidlgen_dart/backend/templates/union.tmpl.go
index 0efc5ff..8355e76 100644
--- a/bin/fidlgen_dart/backend/templates/union.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/union.tmpl.go
@@ -54,11 +54,6 @@
{{- end }}
{{ .TagName }} get $tag => _tag;
- // TODO: remove, see: FIDL-587
- {{ .TagName }} get tag => _tag;
-
- @override
- int get $index => _tag.index;
@override
Object get $data => _data;
diff --git a/bin/fidlgen_dart/goldens/doc_comments.test.fidl.json_async.dart.golden b/bin/fidlgen_dart/goldens/doc_comments.test.fidl.json_async.dart.golden
index 196432e..8f3a67e 100644
--- a/bin/fidlgen_dart/goldens/doc_comments.test.fidl.json_async.dart.golden
+++ b/bin/fidlgen_dart/goldens/doc_comments.test.fidl.json_async.dart.golden
@@ -42,25 +42,32 @@
const int c = 0x4;
enum UnionTag {
- field,
+ field, // 0x1
}
+const Map<int, UnionTag> _UnionTag_map = {
+ 1: UnionTag.field,
+};
+
/// union comment #1
///
/// union comment #3
-class Union extends $fidl.Union {
+class Union extends $fidl.XUnion {
const Union.withField(int value)
- : _data = value,
- _tag = UnionTag.field;
+ : _ordinal = 1,
+ _data = value;
- Union._(UnionTag tag, Object data)
- : _tag = tag,
+ Union._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final UnionTag _tag;
+ final int _ordinal;
final _data;
+
+ UnionTag get $tag => _UnionTag_map[_ordinal];
+
int get field {
- if (_tag != UnionTag.field) {
+ if (_ordinal != 1) {
return null;
}
return _data;
@@ -68,46 +75,44 @@
@override
String toString() {
- switch (_tag) {
- case UnionTag.field:
- return r'Union.field($field)';
+ switch (_ordinal) {
+ case 1:
+ return 'Union.field($field)';
default:
return null;
}
}
- /// union comment #1
- ///
- /// union comment #3
-
- UnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static Union _ctor(int index, Object data) {
- return Union._(UnionTag.values[index], data);
+ static Union _ctor(int ordinal, Object data) {
+ return Union._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<Union> kUnion_Type = $fidl.UnionType<Union>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Int32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: Union._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<Union> kUnion_Type = $fidl.XUnionType<Union>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
},
+ ctor: Union._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<Union> kUnion_OptType = $fidl.XUnionType<Union>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ },
+ ctor: Union._ctor,
+ nullable: true,
+ flexible: false,
);
/// struct comment #1
diff --git a/bin/fidlgen_dart/goldens/protocols.test.fidl.json_async.dart.golden b/bin/fidlgen_dart/goldens/protocols.test.fidl.json_async.dart.golden
index 1e341ca..376a273 100644
--- a/bin/fidlgen_dart/goldens/protocols.test.fidl.json_async.dart.golden
+++ b/bin/fidlgen_dart/goldens/protocols.test.fidl.json_async.dart.golden
@@ -89,36 +89,45 @@
$fidl.EnumType<ErrorEnun>(type: $fidl.Uint32Type(), ctor: ErrorEnun._ctor);
enum WithErrorSyntaxResponseAsStructResultTag {
- response,
- err,
+ response, // 0x1
+ err, // 0x2
}
-class WithErrorSyntaxResponseAsStructResult extends $fidl.Union {
+const Map<int, WithErrorSyntaxResponseAsStructResultTag>
+ _WithErrorSyntaxResponseAsStructResultTag_map = {
+ 1: WithErrorSyntaxResponseAsStructResultTag.response,
+ 2: WithErrorSyntaxResponseAsStructResultTag.err,
+};
+
+class WithErrorSyntaxResponseAsStructResult extends $fidl.XUnion {
const WithErrorSyntaxResponseAsStructResult.withResponse(
WithErrorSyntaxResponseAsStructResponse value)
- : _data = value,
- _tag = WithErrorSyntaxResponseAsStructResultTag.response;
+ : _ordinal = 1,
+ _data = value;
const WithErrorSyntaxResponseAsStructResult.withErr(int value)
- : _data = value,
- _tag = WithErrorSyntaxResponseAsStructResultTag.err;
+ : _ordinal = 2,
+ _data = value;
- WithErrorSyntaxResponseAsStructResult._(
- WithErrorSyntaxResponseAsStructResultTag tag, Object data)
- : _tag = tag,
+ WithErrorSyntaxResponseAsStructResult._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final WithErrorSyntaxResponseAsStructResultTag _tag;
+ final int _ordinal;
final _data;
+
+ WithErrorSyntaxResponseAsStructResultTag get $tag =>
+ _WithErrorSyntaxResponseAsStructResultTag_map[_ordinal];
+
WithErrorSyntaxResponseAsStructResponse get response {
- if (_tag != WithErrorSyntaxResponseAsStructResultTag.response) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
int get err {
- if (_tag != WithErrorSyntaxResponseAsStructResultTag.err) {
+ if (_ordinal != 2) {
return null;
}
return _data;
@@ -126,85 +135,94 @@
@override
String toString() {
- switch (_tag) {
- case WithErrorSyntaxResponseAsStructResultTag.response:
- return r'WithErrorSyntaxResponseAsStructResult.response($response)';
- case WithErrorSyntaxResponseAsStructResultTag.err:
- return r'WithErrorSyntaxResponseAsStructResult.err($err)';
+ switch (_ordinal) {
+ case 1:
+ return 'WithErrorSyntaxResponseAsStructResult.response($response)';
+ case 2:
+ return 'WithErrorSyntaxResponseAsStructResult.err($err)';
default:
return null;
}
}
- WithErrorSyntaxResponseAsStructResultTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- WithErrorSyntaxResponseAsStructResultTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static WithErrorSyntaxResponseAsStructResult _ctor(int index, Object data) {
- return WithErrorSyntaxResponseAsStructResult._(
- WithErrorSyntaxResponseAsStructResultTag.values[index], data);
+ static WithErrorSyntaxResponseAsStructResult _ctor(int ordinal, Object data) {
+ return WithErrorSyntaxResponseAsStructResult._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<WithErrorSyntaxResponseAsStructResult>
+const $fidl.XUnionType<WithErrorSyntaxResponseAsStructResult>
kWithErrorSyntax_ResponseAsStruct_Result_Type =
- $fidl.UnionType<WithErrorSyntaxResponseAsStructResult>(
- inlineSizeOld: 32,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<WithErrorSyntaxResponseAsStructResponse>(
- type: kWithErrorSyntax_ResponseAsStruct_Response_Type,
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- ],
- ctor: WithErrorSyntaxResponseAsStructResult._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
+ $fidl.XUnionType<WithErrorSyntaxResponseAsStructResult>(
+ members: <int, $fidl.FidlType>{
+ 1: kWithErrorSyntax_ResponseAsStruct_Response_Type,
+ 2: $fidl.Uint32Type(),
},
+ ctor: WithErrorSyntaxResponseAsStructResult._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<WithErrorSyntaxResponseAsStructResult>
+ kWithErrorSyntax_ResponseAsStruct_Result_OptType =
+ $fidl.XUnionType<WithErrorSyntaxResponseAsStructResult>(
+ members: <int, $fidl.FidlType>{
+ 1: kWithErrorSyntax_ResponseAsStruct_Response_Type,
+ 2: $fidl.Uint32Type(),
+ },
+ ctor: WithErrorSyntaxResponseAsStructResult._ctor,
+ nullable: true,
+ flexible: false,
);
enum WithErrorSyntaxErrorAsPrimitiveResultTag {
- response,
- err,
+ response, // 0x1
+ err, // 0x2
}
-class WithErrorSyntaxErrorAsPrimitiveResult extends $fidl.Union {
+const Map<int, WithErrorSyntaxErrorAsPrimitiveResultTag>
+ _WithErrorSyntaxErrorAsPrimitiveResultTag_map = {
+ 1: WithErrorSyntaxErrorAsPrimitiveResultTag.response,
+ 2: WithErrorSyntaxErrorAsPrimitiveResultTag.err,
+};
+
+class WithErrorSyntaxErrorAsPrimitiveResult extends $fidl.XUnion {
const WithErrorSyntaxErrorAsPrimitiveResult.withResponse(
WithErrorSyntaxErrorAsPrimitiveResponse value)
- : _data = value,
- _tag = WithErrorSyntaxErrorAsPrimitiveResultTag.response;
+ : _ordinal = 1,
+ _data = value;
const WithErrorSyntaxErrorAsPrimitiveResult.withErr(int value)
- : _data = value,
- _tag = WithErrorSyntaxErrorAsPrimitiveResultTag.err;
+ : _ordinal = 2,
+ _data = value;
- WithErrorSyntaxErrorAsPrimitiveResult._(
- WithErrorSyntaxErrorAsPrimitiveResultTag tag, Object data)
- : _tag = tag,
+ WithErrorSyntaxErrorAsPrimitiveResult._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final WithErrorSyntaxErrorAsPrimitiveResultTag _tag;
+ final int _ordinal;
final _data;
+
+ WithErrorSyntaxErrorAsPrimitiveResultTag get $tag =>
+ _WithErrorSyntaxErrorAsPrimitiveResultTag_map[_ordinal];
+
WithErrorSyntaxErrorAsPrimitiveResponse get response {
- if (_tag != WithErrorSyntaxErrorAsPrimitiveResultTag.response) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
int get err {
- if (_tag != WithErrorSyntaxErrorAsPrimitiveResultTag.err) {
+ if (_ordinal != 2) {
return null;
}
return _data;
@@ -212,85 +230,94 @@
@override
String toString() {
- switch (_tag) {
- case WithErrorSyntaxErrorAsPrimitiveResultTag.response:
- return r'WithErrorSyntaxErrorAsPrimitiveResult.response($response)';
- case WithErrorSyntaxErrorAsPrimitiveResultTag.err:
- return r'WithErrorSyntaxErrorAsPrimitiveResult.err($err)';
+ switch (_ordinal) {
+ case 1:
+ return 'WithErrorSyntaxErrorAsPrimitiveResult.response($response)';
+ case 2:
+ return 'WithErrorSyntaxErrorAsPrimitiveResult.err($err)';
default:
return null;
}
}
- WithErrorSyntaxErrorAsPrimitiveResultTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- WithErrorSyntaxErrorAsPrimitiveResultTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static WithErrorSyntaxErrorAsPrimitiveResult _ctor(int index, Object data) {
- return WithErrorSyntaxErrorAsPrimitiveResult._(
- WithErrorSyntaxErrorAsPrimitiveResultTag.values[index], data);
+ static WithErrorSyntaxErrorAsPrimitiveResult _ctor(int ordinal, Object data) {
+ return WithErrorSyntaxErrorAsPrimitiveResult._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<WithErrorSyntaxErrorAsPrimitiveResult>
+const $fidl.XUnionType<WithErrorSyntaxErrorAsPrimitiveResult>
kWithErrorSyntax_ErrorAsPrimitive_Result_Type =
- $fidl.UnionType<WithErrorSyntaxErrorAsPrimitiveResult>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<WithErrorSyntaxErrorAsPrimitiveResponse>(
- type: kWithErrorSyntax_ErrorAsPrimitive_Response_Type,
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: WithErrorSyntaxErrorAsPrimitiveResult._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
+ $fidl.XUnionType<WithErrorSyntaxErrorAsPrimitiveResult>(
+ members: <int, $fidl.FidlType>{
+ 1: kWithErrorSyntax_ErrorAsPrimitive_Response_Type,
+ 2: $fidl.Uint32Type(),
},
+ ctor: WithErrorSyntaxErrorAsPrimitiveResult._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<WithErrorSyntaxErrorAsPrimitiveResult>
+ kWithErrorSyntax_ErrorAsPrimitive_Result_OptType =
+ $fidl.XUnionType<WithErrorSyntaxErrorAsPrimitiveResult>(
+ members: <int, $fidl.FidlType>{
+ 1: kWithErrorSyntax_ErrorAsPrimitive_Response_Type,
+ 2: $fidl.Uint32Type(),
+ },
+ ctor: WithErrorSyntaxErrorAsPrimitiveResult._ctor,
+ nullable: true,
+ flexible: false,
);
enum WithErrorSyntaxErrorAsEnumResultTag {
- response,
- err,
+ response, // 0x1
+ err, // 0x2
}
-class WithErrorSyntaxErrorAsEnumResult extends $fidl.Union {
+const Map<int, WithErrorSyntaxErrorAsEnumResultTag>
+ _WithErrorSyntaxErrorAsEnumResultTag_map = {
+ 1: WithErrorSyntaxErrorAsEnumResultTag.response,
+ 2: WithErrorSyntaxErrorAsEnumResultTag.err,
+};
+
+class WithErrorSyntaxErrorAsEnumResult extends $fidl.XUnion {
const WithErrorSyntaxErrorAsEnumResult.withResponse(
WithErrorSyntaxErrorAsEnumResponse value)
- : _data = value,
- _tag = WithErrorSyntaxErrorAsEnumResultTag.response;
+ : _ordinal = 1,
+ _data = value;
const WithErrorSyntaxErrorAsEnumResult.withErr(ErrorEnun value)
- : _data = value,
- _tag = WithErrorSyntaxErrorAsEnumResultTag.err;
+ : _ordinal = 2,
+ _data = value;
- WithErrorSyntaxErrorAsEnumResult._(
- WithErrorSyntaxErrorAsEnumResultTag tag, Object data)
- : _tag = tag,
+ WithErrorSyntaxErrorAsEnumResult._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final WithErrorSyntaxErrorAsEnumResultTag _tag;
+ final int _ordinal;
final _data;
+
+ WithErrorSyntaxErrorAsEnumResultTag get $tag =>
+ _WithErrorSyntaxErrorAsEnumResultTag_map[_ordinal];
+
WithErrorSyntaxErrorAsEnumResponse get response {
- if (_tag != WithErrorSyntaxErrorAsEnumResultTag.response) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
ErrorEnun get err {
- if (_tag != WithErrorSyntaxErrorAsEnumResultTag.err) {
+ if (_ordinal != 2) {
return null;
}
return _data;
@@ -298,52 +325,52 @@
@override
String toString() {
- switch (_tag) {
- case WithErrorSyntaxErrorAsEnumResultTag.response:
- return r'WithErrorSyntaxErrorAsEnumResult.response($response)';
- case WithErrorSyntaxErrorAsEnumResultTag.err:
- return r'WithErrorSyntaxErrorAsEnumResult.err($err)';
+ switch (_ordinal) {
+ case 1:
+ return 'WithErrorSyntaxErrorAsEnumResult.response($response)';
+ case 2:
+ return 'WithErrorSyntaxErrorAsEnumResult.err($err)';
default:
return null;
}
}
- WithErrorSyntaxErrorAsEnumResultTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- WithErrorSyntaxErrorAsEnumResultTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static WithErrorSyntaxErrorAsEnumResult _ctor(int index, Object data) {
- return WithErrorSyntaxErrorAsEnumResult._(
- WithErrorSyntaxErrorAsEnumResultTag.values[index], data);
+ static WithErrorSyntaxErrorAsEnumResult _ctor(int ordinal, Object data) {
+ return WithErrorSyntaxErrorAsEnumResult._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<WithErrorSyntaxErrorAsEnumResult>
+const $fidl.XUnionType<WithErrorSyntaxErrorAsEnumResult>
kWithErrorSyntax_ErrorAsEnum_Result_Type =
- $fidl.UnionType<WithErrorSyntaxErrorAsEnumResult>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<WithErrorSyntaxErrorAsEnumResponse>(
- type: kWithErrorSyntax_ErrorAsEnum_Response_Type,
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<ErrorEnun>(
- type: kErrorEnun_Type, offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: WithErrorSyntaxErrorAsEnumResult._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
+ $fidl.XUnionType<WithErrorSyntaxErrorAsEnumResult>(
+ members: <int, $fidl.FidlType>{
+ 1: kWithErrorSyntax_ErrorAsEnum_Response_Type,
+ 2: kErrorEnun_Type,
},
+ ctor: WithErrorSyntaxErrorAsEnumResult._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<WithErrorSyntaxErrorAsEnumResult>
+ kWithErrorSyntax_ErrorAsEnum_Result_OptType =
+ $fidl.XUnionType<WithErrorSyntaxErrorAsEnumResult>(
+ members: <int, $fidl.FidlType>{
+ 1: kWithErrorSyntax_ErrorAsEnum_Response_Type,
+ 2: kErrorEnun_Type,
+ },
+ ctor: WithErrorSyntaxErrorAsEnumResult._ctor,
+ nullable: true,
+ flexible: false,
);
class WithErrorSyntaxResponseAsStructResponse extends $fidl.Struct {
@@ -1423,7 +1450,7 @@
// ignore: prefer_const_declarations
final $response = $types[0].decode($decoder, 0);
- if ($response.tag ==
+ if ($response.$tag ==
WithErrorSyntaxResponseAsStructResultTag.response) {
$completer.complete(WithErrorSyntax$ResponseAsStruct$Response(
$response.response.a,
@@ -1456,7 +1483,7 @@
// ignore: prefer_const_declarations
final $response = $types[0].decode($decoder, 0);
- if ($response.tag ==
+ if ($response.$tag ==
WithErrorSyntaxErrorAsPrimitiveResultTag.response) {
$completer.complete(null);
} else {
@@ -1485,7 +1512,7 @@
// ignore: prefer_const_declarations
final $response = $types[0].decode($decoder, 0);
- if ($response.tag == WithErrorSyntaxErrorAsEnumResultTag.response) {
+ if ($response.$tag == WithErrorSyntaxErrorAsEnumResultTag.response) {
$completer.complete(null);
} else {
$completer.completeError($fidl.MethodException($response.err));
diff --git a/bin/fidlgen_dart/goldens/union.test.fidl.json_async.dart.golden b/bin/fidlgen_dart/goldens/union.test.fidl.json_async.dart.golden
index f87fb93..4ed0a03 100644
--- a/bin/fidlgen_dart/goldens/union.test.fidl.json_async.dart.golden
+++ b/bin/fidlgen_dart/goldens/union.test.fidl.json_async.dart.golden
@@ -37,46 +37,55 @@
// ignore_for_file: avoid_unused_constructor_parameters
enum UnionTag {
- primitive,
- stringNeedsConstructor,
- vectorStringAlsoNeedsConstructor,
+ primitive, // 0x1
+ stringNeedsConstructor, // 0x2
+ vectorStringAlsoNeedsConstructor, // 0x3
}
-class Union extends $fidl.Union {
+const Map<int, UnionTag> _UnionTag_map = {
+ 1: UnionTag.primitive,
+ 2: UnionTag.stringNeedsConstructor,
+ 3: UnionTag.vectorStringAlsoNeedsConstructor,
+};
+
+class Union extends $fidl.XUnion {
const Union.withPrimitive(int value)
- : _data = value,
- _tag = UnionTag.primitive;
+ : _ordinal = 1,
+ _data = value;
const Union.withStringNeedsConstructor(String value)
- : _data = value,
- _tag = UnionTag.stringNeedsConstructor;
+ : _ordinal = 2,
+ _data = value;
const Union.withVectorStringAlsoNeedsConstructor(List<String> value)
- : _data = value,
- _tag = UnionTag.vectorStringAlsoNeedsConstructor;
+ : _ordinal = 3,
+ _data = value;
- Union._(UnionTag tag, Object data)
- : _tag = tag,
+ Union._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final UnionTag _tag;
+ final int _ordinal;
final _data;
+
+ UnionTag get $tag => _UnionTag_map[_ordinal];
+
int get primitive {
- if (_tag != UnionTag.primitive) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
String get stringNeedsConstructor {
- if (_tag != UnionTag.stringNeedsConstructor) {
+ if (_ordinal != 2) {
return null;
}
return _data;
}
List<String> get vectorStringAlsoNeedsConstructor {
- if (_tag != UnionTag.vectorStringAlsoNeedsConstructor) {
+ if (_ordinal != 3) {
return null;
}
return _data;
@@ -84,78 +93,84 @@
@override
String toString() {
- switch (_tag) {
- case UnionTag.primitive:
- return r'Union.primitive($primitive)';
- case UnionTag.stringNeedsConstructor:
- return r'Union.stringNeedsConstructor($stringNeedsConstructor)';
- case UnionTag.vectorStringAlsoNeedsConstructor:
- return r'Union.vectorStringAlsoNeedsConstructor($vectorStringAlsoNeedsConstructor)';
+ switch (_ordinal) {
+ case 1:
+ return 'Union.primitive($primitive)';
+ case 2:
+ return 'Union.stringNeedsConstructor($stringNeedsConstructor)';
+ case 3:
+ return 'Union.vectorStringAlsoNeedsConstructor($vectorStringAlsoNeedsConstructor)';
default:
return null;
}
}
- UnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static Union _ctor(int index, Object data) {
- return Union._(UnionTag.values[index], data);
+ static Union _ctor(int ordinal, Object data) {
+ return Union._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<Union> kUnion_Type = $fidl.UnionType<Union>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Int32Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- $fidl.MemberType<List<String>>(
- type: $fidl.VectorType<List<String>>(
- element: $fidl.StringType(maybeElementCount: null, nullable: false),
- maybeElementCount: null,
- nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: Union._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
- 3: 2,
+const $fidl.XUnionType<Union> kUnion_Type = $fidl.XUnionType<Union>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ 2: $fidl.StringType(maybeElementCount: null, nullable: false),
+ 3: $fidl.VectorType<List<String>>(
+ element: $fidl.StringType(maybeElementCount: null, nullable: false),
+ maybeElementCount: null,
+ nullable: false),
},
+ ctor: Union._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<Union> kUnion_OptType = $fidl.XUnionType<Union>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ 2: $fidl.StringType(maybeElementCount: null, nullable: false),
+ 3: $fidl.VectorType<List<String>>(
+ element: $fidl.StringType(maybeElementCount: null, nullable: false),
+ maybeElementCount: null,
+ nullable: false),
+ },
+ ctor: Union._ctor,
+ nullable: true,
+ flexible: false,
);
enum FieldCollisionTag {
- fieldCollisionTag,
+ fieldCollisionTag, // 0x1
}
-class FieldCollision extends $fidl.Union {
- const FieldCollision.withFieldCollisionTag(int value)
- : _data = value,
- _tag = FieldCollisionTag.fieldCollisionTag;
+const Map<int, FieldCollisionTag> _FieldCollisionTag_map = {
+ 1: FieldCollisionTag.fieldCollisionTag,
+};
- FieldCollision._(FieldCollisionTag tag, Object data)
- : _tag = tag,
+class FieldCollision extends $fidl.XUnion {
+ const FieldCollision.withFieldCollisionTag(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ FieldCollision._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final FieldCollisionTag _tag;
+ final int _ordinal;
final _data;
+
+ FieldCollisionTag get $tag => _FieldCollisionTag_map[_ordinal];
+
int get fieldCollisionTag {
- if (_tag != FieldCollisionTag.fieldCollisionTag) {
+ if (_ordinal != 1) {
return null;
}
return _data;
@@ -163,74 +178,85 @@
@override
String toString() {
- switch (_tag) {
- case FieldCollisionTag.fieldCollisionTag:
- return r'FieldCollision.fieldCollisionTag($fieldCollisionTag)';
+ switch (_ordinal) {
+ case 1:
+ return 'FieldCollision.fieldCollisionTag($fieldCollisionTag)';
default:
return null;
}
}
- FieldCollisionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- FieldCollisionTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static FieldCollision _ctor(int index, Object data) {
- return FieldCollision._(FieldCollisionTag.values[index], data);
+ static FieldCollision _ctor(int ordinal, Object data) {
+ return FieldCollision._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<FieldCollision> kFieldCollision_Type =
- $fidl.UnionType<FieldCollision>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Int32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: FieldCollision._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<FieldCollision> kFieldCollision_Type =
+ $fidl.XUnionType<FieldCollision>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
},
+ ctor: FieldCollision._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<FieldCollision> kFieldCollision_OptType =
+ $fidl.XUnionType<FieldCollision>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ },
+ ctor: FieldCollision._ctor,
+ nullable: true,
+ flexible: false,
);
enum ExplicitUnionTag {
- primitive,
- stringNeedsConstructor,
+ primitive, // 0x1
+ stringNeedsConstructor, // 0x3
}
-class ExplicitUnion extends $fidl.Union {
+const Map<int, ExplicitUnionTag> _ExplicitUnionTag_map = {
+ 1: ExplicitUnionTag.primitive,
+ 3: ExplicitUnionTag.stringNeedsConstructor,
+};
+
+class ExplicitUnion extends $fidl.XUnion {
const ExplicitUnion.withPrimitive(int value)
- : _data = value,
- _tag = ExplicitUnionTag.primitive;
+ : _ordinal = 1,
+ _data = value;
const ExplicitUnion.withStringNeedsConstructor(String value)
- : _data = value,
- _tag = ExplicitUnionTag.stringNeedsConstructor;
+ : _ordinal = 3,
+ _data = value;
- ExplicitUnion._(ExplicitUnionTag tag, Object data)
- : _tag = tag,
+ ExplicitUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final ExplicitUnionTag _tag;
+ final int _ordinal;
final _data;
+
+ ExplicitUnionTag get $tag => _ExplicitUnionTag_map[_ordinal];
+
int get primitive {
- if (_tag != ExplicitUnionTag.primitive) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
String get stringNeedsConstructor {
- if (_tag != ExplicitUnionTag.stringNeedsConstructor) {
+ if (_ordinal != 3) {
return null;
}
return _data;
@@ -238,81 +264,89 @@
@override
String toString() {
- switch (_tag) {
- case ExplicitUnionTag.primitive:
- return r'ExplicitUnion.primitive($primitive)';
- case ExplicitUnionTag.stringNeedsConstructor:
- return r'ExplicitUnion.stringNeedsConstructor($stringNeedsConstructor)';
+ switch (_ordinal) {
+ case 1:
+ return 'ExplicitUnion.primitive($primitive)';
+ case 3:
+ return 'ExplicitUnion.stringNeedsConstructor($stringNeedsConstructor)';
default:
return null;
}
}
- ExplicitUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- ExplicitUnionTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static ExplicitUnion _ctor(int index, Object data) {
- return ExplicitUnion._(ExplicitUnionTag.values[index], data);
+ static ExplicitUnion _ctor(int ordinal, Object data) {
+ return ExplicitUnion._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<ExplicitUnion> kExplicitUnion_Type =
- $fidl.UnionType<ExplicitUnion>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Int32Type(), offsetOld: 8, offsetV1: -1 /* unused */),
- $fidl.MemberType<String>(
- type: $fidl.StringType(maybeElementCount: null, nullable: false),
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: ExplicitUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 3: 1,
+const $fidl.XUnionType<ExplicitUnion> kExplicitUnion_Type =
+ $fidl.XUnionType<ExplicitUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ 3: $fidl.StringType(maybeElementCount: null, nullable: false),
},
+ ctor: ExplicitUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<ExplicitUnion> kExplicitUnion_OptType =
+ $fidl.XUnionType<ExplicitUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Int32Type(),
+ 3: $fidl.StringType(maybeElementCount: null, nullable: false),
+ },
+ ctor: ExplicitUnion._ctor,
+ nullable: true,
+ flexible: false,
);
enum ReverseOrdinalUnionTag {
- first,
- second,
+ first, // 0x1
+ second, // 0x2
}
-class ReverseOrdinalUnion extends $fidl.Union {
+const Map<int, ReverseOrdinalUnionTag> _ReverseOrdinalUnionTag_map = {
+ 1: ReverseOrdinalUnionTag.first,
+ 2: ReverseOrdinalUnionTag.second,
+};
+
+class ReverseOrdinalUnion extends $fidl.XUnion {
const ReverseOrdinalUnion.withFirst(int value)
- : _data = value,
- _tag = ReverseOrdinalUnionTag.first;
+ : _ordinal = 1,
+ _data = value;
const ReverseOrdinalUnion.withSecond(int value)
- : _data = value,
- _tag = ReverseOrdinalUnionTag.second;
+ : _ordinal = 2,
+ _data = value;
- ReverseOrdinalUnion._(ReverseOrdinalUnionTag tag, Object data)
- : _tag = tag,
+ ReverseOrdinalUnion._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final ReverseOrdinalUnionTag _tag;
+ final int _ordinal;
final _data;
+
+ ReverseOrdinalUnionTag get $tag => _ReverseOrdinalUnionTag_map[_ordinal];
+
int get first {
- if (_tag != ReverseOrdinalUnionTag.first) {
+ if (_ordinal != 1) {
return null;
}
return _data;
}
int get second {
- if (_tag != ReverseOrdinalUnionTag.second) {
+ if (_ordinal != 2) {
return null;
}
return _data;
@@ -320,48 +354,50 @@
@override
String toString() {
- switch (_tag) {
- case ReverseOrdinalUnionTag.first:
- return r'ReverseOrdinalUnion.first($first)';
- case ReverseOrdinalUnionTag.second:
- return r'ReverseOrdinalUnion.second($second)';
+ switch (_ordinal) {
+ case 1:
+ return 'ReverseOrdinalUnion.first($first)';
+ case 2:
+ return 'ReverseOrdinalUnion.second($second)';
default:
return null;
}
}
- ReverseOrdinalUnionTag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- ReverseOrdinalUnionTag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static ReverseOrdinalUnion _ctor(int index, Object data) {
- return ReverseOrdinalUnion._(ReverseOrdinalUnionTag.values[index], data);
+ static ReverseOrdinalUnion _ctor(int ordinal, Object data) {
+ return ReverseOrdinalUnion._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<ReverseOrdinalUnion> kReverseOrdinalUnion_Type =
- $fidl.UnionType<ReverseOrdinalUnion>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: ReverseOrdinalUnion._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
- 2: 1,
+const $fidl.XUnionType<ReverseOrdinalUnion> kReverseOrdinalUnion_Type =
+ $fidl.XUnionType<ReverseOrdinalUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ 2: $fidl.Uint32Type(),
},
+ ctor: ReverseOrdinalUnion._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<ReverseOrdinalUnion> kReverseOrdinalUnion_OptType =
+ $fidl.XUnionType<ReverseOrdinalUnion>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ 2: $fidl.Uint32Type(),
+ },
+ ctor: ReverseOrdinalUnion._ctor,
+ nullable: true,
+ flexible: false,
);
class NullableUnionStruct extends $fidl.Struct {
@@ -409,10 +445,7 @@
inlineSizeOld: 8,
inlineSizeV1: 24,
members: <$fidl.MemberType>[
- $fidl.MemberType<Union>(
- type: $fidl.OptUnionType<Union>(element: kUnion_Type),
- offsetOld: 0,
- offsetV1: 0),
+ $fidl.MemberType<Union>(type: kUnion_OptType, offsetOld: 0, offsetV1: 0),
],
ctor: NullableUnionStruct._ctor,
);
diff --git a/bin/fidlgen_dart/goldens/union_sandwich.test.fidl.json_async.dart.golden b/bin/fidlgen_dart/goldens/union_sandwich.test.fidl.json_async.dart.golden
index e81740e..fc5e209 100644
--- a/bin/fidlgen_dart/goldens/union_sandwich.test.fidl.json_async.dart.golden
+++ b/bin/fidlgen_dart/goldens/union_sandwich.test.fidl.json_async.dart.golden
@@ -37,22 +37,29 @@
// ignore_for_file: avoid_unused_constructor_parameters
enum UnionSize8Alignment4Tag {
- variant,
+ variant, // 0x1
}
-class UnionSize8Alignment4 extends $fidl.Union {
- const UnionSize8Alignment4.withVariant(int value)
- : _data = value,
- _tag = UnionSize8Alignment4Tag.variant;
+const Map<int, UnionSize8Alignment4Tag> _UnionSize8Alignment4Tag_map = {
+ 1: UnionSize8Alignment4Tag.variant,
+};
- UnionSize8Alignment4._(UnionSize8Alignment4Tag tag, Object data)
- : _tag = tag,
+class UnionSize8Alignment4 extends $fidl.XUnion {
+ const UnionSize8Alignment4.withVariant(int value)
+ : _ordinal = 1,
+ _data = value;
+
+ UnionSize8Alignment4._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final UnionSize8Alignment4Tag _tag;
+ final int _ordinal;
final _data;
+
+ UnionSize8Alignment4Tag get $tag => _UnionSize8Alignment4Tag_map[_ordinal];
+
int get variant {
- if (_tag != UnionSize8Alignment4Tag.variant) {
+ if (_ordinal != 1) {
return null;
}
return _data;
@@ -60,62 +67,72 @@
@override
String toString() {
- switch (_tag) {
- case UnionSize8Alignment4Tag.variant:
- return r'UnionSize8Alignment4.variant($variant)';
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize8Alignment4.variant($variant)';
default:
return null;
}
}
- UnionSize8Alignment4Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize8Alignment4Tag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static UnionSize8Alignment4 _ctor(int index, Object data) {
- return UnionSize8Alignment4._(UnionSize8Alignment4Tag.values[index], data);
+ static UnionSize8Alignment4 _ctor(int ordinal, Object data) {
+ return UnionSize8Alignment4._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize8Alignment4> kUnionSize8Alignment4_Type =
- $fidl.UnionType<UnionSize8Alignment4>(
- inlineSizeOld: 8,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<int>(
- type: $fidl.Uint32Type(), offsetOld: 4, offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize8Alignment4._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<UnionSize8Alignment4> kUnionSize8Alignment4_Type =
+ $fidl.XUnionType<UnionSize8Alignment4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
},
+ ctor: UnionSize8Alignment4._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize8Alignment4> kUnionSize8Alignment4_OptType =
+ $fidl.XUnionType<UnionSize8Alignment4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.Uint32Type(),
+ },
+ ctor: UnionSize8Alignment4._ctor,
+ nullable: true,
+ flexible: false,
);
enum UnionSize12Alignment4Tag {
- variant,
+ variant, // 0x1
}
-class UnionSize12Alignment4 extends $fidl.Union {
- const UnionSize12Alignment4.withVariant(Uint8List value)
- : _data = value,
- _tag = UnionSize12Alignment4Tag.variant;
+const Map<int, UnionSize12Alignment4Tag> _UnionSize12Alignment4Tag_map = {
+ 1: UnionSize12Alignment4Tag.variant,
+};
- UnionSize12Alignment4._(UnionSize12Alignment4Tag tag, Object data)
- : _tag = tag,
+class UnionSize12Alignment4 extends $fidl.XUnion {
+ const UnionSize12Alignment4.withVariant(Uint8List value)
+ : _ordinal = 1,
+ _data = value;
+
+ UnionSize12Alignment4._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final UnionSize12Alignment4Tag _tag;
+ final int _ordinal;
final _data;
+
+ UnionSize12Alignment4Tag get $tag => _UnionSize12Alignment4Tag_map[_ordinal];
+
Uint8List get variant {
- if (_tag != UnionSize12Alignment4Tag.variant) {
+ if (_ordinal != 1) {
return null;
}
return _data;
@@ -123,66 +140,72 @@
@override
String toString() {
- switch (_tag) {
- case UnionSize12Alignment4Tag.variant:
- return r'UnionSize12Alignment4.variant($variant)';
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize12Alignment4.variant($variant)';
default:
return null;
}
}
- UnionSize12Alignment4Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize12Alignment4Tag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static UnionSize12Alignment4 _ctor(int index, Object data) {
- return UnionSize12Alignment4._(
- UnionSize12Alignment4Tag.values[index], data);
+ static UnionSize12Alignment4 _ctor(int ordinal, Object data) {
+ return UnionSize12Alignment4._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize12Alignment4> kUnionSize12Alignment4_Type =
- $fidl.UnionType<UnionSize12Alignment4>(
- inlineSizeOld: 12,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<Uint8List>(
- type: $fidl.ArrayType<Uint8List>(
- element: $fidl.Uint8Type(), elementCount: 6),
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize12Alignment4._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<UnionSize12Alignment4> kUnionSize12Alignment4_Type =
+ $fidl.XUnionType<UnionSize12Alignment4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 6),
},
+ ctor: UnionSize12Alignment4._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize12Alignment4> kUnionSize12Alignment4_OptType =
+ $fidl.XUnionType<UnionSize12Alignment4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 6),
+ },
+ ctor: UnionSize12Alignment4._ctor,
+ nullable: true,
+ flexible: false,
);
enum UnionSize24Alignment8Tag {
- variant,
+ variant, // 0x1
}
-class UnionSize24Alignment8 extends $fidl.Union {
- const UnionSize24Alignment8.withVariant(StructSize16Alignment8 value)
- : _data = value,
- _tag = UnionSize24Alignment8Tag.variant;
+const Map<int, UnionSize24Alignment8Tag> _UnionSize24Alignment8Tag_map = {
+ 1: UnionSize24Alignment8Tag.variant,
+};
- UnionSize24Alignment8._(UnionSize24Alignment8Tag tag, Object data)
- : _tag = tag,
+class UnionSize24Alignment8 extends $fidl.XUnion {
+ const UnionSize24Alignment8.withVariant(StructSize16Alignment8 value)
+ : _ordinal = 1,
+ _data = value;
+
+ UnionSize24Alignment8._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final UnionSize24Alignment8Tag _tag;
+ final int _ordinal;
final _data;
+
+ UnionSize24Alignment8Tag get $tag => _UnionSize24Alignment8Tag_map[_ordinal];
+
StructSize16Alignment8 get variant {
- if (_tag != UnionSize24Alignment8Tag.variant) {
+ if (_ordinal != 1) {
return null;
}
return _data;
@@ -190,65 +213,72 @@
@override
String toString() {
- switch (_tag) {
- case UnionSize24Alignment8Tag.variant:
- return r'UnionSize24Alignment8.variant($variant)';
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize24Alignment8.variant($variant)';
default:
return null;
}
}
- UnionSize24Alignment8Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize24Alignment8Tag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static UnionSize24Alignment8 _ctor(int index, Object data) {
- return UnionSize24Alignment8._(
- UnionSize24Alignment8Tag.values[index], data);
+ static UnionSize24Alignment8 _ctor(int ordinal, Object data) {
+ return UnionSize24Alignment8._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize24Alignment8> kUnionSize24Alignment8_Type =
- $fidl.UnionType<UnionSize24Alignment8>(
- inlineSizeOld: 24,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<StructSize16Alignment8>(
- type: kStructSize16Alignment8_Type,
- offsetOld: 8,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize24Alignment8._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<UnionSize24Alignment8> kUnionSize24Alignment8_Type =
+ $fidl.XUnionType<UnionSize24Alignment8>(
+ members: <int, $fidl.FidlType>{
+ 1: kStructSize16Alignment8_Type,
},
+ ctor: UnionSize24Alignment8._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize24Alignment8> kUnionSize24Alignment8_OptType =
+ $fidl.XUnionType<UnionSize24Alignment8>(
+ members: <int, $fidl.FidlType>{
+ 1: kStructSize16Alignment8_Type,
+ },
+ ctor: UnionSize24Alignment8._ctor,
+ nullable: true,
+ flexible: false,
);
enum UnionSize36Alignment4Tag {
- variant,
+ variant, // 0x1
}
-class UnionSize36Alignment4 extends $fidl.Union {
- const UnionSize36Alignment4.withVariant(Uint8List value)
- : _data = value,
- _tag = UnionSize36Alignment4Tag.variant;
+const Map<int, UnionSize36Alignment4Tag> _UnionSize36Alignment4Tag_map = {
+ 1: UnionSize36Alignment4Tag.variant,
+};
- UnionSize36Alignment4._(UnionSize36Alignment4Tag tag, Object data)
- : _tag = tag,
+class UnionSize36Alignment4 extends $fidl.XUnion {
+ const UnionSize36Alignment4.withVariant(Uint8List value)
+ : _ordinal = 1,
+ _data = value;
+
+ UnionSize36Alignment4._(int ordinal, Object data)
+ : _ordinal = ordinal,
_data = data;
- final UnionSize36Alignment4Tag _tag;
+ final int _ordinal;
final _data;
+
+ UnionSize36Alignment4Tag get $tag => _UnionSize36Alignment4Tag_map[_ordinal];
+
Uint8List get variant {
- if (_tag != UnionSize36Alignment4Tag.variant) {
+ if (_ordinal != 1) {
return null;
}
return _data;
@@ -256,47 +286,46 @@
@override
String toString() {
- switch (_tag) {
- case UnionSize36Alignment4Tag.variant:
- return r'UnionSize36Alignment4.variant($variant)';
+ switch (_ordinal) {
+ case 1:
+ return 'UnionSize36Alignment4.variant($variant)';
default:
return null;
}
}
- UnionSize36Alignment4Tag get $tag => _tag;
- // TODO: remove, see: FIDL-587
- UnionSize36Alignment4Tag get tag => _tag;
-
@override
- int get $index => _tag.index;
+ int get $ordinal => _ordinal;
@override
Object get $data => _data;
- static UnionSize36Alignment4 _ctor(int index, Object data) {
- return UnionSize36Alignment4._(
- UnionSize36Alignment4Tag.values[index], data);
+ static UnionSize36Alignment4 _ctor(int ordinal, Object data) {
+ return UnionSize36Alignment4._(ordinal, data);
}
}
// See FIDL-308:
// ignore: recursive_compile_time_constant
-const $fidl.UnionType<UnionSize36Alignment4> kUnionSize36Alignment4_Type =
- $fidl.UnionType<UnionSize36Alignment4>(
- inlineSizeOld: 36,
- inlineSizeV1: 24,
- members: <$fidl.MemberType>[
- $fidl.MemberType<Uint8List>(
- type: $fidl.ArrayType<Uint8List>(
- element: $fidl.Uint8Type(), elementCount: 32),
- offsetOld: 4,
- offsetV1: -1 /* unused */),
- ],
- ctor: UnionSize36Alignment4._ctor,
- ordinalToIndex: <int, int>{
- 1: 0,
+const $fidl.XUnionType<UnionSize36Alignment4> kUnionSize36Alignment4_Type =
+ $fidl.XUnionType<UnionSize36Alignment4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 32),
},
+ ctor: UnionSize36Alignment4._ctor,
+ nullable: false,
+ flexible: false,
+);
+// See FIDL-308:
+// ignore: recursive_compile_time_constant
+const $fidl.XUnionType<UnionSize36Alignment4> kUnionSize36Alignment4_OptType =
+ $fidl.XUnionType<UnionSize36Alignment4>(
+ members: <int, $fidl.FidlType>{
+ 1: $fidl.ArrayType<Uint8List>(element: $fidl.Uint8Type(), elementCount: 32),
+ },
+ ctor: UnionSize36Alignment4._ctor,
+ nullable: true,
+ flexible: false,
);
class SandwichUnionSize8Alignment4 extends $fidl.Struct {