MCPcopy
hub / github.com/protocolbuffers/protobuf-go / TestReset

Function TestReset

internal/impl/message_reflect_test.go:1466–1477  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1464}
1465
1466func TestReset(t *testing.T) {
1467 mi := new(testpb.TestAllTypes)
1468
1469 // ProtoReflect is implemented using a messageState cache.
1470 m := mi.ProtoReflect()
1471
1472 // Reset must not clear the messageState cache.
1473 mi.Reset()
1474
1475 // If Reset accidentally cleared the messageState cache, this panics.
1476 m.Descriptor()
1477}
1478
1479func TestIsValid(t *testing.T) {
1480 var m *testpb.TestAllTypes

Callers

nothing calls this directly

Calls 3

ProtoReflectMethod · 0.65
ResetMethod · 0.65
DescriptorMethod · 0.65

Tested by

no test coverage detected