diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-07-01 19:09:33 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-07-01 21:41:27 +0000 |
| commit | bc80e4f080d226b12fae367dc46bc54ac3681009 (patch) | |
| tree | 396991c29ca9a28b701a72013e5283ef0188b8ec /pkg/coveragedb | |
| parent | 065d1b73397a6839320b1fc6cb5b40e8623a4825 (diff) | |
all/mocks: regenerate with mockery v3
Diffstat (limited to 'pkg/coveragedb')
| -rw-r--r-- | pkg/coveragedb/mocks/ReadOnlyTransaction.go | 69 | ||||
| -rw-r--r-- | pkg/coveragedb/mocks/Row.go | 61 | ||||
| -rw-r--r-- | pkg/coveragedb/mocks/RowIterator.go | 65 | ||||
| -rw-r--r-- | pkg/coveragedb/mocks/SpannerClient.go | 119 |
4 files changed, 172 insertions, 142 deletions
diff --git a/pkg/coveragedb/mocks/ReadOnlyTransaction.go b/pkg/coveragedb/mocks/ReadOnlyTransaction.go index 1a4eecfb8..3f00faca0 100644 --- a/pkg/coveragedb/mocks/ReadOnlyTransaction.go +++ b/pkg/coveragedb/mocks/ReadOnlyTransaction.go @@ -1,16 +1,31 @@ -// Code generated by mockery v2.52.1. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - spanner "cloud.google.com/go/spanner" + "cloud.google.com/go/spanner" + "github.com/google/syzkaller/pkg/coveragedb/spannerclient" mock "github.com/stretchr/testify/mock" - - spannerclient "github.com/google/syzkaller/pkg/coveragedb/spannerclient" ) +// NewReadOnlyTransaction creates a new instance of ReadOnlyTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyTransaction(t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyTransaction { + mock := &ReadOnlyTransaction{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // ReadOnlyTransaction is an autogenerated mock type for the ReadOnlyTransaction type type ReadOnlyTransaction struct { mock.Mock @@ -24,23 +39,22 @@ func (_m *ReadOnlyTransaction) EXPECT() *ReadOnlyTransaction_Expecter { return &ReadOnlyTransaction_Expecter{mock: &_m.Mock} } -// Query provides a mock function with given fields: ctx, statement -func (_m *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator { - ret := _m.Called(ctx, statement) +// Query provides a mock function for the type ReadOnlyTransaction +func (_mock *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator { + ret := _mock.Called(ctx, statement) if len(ret) == 0 { panic("no return value specified for Query") } var r0 spannerclient.RowIterator - if rf, ok := ret.Get(0).(func(context.Context, spanner.Statement) spannerclient.RowIterator); ok { - r0 = rf(ctx, statement) + if returnFunc, ok := ret.Get(0).(func(context.Context, spanner.Statement) spannerclient.RowIterator); ok { + r0 = returnFunc(ctx, statement) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(spannerclient.RowIterator) } } - return r0 } @@ -58,31 +72,28 @@ func (_e *ReadOnlyTransaction_Expecter) Query(ctx interface{}, statement interfa func (_c *ReadOnlyTransaction_Query_Call) Run(run func(ctx context.Context, statement spanner.Statement)) *ReadOnlyTransaction_Query_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(spanner.Statement)) + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 spanner.Statement + if args[1] != nil { + arg1 = args[1].(spanner.Statement) + } + run( + arg0, + arg1, + ) }) return _c } -func (_c *ReadOnlyTransaction_Query_Call) Return(_a0 spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { - _c.Call.Return(_a0) +func (_c *ReadOnlyTransaction_Query_Call) Return(rowIterator spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { + _c.Call.Return(rowIterator) return _c } -func (_c *ReadOnlyTransaction_Query_Call) RunAndReturn(run func(context.Context, spanner.Statement) spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { +func (_c *ReadOnlyTransaction_Query_Call) RunAndReturn(run func(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { _c.Call.Return(run) return _c } - -// NewReadOnlyTransaction creates a new instance of ReadOnlyTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyTransaction(t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyTransaction { - mock := &ReadOnlyTransaction{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/coveragedb/mocks/Row.go b/pkg/coveragedb/mocks/Row.go index 549e7d214..3ea716173 100644 --- a/pkg/coveragedb/mocks/Row.go +++ b/pkg/coveragedb/mocks/Row.go @@ -1,8 +1,26 @@ -// Code generated by mockery v2.52.1. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks -import mock "github.com/stretchr/testify/mock" +import ( + mock "github.com/stretchr/testify/mock" +) + +// NewRow creates a new instance of Row. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRow(t interface { + mock.TestingT + Cleanup(func()) +}) *Row { + mock := &Row{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} // Row is an autogenerated mock type for the Row type type Row struct { @@ -17,21 +35,20 @@ func (_m *Row) EXPECT() *Row_Expecter { return &Row_Expecter{mock: &_m.Mock} } -// ToStruct provides a mock function with given fields: p -func (_m *Row) ToStruct(p interface{}) error { - ret := _m.Called(p) +// ToStruct provides a mock function for the type Row +func (_mock *Row) ToStruct(p interface{}) error { + ret := _mock.Called(p) if len(ret) == 0 { panic("no return value specified for ToStruct") } var r0 error - if rf, ok := ret.Get(0).(func(interface{}) error); ok { - r0 = rf(p) + if returnFunc, ok := ret.Get(0).(func(interface{}) error); ok { + r0 = returnFunc(p) } else { r0 = ret.Error(0) } - return r0 } @@ -48,31 +65,23 @@ func (_e *Row_Expecter) ToStruct(p interface{}) *Row_ToStruct_Call { func (_c *Row_ToStruct_Call) Run(run func(p interface{})) *Row_ToStruct_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{})) + var arg0 interface{} + if args[0] != nil { + arg0 = args[0].(interface{}) + } + run( + arg0, + ) }) return _c } -func (_c *Row_ToStruct_Call) Return(_a0 error) *Row_ToStruct_Call { - _c.Call.Return(_a0) +func (_c *Row_ToStruct_Call) Return(err error) *Row_ToStruct_Call { + _c.Call.Return(err) return _c } -func (_c *Row_ToStruct_Call) RunAndReturn(run func(interface{}) error) *Row_ToStruct_Call { +func (_c *Row_ToStruct_Call) RunAndReturn(run func(p interface{}) error) *Row_ToStruct_Call { _c.Call.Return(run) return _c } - -// NewRow creates a new instance of Row. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRow(t interface { - mock.TestingT - Cleanup(func()) -}) *Row { - mock := &Row{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/coveragedb/mocks/RowIterator.go b/pkg/coveragedb/mocks/RowIterator.go index 7bea62355..055039af6 100644 --- a/pkg/coveragedb/mocks/RowIterator.go +++ b/pkg/coveragedb/mocks/RowIterator.go @@ -1,12 +1,28 @@ -// Code generated by mockery v2.52.1. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - spannerclient "github.com/google/syzkaller/pkg/coveragedb/spannerclient" + "github.com/google/syzkaller/pkg/coveragedb/spannerclient" mock "github.com/stretchr/testify/mock" ) +// NewRowIterator creates a new instance of RowIterator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRowIterator(t interface { + mock.TestingT + Cleanup(func()) +}) *RowIterator { + mock := &RowIterator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // RowIterator is an autogenerated mock type for the RowIterator type type RowIterator struct { mock.Mock @@ -20,9 +36,9 @@ func (_m *RowIterator) EXPECT() *RowIterator_Expecter { return &RowIterator_Expecter{mock: &_m.Mock} } -// Next provides a mock function with no fields -func (_m *RowIterator) Next() (spannerclient.Row, error) { - ret := _m.Called() +// Next provides a mock function for the type RowIterator +func (_mock *RowIterator) Next() (spannerclient.Row, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Next") @@ -30,23 +46,21 @@ func (_m *RowIterator) Next() (spannerclient.Row, error) { var r0 spannerclient.Row var r1 error - if rf, ok := ret.Get(0).(func() (spannerclient.Row, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (spannerclient.Row, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() spannerclient.Row); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() spannerclient.Row); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(spannerclient.Row) } } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() } else { r1 = ret.Error(1) } - return r0, r1 } @@ -67,8 +81,8 @@ func (_c *RowIterator_Next_Call) Run(run func()) *RowIterator_Next_Call { return _c } -func (_c *RowIterator_Next_Call) Return(_a0 spannerclient.Row, _a1 error) *RowIterator_Next_Call { - _c.Call.Return(_a0, _a1) +func (_c *RowIterator_Next_Call) Return(row spannerclient.Row, err error) *RowIterator_Next_Call { + _c.Call.Return(row, err) return _c } @@ -77,9 +91,10 @@ func (_c *RowIterator_Next_Call) RunAndReturn(run func() (spannerclient.Row, err return _c } -// Stop provides a mock function with no fields -func (_m *RowIterator) Stop() { - _m.Called() +// Stop provides a mock function for the type RowIterator +func (_mock *RowIterator) Stop() { + _mock.Called() + return } // RowIterator_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' @@ -108,17 +123,3 @@ func (_c *RowIterator_Stop_Call) RunAndReturn(run func()) *RowIterator_Stop_Call _c.Run(run) return _c } - -// NewRowIterator creates a new instance of RowIterator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRowIterator(t interface { - mock.TestingT - Cleanup(func()) -}) *RowIterator { - mock := &RowIterator{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/pkg/coveragedb/mocks/SpannerClient.go b/pkg/coveragedb/mocks/SpannerClient.go index 0919b57cc..5f5c6cc05 100644 --- a/pkg/coveragedb/mocks/SpannerClient.go +++ b/pkg/coveragedb/mocks/SpannerClient.go @@ -1,17 +1,31 @@ -// Code generated by mockery v2.52.1. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" + "time" - spanner "cloud.google.com/go/spanner" + "cloud.google.com/go/spanner" + "github.com/google/syzkaller/pkg/coveragedb/spannerclient" mock "github.com/stretchr/testify/mock" +) - spannerclient "github.com/google/syzkaller/pkg/coveragedb/spannerclient" +// NewSpannerClient creates a new instance of SpannerClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSpannerClient(t interface { + mock.TestingT + Cleanup(func()) +}) *SpannerClient { + mock := &SpannerClient{} + mock.Mock.Test(t) - time "time" -) + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} // SpannerClient is an autogenerated mock type for the SpannerClient type type SpannerClient struct { @@ -26,16 +40,15 @@ func (_m *SpannerClient) EXPECT() *SpannerClient_Expecter { return &SpannerClient_Expecter{mock: &_m.Mock} } -// Apply provides a mock function with given fields: ctx, ms, opts -func (_m *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] +// Apply provides a mock function for the type SpannerClient +func (_mock *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error) { + var tmpRet mock.Arguments + if len(opts) > 0 { + tmpRet = _mock.Called(ctx, ms, opts) + } else { + tmpRet = _mock.Called(ctx, ms) } - var _ca []interface{} - _ca = append(_ca, ctx, ms) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for Apply") @@ -43,21 +56,19 @@ func (_m *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts var r0 time.Time var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)); ok { - return rf(ctx, ms, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)); ok { + return returnFunc(ctx, ms, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) time.Time); ok { - r0 = rf(ctx, ms, opts...) + if returnFunc, ok := ret.Get(0).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) time.Time); ok { + r0 = returnFunc(ctx, ms, opts...) } else { r0 = ret.Get(0).(time.Time) } - - if rf, ok := ret.Get(1).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) error); ok { - r1 = rf(ctx, ms, opts...) + if returnFunc, ok := ret.Get(1).(func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) error); ok { + r1 = returnFunc(ctx, ms, opts...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -77,13 +88,25 @@ func (_e *SpannerClient_Expecter) Apply(ctx interface{}, ms interface{}, opts .. func (_c *SpannerClient_Apply_Call) Run(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption)) *SpannerClient_Apply_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]spanner.ApplyOption, len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(spanner.ApplyOption) - } + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) } - run(args[0].(context.Context), args[1].([]*spanner.Mutation), variadicArgs...) + var arg1 []*spanner.Mutation + if args[1] != nil { + arg1 = args[1].([]*spanner.Mutation) + } + var arg2 []spanner.ApplyOption + var variadicArgs []spanner.ApplyOption + if len(args) > 2 { + variadicArgs = args[2].([]spanner.ApplyOption) + } + arg2 = variadicArgs + run( + arg0, + arg1, + arg2..., + ) }) return _c } @@ -93,14 +116,15 @@ func (_c *SpannerClient_Apply_Call) Return(commitTimestamp time.Time, err error) return _c } -func (_c *SpannerClient_Apply_Call) RunAndReturn(run func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)) *SpannerClient_Apply_Call { +func (_c *SpannerClient_Apply_Call) RunAndReturn(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error)) *SpannerClient_Apply_Call { _c.Call.Return(run) return _c } -// Close provides a mock function with no fields -func (_m *SpannerClient) Close() { - _m.Called() +// Close provides a mock function for the type SpannerClient +func (_mock *SpannerClient) Close() { + _mock.Called() + return } // SpannerClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' @@ -130,23 +154,22 @@ func (_c *SpannerClient_Close_Call) RunAndReturn(run func()) *SpannerClient_Clos return _c } -// Single provides a mock function with no fields -func (_m *SpannerClient) Single() spannerclient.ReadOnlyTransaction { - ret := _m.Called() +// Single provides a mock function for the type SpannerClient +func (_mock *SpannerClient) Single() spannerclient.ReadOnlyTransaction { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Single") } var r0 spannerclient.ReadOnlyTransaction - if rf, ok := ret.Get(0).(func() spannerclient.ReadOnlyTransaction); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() spannerclient.ReadOnlyTransaction); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(spannerclient.ReadOnlyTransaction) } } - return r0 } @@ -167,8 +190,8 @@ func (_c *SpannerClient_Single_Call) Run(run func()) *SpannerClient_Single_Call return _c } -func (_c *SpannerClient_Single_Call) Return(_a0 spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call { - _c.Call.Return(_a0) +func (_c *SpannerClient_Single_Call) Return(readOnlyTransaction spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call { + _c.Call.Return(readOnlyTransaction) return _c } @@ -176,17 +199,3 @@ func (_c *SpannerClient_Single_Call) RunAndReturn(run func() spannerclient.ReadO _c.Call.Return(run) return _c } - -// NewSpannerClient creates a new instance of SpannerClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSpannerClient(t interface { - mock.TestingT - Cleanup(func()) -}) *SpannerClient { - mock := &SpannerClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} |
