MCPcopy
hub / github.com/gogo/protobuf / TestPackedNonPackedDecoderSwitching

Function TestPackedNonPackedDecoderSwitching

proto/all_test.go:1211–1228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1209}
1210
1211func TestPackedNonPackedDecoderSwitching(t *testing.T) {
1212 np, p := new(NonPackedTest), new(PackedTest)
1213
1214 // non-packed -> packed
1215 np.A = []int32{0, 1, 1, 2, 3, 5}
1216 encodeDecode(t, np, p, "non-packed -> packed")
1217 if !reflect.DeepEqual(np.A, p.B) {
1218 t.Errorf("failed non-packed -> packed; np.A=%+v, p.B=%+v", np.A, p.B)
1219 }
1220
1221 // packed -> non-packed
1222 np.Reset()
1223 p.B = []int32{3, 1, 4, 1, 5, 9}
1224 encodeDecode(t, p, np, "packed -> non-packed")
1225 if !reflect.DeepEqual(p.B, np.A) {
1226 t.Errorf("failed packed -> non-packed; p.B=%+v, np.A=%+v", p.B, np.A)
1227 }
1228}
1229
1230func TestProto1RepeatedGroup(t *testing.T) {
1231 pb := &MessageList{

Callers

nothing calls this directly

Calls 2

encodeDecodeFunction · 0.85
ResetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…