mirror of
https://github.com/nspcc-dev/neofs-api-go.git
synced 2026-03-01 04:28:56 +00:00
Add test coverage for nil pointers #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @carpawell on GitHub (Apr 27, 2021).
Originally assigned to: @carpawell on GitHub.
There is a bugfix in #275 that adds checking zero pointers of one of the nested fields. Also, there is a fix of the corresponding unit test that allocates memory for
emptystruct by default. But it is done only for the certain struct.Possible solutions:
Move all struct allocation for pointer fields behind
if !emptystatements in all generator functions.Develop a general test constructor that fills all fields with correct non-nil values for one type of test cases and fills with incorrect nil pointer values for another(e.g. via
reflectpkg).@carpawell commented on GitHub (Jun 11, 2021):
the second option is meaningless in our context(at least for now) since there are a lot of already written
v2/*package*/testpackages that contain more agile generators of required types