forked from TrueCloudLab/frostfs-node
[#1214] *: Use single Object
type in whole project
Remove `Object` and `RawObject` types from `pkg/core/object` package. Use `Object` type from NeoFS SDK Go library everywhere. Avoid using the deprecated elements. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
19ad349b27
commit
7ccd1625af
100 changed files with 847 additions and 965 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/writecache"
|
||||
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -17,16 +18,16 @@ func TestWriteCacheObjectLoss(t *testing.T) {
|
|||
objCount = 100
|
||||
)
|
||||
|
||||
objects := make([]*object.Object, objCount)
|
||||
objects := make([]*objectSDK.Object, objCount)
|
||||
for i := range objects {
|
||||
size := smallSize
|
||||
//if i%2 == 0 {
|
||||
// if i%2 == 0 {
|
||||
size = smallSize / 2
|
||||
//}
|
||||
// }
|
||||
data := make([]byte, size)
|
||||
rand.Read(data)
|
||||
|
||||
objects[i] = generateRawObjectWithPayload(cidtest.ID(), data).Object()
|
||||
objects[i] = generateObjectWithPayload(cidtest.ID(), data)
|
||||
}
|
||||
|
||||
dir := t.TempDir()
|
||||
|
@ -46,7 +47,7 @@ func TestWriteCacheObjectLoss(t *testing.T) {
|
|||
defer releaseShard(sh, t)
|
||||
|
||||
for i := range objects {
|
||||
_, err := sh.Get(new(shard.GetPrm).WithAddress(objects[i].Address()))
|
||||
_, err := sh.Get(new(shard.GetPrm).WithAddress(object.AddressOf(objects[i])))
|
||||
require.NoError(t, err, i)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue