Exemplo n.º 1
0
func TestUnionInStruct(t *testing.T) {
	var ss, out test_unions.SmallStruct
	ss.PodUnion = &test_unions.PodUnionFInt8{10}
	check(t, &ss, &out)

	bytes, _, _ := encode(t, &ss)
	if int(bytes[8*2]) != 16 {
		t.Fatalf("Union does not start at the correct location in struct.")
	}
}