MCPcopy
hub / github.com/golang/protobuf / TestEncodeDecode5

Function TestEncodeDecode5

proto/proto_test.go:662–773  ·  view source on GitHub ↗

All required fields set, defaults provided, all repeated fields given two values.

(t *testing.T)

Source from the content-addressed store, hash-verified

660
661// All required fields set, defaults provided, all repeated fields given two values.
662func TestEncodeDecode5(t *testing.T) {
663 pb := initGoTest(true)
664 pb.RepeatedField = []*pb2.GoTestField{initGoTestField(), initGoTestField()}
665 pb.F_BoolRepeated = []bool{false, true}
666 pb.F_Int32Repeated = []int32{32, 33}
667 pb.F_Int64Repeated = []int64{64, 65}
668 pb.F_Fixed32Repeated = []uint32{3232, 3333}
669 pb.F_Fixed64Repeated = []uint64{6464, 6565}
670 pb.F_Uint32Repeated = []uint32{323232, 333333}
671 pb.F_Uint64Repeated = []uint64{646464, 656565}
672 pb.F_FloatRepeated = []float32{32., 33.}
673 pb.F_DoubleRepeated = []float64{64., 65.}
674 pb.F_StringRepeated = []string{"hello", "sailor"}
675 pb.F_BytesRepeated = [][]byte{[]byte("big"), []byte("nose")}
676 pb.F_Sint32Repeated = []int32{32, -32}
677 pb.F_Sint64Repeated = []int64{64, -64}
678 pb.F_Sfixed32Repeated = []int32{32, -32}
679 pb.F_Sfixed64Repeated = []int64{64, -64}
680 pb.Repeatedgroup = []*pb2.GoTest_RepeatedGroup{initGoTest_RepeatedGroup(), initGoTest_RepeatedGroup()}
681
682 overify(t, pb,
683 protopack.Message{
684 protopack.Tag{1, protopack.VarintType}, protopack.Uvarint(7),
685 protopack.Tag{4, protopack.BytesType}, protopack.LengthPrefix(protopack.Message{
686 protopack.Tag{1, protopack.BytesType}, protopack.String("label"),
687 protopack.Tag{2, protopack.BytesType}, protopack.String("type"),
688 }),
689 protopack.Tag{5, protopack.BytesType}, protopack.LengthPrefix(protopack.Message{
690 protopack.Tag{1, protopack.BytesType}, protopack.String("label"),
691 protopack.Tag{2, protopack.BytesType}, protopack.String("type"),
692 }),
693 protopack.Tag{5, protopack.BytesType}, protopack.LengthPrefix(protopack.Message{
694 protopack.Tag{1, protopack.BytesType}, protopack.String("label"),
695 protopack.Tag{2, protopack.BytesType}, protopack.String("type"),
696 }),
697 protopack.Tag{10, protopack.VarintType}, protopack.Bool(true),
698 protopack.Tag{11, protopack.VarintType}, protopack.Varint(3),
699 protopack.Tag{12, protopack.VarintType}, protopack.Varint(6),
700 protopack.Tag{13, protopack.Fixed32Type}, protopack.Uint32(32),
701 protopack.Tag{14, protopack.Fixed64Type}, protopack.Uint64(64),
702 protopack.Tag{15, protopack.VarintType}, protopack.Uvarint(3232),
703 protopack.Tag{16, protopack.VarintType}, protopack.Uvarint(6464),
704 protopack.Tag{17, protopack.Fixed32Type}, protopack.Float32(3232),
705 protopack.Tag{18, protopack.Fixed64Type}, protopack.Float64(6464),
706 protopack.Tag{19, protopack.BytesType}, protopack.String("string"),
707 protopack.Tag{20, protopack.VarintType}, protopack.Bool(false),
708 protopack.Tag{20, protopack.VarintType}, protopack.Bool(true),
709 protopack.Tag{21, protopack.VarintType}, protopack.Varint(32),
710 protopack.Tag{21, protopack.VarintType}, protopack.Varint(33),
711 protopack.Tag{22, protopack.VarintType}, protopack.Varint(64),
712 protopack.Tag{22, protopack.VarintType}, protopack.Varint(65),
713 protopack.Tag{23, protopack.Fixed32Type}, protopack.Uint32(3232),
714 protopack.Tag{23, protopack.Fixed32Type}, protopack.Uint32(3333),
715 protopack.Tag{24, protopack.Fixed64Type}, protopack.Uint64(6464),
716 protopack.Tag{24, protopack.Fixed64Type}, protopack.Uint64(6565),
717 protopack.Tag{25, protopack.VarintType}, protopack.Uvarint(323232),
718 protopack.Tag{25, protopack.VarintType}, protopack.Uvarint(333333),
719 protopack.Tag{26, protopack.VarintType}, protopack.Uvarint(646464),

Callers

nothing calls this directly

Calls 7

initGoTestFunction · 0.85
initGoTestFieldFunction · 0.85
initGoTest_RepeatedGroupFunction · 0.85
overifyFunction · 0.85
BytesMethod · 0.80
MarshalMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected