From d947f1094a2500a8623bb3252f016eeee5d639b4 Mon Sep 17 00:00:00 2001 From: illia-li Date: Mon, 21 Oct 2024 15:10:15 -0400 Subject: [PATCH] add `map` tests --- .../marshal_20_map_v2_corrupt_test.go | 191 ++++++++++++++++++ tests/serialization/marshal_20_map_v2_test.go | 130 ++++++++++++ .../marshal_20_map_v3_corrupt_test.go | 139 +++++++++++++ tests/serialization/marshal_20_map_v3_test.go | 64 ++++++ 4 files changed, 524 insertions(+) create mode 100644 tests/serialization/marshal_20_map_v2_corrupt_test.go create mode 100644 tests/serialization/marshal_20_map_v2_test.go create mode 100644 tests/serialization/marshal_20_map_v3_corrupt_test.go create mode 100644 tests/serialization/marshal_20_map_v3_test.go diff --git a/tests/serialization/marshal_20_map_v2_corrupt_test.go b/tests/serialization/marshal_20_map_v2_corrupt_test.go new file mode 100644 index 000000000..558473da7 --- /dev/null +++ b/tests/serialization/marshal_20_map_v2_corrupt_test.go @@ -0,0 +1,191 @@ +package serialization_test + +import ( + "fmt" + "math" + "testing" + + "github.com/gocql/gocql" + "github.com/gocql/gocql/internal/tests/serialization" + "github.com/gocql/gocql/internal/tests/serialization/mod" +) + +func TestMarshalMapV2Corrupt(t *testing.T) { + elem := gocql.NewNativeType(2, gocql.TypeSmallInt, "") + tType := gocql.NewCollectionType(gocql.NewNativeType(2, gocql.TypeMap, ""), elem, elem) + + //unmarshal data than bigger the normal data, does not return error. + brokenBigData := serialization.GetTypes(mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...)...) + + refInt32 := func(v int32) *int32 { return &v } + refModInt32 := func(v mod.Int32) *mod.Int32 { return &v } + + marshal := func(i interface{}) ([]byte, error) { return gocql.Marshal(tType, i) } + unmarshal := func(bytes []byte, i interface{}) error { + return gocql.Unmarshal(tType, bytes, i) + } + + val := int32(math.MaxInt16 + 1) + valc := mod.Int32(val) + serialization.NegativeMarshalSet{ + Values: mod.Values{ + map[int32]int32{val: val}, map[int32]int32{val: 0}, map[int32]int32{0: val}, + map[int32]*int32{val: refInt32(val)}, map[int32]*int32{val: refInt32(0)}, map[int32]*int32{0: refInt32(val)}, + map[mod.Int32]mod.Int32{valc: valc}, map[mod.Int32]mod.Int32{valc: 0}, map[mod.Int32]mod.Int32{0: valc}, + map[mod.Int32]*mod.Int32{valc: refModInt32(valc)}, map[mod.Int32]*mod.Int32{valc: refModInt32(0)}, map[mod.Int32]*mod.Int32{0: refModInt32(valc)}, + }.AddVariants(mod.All...), + }.Run("big_vals", t, marshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02\xff\xff\x00\x02\xff\xff\x01"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + BrokenTypes: brokenBigData, + }.Run("big_data_elem1+", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x00\x00\x00\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + BrokenTypes: brokenBigData, + }.Run("big_data_zeroElem1+", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x01"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + BrokenTypes: brokenBigData, + }.Run("big_data_elems0+", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02\xff\xff\x00\x02\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val_value-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02\xff\xff\x00\x02"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val_len", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02\xff\xff\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val_len-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02\xff\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_key_value-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00\x02"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_key_len", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_key_len-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x01"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_pair-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_elems-", t, unmarshal) +} + +func TestMarshalMapV2CorruptMax(t *testing.T) { + t.Parallel() + elem := gocql.NewNativeType(2, gocql.TypeSmallInt, "") + tType := gocql.NewCollectionType(gocql.NewNativeType(2, gocql.TypeMap, ""), elem, elem) + + elems := math.MaxUint16 + 1 + values := []func() interface{}{ + func() interface{} { + out := make(map[int32]int32, elems) + for i := 0; i < elems; i++ { + out[int32(i)] = int32(1) + } + return out + }, + func() interface{} { + out := make(map[int32]*int32, elems) + for i := 0; i < elems; i++ { + tmp := int32(1) + out[int32(i)] = &tmp + } + return out + }, + func() interface{} { + out := make(map[mod.Int32]mod.Int32, elems) + for i := 0; i < elems; i++ { + out[mod.Int32(i)] = mod.Int32(1) + } + return out + }, + func() interface{} { + out := make(map[mod.Int32]*mod.Int32, elems) + for i := 0; i < elems; i++ { + tmp := mod.Int32(1) + out[mod.Int32(i)] = &tmp + } + return out + }, + } + + marshal := func(i interface{}) ([]byte, error) { return gocql.Marshal(tType, i) } + + for _, v := range values { + value := v() + name := fmt.Sprintf("%T", value) + + serialization.NegativeMarshalSet{ + Values: mod.Values{value}.AddVariants(mod.All...), + }.Run(name, t, marshal) + } +} diff --git a/tests/serialization/marshal_20_map_v2_test.go b/tests/serialization/marshal_20_map_v2_test.go new file mode 100644 index 000000000..1fbaee5e5 --- /dev/null +++ b/tests/serialization/marshal_20_map_v2_test.go @@ -0,0 +1,130 @@ +package serialization_test + +import ( + "fmt" + "math" + "testing" + + "github.com/gocql/gocql" + "github.com/gocql/gocql/internal/tests/serialization" + "github.com/gocql/gocql/internal/tests/serialization/mod" +) + +func TestMarshalMapV2(t *testing.T) { + elem := gocql.NewNativeType(2, gocql.TypeSmallInt, "") + tType := gocql.NewCollectionType(gocql.NewNativeType(2, gocql.TypeMap, ""), elem, elem) + + refInt16 := func(v int16) *int16 { return &v } + refModInt16 := func(v mod.Int16) *mod.Int16 { return &v } + + marshal := func(i interface{}) ([]byte, error) { return gocql.Marshal(tType, i) } + unmarshal := func(bytes []byte, i interface{}) error { + return gocql.Unmarshal(tType, bytes, i) + } + + serialization.PositiveSet{ + Data: nil, + Values: mod.Values{ + (map[int16]int16)(nil), (map[int16]*int16)(nil), + (map[mod.Int16]mod.Int16)(nil), (map[mod.Int16]*mod.Int16)(nil), + (*map[int16]int16)(nil), (*map[int16]*int16)(nil), + (*map[mod.Int16]mod.Int16)(nil), (*map[mod.Int16]*mod.Int16)(nil), + }.AddVariants(mod.CustomType), + }.Run("[nil]nullable", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("zero elems", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x01\x00\x00\x00\x00"), + Values: mod.Values{ + map[int16]int16{0: 0}, map[int16]*int16{0: refInt16(0)}, + map[mod.Int16]mod.Int16{0: 0}, map[mod.Int16]*mod.Int16{0: refModInt16(0)}, + }.AddVariants(mod.All...), + }.Run("[]{zero elem}unmarshal", t, nil, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x01\x00\x02\x00\x00\x00\x02\x00\x00"), + Values: mod.Values{ + map[int16]int16{0: 0}, map[int16]*int16{0: refInt16(0)}, + map[mod.Int16]mod.Int16{0: 0}, map[mod.Int16]*mod.Int16{0: refModInt16(0)}, + }.AddVariants(mod.All...), + }.Run("[]{0:0}", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x01\x00\x02\x7f\xff\x00\x02\x7f\xff"), + Values: mod.Values{ + map[int16]int16{32767: 32767}, map[int16]*int16{32767: refInt16(32767)}, + map[mod.Int16]mod.Int16{32767: 32767}, map[mod.Int16]*mod.Int16{32767: refModInt16(32767)}, + }.AddVariants(mod.All...), + }.Run("[]{max:max}", t, marshal, unmarshal) +} + +func TestMarshalMapV2Max(t *testing.T) { + t.Parallel() + elem := gocql.NewNativeType(2, gocql.TypeSmallInt, "") + tType := gocql.NewCollectionType(gocql.NewNativeType(2, gocql.TypeMap, ""), elem, elem) + + elems := math.MaxUint16 + + data := make([]byte, 0, elems*4+2) + data = append(data, 255, 255) + uintData := func(v uint) (byte, byte) { + return byte(v >> 8), byte(v) + } + for v := 0; v < elems; v++ { + b1, b2 := uintData(uint(v)) + data = append(data, 0, 2, b1, b2, 0, 2, 0, 1) + } + + values := []func() interface{}{ + func() interface{} { + out := make(map[int16]int16, elems) + for i := 0; i < elems; i++ { + out[int16(i)] = int16(1) + } + return out + }, + func() interface{} { + out := make(map[int16]*int16, elems) + for i := 0; i < elems; i++ { + tmp := int16(1) + out[int16(i)] = &tmp + } + return out + }, + func() interface{} { + out := make(map[mod.Int16]mod.Int16, elems) + for i := 0; i < elems; i++ { + out[mod.Int16(i)] = mod.Int16(1) + } + return out + }, + func() interface{} { + out := make(map[mod.Int16]*mod.Int16, elems) + for i := 0; i < elems; i++ { + tmp := mod.Int16(1) + out[mod.Int16(i)] = &tmp + } + return out + }, + } + unmarshal := func(bytes []byte, i interface{}) error { + return gocql.Unmarshal(tType, bytes, i) + } + + for _, v := range values { + value := v() + name := fmt.Sprintf("%T", value) + + serialization.PositiveSet{ + Data: data, + Values: mod.Values{value}.AddVariants(mod.All...), + }.Run(name, t, nil, unmarshal) + } +} diff --git a/tests/serialization/marshal_20_map_v3_corrupt_test.go b/tests/serialization/marshal_20_map_v3_corrupt_test.go new file mode 100644 index 000000000..29ed6f983 --- /dev/null +++ b/tests/serialization/marshal_20_map_v3_corrupt_test.go @@ -0,0 +1,139 @@ +package serialization_test + +import ( + "math" + "testing" + + "github.com/gocql/gocql" + "github.com/gocql/gocql/internal/tests/serialization" + "github.com/gocql/gocql/internal/tests/serialization/mod" +) + +func TestMarshalMapV3Corrupt(t *testing.T) { + elem := gocql.NewNativeType(3, gocql.TypeSmallInt, "") + tType := gocql.NewCollectionType(gocql.NewNativeType(3, gocql.TypeMap, ""), elem, elem) + + //unmarshal data than bigger the normal data, does not return error. + brokenBigData := serialization.GetTypes(mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...)...) + + refInt32 := func(v int32) *int32 { return &v } + refModInt32 := func(v mod.Int32) *mod.Int32 { return &v } + + marshal := func(i interface{}) ([]byte, error) { return gocql.Marshal(tType, i) } + unmarshal := func(bytes []byte, i interface{}) error { + return gocql.Unmarshal(tType, bytes, i) + } + + val := int32(math.MaxInt16 + 1) + valc := mod.Int32(val) + serialization.NegativeMarshalSet{ + Values: mod.Values{ + map[int32]int32{val: val}, map[int32]int32{val: 0}, map[int32]int32{0: val}, + map[int32]*int32{val: refInt32(val)}, map[int32]*int32{val: refInt32(0)}, map[int32]*int32{0: refInt32(val)}, + map[mod.Int32]mod.Int32{valc: valc}, map[mod.Int32]mod.Int32{valc: 0}, map[mod.Int32]mod.Int32{0: valc}, + map[mod.Int32]*mod.Int32{valc: refModInt32(valc)}, map[mod.Int32]*mod.Int32{valc: refModInt32(0)}, map[mod.Int32]*mod.Int32{0: refModInt32(valc)}, + }.AddVariants(mod.All...), + }.Run("big_vals", t, marshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\xff\xff\x00\x00\x00\x02\xff\xff\x01"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + BrokenTypes: brokenBigData, + }.Run("big_data_elem1+", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + BrokenTypes: brokenBigData, + }.Run("big_data_zeroElem1+", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x00\x01"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + BrokenTypes: brokenBigData, + }.Run("big_data_elems0+", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\xff\xff\x00\x00\x00\x02\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val_value-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\xff\xff\x00\x00\x00\x02"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val_len", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\xff\xff\x00\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val_len-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\xff\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_val-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\xff"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_key_value-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_key_len", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_key_len-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00\x00\x01"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_pair-", t, unmarshal) + + serialization.NegativeUnmarshalSet{ + Data: []byte("\x00\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("small_data_elems-", t, unmarshal) +} diff --git a/tests/serialization/marshal_20_map_v3_test.go b/tests/serialization/marshal_20_map_v3_test.go new file mode 100644 index 000000000..f425cb774 --- /dev/null +++ b/tests/serialization/marshal_20_map_v3_test.go @@ -0,0 +1,64 @@ +package serialization_test + +import ( + "testing" + + "github.com/gocql/gocql" + "github.com/gocql/gocql/internal/tests/serialization" + "github.com/gocql/gocql/internal/tests/serialization/mod" +) + +func TestMarshalMapV3(t *testing.T) { + elem := gocql.NewNativeType(3, gocql.TypeSmallInt, "") + tType := gocql.NewCollectionType(gocql.NewNativeType(3, gocql.TypeMap, ""), elem, elem) + + refInt16 := func(v int16) *int16 { return &v } + refModInt16 := func(v mod.Int16) *mod.Int16 { return &v } + + marshal := func(i interface{}) ([]byte, error) { return gocql.Marshal(tType, i) } + unmarshal := func(bytes []byte, i interface{}) error { + return gocql.Unmarshal(tType, bytes, i) + } + + serialization.PositiveSet{ + Data: nil, + Values: mod.Values{ + (map[int16]int16)(nil), (map[int16]*int16)(nil), + (map[mod.Int16]mod.Int16)(nil), (map[mod.Int16]*mod.Int16)(nil), + (*map[int16]int16)(nil), (*map[int16]*int16)(nil), + (*map[mod.Int16]mod.Int16)(nil), (*map[mod.Int16]*mod.Int16)(nil), + }.AddVariants(mod.CustomType), + }.Run("[nil]nullable", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x00\x00\x00"), + Values: mod.Values{ + make(map[int16]int16), make(map[int16]*int16), + make(map[mod.Int16]mod.Int16), make(map[mod.Int16]*mod.Int16), + }.AddVariants(mod.All...), + }.Run("zero elems", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"), + Values: mod.Values{ + map[int16]int16{0: 0}, map[int16]*int16{0: refInt16(0)}, + map[mod.Int16]mod.Int16{0: 0}, map[mod.Int16]*mod.Int16{0: refModInt16(0)}, + }.AddVariants(mod.All...), + }.Run("[]{zero elem}unmarshal", t, nil, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x00\x00\x02\x00\x00"), + Values: mod.Values{ + map[int16]int16{0: 0}, map[int16]*int16{0: refInt16(0)}, + map[mod.Int16]mod.Int16{0: 0}, map[mod.Int16]*mod.Int16{0: refModInt16(0)}, + }.AddVariants(mod.All...), + }.Run("[]{0:0}", t, marshal, unmarshal) + + serialization.PositiveSet{ + Data: []byte("\x00\x00\x00\x01\x00\x00\x00\x02\x7f\xff\x00\x00\x00\x02\x7f\xff"), + Values: mod.Values{ + map[int16]int16{32767: 32767}, map[int16]*int16{32767: refInt16(32767)}, + map[mod.Int16]mod.Int16{32767: 32767}, map[mod.Int16]*mod.Int16{32767: refModInt16(32767)}, + }.AddVariants(mod.All...), + }.Run("[]{max:max}", t, marshal, unmarshal) +}