[fidl] Update conformance tests
Regen for https://fuchsia-review.googlesource.com/c/fuchsia/+/336773
Test: fx run-test go_fidl_tests
Change-Id: Iaa779304b1a19d203c9a1291f41fd590a1c8f9ef
diff --git a/src/syscall/zx/fidl/conformance/impl.go b/src/syscall/zx/fidl/conformance/impl.go
index df5665f..db46295 100644
--- a/src/syscall/zx/fidl/conformance/impl.go
+++ b/src/syscall/zx/fidl/conformance/impl.go
@@ -16,6 +16,57 @@
_bindings "syscall/zx/fidl"
)
+type EmptyStruct struct {
+ _ struct{} `fidl:"s,1,1" fidl_size_v1:"1" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"1" fidl_alignment_v1_no_ee:"1"`
+}
+
+var _mEmptyStruct = _bindings.CreateLazyMarshaler(EmptyStruct{})
+
+func (msg *EmptyStruct) Marshaler() _bindings.Marshaler {
+ return _mEmptyStruct
+}
+
+type EmptyStructSandwich struct {
+ _ struct{} `fidl:"s,40,8" fidl_size_v1:"40" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"8"`
+ Before string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Es EmptyStruct `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+ After string `fidl:"24," fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
+}
+
+var _mEmptyStructSandwich = _bindings.CreateLazyMarshaler(EmptyStructSandwich{})
+
+func (msg *EmptyStructSandwich) Marshaler() _bindings.Marshaler {
+ return _mEmptyStructSandwich
+}
+
+type Uint8Uint16Uint32Uint64 struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ F1 uint8 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ F2 uint16 `fidl:"2" fidl_offset_v1:"2" fidl_offset_v1_no_ee:"2"`
+ F3 uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
+ F4 uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
+}
+
+var _mUint8Uint16Uint32Uint64 = _bindings.CreateLazyMarshaler(Uint8Uint16Uint32Uint64{})
+
+func (msg *Uint8Uint16Uint32Uint64) Marshaler() _bindings.Marshaler {
+ return _mUint8Uint16Uint32Uint64
+}
+
+type Uint64Uint32Uint16Uint8 struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ F1 uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ F2 uint32 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
+ F3 uint16 `fidl:"12" fidl_offset_v1:"12" fidl_offset_v1_no_ee:"12"`
+ F4 uint8 `fidl:"14" fidl_offset_v1:"14" fidl_offset_v1_no_ee:"14"`
+}
+
+var _mUint64Uint32Uint16Uint8 = _bindings.CreateLazyMarshaler(Uint64Uint32Uint16Uint8{})
+
+func (msg *Uint64Uint32Uint16Uint8) Marshaler() _bindings.Marshaler {
+ return _mUint64Uint32Uint16Uint8
+}
+
type UnionWithBoundStringStruct struct {
_ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
V UnionWithBoundString `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
@@ -102,186 +153,6 @@
return _mSandwichUnionSize36Alignment4
}
-type Length2StringWrapper struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- Length2String string `fidl:"0,2" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mLength2StringWrapper = _bindings.CreateLazyMarshaler(Length2StringWrapper{})
-
-func (msg *Length2StringWrapper) Marshaler() _bindings.Marshaler {
- return _mLength2StringWrapper
-}
-
-type StringWrapper struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- Str string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mStringWrapper = _bindings.CreateLazyMarshaler(StringWrapper{})
-
-func (msg *StringWrapper) Marshaler() _bindings.Marshaler {
- return _mStringWrapper
-}
-
-type TestXUnionInTable struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- Value XUnionInTable `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mTestXUnionInTable = _bindings.CreateLazyMarshaler(TestXUnionInTable{})
-
-func (msg *TestXUnionInTable) Marshaler() _bindings.Marshaler {
- return _mTestXUnionInTable
-}
-
-type InterfaceConfig struct {
- _ struct{} `fidl:"s,48,8" fidl_size_v1:"40" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"8"`
- Name string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- IpAddressConfig IpAddressConfig `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
-}
-
-var _mInterfaceConfig = _bindings.CreateLazyMarshaler(InterfaceConfig{})
-
-func (msg *InterfaceConfig) Marshaler() _bindings.Marshaler {
- return _mInterfaceConfig
-}
-
-type TestAddEthernetDeviceRequest struct {
- _ struct{} `fidl:"s,72,8" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"8"`
- TopologicalPath string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Config InterfaceConfig `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
- ThisShouldBeAHandle uint32 `fidl:"64" fidl_offset_v1:"56" fidl_offset_v1_no_ee:"56"`
-}
-
-var _mTestAddEthernetDeviceRequest = _bindings.CreateLazyMarshaler(TestAddEthernetDeviceRequest{})
-
-func (msg *TestAddEthernetDeviceRequest) Marshaler() _bindings.Marshaler {
- return _mTestAddEthernetDeviceRequest
-}
-
-type NodeAttributes struct {
- _ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
- Mode uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Id uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
- ContentSize uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
- StorageSize uint64 `fidl:"24" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
- LinkCount uint64 `fidl:"32" fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
- CreationTime uint64 `fidl:"40" fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
- ModificationTime uint64 `fidl:"48" fidl_offset_v1:"48" fidl_offset_v1_no_ee:"48"`
-}
-
-var _mNodeAttributes = _bindings.CreateLazyMarshaler(NodeAttributes{})
-
-func (msg *NodeAttributes) Marshaler() _bindings.Marshaler {
- return _mNodeAttributes
-}
-
-type FileGetAttrResponse struct {
- _ struct{} `fidl:"s,64,8" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"8"`
- S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
-}
-
-var _mFileGetAttrResponse = _bindings.CreateLazyMarshaler(FileGetAttrResponse{})
-
-func (msg *FileGetAttrResponse) Marshaler() _bindings.Marshaler {
- return _mFileGetAttrResponse
-}
-
-type StructOfSimpleTable struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- Table SimpleTable `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mStructOfSimpleTable = _bindings.CreateLazyMarshaler(StructOfSimpleTable{})
-
-func (msg *StructOfSimpleTable) Marshaler() _bindings.Marshaler {
- return _mStructOfSimpleTable
-}
-
-type SimpleTableThenUint64 struct {
- _ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
- Table SimpleTable `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Number uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
-}
-
-var _mSimpleTableThenUint64 = _bindings.CreateLazyMarshaler(SimpleTableThenUint64{})
-
-func (msg *SimpleTableThenUint64) Marshaler() _bindings.Marshaler {
- return _mSimpleTableThenUint64
-}
-
-type StructOfTableWithStringAndVector struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- Table TableWithStringAndVector `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mStructOfTableWithStringAndVector = _bindings.CreateLazyMarshaler(StructOfTableWithStringAndVector{})
-
-func (msg *StructOfTableWithStringAndVector) Marshaler() _bindings.Marshaler {
- return _mStructOfTableWithStringAndVector
-}
-
-type Int64Struct struct {
- _ struct{} `fidl:"s,8,8" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"8"`
- X int64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mInt64Struct = _bindings.CreateLazyMarshaler(Int64Struct{})
-
-func (msg *Int64Struct) Marshaler() _bindings.Marshaler {
- return _mInt64Struct
-}
-
-type TestInlineXUnionInStruct struct {
- _ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
- Before string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Xu SampleXUnion `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
- After string `fidl:"40," fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
-}
-
-var _mTestInlineXUnionInStruct = _bindings.CreateLazyMarshaler(TestInlineXUnionInStruct{})
-
-func (msg *TestInlineXUnionInStruct) Marshaler() _bindings.Marshaler {
- return _mTestInlineXUnionInStruct
-}
-
-type TestOptionalXUnionInStruct struct {
- _ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
- Before string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Xu *SampleXUnion `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
- After string `fidl:"40," fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
-}
-
-var _mTestOptionalXUnionInStruct = _bindings.CreateLazyMarshaler(TestOptionalXUnionInStruct{})
-
-func (msg *TestOptionalXUnionInStruct) Marshaler() _bindings.Marshaler {
- return _mTestOptionalXUnionInStruct
-}
-
-type TestStrictXUnionInStruct struct {
- _ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
- Xu SampleStrictXUnion `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mTestStrictXUnionInStruct = _bindings.CreateLazyMarshaler(TestStrictXUnionInStruct{})
-
-func (msg *TestStrictXUnionInStruct) Marshaler() _bindings.Marshaler {
- return _mTestStrictXUnionInStruct
-}
-
-type TestFlexibleXUnionInStruct struct {
- _ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
- Xu SampleXUnion `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
-}
-
-var _mTestFlexibleXUnionInStruct = _bindings.CreateLazyMarshaler(TestFlexibleXUnionInStruct{})
-
-func (msg *TestFlexibleXUnionInStruct) Marshaler() _bindings.Marshaler {
- return _mTestFlexibleXUnionInStruct
-}
-
type StructWithOptionals struct {
_ struct{} `fidl:"s,104,8" fidl_size_v1:"128" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"128" fidl_alignment_v1_no_ee:"8"`
S EmptyStruct `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
@@ -299,57 +170,6 @@
return _mStructWithOptionals
}
-type EmptyStruct struct {
- _ struct{} `fidl:"s,1,1" fidl_size_v1:"1" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"1" fidl_alignment_v1_no_ee:"1"`
-}
-
-var _mEmptyStruct = _bindings.CreateLazyMarshaler(EmptyStruct{})
-
-func (msg *EmptyStruct) Marshaler() _bindings.Marshaler {
- return _mEmptyStruct
-}
-
-type EmptyStructSandwich struct {
- _ struct{} `fidl:"s,40,8" fidl_size_v1:"40" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"8"`
- Before string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- Es EmptyStruct `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
- After string `fidl:"24," fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
-}
-
-var _mEmptyStructSandwich = _bindings.CreateLazyMarshaler(EmptyStructSandwich{})
-
-func (msg *EmptyStructSandwich) Marshaler() _bindings.Marshaler {
- return _mEmptyStructSandwich
-}
-
-type Uint8Uint16Uint32Uint64 struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- F1 uint8 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- F2 uint16 `fidl:"2" fidl_offset_v1:"2" fidl_offset_v1_no_ee:"2"`
- F3 uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
- F4 uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
-}
-
-var _mUint8Uint16Uint32Uint64 = _bindings.CreateLazyMarshaler(Uint8Uint16Uint32Uint64{})
-
-func (msg *Uint8Uint16Uint32Uint64) Marshaler() _bindings.Marshaler {
- return _mUint8Uint16Uint32Uint64
-}
-
-type Uint64Uint32Uint16Uint8 struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- F1 uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- F2 uint32 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
- F3 uint16 `fidl:"12" fidl_offset_v1:"12" fidl_offset_v1_no_ee:"12"`
- F4 uint8 `fidl:"14" fidl_offset_v1:"14" fidl_offset_v1_no_ee:"14"`
-}
-
-var _mUint64Uint32Uint16Uint8 = _bindings.CreateLazyMarshaler(Uint64Uint32Uint16Uint8{})
-
-func (msg *Uint64Uint32Uint16Uint8) Marshaler() _bindings.Marshaler {
- return _mUint64Uint32Uint16Uint8
-}
-
type ThreeByte struct {
_ struct{} `fidl:"s,3,1" fidl_size_v1:"3" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"3" fidl_alignment_v1_no_ee:"1"`
Elem1 uint8 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
@@ -445,48 +265,97 @@
return _mFiveByteInArray
}
-type StructWithInt struct {
- _ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
- X int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+type StructOfSimpleTable struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ Table SimpleTable `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructWithInt = _bindings.CreateLazyMarshaler(StructWithInt{})
+var _mStructOfSimpleTable = _bindings.CreateLazyMarshaler(StructOfSimpleTable{})
-func (msg *StructWithInt) Marshaler() _bindings.Marshaler {
- return _mStructWithInt
+func (msg *StructOfSimpleTable) Marshaler() _bindings.Marshaler {
+ return _mStructOfSimpleTable
}
-type StructWithArrays struct {
- _ struct{} `fidl:"s,120,8" fidl_size_v1:"120" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"120" fidl_alignment_v1_no_ee:"8"`
- ArrInt [2]int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- ArrString [2]string `fidl:"8," fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
- ArrNullableString [2]*string `fidl:"40," fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
- ArrStruct [2]StructWithInt `fidl:"72" fidl_offset_v1:"72" fidl_offset_v1_no_ee:"72"`
- ArrNullableStruct [2]*StructWithInt `fidl:"80" fidl_offset_v1:"80" fidl_offset_v1_no_ee:"80"`
- ArrArrInt [2][3]int32 `fidl:"96" fidl_offset_v1:"96" fidl_offset_v1_no_ee:"96"`
+type SimpleTableThenUint64 struct {
+ _ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
+ Table SimpleTable `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Number uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
}
-var _mStructWithArrays = _bindings.CreateLazyMarshaler(StructWithArrays{})
+var _mSimpleTableThenUint64 = _bindings.CreateLazyMarshaler(SimpleTableThenUint64{})
-func (msg *StructWithArrays) Marshaler() _bindings.Marshaler {
- return _mStructWithArrays
+func (msg *SimpleTableThenUint64) Marshaler() _bindings.Marshaler {
+ return _mSimpleTableThenUint64
}
-type StructWithVectors struct {
- _ struct{} `fidl:"s,112,8" fidl_size_v1:"112" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"112" fidl_alignment_v1_no_ee:"8"`
- VecEmpty []int32 `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
- VecInt []int32 `fidl:"16," fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
- VecString []string `fidl:"32,," fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
- VecNullableString []*string `fidl:"48,," fidl_offset_v1:"48" fidl_offset_v1_no_ee:"48"`
- VecStruct []StructWithInt `fidl:"64," fidl_offset_v1:"64" fidl_offset_v1_no_ee:"64"`
- VecNullableStruct []*StructWithInt `fidl:"80," fidl_offset_v1:"80" fidl_offset_v1_no_ee:"80"`
- VecVecInt [][]int32 `fidl:"96,," fidl_offset_v1:"96" fidl_offset_v1_no_ee:"96"`
+type StructOfTableWithStringAndVector struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ Table TableWithStringAndVector `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructWithVectors = _bindings.CreateLazyMarshaler(StructWithVectors{})
+var _mStructOfTableWithStringAndVector = _bindings.CreateLazyMarshaler(StructOfTableWithStringAndVector{})
-func (msg *StructWithVectors) Marshaler() _bindings.Marshaler {
- return _mStructWithVectors
+func (msg *StructOfTableWithStringAndVector) Marshaler() _bindings.Marshaler {
+ return _mStructOfTableWithStringAndVector
+}
+
+type Int64Struct struct {
+ _ struct{} `fidl:"s,8,8" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"8"`
+ X int64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mInt64Struct = _bindings.CreateLazyMarshaler(Int64Struct{})
+
+func (msg *Int64Struct) Marshaler() _bindings.Marshaler {
+ return _mInt64Struct
+}
+
+type TestInlineXUnionInStruct struct {
+ _ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
+ Before string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Xu SampleXUnion `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+ After string `fidl:"40," fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
+}
+
+var _mTestInlineXUnionInStruct = _bindings.CreateLazyMarshaler(TestInlineXUnionInStruct{})
+
+func (msg *TestInlineXUnionInStruct) Marshaler() _bindings.Marshaler {
+ return _mTestInlineXUnionInStruct
+}
+
+type TestOptionalXUnionInStruct struct {
+ _ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
+ Before string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Xu *SampleXUnion `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+ After string `fidl:"40," fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
+}
+
+var _mTestOptionalXUnionInStruct = _bindings.CreateLazyMarshaler(TestOptionalXUnionInStruct{})
+
+func (msg *TestOptionalXUnionInStruct) Marshaler() _bindings.Marshaler {
+ return _mTestOptionalXUnionInStruct
+}
+
+type TestStrictXUnionInStruct struct {
+ _ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
+ Xu SampleStrictXUnion `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mTestStrictXUnionInStruct = _bindings.CreateLazyMarshaler(TestStrictXUnionInStruct{})
+
+func (msg *TestStrictXUnionInStruct) Marshaler() _bindings.Marshaler {
+ return _mTestStrictXUnionInStruct
+}
+
+type TestFlexibleXUnionInStruct struct {
+ _ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
+ Xu SampleXUnion `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mTestFlexibleXUnionInStruct = _bindings.CreateLazyMarshaler(TestFlexibleXUnionInStruct{})
+
+func (msg *TestFlexibleXUnionInStruct) Marshaler() _bindings.Marshaler {
+ return _mTestFlexibleXUnionInStruct
}
type MyBool struct {
@@ -646,6 +515,19 @@
return _mSandwich1
}
+type Sandwich1WithOptUnion struct {
+ _ struct{} `fidl:"s,24,8" fidl_size_v1:"40" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"8"`
+ Before uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ OptUnion *UnionSize8Align4 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
+ After uint32 `fidl:"16" fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
+}
+
+var _mSandwich1WithOptUnion = _bindings.CreateLazyMarshaler(Sandwich1WithOptUnion{})
+
+func (msg *Sandwich1WithOptUnion) Marshaler() _bindings.Marshaler {
+ return _mSandwich1WithOptUnion
+}
+
type Sandwich2 struct {
_ struct{} `fidl:"s,20,4" fidl_size_v1:"40" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"8"`
Before uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
@@ -865,71 +747,71 @@
return _mXUnionWithXUnionStruct
}
-type StructSize5Align1 struct {
+type Size5Alignment1 struct {
_ struct{} `fidl:"s,5,1" fidl_size_v1:"5" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"5" fidl_alignment_v1_no_ee:"1"`
Data [5]uint8 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructSize5Align1 = _bindings.CreateLazyMarshaler(StructSize5Align1{})
+var _mSize5Alignment1 = _bindings.CreateLazyMarshaler(Size5Alignment1{})
-func (msg *StructSize5Align1) Marshaler() _bindings.Marshaler {
- return _mStructSize5Align1
+func (msg *Size5Alignment1) Marshaler() _bindings.Marshaler {
+ return _mSize5Alignment1
}
-type StructSize5Align4 struct {
+type Size5Alignment4 struct {
_ struct{} `fidl:"s,8,4" fidl_size_v1:"8" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"4"`
Four uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
One uint8 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
-var _mStructSize5Align4 = _bindings.CreateLazyMarshaler(StructSize5Align4{})
+var _mSize5Alignment4 = _bindings.CreateLazyMarshaler(Size5Alignment4{})
-func (msg *StructSize5Align4) Marshaler() _bindings.Marshaler {
- return _mStructSize5Align4
+func (msg *Size5Alignment4) Marshaler() _bindings.Marshaler {
+ return _mSize5Alignment4
}
-type StructSize5Align1Vector struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- V []StructSize5Align1 `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+type Size5Alignment1Vector struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ V []Size5Alignment1 `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructSize5Align1Vector = _bindings.CreateLazyMarshaler(StructSize5Align1Vector{})
+var _mSize5Alignment1Vector = _bindings.CreateLazyMarshaler(Size5Alignment1Vector{})
-func (msg *StructSize5Align1Vector) Marshaler() _bindings.Marshaler {
- return _mStructSize5Align1Vector
+func (msg *Size5Alignment1Vector) Marshaler() _bindings.Marshaler {
+ return _mSize5Alignment1Vector
}
-type StructSize5Align4Vector struct {
- _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- V []StructSize5Align4 `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+type Size5Alignment4Vector struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ V []Size5Alignment4 `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructSize5Align4Vector = _bindings.CreateLazyMarshaler(StructSize5Align4Vector{})
+var _mSize5Alignment4Vector = _bindings.CreateLazyMarshaler(Size5Alignment4Vector{})
-func (msg *StructSize5Align4Vector) Marshaler() _bindings.Marshaler {
- return _mStructSize5Align4Vector
+func (msg *Size5Alignment4Vector) Marshaler() _bindings.Marshaler {
+ return _mSize5Alignment4Vector
}
-type StructSize5Align1Array struct {
- _ struct{} `fidl:"s,15,1" fidl_size_v1:"15" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"15" fidl_alignment_v1_no_ee:"1"`
- A [3]StructSize5Align1 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+type Size5Alignment1Array struct {
+ _ struct{} `fidl:"s,15,1" fidl_size_v1:"15" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"15" fidl_alignment_v1_no_ee:"1"`
+ A [3]Size5Alignment1 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructSize5Align1Array = _bindings.CreateLazyMarshaler(StructSize5Align1Array{})
+var _mSize5Alignment1Array = _bindings.CreateLazyMarshaler(Size5Alignment1Array{})
-func (msg *StructSize5Align1Array) Marshaler() _bindings.Marshaler {
- return _mStructSize5Align1Array
+func (msg *Size5Alignment1Array) Marshaler() _bindings.Marshaler {
+ return _mSize5Alignment1Array
}
-type StructSize5Align4Array struct {
- _ struct{} `fidl:"s,24,4" fidl_size_v1:"24" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"4"`
- A [3]StructSize5Align4 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+type Size5Alignment4Array struct {
+ _ struct{} `fidl:"s,24,4" fidl_size_v1:"24" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"4"`
+ A [3]Size5Alignment4 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
-var _mStructSize5Align4Array = _bindings.CreateLazyMarshaler(StructSize5Align4Array{})
+var _mSize5Alignment4Array = _bindings.CreateLazyMarshaler(Size5Alignment4Array{})
-func (msg *StructSize5Align4Array) Marshaler() _bindings.Marshaler {
- return _mStructSize5Align4Array
+func (msg *Size5Alignment4Array) Marshaler() _bindings.Marshaler {
+ return _mSize5Alignment4Array
}
type ArrayStruct struct {
@@ -944,6 +826,137 @@
return _mArrayStruct
}
+type StructWithInt struct {
+ _ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
+ X int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mStructWithInt = _bindings.CreateLazyMarshaler(StructWithInt{})
+
+func (msg *StructWithInt) Marshaler() _bindings.Marshaler {
+ return _mStructWithInt
+}
+
+type StructWithArrays struct {
+ _ struct{} `fidl:"s,120,8" fidl_size_v1:"120" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"120" fidl_alignment_v1_no_ee:"8"`
+ ArrInt [2]int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ ArrString [2]string `fidl:"8," fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
+ ArrNullableString [2]*string `fidl:"40," fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
+ ArrStruct [2]StructWithInt `fidl:"72" fidl_offset_v1:"72" fidl_offset_v1_no_ee:"72"`
+ ArrNullableStruct [2]*StructWithInt `fidl:"80" fidl_offset_v1:"80" fidl_offset_v1_no_ee:"80"`
+ ArrArrInt [2][3]int32 `fidl:"96" fidl_offset_v1:"96" fidl_offset_v1_no_ee:"96"`
+}
+
+var _mStructWithArrays = _bindings.CreateLazyMarshaler(StructWithArrays{})
+
+func (msg *StructWithArrays) Marshaler() _bindings.Marshaler {
+ return _mStructWithArrays
+}
+
+type StructWithVectors struct {
+ _ struct{} `fidl:"s,112,8" fidl_size_v1:"112" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"112" fidl_alignment_v1_no_ee:"8"`
+ VecEmpty []int32 `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ VecInt []int32 `fidl:"16," fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+ VecString []string `fidl:"32,," fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
+ VecNullableString []*string `fidl:"48,," fidl_offset_v1:"48" fidl_offset_v1_no_ee:"48"`
+ VecStruct []StructWithInt `fidl:"64," fidl_offset_v1:"64" fidl_offset_v1_no_ee:"64"`
+ VecNullableStruct []*StructWithInt `fidl:"80," fidl_offset_v1:"80" fidl_offset_v1_no_ee:"80"`
+ VecVecInt [][]int32 `fidl:"96,," fidl_offset_v1:"96" fidl_offset_v1_no_ee:"96"`
+}
+
+var _mStructWithVectors = _bindings.CreateLazyMarshaler(StructWithVectors{})
+
+func (msg *StructWithVectors) Marshaler() _bindings.Marshaler {
+ return _mStructWithVectors
+}
+
+type Length2StringWrapper struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ Length2String string `fidl:"0,2" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mLength2StringWrapper = _bindings.CreateLazyMarshaler(Length2StringWrapper{})
+
+func (msg *Length2StringWrapper) Marshaler() _bindings.Marshaler {
+ return _mLength2StringWrapper
+}
+
+type StringWrapper struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ Str string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mStringWrapper = _bindings.CreateLazyMarshaler(StringWrapper{})
+
+func (msg *StringWrapper) Marshaler() _bindings.Marshaler {
+ return _mStringWrapper
+}
+
+type TestXUnionInTable struct {
+ _ struct{} `fidl:"s,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ Value XUnionInTable `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+}
+
+var _mTestXUnionInTable = _bindings.CreateLazyMarshaler(TestXUnionInTable{})
+
+func (msg *TestXUnionInTable) Marshaler() _bindings.Marshaler {
+ return _mTestXUnionInTable
+}
+
+type InterfaceConfig struct {
+ _ struct{} `fidl:"s,48,8" fidl_size_v1:"40" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"8"`
+ Name string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ IpAddressConfig IpAddressConfig `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+}
+
+var _mInterfaceConfig = _bindings.CreateLazyMarshaler(InterfaceConfig{})
+
+func (msg *InterfaceConfig) Marshaler() _bindings.Marshaler {
+ return _mInterfaceConfig
+}
+
+type TestAddEthernetDeviceRequest struct {
+ _ struct{} `fidl:"s,72,8" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"8"`
+ TopologicalPath string `fidl:"0," fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Config InterfaceConfig `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+ ThisShouldBeAHandle uint32 `fidl:"64" fidl_offset_v1:"56" fidl_offset_v1_no_ee:"56"`
+}
+
+var _mTestAddEthernetDeviceRequest = _bindings.CreateLazyMarshaler(TestAddEthernetDeviceRequest{})
+
+func (msg *TestAddEthernetDeviceRequest) Marshaler() _bindings.Marshaler {
+ return _mTestAddEthernetDeviceRequest
+}
+
+type NodeAttributes struct {
+ _ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
+ Mode uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Id uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
+ ContentSize uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
+ StorageSize uint64 `fidl:"24" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
+ LinkCount uint64 `fidl:"32" fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
+ CreationTime uint64 `fidl:"40" fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
+ ModificationTime uint64 `fidl:"48" fidl_offset_v1:"48" fidl_offset_v1_no_ee:"48"`
+}
+
+var _mNodeAttributes = _bindings.CreateLazyMarshaler(NodeAttributes{})
+
+func (msg *NodeAttributes) Marshaler() _bindings.Marshaler {
+ return _mNodeAttributes
+}
+
+type FileGetAttrResponse struct {
+ _ struct{} `fidl:"s,64,8" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"8"`
+ S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
+ Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
+}
+
+var _mFileGetAttrResponse = _bindings.CreateLazyMarshaler(FileGetAttrResponse{})
+
+func (msg *FileGetAttrResponse) Marshaler() _bindings.Marshaler {
+ return _mFileGetAttrResponse
+}
+
type I_unionWithBoundStringTag uint32
const (
@@ -1249,43 +1262,43 @@
return _u
}
-type I_ipAddressConfigTag uint32
+type I_unionWithEmptyStructTag uint32
const (
- _ I_ipAddressConfigTag = iota
- IpAddressConfigPaddingSize24Align4
- IpAddressConfigDhcp
+ _ I_unionWithEmptyStructTag = iota
+ UnionWithEmptyStructS
+ UnionWithEmptyStructForceAlignmentOf8
)
-type IpAddressConfig struct {
- I_ipAddressConfigTag `fidl:"u,28,4" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
- PaddingSize24Align4 [6]uint32 `fidl:"1"`
- Dhcp bool `fidl:"2"`
+type UnionWithEmptyStruct struct {
+ I_unionWithEmptyStructTag `fidl:"u,16,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
+ S EmptyStruct `fidl:"1"`
+ ForceAlignmentOf8 uint64 `fidl:"2"`
}
-func (u *IpAddressConfig) Which() I_ipAddressConfigTag {
- return u.I_ipAddressConfigTag
+func (u *UnionWithEmptyStruct) Which() I_unionWithEmptyStructTag {
+ return u.I_unionWithEmptyStructTag
}
-func (u *IpAddressConfig) SetPaddingSize24Align4(paddingSize24Align4 [6]uint32) {
- u.I_ipAddressConfigTag = IpAddressConfigPaddingSize24Align4
- u.PaddingSize24Align4 = paddingSize24Align4
+func (u *UnionWithEmptyStruct) SetS(s EmptyStruct) {
+ u.I_unionWithEmptyStructTag = UnionWithEmptyStructS
+ u.S = s
}
-func IpAddressConfigWithPaddingSize24Align4(paddingSize24Align4 [6]uint32) IpAddressConfig {
- var _u IpAddressConfig
- _u.SetPaddingSize24Align4(paddingSize24Align4)
+func UnionWithEmptyStructWithS(s EmptyStruct) UnionWithEmptyStruct {
+ var _u UnionWithEmptyStruct
+ _u.SetS(s)
return _u
}
-func (u *IpAddressConfig) SetDhcp(dhcp bool) {
- u.I_ipAddressConfigTag = IpAddressConfigDhcp
- u.Dhcp = dhcp
+func (u *UnionWithEmptyStruct) SetForceAlignmentOf8(forceAlignmentOf8 uint64) {
+ u.I_unionWithEmptyStructTag = UnionWithEmptyStructForceAlignmentOf8
+ u.ForceAlignmentOf8 = forceAlignmentOf8
}
-func IpAddressConfigWithDhcp(dhcp bool) IpAddressConfig {
- var _u IpAddressConfig
- _u.SetDhcp(dhcp)
+func UnionWithEmptyStructWithForceAlignmentOf8(forceAlignmentOf8 uint64) UnionWithEmptyStruct {
+ var _u UnionWithEmptyStruct
+ _u.SetForceAlignmentOf8(forceAlignmentOf8)
return _u
}
@@ -1355,46 +1368,6 @@
return _u
}
-type I_unionWithEmptyStructTag uint32
-
-const (
- _ I_unionWithEmptyStructTag = iota
- UnionWithEmptyStructS
- UnionWithEmptyStructForceAlignmentOf8
-)
-
-type UnionWithEmptyStruct struct {
- I_unionWithEmptyStructTag `fidl:"u,16,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
- S EmptyStruct `fidl:"1"`
- ForceAlignmentOf8 uint64 `fidl:"2"`
-}
-
-func (u *UnionWithEmptyStruct) Which() I_unionWithEmptyStructTag {
- return u.I_unionWithEmptyStructTag
-}
-
-func (u *UnionWithEmptyStruct) SetS(s EmptyStruct) {
- u.I_unionWithEmptyStructTag = UnionWithEmptyStructS
- u.S = s
-}
-
-func UnionWithEmptyStructWithS(s EmptyStruct) UnionWithEmptyStruct {
- var _u UnionWithEmptyStruct
- _u.SetS(s)
- return _u
-}
-
-func (u *UnionWithEmptyStruct) SetForceAlignmentOf8(forceAlignmentOf8 uint64) {
- u.I_unionWithEmptyStructTag = UnionWithEmptyStructForceAlignmentOf8
- u.ForceAlignmentOf8 = forceAlignmentOf8
-}
-
-func UnionWithEmptyStructWithForceAlignmentOf8(forceAlignmentOf8 uint64) UnionWithEmptyStruct {
- var _u UnionWithEmptyStruct
- _u.SetForceAlignmentOf8(forceAlignmentOf8)
- return _u
-}
-
type I_unionSize8Align4Tag uint32
const (
@@ -1731,7 +1704,7 @@
_ I_unionWithVectorTag = iota
UnionWithVectorUnused
UnionWithVectorVectorOfUint8
- UnionWithVectorString
+ UnionWithVectorS
UnionWithVectorVectorS3A1
UnionWithVectorVectorS3A2
UnionWithVectorHandles
@@ -1744,7 +1717,7 @@
I_unionWithVectorTag `fidl:"u,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
Unused uint8 `fidl:"1"`
VectorOfUint8 []uint8 `fidl:"2,"`
- String string `fidl:"3,"`
+ S string `fidl:"3,"`
VectorS3A1 []StructSize3Align1 `fidl:"4,"`
VectorS3A2 []StructSize3Align2 `fidl:"5,"`
Handles []uint32 `fidl:"6,"`
@@ -1779,14 +1752,14 @@
return _u
}
-func (u *UnionWithVector) SetString(string_ string) {
- u.I_unionWithVectorTag = UnionWithVectorString
- u.String = string_
+func (u *UnionWithVector) SetS(s string) {
+ u.I_unionWithVectorTag = UnionWithVectorS
+ u.S = s
}
-func UnionWithVectorWithString(string_ string) UnionWithVector {
+func UnionWithVectorWithS(s string) UnionWithVector {
var _u UnionWithVector
- _u.SetString(string_)
+ _u.SetS(s)
return _u
}
@@ -1896,6 +1869,83 @@
return _u
}
+type I_ipAddressConfigTag uint32
+
+const (
+ _ I_ipAddressConfigTag = iota
+ IpAddressConfigPaddingSize24Align4
+ IpAddressConfigDhcp
+)
+
+type IpAddressConfig struct {
+ I_ipAddressConfigTag `fidl:"u,28,4" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
+ PaddingSize24Align4 [6]uint32 `fidl:"1"`
+ Dhcp bool `fidl:"2"`
+}
+
+func (u *IpAddressConfig) Which() I_ipAddressConfigTag {
+ return u.I_ipAddressConfigTag
+}
+
+func (u *IpAddressConfig) SetPaddingSize24Align4(paddingSize24Align4 [6]uint32) {
+ u.I_ipAddressConfigTag = IpAddressConfigPaddingSize24Align4
+ u.PaddingSize24Align4 = paddingSize24Align4
+}
+
+func IpAddressConfigWithPaddingSize24Align4(paddingSize24Align4 [6]uint32) IpAddressConfig {
+ var _u IpAddressConfig
+ _u.SetPaddingSize24Align4(paddingSize24Align4)
+ return _u
+}
+
+func (u *IpAddressConfig) SetDhcp(dhcp bool) {
+ u.I_ipAddressConfigTag = IpAddressConfigDhcp
+ u.Dhcp = dhcp
+}
+
+func IpAddressConfigWithDhcp(dhcp bool) IpAddressConfig {
+ var _u IpAddressConfig
+ _u.SetDhcp(dhcp)
+ return _u
+}
+
+type I_xUnionWithEmptyStructTag uint32
+
+const (
+ XUnionWithEmptyStruct_unknownData = 0 // 0x00000000
+ XUnionWithEmptyStructS = 1956241662 // 0x7499e0fe
+)
+
+type XUnionWithEmptyStruct struct {
+ I_xUnionWithEmptyStructTag `fidl:"x,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
+ I_unknownData []byte
+ S EmptyStruct `fidl:"1956241662"`
+}
+
+func (_m *XUnionWithEmptyStruct) Which() I_xUnionWithEmptyStructTag {
+ switch _m.I_xUnionWithEmptyStructTag {
+ case 1956241662:
+ return XUnionWithEmptyStructS
+ default:
+ return XUnionWithEmptyStruct_unknownData
+ }
+}
+
+func (_m *XUnionWithEmptyStruct) Ordinal() uint32 {
+ return uint32(_m.I_xUnionWithEmptyStructTag)
+}
+
+func (_m *XUnionWithEmptyStruct) SetS(s EmptyStruct) {
+ _m.I_xUnionWithEmptyStructTag = XUnionWithEmptyStructS
+ _m.S = s
+}
+
+func XUnionWithEmptyStructWithS(s EmptyStruct) XUnionWithEmptyStruct {
+ var _u XUnionWithEmptyStruct
+ _u.SetS(s)
+ return _u
+}
+
type I_sampleXUnionTag uint32
const (
@@ -2019,43 +2069,6 @@
return _u
}
-type I_xUnionWithEmptyStructTag uint32
-
-const (
- XUnionWithEmptyStruct_unknownData = 0 // 0x00000000
- XUnionWithEmptyStructS = 1956241662 // 0x7499e0fe
-)
-
-type XUnionWithEmptyStruct struct {
- I_xUnionWithEmptyStructTag `fidl:"x,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
- I_unknownData []byte
- S EmptyStruct `fidl:"1956241662"`
-}
-
-func (_m *XUnionWithEmptyStruct) Which() I_xUnionWithEmptyStructTag {
- switch _m.I_xUnionWithEmptyStructTag {
- case 1956241662:
- return XUnionWithEmptyStructS
- default:
- return XUnionWithEmptyStruct_unknownData
- }
-}
-
-func (_m *XUnionWithEmptyStruct) Ordinal() uint32 {
- return uint32(_m.I_xUnionWithEmptyStructTag)
-}
-
-func (_m *XUnionWithEmptyStruct) SetS(s EmptyStruct) {
- _m.I_xUnionWithEmptyStructTag = XUnionWithEmptyStructS
- _m.S = s
-}
-
-func XUnionWithEmptyStructWithS(s EmptyStruct) XUnionWithEmptyStruct {
- var _u XUnionWithEmptyStruct
- _u.SetS(s)
- return _u
-}
-
type I_xUnionWithStructTag uint32
const (
@@ -2182,86 +2195,34 @@
return _u
}
-type XUnionInTable struct {
- _ struct{} `fidl:"t,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- Before string `fidl:"1,"`
- BeforePresent bool
- Xu SampleXUnion `fidl:"2"`
- XuPresent bool
- After string `fidl:"3,"`
- AfterPresent bool
+type TableWithEmptyStruct struct {
+ _ struct{} `fidl:"t,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ S EmptyStruct `fidl:"1"`
+ SPresent bool
}
-func (u *XUnionInTable) SetBefore(before string) {
- u.Before = before
- u.BeforePresent = true
+func (u *TableWithEmptyStruct) SetS(s EmptyStruct) {
+ u.S = s
+ u.SPresent = true
}
-func (u *XUnionInTable) GetBefore() string {
- return u.Before
+func (u *TableWithEmptyStruct) GetS() EmptyStruct {
+ return u.S
}
-func (u *XUnionInTable) GetBeforeWithDefault(_default string) string {
- if !u.HasBefore() {
+func (u *TableWithEmptyStruct) GetSWithDefault(_default EmptyStruct) EmptyStruct {
+ if !u.HasS() {
return _default
}
- return u.Before
+ return u.S
}
-func (u *XUnionInTable) HasBefore() bool {
- return u.BeforePresent
+func (u *TableWithEmptyStruct) HasS() bool {
+ return u.SPresent
}
-func (u *XUnionInTable) ClearBefore() {
- u.BeforePresent = false
-}
-
-func (u *XUnionInTable) SetXu(xu SampleXUnion) {
- u.Xu = xu
- u.XuPresent = true
-}
-
-func (u *XUnionInTable) GetXu() SampleXUnion {
- return u.Xu
-}
-
-func (u *XUnionInTable) GetXuWithDefault(_default SampleXUnion) SampleXUnion {
- if !u.HasXu() {
- return _default
- }
- return u.Xu
-}
-
-func (u *XUnionInTable) HasXu() bool {
- return u.XuPresent
-}
-
-func (u *XUnionInTable) ClearXu() {
- u.XuPresent = false
-}
-
-func (u *XUnionInTable) SetAfter(after string) {
- u.After = after
- u.AfterPresent = true
-}
-
-func (u *XUnionInTable) GetAfter() string {
- return u.After
-}
-
-func (u *XUnionInTable) GetAfterWithDefault(_default string) string {
- if !u.HasAfter() {
- return _default
- }
- return u.After
-}
-
-func (u *XUnionInTable) HasAfter() bool {
- return u.AfterPresent
-}
-
-func (u *XUnionInTable) ClearAfter() {
- u.AfterPresent = false
+func (u *TableWithEmptyStruct) ClearS() {
+ u.SPresent = false
}
type SimpleTable struct {
@@ -2402,36 +2363,6 @@
u.BazPresent = false
}
-type TableWithEmptyStruct struct {
- _ struct{} `fidl:"t,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
- S EmptyStruct `fidl:"1"`
- SPresent bool
-}
-
-func (u *TableWithEmptyStruct) SetS(s EmptyStruct) {
- u.S = s
- u.SPresent = true
-}
-
-func (u *TableWithEmptyStruct) GetS() EmptyStruct {
- return u.S
-}
-
-func (u *TableWithEmptyStruct) GetSWithDefault(_default EmptyStruct) EmptyStruct {
- if !u.HasS() {
- return _default
- }
- return u.S
-}
-
-func (u *TableWithEmptyStruct) HasS() bool {
- return u.SPresent
-}
-
-func (u *TableWithEmptyStruct) ClearS() {
- u.SPresent = false
-}
-
type TableStructWithReservedSandwich struct {
_ struct{} `fidl:"t,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
S1 StructSize3Align1 `fidl:"2"`
@@ -2708,6 +2639,88 @@
u.S2Present = false
}
+type XUnionInTable struct {
+ _ struct{} `fidl:"t,16,8" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"8"`
+ Before string `fidl:"1,"`
+ BeforePresent bool
+ Xu SampleXUnion `fidl:"2"`
+ XuPresent bool
+ After string `fidl:"3,"`
+ AfterPresent bool
+}
+
+func (u *XUnionInTable) SetBefore(before string) {
+ u.Before = before
+ u.BeforePresent = true
+}
+
+func (u *XUnionInTable) GetBefore() string {
+ return u.Before
+}
+
+func (u *XUnionInTable) GetBeforeWithDefault(_default string) string {
+ if !u.HasBefore() {
+ return _default
+ }
+ return u.Before
+}
+
+func (u *XUnionInTable) HasBefore() bool {
+ return u.BeforePresent
+}
+
+func (u *XUnionInTable) ClearBefore() {
+ u.BeforePresent = false
+}
+
+func (u *XUnionInTable) SetXu(xu SampleXUnion) {
+ u.Xu = xu
+ u.XuPresent = true
+}
+
+func (u *XUnionInTable) GetXu() SampleXUnion {
+ return u.Xu
+}
+
+func (u *XUnionInTable) GetXuWithDefault(_default SampleXUnion) SampleXUnion {
+ if !u.HasXu() {
+ return _default
+ }
+ return u.Xu
+}
+
+func (u *XUnionInTable) HasXu() bool {
+ return u.XuPresent
+}
+
+func (u *XUnionInTable) ClearXu() {
+ u.XuPresent = false
+}
+
+func (u *XUnionInTable) SetAfter(after string) {
+ u.After = after
+ u.AfterPresent = true
+}
+
+func (u *XUnionInTable) GetAfter() string {
+ return u.After
+}
+
+func (u *XUnionInTable) GetAfterWithDefault(_default string) string {
+ if !u.HasAfter() {
+ return _default
+ }
+ return u.After
+}
+
+func (u *XUnionInTable) HasAfter() bool {
+ return u.AfterPresent
+}
+
+func (u *XUnionInTable) ClearAfter() {
+ u.AfterPresent = false
+}
+
type EthernetDeviceInterface _bindings.ChannelProxy
type EthernetDevice interface {
diff --git a/src/syscall/zx/fidl/fidl_test/conformance_test.go b/src/syscall/zx/fidl/fidl_test/conformance_test.go
index ba494c7..abee77b 100644
--- a/src/syscall/zx/fidl/fidl_test/conformance_test.go
+++ b/src/syscall/zx/fidl/fidl_test/conformance_test.go
@@ -1628,6 +1628,108 @@
}
{
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ v3 := &conformance.UnionSize8Align4{}
+ var v4 uint32 = 202050057
+ v3.SetVariant(v4)
+ v1.OptUnion = v3
+ var v5 uint32 = 134678021
+ v1.After = v5
+
+ encodeSuccessCase{
+ name: "Sandwich1WithOptUnionPresent",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ v3 := &conformance.UnionSize8Align4{}
+ var v4 uint32 = 202050057
+ v3.SetVariant(v4)
+ v1.OptUnion = v3
+ var v5 uint32 = 134678021
+ v1.After = v5
+
+ encodeSuccessCase{
+ name: "Sandwich1WithOptUnionPresent_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ var v3 uint32 = 134678021
+ v1.After = v3
+
+ encodeSuccessCase{
+ name: "Sandwich1WithOptUnionAbsent",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ var v3 uint32 = 134678021
+ v1.After = v3
+
+ encodeSuccessCase{
+ name: "Sandwich1WithOptUnionAbsent_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
v1 := conformance.Sandwich2{}
var v2 uint32 = 67305985
v1.Before = v2
@@ -2160,7 +2262,7 @@
v1.Before = v2
v3 := conformance.UnionWithVector{}
v4 := "soft migrations rock!"
- v3.SetString(v4)
+ v3.SetS(v4)
v1.TheUnion = v3
var v5 uint32 = 134678021
v1.After = v5
@@ -2191,7 +2293,7 @@
v1.Before = v2
v3 := conformance.UnionWithVector{}
v4 := "soft migrations rock!"
- v3.SetString(v4)
+ v3.SetS(v4)
v1.TheUnion = v3
var v5 uint32 = 134678021
v1.After = v5
@@ -2704,538 +2806,117 @@
}
{
- v1 := conformance.TableStructWithReservedSandwichStruct{}
- v2 := conformance.TableStructWithReservedSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 9
- var v5 uint8 = 10
- var v6 uint8 = 11
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.StructSize3Align1{}
- var v9 uint8 = 25
- var v10 uint8 = 26
- var v11 uint8 = 27
- v12 := [3]uint8{v9, v10, v11}
- v8.ThreeBytes = v12
- v2.SetS2(v8)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ v3 := &conformance.Sandwich1{}
+ var v4 uint32 = 67305985
+ v3.Before = v4
+ v5 := conformance.UnionSize8Align4{}
+ var v6 uint32 = 202050057
+ v5.SetVariant(v6)
+ v3.TheUnion = v5
+ var v7 uint32 = 134678021
+ v3.After = v7
+ v1.OptSandwich1 = v3
+ var v8 uint32 = 606282273
+ v1.After = v8
encodeSuccessCase{
- name: "Table_StructWithReservedSandwich",
+ name: "Sandwich7Case1",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: false,
EncodeUnionsAsXUnionBytes: false,
},
input: &v1,
bytes: []byte{
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x13, 0x14, 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,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x00,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08,
},
}.check(t)
}
{
- v1 := conformance.TableStructWithReservedSandwichStruct{}
- v2 := conformance.TableStructWithReservedSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 9
- var v5 uint8 = 10
- var v6 uint8 = 11
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.StructSize3Align1{}
- var v9 uint8 = 25
- var v10 uint8 = 26
- var v11 uint8 = 27
- v12 := [3]uint8{v9, v10, v11}
- v8.ThreeBytes = v12
- v2.SetS2(v8)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ v3 := &conformance.Sandwich1{}
+ var v4 uint32 = 67305985
+ v3.Before = v4
+ v5 := conformance.UnionSize8Align4{}
+ var v6 uint32 = 202050057
+ v5.SetVariant(v6)
+ v3.TheUnion = v5
+ var v7 uint32 = 134678021
+ v3.After = v7
+ v1.OptSandwich1 = v3
+ var v8 uint32 = 606282273
+ v1.After = v8
encodeSuccessCase{
- name: "Table_StructWithReservedSandwich_v1",
+ name: "Sandwich7Case1_v1",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: true,
EncodeUnionsAsXUnionBytes: true,
},
input: &v1,
bytes: []byte{
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x13, 0x14, 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableStructWithUint32SandwichStruct{}
- v2 := conformance.TableStructWithUint32Sandwich{}
- var v3 uint32 = 67305985
- v2.SetI(v3)
- v4 := conformance.StructSize3Align1{}
- var v5 uint8 = 9
- var v6 uint8 = 10
- var v7 uint8 = 11
- v8 := [3]uint8{v5, v6, v7}
- v4.ThreeBytes = v8
- v2.SetS1(v4)
- v9 := conformance.StructSize3Align1{}
- var v10 uint8 = 25
- var v11 uint8 = 26
- var v12 uint8 = 27
- v13 := [3]uint8{v10, v11, v12}
- v9.ThreeBytes = v13
- v2.SetS2(v9)
- var v14 uint32 = 218893066
- v2.SetI2(v14)
- v1.Table = v2
-
- encodeSuccessCase{
- name: "Table_StructWithUint32Sandwich",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
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,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
},
}.check(t)
}
{
- v1 := conformance.TableStructWithUint32SandwichStruct{}
- v2 := conformance.TableStructWithUint32Sandwich{}
- var v3 uint32 = 67305985
- v2.SetI(v3)
- v4 := conformance.StructSize3Align1{}
- var v5 uint8 = 9
- var v6 uint8 = 10
- var v7 uint8 = 11
- v8 := [3]uint8{v5, v6, v7}
- v4.ThreeBytes = v8
- v2.SetS1(v4)
- v9 := conformance.StructSize3Align1{}
- var v10 uint8 = 25
- var v11 uint8 = 26
- var v12 uint8 = 27
- v13 := [3]uint8{v10, v11, v12}
- v9.ThreeBytes = v13
- v2.SetS2(v9)
- var v14 uint32 = 218893066
- v2.SetI2(v14)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ var v3 uint32 = 606282273
+ v1.After = v3
encodeSuccessCase{
- name: "Table_StructWithUint32Sandwich_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
- v2 := conformance.TableUnionWithVectorReservedSandwich{}
- v3 := conformance.UnionWithVector{}
- v4 := "hello"
- v3.SetString(v4)
- v2.SetUv(v3)
- v1.Table = v2
-
- encodeSuccessCase{
- name: "Table_UnionWithVector_ReservedSandwich",
+ name: "Sandwich7Case2",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: false,
EncodeUnionsAsXUnionBytes: false,
},
input: &v1,
bytes: []byte{
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00,
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,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
},
}.check(t)
}
{
- v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
- v2 := conformance.TableUnionWithVectorReservedSandwich{}
- v3 := conformance.UnionWithVector{}
- v4 := "hello"
- v3.SetString(v4)
- v2.SetUv(v3)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ var v3 uint32 = 606282273
+ v1.After = v3
encodeSuccessCase{
- name: "Table_UnionWithVector_ReservedSandwich_v1",
+ name: "Sandwich7Case2_v1",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: true,
EncodeUnionsAsXUnionBytes: true,
},
input: &v1,
bytes: []byte{
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
- v2 := conformance.TableUnionWithVectorStructSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.UnionWithVector{}
- v9 := "hello"
- v8.SetString(v9)
- v2.SetUv(v8)
- v10 := conformance.StructSize3Align1{}
- var v11 uint8 = 4
- var v12 uint8 = 5
- var v13 uint8 = 6
- v14 := [3]uint8{v11, v12, v13}
- v10.ThreeBytes = v14
- v2.SetS2(v10)
- v1.Table = v2
-
- encodeSuccessCase{
- name: "Table_UnionWithVector_StructSandwich",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
- v2 := conformance.TableUnionWithVectorStructSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.UnionWithVector{}
- v9 := "hello"
- v8.SetString(v9)
- v2.SetUv(v8)
- v10 := conformance.StructSize3Align1{}
- var v11 uint8 = 4
- var v12 uint8 = 5
- var v13 uint8 = 6
- v14 := [3]uint8{v11, v12, v13}
- v10.ThreeBytes = v14
- v2.SetS2(v10)
- v1.Table = v2
-
- encodeSuccessCase{
- name: "Table_UnionWithVector_StructSandwich_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
- 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.XUnionWithStructStruct{}
- v2 := conformance.XUnionWithStruct{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS(v3)
- v1.Xu = v2
-
- encodeSuccessCase{
- name: "XUnionWithStruct",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.XUnionWithStructStruct{}
- v2 := conformance.XUnionWithStruct{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS(v3)
- v1.Xu = v2
-
- encodeSuccessCase{
- name: "XUnionWithStruct_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.ArrayStruct{}
- v2 := conformance.StringUnion{}
- v3 := "one"
- v2.SetS(v3)
- v4 := conformance.StringUnion{}
- v5 := "two"
- v4.SetS(v5)
- v6 := conformance.StringUnion{}
- v7 := "three"
- v6.SetS(v7)
- v8 := [3]conformance.StringUnion{v2, v4, v6}
- v1.Unions = v8
- v9 := &conformance.StringUnion{}
- v10 := "four"
- v9.SetS(v10)
- v11 := &conformance.StringUnion{}
- v12 := "five"
- v11.SetS(v12)
- v13 := &conformance.StringUnion{}
- v14 := "six"
- v13.SetS(v14)
- v15 := [3]*conformance.StringUnion{v9, v11, v13}
- v1.OptionalUnions = v15
-
- encodeSuccessCase{
- name: "ArrayStruct",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.ArrayStruct{}
- v2 := conformance.StringUnion{}
- v3 := "one"
- v2.SetS(v3)
- v4 := conformance.StringUnion{}
- v5 := "two"
- v4.SetS(v5)
- v6 := conformance.StringUnion{}
- v7 := "three"
- v6.SetS(v7)
- v8 := [3]conformance.StringUnion{v2, v4, v6}
- v1.Unions = v8
- v9 := &conformance.StringUnion{}
- v10 := "four"
- v9.SetS(v10)
- v11 := &conformance.StringUnion{}
- v12 := "five"
- v11.SetS(v12)
- v13 := &conformance.StringUnion{}
- v14 := "six"
- v13.SetS(v14)
- v15 := [3]*conformance.StringUnion{v9, v11, v13}
- v1.OptionalUnions = v15
-
- encodeSuccessCase{
- name: "ArrayStruct_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x66, 0x6f, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x66, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x73, 0x69, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
},
}.check(t)
}
@@ -3485,6 +3166,835 @@
}
{
+ v1 := conformance.Size5Alignment1Array{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := conformance.Size5Alignment1{}
+ var v17 uint8 = 11
+ var v18 uint8 = 12
+ var v19 uint8 = 13
+ var v20 uint8 = 14
+ var v21 uint8 = 15
+ v22 := [5]uint8{v17, v18, v19, v20, v21}
+ v16.Data = v22
+ v23 := [3]conformance.Size5Alignment1{v2, v9, v16}
+ v1.A = v23
+
+ encodeSuccessCase{
+ name: "Size5Alignment1Array",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment1Array{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := conformance.Size5Alignment1{}
+ var v17 uint8 = 11
+ var v18 uint8 = 12
+ var v19 uint8 = 13
+ var v20 uint8 = 14
+ var v21 uint8 = 15
+ v22 := [5]uint8{v17, v18, v19, v20, v21}
+ v16.Data = v22
+ v23 := [3]conformance.Size5Alignment1{v2, v9, v16}
+ v1.A = v23
+
+ encodeSuccessCase{
+ name: "Size5Alignment1Array_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Array{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := conformance.Size5Alignment4{}
+ var v9 uint32 = 235736075
+ v8.Four = v9
+ var v10 uint8 = 15
+ v8.One = v10
+ v11 := [3]conformance.Size5Alignment4{v2, v5, v8}
+ v1.A = v11
+
+ encodeSuccessCase{
+ name: "Size5Alignment4Array",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00,
+ 0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Array{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := conformance.Size5Alignment4{}
+ var v9 uint32 = 235736075
+ v8.Four = v9
+ var v10 uint8 = 15
+ v8.One = v10
+ v11 := [3]conformance.Size5Alignment4{v2, v5, v8}
+ v1.A = v11
+
+ encodeSuccessCase{
+ name: "Size5Alignment4Array_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00,
+ 0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment1Vector{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := []conformance.Size5Alignment1{v2, v9}
+ v1.V = v16
+
+ encodeSuccessCase{
+ name: "Size5Alignment1Vector",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment1Vector{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := []conformance.Size5Alignment1{v2, v9}
+ v1.V = v16
+
+ encodeSuccessCase{
+ name: "Size5Alignment1Vector_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Vector{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := []conformance.Size5Alignment4{v2, v5}
+ v1.V = v8
+
+ encodeSuccessCase{
+ name: "Size5Alignment4Vector",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Vector{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := []conformance.Size5Alignment4{v2, v5}
+ v1.V = v8
+
+ encodeSuccessCase{
+ name: "Size5Alignment4Vector_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithReservedSandwichStruct{}
+ v2 := conformance.TableStructWithReservedSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 9
+ var v5 uint8 = 10
+ var v6 uint8 = 11
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.StructSize3Align1{}
+ var v9 uint8 = 25
+ var v10 uint8 = 26
+ var v11 uint8 = 27
+ v12 := [3]uint8{v9, v10, v11}
+ v8.ThreeBytes = v12
+ v2.SetS2(v8)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_StructWithReservedSandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithReservedSandwichStruct{}
+ v2 := conformance.TableStructWithReservedSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 9
+ var v5 uint8 = 10
+ var v6 uint8 = 11
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.StructSize3Align1{}
+ var v9 uint8 = 25
+ var v10 uint8 = 26
+ var v11 uint8 = 27
+ v12 := [3]uint8{v9, v10, v11}
+ v8.ThreeBytes = v12
+ v2.SetS2(v8)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_StructWithReservedSandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithUint32SandwichStruct{}
+ v2 := conformance.TableStructWithUint32Sandwich{}
+ var v3 uint32 = 67305985
+ v2.SetI(v3)
+ v4 := conformance.StructSize3Align1{}
+ var v5 uint8 = 9
+ var v6 uint8 = 10
+ var v7 uint8 = 11
+ v8 := [3]uint8{v5, v6, v7}
+ v4.ThreeBytes = v8
+ v2.SetS1(v4)
+ v9 := conformance.StructSize3Align1{}
+ var v10 uint8 = 25
+ var v11 uint8 = 26
+ var v12 uint8 = 27
+ v13 := [3]uint8{v10, v11, v12}
+ v9.ThreeBytes = v13
+ v2.SetS2(v9)
+ var v14 uint32 = 218893066
+ v2.SetI2(v14)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_StructWithUint32Sandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithUint32SandwichStruct{}
+ v2 := conformance.TableStructWithUint32Sandwich{}
+ var v3 uint32 = 67305985
+ v2.SetI(v3)
+ v4 := conformance.StructSize3Align1{}
+ var v5 uint8 = 9
+ var v6 uint8 = 10
+ var v7 uint8 = 11
+ v8 := [3]uint8{v5, v6, v7}
+ v4.ThreeBytes = v8
+ v2.SetS1(v4)
+ v9 := conformance.StructSize3Align1{}
+ var v10 uint8 = 25
+ var v11 uint8 = 26
+ var v12 uint8 = 27
+ v13 := [3]uint8{v10, v11, v12}
+ v9.ThreeBytes = v13
+ v2.SetS2(v9)
+ var v14 uint32 = 218893066
+ v2.SetI2(v14)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_StructWithUint32Sandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorReservedSandwich{}
+ v3 := conformance.UnionWithVector{}
+ v4 := "hello"
+ v3.SetS(v4)
+ v2.SetUv(v3)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_UnionWithVector_ReservedSandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorReservedSandwich{}
+ v3 := conformance.UnionWithVector{}
+ v4 := "hello"
+ v3.SetS(v4)
+ v2.SetUv(v3)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_UnionWithVector_ReservedSandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorStructSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.UnionWithVector{}
+ v9 := "hello"
+ v8.SetS(v9)
+ v2.SetUv(v8)
+ v10 := conformance.StructSize3Align1{}
+ var v11 uint8 = 4
+ var v12 uint8 = 5
+ var v13 uint8 = 6
+ v14 := [3]uint8{v11, v12, v13}
+ v10.ThreeBytes = v14
+ v2.SetS2(v10)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_UnionWithVector_StructSandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorStructSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.UnionWithVector{}
+ v9 := "hello"
+ v8.SetS(v9)
+ v2.SetUv(v8)
+ v10 := conformance.StructSize3Align1{}
+ var v11 uint8 = 4
+ var v12 uint8 = 5
+ var v13 uint8 = 6
+ v14 := [3]uint8{v11, v12, v13}
+ v10.ThreeBytes = v14
+ v2.SetS2(v10)
+ v1.Table = v2
+
+ encodeSuccessCase{
+ name: "Table_UnionWithVector_StructSandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.XUnionWithStructStruct{}
+ v2 := conformance.XUnionWithStruct{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS(v3)
+ v1.Xu = v2
+
+ encodeSuccessCase{
+ name: "XUnionWithStruct",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.XUnionWithStructStruct{}
+ v2 := conformance.XUnionWithStruct{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS(v3)
+ v1.Xu = v2
+
+ encodeSuccessCase{
+ name: "XUnionWithStruct_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.ArrayStruct{}
+ v2 := conformance.StringUnion{}
+ v3 := "one"
+ v2.SetS(v3)
+ v4 := conformance.StringUnion{}
+ v5 := "two"
+ v4.SetS(v5)
+ v6 := conformance.StringUnion{}
+ v7 := "three"
+ v6.SetS(v7)
+ v8 := [3]conformance.StringUnion{v2, v4, v6}
+ v1.Unions = v8
+ v9 := &conformance.StringUnion{}
+ v10 := "four"
+ v9.SetS(v10)
+ v11 := &conformance.StringUnion{}
+ v12 := "five"
+ v11.SetS(v12)
+ v13 := &conformance.StringUnion{}
+ v14 := "six"
+ v13.SetS(v14)
+ v15 := [3]*conformance.StringUnion{v9, v11, v13}
+ v1.OptionalUnions = v15
+
+ encodeSuccessCase{
+ name: "ArrayStruct",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.ArrayStruct{}
+ v2 := conformance.StringUnion{}
+ v3 := "one"
+ v2.SetS(v3)
+ v4 := conformance.StringUnion{}
+ v5 := "two"
+ v4.SetS(v5)
+ v6 := conformance.StringUnion{}
+ v7 := "three"
+ v6.SetS(v7)
+ v8 := [3]conformance.StringUnion{v2, v4, v6}
+ v1.Unions = v8
+ v9 := &conformance.StringUnion{}
+ v10 := "four"
+ v9.SetS(v10)
+ v11 := &conformance.StringUnion{}
+ v12 := "five"
+ v11.SetS(v12)
+ v13 := &conformance.StringUnion{}
+ v14 := "six"
+ v13.SetS(v14)
+ v15 := [3]*conformance.StringUnion{v9, v11, v13}
+ v1.OptionalUnions = v15
+
+ encodeSuccessCase{
+ name: "ArrayStruct_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x66, 0x6f, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x66, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x73, 0x69, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
v1 := conformance.UnionWithBoundStringStruct{}
v2 := conformance.UnionWithBoundString{}
v3 := "abcd"
@@ -5475,6 +5985,108 @@
}
{
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ v3 := &conformance.UnionSize8Align4{}
+ var v4 uint32 = 202050057
+ v3.SetVariant(v4)
+ v1.OptUnion = v3
+ var v5 uint32 = 134678021
+ v1.After = v5
+
+ decodeSuccessCase{
+ name: "Sandwich1WithOptUnionPresent",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ v3 := &conformance.UnionSize8Align4{}
+ var v4 uint32 = 202050057
+ v3.SetVariant(v4)
+ v1.OptUnion = v3
+ var v5 uint32 = 134678021
+ v1.After = v5
+
+ decodeSuccessCase{
+ name: "Sandwich1WithOptUnionPresent_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ var v3 uint32 = 134678021
+ v1.After = v3
+
+ decodeSuccessCase{
+ name: "Sandwich1WithOptUnionAbsent",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Sandwich1WithOptUnion{}
+ var v2 uint32 = 67305985
+ v1.Before = v2
+ var v3 uint32 = 134678021
+ v1.After = v3
+
+ decodeSuccessCase{
+ name: "Sandwich1WithOptUnionAbsent_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
v1 := conformance.Sandwich2{}
var v2 uint32 = 67305985
v1.Before = v2
@@ -6007,7 +6619,7 @@
v1.Before = v2
v3 := conformance.UnionWithVector{}
v4 := "soft migrations rock!"
- v3.SetString(v4)
+ v3.SetS(v4)
v1.TheUnion = v3
var v5 uint32 = 134678021
v1.After = v5
@@ -6038,7 +6650,7 @@
v1.Before = v2
v3 := conformance.UnionWithVector{}
v4 := "soft migrations rock!"
- v3.SetString(v4)
+ v3.SetS(v4)
v1.TheUnion = v3
var v5 uint32 = 134678021
v1.After = v5
@@ -6551,538 +7163,117 @@
}
{
- v1 := conformance.TableStructWithReservedSandwichStruct{}
- v2 := conformance.TableStructWithReservedSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 9
- var v5 uint8 = 10
- var v6 uint8 = 11
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.StructSize3Align1{}
- var v9 uint8 = 25
- var v10 uint8 = 26
- var v11 uint8 = 27
- v12 := [3]uint8{v9, v10, v11}
- v8.ThreeBytes = v12
- v2.SetS2(v8)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ v3 := &conformance.Sandwich1{}
+ var v4 uint32 = 67305985
+ v3.Before = v4
+ v5 := conformance.UnionSize8Align4{}
+ var v6 uint32 = 202050057
+ v5.SetVariant(v6)
+ v3.TheUnion = v5
+ var v7 uint32 = 134678021
+ v3.After = v7
+ v1.OptSandwich1 = v3
+ var v8 uint32 = 606282273
+ v1.After = v8
decodeSuccessCase{
- name: "Table_StructWithReservedSandwich",
+ name: "Sandwich7Case1",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: false,
EncodeUnionsAsXUnionBytes: false,
},
input: &v1,
bytes: []byte{
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x13, 0x14, 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,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x00,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x07, 0x08,
},
}.check(t)
}
{
- v1 := conformance.TableStructWithReservedSandwichStruct{}
- v2 := conformance.TableStructWithReservedSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 9
- var v5 uint8 = 10
- var v6 uint8 = 11
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.StructSize3Align1{}
- var v9 uint8 = 25
- var v10 uint8 = 26
- var v11 uint8 = 27
- v12 := [3]uint8{v9, v10, v11}
- v8.ThreeBytes = v12
- v2.SetS2(v8)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ v3 := &conformance.Sandwich1{}
+ var v4 uint32 = 67305985
+ v3.Before = v4
+ v5 := conformance.UnionSize8Align4{}
+ var v6 uint32 = 202050057
+ v5.SetVariant(v6)
+ v3.TheUnion = v5
+ var v7 uint32 = 134678021
+ v3.After = v7
+ v1.OptSandwich1 = v3
+ var v8 uint32 = 606282273
+ v1.After = v8
decodeSuccessCase{
- name: "Table_StructWithReservedSandwich_v1",
+ name: "Sandwich7Case1_v1",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: true,
EncodeUnionsAsXUnionBytes: true,
},
input: &v1,
bytes: []byte{
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x13, 0x14, 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableStructWithUint32SandwichStruct{}
- v2 := conformance.TableStructWithUint32Sandwich{}
- var v3 uint32 = 67305985
- v2.SetI(v3)
- v4 := conformance.StructSize3Align1{}
- var v5 uint8 = 9
- var v6 uint8 = 10
- var v7 uint8 = 11
- v8 := [3]uint8{v5, v6, v7}
- v4.ThreeBytes = v8
- v2.SetS1(v4)
- v9 := conformance.StructSize3Align1{}
- var v10 uint8 = 25
- var v11 uint8 = 26
- var v12 uint8 = 27
- v13 := [3]uint8{v10, v11, v12}
- v9.ThreeBytes = v13
- v2.SetS2(v9)
- var v14 uint32 = 218893066
- v2.SetI2(v14)
- v1.Table = v2
-
- decodeSuccessCase{
- name: "Table_StructWithUint32Sandwich",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
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,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
},
}.check(t)
}
{
- v1 := conformance.TableStructWithUint32SandwichStruct{}
- v2 := conformance.TableStructWithUint32Sandwich{}
- var v3 uint32 = 67305985
- v2.SetI(v3)
- v4 := conformance.StructSize3Align1{}
- var v5 uint8 = 9
- var v6 uint8 = 10
- var v7 uint8 = 11
- v8 := [3]uint8{v5, v6, v7}
- v4.ThreeBytes = v8
- v2.SetS1(v4)
- v9 := conformance.StructSize3Align1{}
- var v10 uint8 = 25
- var v11 uint8 = 26
- var v12 uint8 = 27
- v13 := [3]uint8{v10, v11, v12}
- v9.ThreeBytes = v13
- v2.SetS2(v9)
- var v14 uint32 = 218893066
- v2.SetI2(v14)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ var v3 uint32 = 606282273
+ v1.After = v3
decodeSuccessCase{
- name: "Table_StructWithUint32Sandwich_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
- v2 := conformance.TableUnionWithVectorReservedSandwich{}
- v3 := conformance.UnionWithVector{}
- v4 := "hello"
- v3.SetString(v4)
- v2.SetUv(v3)
- v1.Table = v2
-
- decodeSuccessCase{
- name: "Table_UnionWithVector_ReservedSandwich",
+ name: "Sandwich7Case2",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: false,
EncodeUnionsAsXUnionBytes: false,
},
input: &v1,
bytes: []byte{
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00,
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,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
},
}.check(t)
}
{
- v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
- v2 := conformance.TableUnionWithVectorReservedSandwich{}
- v3 := conformance.UnionWithVector{}
- v4 := "hello"
- v3.SetString(v4)
- v2.SetUv(v3)
- v1.Table = v2
+ v1 := conformance.Sandwich7{}
+ var v2 uint32 = 336794129
+ v1.Before = v2
+ var v3 uint32 = 606282273
+ v1.After = v3
decodeSuccessCase{
- name: "Table_UnionWithVector_ReservedSandwich_v1",
+ name: "Sandwich7Case2_v1",
context: fidl.MarshalerContext{
DecodeUnionsFromXUnionBytes: true,
EncodeUnionsAsXUnionBytes: true,
},
input: &v1,
bytes: []byte{
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x11, 0x12, 0x13, 0x14, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
- v2 := conformance.TableUnionWithVectorStructSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.UnionWithVector{}
- v9 := "hello"
- v8.SetString(v9)
- v2.SetUv(v8)
- v10 := conformance.StructSize3Align1{}
- var v11 uint8 = 4
- var v12 uint8 = 5
- var v13 uint8 = 6
- v14 := [3]uint8{v11, v12, v13}
- v10.ThreeBytes = v14
- v2.SetS2(v10)
- v1.Table = v2
-
- decodeSuccessCase{
- name: "Table_UnionWithVector_StructSandwich",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
- v2 := conformance.TableUnionWithVectorStructSandwich{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS1(v3)
- v8 := conformance.UnionWithVector{}
- v9 := "hello"
- v8.SetString(v9)
- v2.SetUv(v8)
- v10 := conformance.StructSize3Align1{}
- var v11 uint8 = 4
- var v12 uint8 = 5
- var v13 uint8 = 6
- v14 := [3]uint8{v11, v12, v13}
- v10.ThreeBytes = v14
- v2.SetS2(v10)
- v1.Table = v2
-
- decodeSuccessCase{
- name: "Table_UnionWithVector_StructSandwich_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
- 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.XUnionWithStructStruct{}
- v2 := conformance.XUnionWithStruct{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS(v3)
- v1.Xu = v2
-
- decodeSuccessCase{
- name: "XUnionWithStruct",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.XUnionWithStructStruct{}
- v2 := conformance.XUnionWithStruct{}
- v3 := conformance.StructSize3Align1{}
- var v4 uint8 = 1
- var v5 uint8 = 2
- var v6 uint8 = 3
- v7 := [3]uint8{v4, v5, v6}
- v3.ThreeBytes = v7
- v2.SetS(v3)
- v1.Xu = v2
-
- decodeSuccessCase{
- name: "XUnionWithStruct_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.ArrayStruct{}
- v2 := conformance.StringUnion{}
- v3 := "one"
- v2.SetS(v3)
- v4 := conformance.StringUnion{}
- v5 := "two"
- v4.SetS(v5)
- v6 := conformance.StringUnion{}
- v7 := "three"
- v6.SetS(v7)
- v8 := [3]conformance.StringUnion{v2, v4, v6}
- v1.Unions = v8
- v9 := &conformance.StringUnion{}
- v10 := "four"
- v9.SetS(v10)
- v11 := &conformance.StringUnion{}
- v12 := "five"
- v11.SetS(v12)
- v13 := &conformance.StringUnion{}
- v14 := "six"
- v13.SetS(v14)
- v15 := [3]*conformance.StringUnion{v9, v11, v13}
- v1.OptionalUnions = v15
-
- decodeSuccessCase{
- name: "ArrayStruct",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: false,
- EncodeUnionsAsXUnionBytes: false,
- },
- input: &v1,
- bytes: []byte{
- 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,
- },
- }.check(t)
- }
-
- {
- v1 := conformance.ArrayStruct{}
- v2 := conformance.StringUnion{}
- v3 := "one"
- v2.SetS(v3)
- v4 := conformance.StringUnion{}
- v5 := "two"
- v4.SetS(v5)
- v6 := conformance.StringUnion{}
- v7 := "three"
- v6.SetS(v7)
- v8 := [3]conformance.StringUnion{v2, v4, v6}
- v1.Unions = v8
- v9 := &conformance.StringUnion{}
- v10 := "four"
- v9.SetS(v10)
- v11 := &conformance.StringUnion{}
- v12 := "five"
- v11.SetS(v12)
- v13 := &conformance.StringUnion{}
- v14 := "six"
- v13.SetS(v14)
- v15 := [3]*conformance.StringUnion{v9, v11, v13}
- v1.OptionalUnions = v15
-
- decodeSuccessCase{
- name: "ArrayStruct_v1",
- context: fidl.MarshalerContext{
- DecodeUnionsFromXUnionBytes: true,
- EncodeUnionsAsXUnionBytes: true,
- },
- input: &v1,
- bytes: []byte{
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x66, 0x6f, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x66, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x73, 0x69, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x21, 0x22, 0x23, 0x24, 0x00, 0x00, 0x00, 0x00,
},
}.check(t)
}
@@ -7332,6 +7523,835 @@
}
{
+ v1 := conformance.Size5Alignment1Array{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := conformance.Size5Alignment1{}
+ var v17 uint8 = 11
+ var v18 uint8 = 12
+ var v19 uint8 = 13
+ var v20 uint8 = 14
+ var v21 uint8 = 15
+ v22 := [5]uint8{v17, v18, v19, v20, v21}
+ v16.Data = v22
+ v23 := [3]conformance.Size5Alignment1{v2, v9, v16}
+ v1.A = v23
+
+ decodeSuccessCase{
+ name: "Size5Alignment1Array",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment1Array{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := conformance.Size5Alignment1{}
+ var v17 uint8 = 11
+ var v18 uint8 = 12
+ var v19 uint8 = 13
+ var v20 uint8 = 14
+ var v21 uint8 = 15
+ v22 := [5]uint8{v17, v18, v19, v20, v21}
+ v16.Data = v22
+ v23 := [3]conformance.Size5Alignment1{v2, v9, v16}
+ v1.A = v23
+
+ decodeSuccessCase{
+ name: "Size5Alignment1Array_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Array{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := conformance.Size5Alignment4{}
+ var v9 uint32 = 235736075
+ v8.Four = v9
+ var v10 uint8 = 15
+ v8.One = v10
+ v11 := [3]conformance.Size5Alignment4{v2, v5, v8}
+ v1.A = v11
+
+ decodeSuccessCase{
+ name: "Size5Alignment4Array",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00,
+ 0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Array{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := conformance.Size5Alignment4{}
+ var v9 uint32 = 235736075
+ v8.Four = v9
+ var v10 uint8 = 15
+ v8.One = v10
+ v11 := [3]conformance.Size5Alignment4{v2, v5, v8}
+ v1.A = v11
+
+ decodeSuccessCase{
+ name: "Size5Alignment4Array_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x00,
+ 0x06, 0x07, 0x08, 0x09, 0x0a, 0x00, 0x00, 0x00,
+ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment1Vector{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := []conformance.Size5Alignment1{v2, v9}
+ v1.V = v16
+
+ decodeSuccessCase{
+ name: "Size5Alignment1Vector",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment1Vector{}
+ v2 := conformance.Size5Alignment1{}
+ var v3 uint8 = 1
+ var v4 uint8 = 2
+ var v5 uint8 = 3
+ var v6 uint8 = 4
+ var v7 uint8 = 5
+ v8 := [5]uint8{v3, v4, v5, v6, v7}
+ v2.Data = v8
+ v9 := conformance.Size5Alignment1{}
+ var v10 uint8 = 6
+ var v11 uint8 = 7
+ var v12 uint8 = 8
+ var v13 uint8 = 9
+ var v14 uint8 = 10
+ v15 := [5]uint8{v10, v11, v12, v13, v14}
+ v9.Data = v15
+ v16 := []conformance.Size5Alignment1{v2, v9}
+ v1.V = v16
+
+ decodeSuccessCase{
+ name: "Size5Alignment1Vector_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Vector{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := []conformance.Size5Alignment4{v2, v5}
+ v1.V = v8
+
+ decodeSuccessCase{
+ name: "Size5Alignment4Vector",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.Size5Alignment4Vector{}
+ v2 := conformance.Size5Alignment4{}
+ var v3 uint32 = 67305985
+ v2.Four = v3
+ var v4 uint8 = 5
+ v2.One = v4
+ v5 := conformance.Size5Alignment4{}
+ var v6 uint32 = 151521030
+ v5.Four = v6
+ var v7 uint8 = 10
+ v5.One = v7
+ v8 := []conformance.Size5Alignment4{v2, v5}
+ v1.V = v8
+
+ decodeSuccessCase{
+ name: "Size5Alignment4Vector_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithReservedSandwichStruct{}
+ v2 := conformance.TableStructWithReservedSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 9
+ var v5 uint8 = 10
+ var v6 uint8 = 11
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.StructSize3Align1{}
+ var v9 uint8 = 25
+ var v10 uint8 = 26
+ var v11 uint8 = 27
+ v12 := [3]uint8{v9, v10, v11}
+ v8.ThreeBytes = v12
+ v2.SetS2(v8)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_StructWithReservedSandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithReservedSandwichStruct{}
+ v2 := conformance.TableStructWithReservedSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 9
+ var v5 uint8 = 10
+ var v6 uint8 = 11
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.StructSize3Align1{}
+ var v9 uint8 = 25
+ var v10 uint8 = 26
+ var v11 uint8 = 27
+ v12 := [3]uint8{v9, v10, v11}
+ v8.ThreeBytes = v12
+ v2.SetS2(v8)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_StructWithReservedSandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithUint32SandwichStruct{}
+ v2 := conformance.TableStructWithUint32Sandwich{}
+ var v3 uint32 = 67305985
+ v2.SetI(v3)
+ v4 := conformance.StructSize3Align1{}
+ var v5 uint8 = 9
+ var v6 uint8 = 10
+ var v7 uint8 = 11
+ v8 := [3]uint8{v5, v6, v7}
+ v4.ThreeBytes = v8
+ v2.SetS1(v4)
+ v9 := conformance.StructSize3Align1{}
+ var v10 uint8 = 25
+ var v11 uint8 = 26
+ var v12 uint8 = 27
+ v13 := [3]uint8{v10, v11, v12}
+ v9.ThreeBytes = v13
+ v2.SetS2(v9)
+ var v14 uint32 = 218893066
+ v2.SetI2(v14)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_StructWithUint32Sandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableStructWithUint32SandwichStruct{}
+ v2 := conformance.TableStructWithUint32Sandwich{}
+ var v3 uint32 = 67305985
+ v2.SetI(v3)
+ v4 := conformance.StructSize3Align1{}
+ var v5 uint8 = 9
+ var v6 uint8 = 10
+ var v7 uint8 = 11
+ v8 := [3]uint8{v5, v6, v7}
+ v4.ThreeBytes = v8
+ v2.SetS1(v4)
+ v9 := conformance.StructSize3Align1{}
+ var v10 uint8 = 25
+ var v11 uint8 = 26
+ var v12 uint8 = 27
+ v13 := [3]uint8{v10, v11, v12}
+ v9.ThreeBytes = v13
+ v2.SetS2(v9)
+ var v14 uint32 = 218893066
+ v2.SetI2(v14)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_StructWithUint32Sandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorReservedSandwich{}
+ v3 := conformance.UnionWithVector{}
+ v4 := "hello"
+ v3.SetS(v4)
+ v2.SetUv(v3)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_UnionWithVector_ReservedSandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorReservedSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorReservedSandwich{}
+ v3 := conformance.UnionWithVector{}
+ v4 := "hello"
+ v3.SetS(v4)
+ v2.SetUv(v3)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_UnionWithVector_ReservedSandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorStructSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.UnionWithVector{}
+ v9 := "hello"
+ v8.SetS(v9)
+ v2.SetUv(v8)
+ v10 := conformance.StructSize3Align1{}
+ var v11 uint8 = 4
+ var v12 uint8 = 5
+ var v13 uint8 = 6
+ v14 := [3]uint8{v11, v12, v13}
+ v10.ThreeBytes = v14
+ v2.SetS2(v10)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_UnionWithVector_StructSandwich",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.TableUnionWithVectorStructSandwichStruct{}
+ v2 := conformance.TableUnionWithVectorStructSandwich{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS1(v3)
+ v8 := conformance.UnionWithVector{}
+ v9 := "hello"
+ v8.SetS(v9)
+ v2.SetUv(v8)
+ v10 := conformance.StructSize3Align1{}
+ var v11 uint8 = 4
+ var v12 uint8 = 5
+ var v13 uint8 = 6
+ v14 := [3]uint8{v11, v12, v13}
+ v10.ThreeBytes = v14
+ v2.SetS2(v10)
+ v1.Table = v2
+
+ decodeSuccessCase{
+ name: "Table_UnionWithVector_StructSandwich_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
+ 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.XUnionWithStructStruct{}
+ v2 := conformance.XUnionWithStruct{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS(v3)
+ v1.Xu = v2
+
+ decodeSuccessCase{
+ name: "XUnionWithStruct",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.XUnionWithStructStruct{}
+ v2 := conformance.XUnionWithStruct{}
+ v3 := conformance.StructSize3Align1{}
+ var v4 uint8 = 1
+ var v5 uint8 = 2
+ var v6 uint8 = 3
+ v7 := [3]uint8{v4, v5, v6}
+ v3.ThreeBytes = v7
+ v2.SetS(v3)
+ v1.Xu = v2
+
+ decodeSuccessCase{
+ name: "XUnionWithStruct_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.ArrayStruct{}
+ v2 := conformance.StringUnion{}
+ v3 := "one"
+ v2.SetS(v3)
+ v4 := conformance.StringUnion{}
+ v5 := "two"
+ v4.SetS(v5)
+ v6 := conformance.StringUnion{}
+ v7 := "three"
+ v6.SetS(v7)
+ v8 := [3]conformance.StringUnion{v2, v4, v6}
+ v1.Unions = v8
+ v9 := &conformance.StringUnion{}
+ v10 := "four"
+ v9.SetS(v10)
+ v11 := &conformance.StringUnion{}
+ v12 := "five"
+ v11.SetS(v12)
+ v13 := &conformance.StringUnion{}
+ v14 := "six"
+ v13.SetS(v14)
+ v15 := [3]*conformance.StringUnion{v9, v11, v13}
+ v1.OptionalUnions = v15
+
+ decodeSuccessCase{
+ name: "ArrayStruct",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: false,
+ EncodeUnionsAsXUnionBytes: false,
+ },
+ input: &v1,
+ bytes: []byte{
+ 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,
+ },
+ }.check(t)
+ }
+
+ {
+ v1 := conformance.ArrayStruct{}
+ v2 := conformance.StringUnion{}
+ v3 := "one"
+ v2.SetS(v3)
+ v4 := conformance.StringUnion{}
+ v5 := "two"
+ v4.SetS(v5)
+ v6 := conformance.StringUnion{}
+ v7 := "three"
+ v6.SetS(v7)
+ v8 := [3]conformance.StringUnion{v2, v4, v6}
+ v1.Unions = v8
+ v9 := &conformance.StringUnion{}
+ v10 := "four"
+ v9.SetS(v10)
+ v11 := &conformance.StringUnion{}
+ v12 := "five"
+ v11.SetS(v12)
+ v13 := &conformance.StringUnion{}
+ v14 := "six"
+ v13.SetS(v14)
+ v15 := [3]*conformance.StringUnion{v9, v11, v13}
+ v1.OptionalUnions = v15
+
+ decodeSuccessCase{
+ name: "ArrayStruct_v1",
+ context: fidl.MarshalerContext{
+ DecodeUnionsFromXUnionBytes: true,
+ EncodeUnionsAsXUnionBytes: true,
+ },
+ input: &v1,
+ bytes: []byte{
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x74, 0x77, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x74, 0x68, 0x72, 0x65, 0x65, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x66, 0x6f, 0x75, 0x72, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x66, 0x69, 0x76, 0x65, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x73, 0x69, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ },
+ }.check(t)
+ }
+
+ {
v1 := conformance.UnionWithBoundStringStruct{}
v2 := conformance.UnionWithBoundString{}
v3 := "abcd"