All checks were successful
* Add plugin option for protogen in Makefile * Fix the generator for the plugin in util/protogen * Erase convertable types, move helpful methods to gRPC protobufs * Erase helpers for convertations * Generate StableMarshlal/StableSize for protobufs by the protoc plugin Signed-off-by: Airat Arifullin a.arifullin@yadro.com
28 lines
614 B
Go
28 lines
614 B
Go
package lock_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
lock "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/lock/grpc"
|
|
locktest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/lock/test"
|
|
object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc"
|
|
"github.com/stretchr/testify/require"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
func TestLockRW(t *testing.T) {
|
|
l := new(lock.Lock)
|
|
obj := new(object.Object)
|
|
|
|
require.Error(t, lock.ReadLock(l, obj))
|
|
|
|
l = locktest.GenerateLock(false)
|
|
|
|
lock.WriteLock(obj, l)
|
|
|
|
l2 := new(lock.Lock)
|
|
|
|
require.NoError(t, lock.ReadLock(l2, obj))
|
|
|
|
require.True(t, proto.Equal(l, l2))
|
|
}
|