| library test.unionsandwich; |
| |
| // These are various unions and structs-containing-unions of different sizes and alignments, |
| // explicitly designed as test cases for the wire format migration where the FIDL union type is |
| // changing from a static union on-the-wire (the "old" format) to an extensible union on-the-wire |
| // (the "v1" format). |
| // |
| // See typeshape_tests.cc for furher details. |
| |
| type UnionSize8Alignment4 = strict union { |
| 1: variant uint32; |
| }; |
| |
| type SandwichUnionSize8Alignment4 = struct { |
| before uint32; |
| union UnionSize8Alignment4; |
| after uint32; |
| }; |
| |
| type UnionSize12Alignment4 = strict union { |
| 1: variant array<uint8, 6>; |
| }; |
| |
| type SandwichUnionSize12Alignment4 = struct { |
| before uint32; |
| union UnionSize12Alignment4; |
| after int32; |
| }; |
| |
| type StructSize16Alignment8 = struct { |
| f1 uint64; |
| f2 uint64; |
| }; |
| |
| type UnionSize24Alignment8 = strict union { |
| 1: variant StructSize16Alignment8; |
| }; |
| |
| type SandwichUnionSize24Alignment8 = struct { |
| before uint32; |
| union UnionSize24Alignment8; |
| after uint32; |
| }; |
| |
| type UnionSize36Alignment4 = strict union { |
| 1: variant array<uint8, 32>; |
| }; |
| |
| type SandwichUnionSize36Alignment4 = struct { |
| before uint32; |
| union UnionSize36Alignment4; |
| after uint32; |
| }; |