+ {testName: "union_alias", input: typeTestData{
+ typ: "union", fields: []*typeTestData{{typ: "alias", value: U16},
+ }}.getUnion("union1"), expsize: 2},
+ {testName: "union_enum", input: typeTestData{
+ typ: "union", fields: []*typeTestData{{typ: "enum", value: U32},
+ }}.getUnion("union2"), expsize: 4},
+ {testName: "union_struct", input: typeTestData{
+ typ: "union", fields: []*typeTestData{
+ {typ: "struct", fields: []*typeTestData{{value: U8}, {value: U16}, {value: U32}}},
+ }}.getUnion("union3"), expsize: 7},
+ {testName: "union_structs", input: typeTestData{
+ typ: "union", fields: []*typeTestData{
+ {typ: "struct", fields: []*typeTestData{{value: U8}, {value: BOOL}}},
+ {typ: "struct", fields: []*typeTestData{{value: U16}, {value: U32}}},
+ {typ: "struct", fields: []*typeTestData{{value: U32}, {value: U64}}},
+ }}.getUnion("union4"), expsize: 12},
+ {testName: "union_unions", input: typeTestData{
+ typ: "union", fields: []*typeTestData{
+ {typ: "union", fields: []*typeTestData{
+ {typ: "struct", fields: []*typeTestData{{value: STRING}}},
+ }},
+ {typ: "union", fields: []*typeTestData{
+ {typ: "struct", fields: []*typeTestData{{value: U32}}},
+ }},
+ {typ: "union", fields: []*typeTestData{
+ {typ: "struct", fields: []*typeTestData{{value: U64}}},
+ }},
+ }}.getUnion("union5"), expsize: 8},
+ {testName: "union_combined", input: typeTestData{
+ typ: "union", fields: []*typeTestData{
+ {typ: "alias", value: U8},
+ {typ: "enum", value: U16},
+ {typ: "struct", fields: []*typeTestData{{value: U8}, {value: U16}, {value: U32}}}, // <-
+ {typ: "union", fields: []*typeTestData{
+ {typ: "alias", value: U16},
+ {typ: "enum", value: U16},
+ {typ: "struct", fields: []*typeTestData{{value: U32}}},
+ }},
+ }}.getUnion("union6"), expsize: 7},