mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-03 04:27:39 +03:00
199 lines
4.8 KiB
Go
199 lines
4.8 KiB
Go
// Code generated by mockery v2.43.0. DO NOT EDIT.
|
|
|
|
package outbounds
|
|
|
|
import mock "github.com/stretchr/testify/mock"
|
|
|
|
// mockUDPConn is an autogenerated mock type for the UDPConn type
|
|
type mockUDPConn struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type mockUDPConn_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *mockUDPConn) EXPECT() *mockUDPConn_Expecter {
|
|
return &mockUDPConn_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Close provides a mock function with given fields:
|
|
func (_m *mockUDPConn) Close() error {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Close")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// mockUDPConn_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
|
|
type mockUDPConn_Close_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Close is a helper method to define mock.On call
|
|
func (_e *mockUDPConn_Expecter) Close() *mockUDPConn_Close_Call {
|
|
return &mockUDPConn_Close_Call{Call: _e.mock.On("Close")}
|
|
}
|
|
|
|
func (_c *mockUDPConn_Close_Call) Run(run func()) *mockUDPConn_Close_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run()
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockUDPConn_Close_Call) Return(_a0 error) *mockUDPConn_Close_Call {
|
|
_c.Call.Return(_a0)
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockUDPConn_Close_Call) RunAndReturn(run func() error) *mockUDPConn_Close_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ReadFrom provides a mock function with given fields: b
|
|
func (_m *mockUDPConn) ReadFrom(b []byte) (int, *AddrEx, error) {
|
|
ret := _m.Called(b)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ReadFrom")
|
|
}
|
|
|
|
var r0 int
|
|
var r1 *AddrEx
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func([]byte) (int, *AddrEx, error)); ok {
|
|
return rf(b)
|
|
}
|
|
if rf, ok := ret.Get(0).(func([]byte) int); ok {
|
|
r0 = rf(b)
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func([]byte) *AddrEx); ok {
|
|
r1 = rf(b)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*AddrEx)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func([]byte) error); ok {
|
|
r2 = rf(b)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// mockUDPConn_ReadFrom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFrom'
|
|
type mockUDPConn_ReadFrom_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ReadFrom is a helper method to define mock.On call
|
|
// - b []byte
|
|
func (_e *mockUDPConn_Expecter) ReadFrom(b interface{}) *mockUDPConn_ReadFrom_Call {
|
|
return &mockUDPConn_ReadFrom_Call{Call: _e.mock.On("ReadFrom", b)}
|
|
}
|
|
|
|
func (_c *mockUDPConn_ReadFrom_Call) Run(run func(b []byte)) *mockUDPConn_ReadFrom_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].([]byte))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockUDPConn_ReadFrom_Call) Return(_a0 int, _a1 *AddrEx, _a2 error) *mockUDPConn_ReadFrom_Call {
|
|
_c.Call.Return(_a0, _a1, _a2)
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockUDPConn_ReadFrom_Call) RunAndReturn(run func([]byte) (int, *AddrEx, error)) *mockUDPConn_ReadFrom_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// WriteTo provides a mock function with given fields: b, addr
|
|
func (_m *mockUDPConn) WriteTo(b []byte, addr *AddrEx) (int, error) {
|
|
ret := _m.Called(b, addr)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for WriteTo")
|
|
}
|
|
|
|
var r0 int
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func([]byte, *AddrEx) (int, error)); ok {
|
|
return rf(b, addr)
|
|
}
|
|
if rf, ok := ret.Get(0).(func([]byte, *AddrEx) int); ok {
|
|
r0 = rf(b, addr)
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func([]byte, *AddrEx) error); ok {
|
|
r1 = rf(b, addr)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// mockUDPConn_WriteTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteTo'
|
|
type mockUDPConn_WriteTo_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// WriteTo is a helper method to define mock.On call
|
|
// - b []byte
|
|
// - addr *AddrEx
|
|
func (_e *mockUDPConn_Expecter) WriteTo(b interface{}, addr interface{}) *mockUDPConn_WriteTo_Call {
|
|
return &mockUDPConn_WriteTo_Call{Call: _e.mock.On("WriteTo", b, addr)}
|
|
}
|
|
|
|
func (_c *mockUDPConn_WriteTo_Call) Run(run func(b []byte, addr *AddrEx)) *mockUDPConn_WriteTo_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].([]byte), args[1].(*AddrEx))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockUDPConn_WriteTo_Call) Return(_a0 int, _a1 error) *mockUDPConn_WriteTo_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *mockUDPConn_WriteTo_Call) RunAndReturn(run func([]byte, *AddrEx) (int, error)) *mockUDPConn_WriteTo_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// newMockUDPConn creates a new instance of mockUDPConn. 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 newMockUDPConn(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *mockUDPConn {
|
|
mock := &mockUDPConn{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|