protobuf-go/proto
Joe Tsai f6cf4925a9 proto: add TestNil test
TestNil checks for panic behavior for all top-level functions that
accept messages to ensure that we can detect when behavior changes
whether accidentally or deliberately.

This test discovered that the pure protobuf reflect behavior
differs with the fast-path implementation for a few cases.

For the protobuf reflection implementation, we explicitly check
for invalid messages in Merge and Reset. Previously, these would
not panic if the message was already empty (i.e., had no need to
actually set/clear any fields in the receiver message).

Change-Id: I571c0a819366bae993ce7c99b05fb4707e55cd3e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220958
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-25 20:33:07 +00:00
..
bench_test.go all: remove APIv1 dependency 2020-01-09 18:06:30 +00:00
checkinit_test.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
checkinit.go proto: remove IsInitialized 2020-02-24 22:37:49 +00:00
decode_gen.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
decode_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
decode.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
doc.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
encode_gen.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
encode_test.go internal/impl: check for size cache overflow 2020-02-24 20:12:47 +00:00
encode.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
equal_test.go proto, internal/protobuild: add test proto template builder 2020-02-03 19:14:55 +00:00
equal.go proto: fix equality on nil values of different types 2020-01-06 23:36:47 +00:00
extension_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
extension.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
merge_test.go proto: refactor merge tests 2020-02-12 19:41:50 +00:00
merge.go proto: add TestNil test 2020-02-25 20:33:07 +00:00
messageset_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
messageset.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
methods_test.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
nil_test.go proto: add TestNil test 2020-02-25 20:33:07 +00:00
noenforceutf8_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
proto_methods.go all: add ProtoMethods method to protoreflect.Message 2020-01-21 21:05:54 +00:00
proto_reflect.go proto: reset message by default in Unmarshal 2019-09-17 21:13:42 +00:00
proto.go proto: document the relationship between v1 and v2 messages 2020-02-14 20:42:20 +00:00
reset_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
reset.go proto: add TestNil test 2020-02-25 20:33:07 +00:00
size_gen.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
size.go all: fast-path method refactoring 2020-02-19 22:01:50 +00:00
testmessages_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
validate_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
weak_test.go all: remove stray "." from license headers 2020-02-20 18:54:38 +00:00
wrappers.go proto: move T->*T wrappers from internal/scalar to proto 2019-07-12 17:35:01 +00:00