adjust_integer was always zeroing out top-most 256 - size bits, thus resulting in incorrect values in some cases. Example for int8 case: -1 & ((1 << 8) - 1) = 255 which overflows int8. This PR changes it to correctly handle sign and set higher bits to 1 in cases when we end up with a negative value.
strategies for CustomStruct were generating duplicating field names in certain cases, also value strategy for CustomStruct types was generating different field names for every instance.
Motivation
adjust_integer
was always zeroing out top-most256 - size
bits, thus resulting in incorrect values in some cases. Example forint8
case:-1 & ((1 << 8) - 1) = 255
which overflows int8. This PR changes it to correctly handle sign and set higher bits to 1 in cases when we end up with a negative value.CustomStruct
were generating duplicating field names in certain cases, also value strategy forCustomStruct
types was generating different field names for every instance.Solution
PR Checklist