forked from TrueCloudLab/frostfs-sdk-go
[#170] checksum: Do not use pointers
Do not return pointers from getters. Do not pass pointers to the methods that does not modify the checksum. Add `Empty` method. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
fd13e61266
commit
caa055236b
7 changed files with 53 additions and 35 deletions
|
@ -125,9 +125,9 @@ func TestObject_SetPayloadChecksum(t *testing.T) {
|
|||
var cs checksum.Checksum
|
||||
cs.SetSHA256(randSHA256Checksum(t))
|
||||
|
||||
obj.SetPayloadChecksum(&cs)
|
||||
obj.SetPayloadChecksum(cs)
|
||||
|
||||
require.Equal(t, &cs, obj.PayloadChecksum())
|
||||
require.Equal(t, cs, obj.PayloadChecksum())
|
||||
}
|
||||
|
||||
func TestObject_SetPayloadHomomorphicHash(t *testing.T) {
|
||||
|
@ -136,9 +136,9 @@ func TestObject_SetPayloadHomomorphicHash(t *testing.T) {
|
|||
var cs checksum.Checksum
|
||||
cs.SetTillichZemor(randTZChecksum(t))
|
||||
|
||||
obj.SetPayloadHomomorphicHash(&cs)
|
||||
obj.SetPayloadHomomorphicHash(cs)
|
||||
|
||||
require.Equal(t, &cs, obj.PayloadHomomorphicHash())
|
||||
require.Equal(t, cs, obj.PayloadHomomorphicHash())
|
||||
}
|
||||
|
||||
func TestObject_SetAttributes(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue