From 3b66f98f27755e33c00ed845c41eb8996ef55a0e Mon Sep 17 00:00:00 2001 From: Alejandro Lopez Date: Thu, 13 Jul 2023 15:04:29 +0300 Subject: [PATCH] [#519] Use Address.Equals in policer tests Signed-off-by: Alejandro Lopez --- pkg/services/policer/policer_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/services/policer/policer_test.go b/pkg/services/policer/policer_test.go index 42428df23..56dab413e 100644 --- a/pkg/services/policer/policer_test.go +++ b/pkg/services/policer/policer_test.go @@ -220,11 +220,11 @@ func TestProcessObject(t *testing.T) { WithRemoteObjectHeaderFunc(headFn), WithBuryFunc(buryFn), WithRedundantCopyCallback(func(_ context.Context, a oid.Address) { - require.True(t, eqAddr(a, addr), "unexpected redundant copy callback: a=%v", a) + require.True(t, a.Equals(addr), "unexpected redundant copy callback: a=%v", a) gotRemoveRedundant = true }), WithReplicator(replicatorFunc(func(_ context.Context, task replicator.Task, res replicator.TaskResult) { - require.True(t, eqAddr(task.Addr, addr), "unexpected replicator task: %+v", task) + require.True(t, task.Addr.Equals(addr), "unexpected replicator task: %+v", task) for _, node := range task.Nodes { gotReplicateTo = append(gotReplicateTo, int(node.PublicKey()[0])) } @@ -303,11 +303,6 @@ func TestIteratorContract(t *testing.T) { }, it.calls) } -// TODO(https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/101) -func eqAddr(a, b oid.Address) bool { - return a.Container().Equals(b.Container()) && a.Object().Equals(b.Object()) -} - type nextResult struct { objs []objectcore.AddressWithType err error