[#307] v2/audit/test: Do not allocate memory if `!empty`

Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
remotes/KirillovDenis/feature/refactor-sig-rpc
Pavel Karpy 2021-06-11 14:58:32 +03:00 committed by Alex Vanin
parent e15dd105fe
commit 772c8be200
1 changed files with 4 additions and 5 deletions

View File

@ -19,12 +19,11 @@ func GenerateDataAuditResult(empty bool) *audit.DataAuditResult {
m.SetFailNodes([][]byte{{3}, {4}})
m.SetRequests(666)
m.SetRetries(777)
m.SetVersion(refstest.GenerateVersion(false))
m.SetContainerID(refstest.GenerateContainerID(false))
m.SetPassSG(refstest.GenerateObjectIDs(false))
m.SetFailSG(refstest.GenerateObjectIDs(false))
}
m.SetVersion(refstest.GenerateVersion(empty))
m.SetContainerID(refstest.GenerateContainerID(empty))
m.SetPassSG(refstest.GenerateObjectIDs(empty))
m.SetFailSG(refstest.GenerateObjectIDs(empty))
return m
}