diff --git a/util/proto/marshal_test.go b/util/proto/marshal_test.go index d5758f2..5d887ce 100644 --- a/util/proto/marshal_test.go +++ b/util/proto/marshal_test.go @@ -49,6 +49,8 @@ func TestStableMarshalSingle(t *testing.T) { {name: "fixed32", input: &generated.Primitives{FieldK: nonZero[uint32]()}}, {name: "enum, positive", input: &generated.Primitives{FieldH: generated.Primitives_POSITIVE}}, {name: "enum, negative", input: &generated.Primitives{FieldH: generated.Primitives_NEGATIVE}}, + {name: "oneof, first", input: &generated.Primitives{FieldM: &generated.Primitives_FieldMa{FieldMa: []byte{4, 2}}}}, + {name: "oneof, second", input: &generated.Primitives{FieldM: &generated.Primitives_FieldMe{FieldMe: nonZero[uint32]()}}}, } for _, tc := range marshalCases { t.Run(tc.name, func(t *testing.T) { @@ -97,6 +99,9 @@ func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) require.Equal(t, a.FieldJ, b.FieldJ) require.Equal(t, a.FieldK, b.FieldK) require.EqualValues(t, a.FieldH, b.FieldH) + require.Equal(t, a.GetFieldMa(), b.GetFieldMa()) + require.Equal(t, a.GetFieldMe(), b.GetFieldMe()) + require.Equal(t, a.GetFieldAux().GetInnerField(), b.GetFieldAux().GetInnerField()) } func repPrimitivesEqual(t *testing.T, a *generated.RepPrimitives, b *test.RepPrimitives) { diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index c99234e..b1d2cf2 100644 Binary files a/util/proto/test/custom/test_frostfs.pb.go and b/util/proto/test/custom/test_frostfs.pb.go differ diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 57f7fb0..de8ec65 100644 Binary files a/util/proto/test/test.pb.go and b/util/proto/test/test.pb.go differ diff --git a/util/proto/test/test.proto b/util/proto/test/test.proto index 14f6ac2..f33be49 100644 --- a/util/proto/test/test.proto +++ b/util/proto/test/test.proto @@ -22,6 +22,14 @@ message Primitives { NEGATIVE = -1; } SomeEnum field_h = 300; + + message Aux { uint32 inner_field = 1; } + + oneof field_m { + bytes field_ma = 401; + uint32 field_me = 402; + Aux field_aux = 403; + } } message RepPrimitives {