From 74a5254819acb48454f543d7cd9783d7cdd9fade Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 8 Nov 2021 15:13:59 +0300 Subject: [PATCH] [#59] audit/test: reuse version generator Signed-off-by: Evgenii Stratonikov --- audit/test/generate.go | 4 ++-- version/test/generate.go | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 version/test/generate.go diff --git a/audit/test/generate.go b/audit/test/generate.go index 813dffd2..ac14cfbc 100644 --- a/audit/test/generate.go +++ b/audit/test/generate.go @@ -5,14 +5,14 @@ import ( cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test" "github.com/nspcc-dev/neofs-sdk-go/object" objecttest "github.com/nspcc-dev/neofs-sdk-go/object/test" - "github.com/nspcc-dev/neofs-sdk-go/version" + versiontest "github.com/nspcc-dev/neofs-sdk-go/version/test" ) // Generate returns random audit.Result. func Generate() *audit.Result { x := audit.NewResult() - x.SetVersion(version.Current()) + x.SetVersion(versiontest.Version()) x.SetContainerID(cidtest.GenerateID()) x.SetPublicKey([]byte("key")) x.SetComplete(true) diff --git a/version/test/generate.go b/version/test/generate.go new file mode 100644 index 00000000..1afecaa9 --- /dev/null +++ b/version/test/generate.go @@ -0,0 +1,17 @@ +package test + +import ( + "math/rand" + + "github.com/nspcc-dev/neofs-sdk-go/version" +) + +// Version returns random version.Version. +func Version() *version.Version { + x := version.New() + + x.SetMajor(rand.Uint32()) + x.SetMinor(rand.Uint32()) + + return x +}