simplify mockgen usage for private interfaces (#3769)

This commit is contained in:
Marten Seemann 2023-04-19 16:57:00 +02:00 committed by GitHub
parent 379e7ec848
commit c9a2f79b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 325 additions and 310 deletions

View file

@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: stream.go
// Source: github.com/quic-go/quic-go (interfaces: StreamI)
// Package quic is a generated GoMock package.
package quic
@ -12,6 +12,7 @@ import (
gomock "github.com/golang/mock/gomock"
ackhandler "github.com/quic-go/quic-go/internal/ackhandler"
protocol "github.com/quic-go/quic-go/internal/protocol"
qerr "github.com/quic-go/quic-go/internal/qerr"
wire "github.com/quic-go/quic-go/internal/wire"
)
@ -39,7 +40,7 @@ func (m *MockStreamI) EXPECT() *MockStreamIMockRecorder {
}
// CancelRead mocks base method.
func (m *MockStreamI) CancelRead(arg0 StreamErrorCode) {
func (m *MockStreamI) CancelRead(arg0 qerr.StreamErrorCode) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "CancelRead", arg0)
}
@ -51,7 +52,7 @@ func (mr *MockStreamIMockRecorder) CancelRead(arg0 interface{}) *gomock.Call {
}
// CancelWrite mocks base method.
func (m *MockStreamI) CancelWrite(arg0 StreamErrorCode) {
func (m *MockStreamI) CancelWrite(arg0 qerr.StreamErrorCode) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "CancelWrite", arg0)
}
@ -91,67 +92,67 @@ func (mr *MockStreamIMockRecorder) Context() *gomock.Call {
}
// Read mocks base method.
func (m *MockStreamI) Read(p []byte) (int, error) {
func (m *MockStreamI) Read(arg0 []byte) (int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Read", p)
ret := m.ctrl.Call(m, "Read", arg0)
ret0, _ := ret[0].(int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Read indicates an expected call of Read.
func (mr *MockStreamIMockRecorder) Read(p interface{}) *gomock.Call {
func (mr *MockStreamIMockRecorder) Read(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockStreamI)(nil).Read), p)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockStreamI)(nil).Read), arg0)
}
// SetDeadline mocks base method.
func (m *MockStreamI) SetDeadline(t time.Time) error {
func (m *MockStreamI) SetDeadline(arg0 time.Time) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetDeadline", t)
ret := m.ctrl.Call(m, "SetDeadline", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetDeadline indicates an expected call of SetDeadline.
func (mr *MockStreamIMockRecorder) SetDeadline(t interface{}) *gomock.Call {
func (mr *MockStreamIMockRecorder) SetDeadline(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockStreamI)(nil).SetDeadline), t)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetDeadline", reflect.TypeOf((*MockStreamI)(nil).SetDeadline), arg0)
}
// SetReadDeadline mocks base method.
func (m *MockStreamI) SetReadDeadline(t time.Time) error {
func (m *MockStreamI) SetReadDeadline(arg0 time.Time) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetReadDeadline", t)
ret := m.ctrl.Call(m, "SetReadDeadline", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetReadDeadline indicates an expected call of SetReadDeadline.
func (mr *MockStreamIMockRecorder) SetReadDeadline(t interface{}) *gomock.Call {
func (mr *MockStreamIMockRecorder) SetReadDeadline(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockStreamI)(nil).SetReadDeadline), t)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetReadDeadline", reflect.TypeOf((*MockStreamI)(nil).SetReadDeadline), arg0)
}
// SetWriteDeadline mocks base method.
func (m *MockStreamI) SetWriteDeadline(t time.Time) error {
func (m *MockStreamI) SetWriteDeadline(arg0 time.Time) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetWriteDeadline", t)
ret := m.ctrl.Call(m, "SetWriteDeadline", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetWriteDeadline indicates an expected call of SetWriteDeadline.
func (mr *MockStreamIMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call {
func (mr *MockStreamIMockRecorder) SetWriteDeadline(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockStreamI)(nil).SetWriteDeadline), t)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockStreamI)(nil).SetWriteDeadline), arg0)
}
// StreamID mocks base method.
func (m *MockStreamI) StreamID() StreamID {
func (m *MockStreamI) StreamID() protocol.StreamID {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StreamID")
ret0, _ := ret[0].(StreamID)
ret0, _ := ret[0].(protocol.StreamID)
return ret0
}
@ -162,18 +163,18 @@ func (mr *MockStreamIMockRecorder) StreamID() *gomock.Call {
}
// Write mocks base method.
func (m *MockStreamI) Write(p []byte) (int, error) {
func (m *MockStreamI) Write(arg0 []byte) (int, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Write", p)
ret := m.ctrl.Call(m, "Write", arg0)
ret0, _ := ret[0].(int)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Write indicates an expected call of Write.
func (mr *MockStreamIMockRecorder) Write(p interface{}) *gomock.Call {
func (mr *MockStreamIMockRecorder) Write(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockStreamI)(nil).Write), p)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockStreamI)(nil).Write), arg0)
}
// closeForShutdown mocks base method.
@ -257,18 +258,18 @@ func (mr *MockStreamIMockRecorder) hasData() *gomock.Call {
}
// popStreamFrame mocks base method.
func (m *MockStreamI) popStreamFrame(maxBytes protocol.ByteCount, v protocol.VersionNumber) (*ackhandler.Frame, bool) {
func (m *MockStreamI) popStreamFrame(arg0 protocol.ByteCount, arg1 protocol.VersionNumber) (*ackhandler.Frame, bool) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "popStreamFrame", maxBytes, v)
ret := m.ctrl.Call(m, "popStreamFrame", arg0, arg1)
ret0, _ := ret[0].(*ackhandler.Frame)
ret1, _ := ret[1].(bool)
return ret0, ret1
}
// popStreamFrame indicates an expected call of popStreamFrame.
func (mr *MockStreamIMockRecorder) popStreamFrame(maxBytes, v interface{}) *gomock.Call {
func (mr *MockStreamIMockRecorder) popStreamFrame(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "popStreamFrame", reflect.TypeOf((*MockStreamI)(nil).popStreamFrame), maxBytes, v)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "popStreamFrame", reflect.TypeOf((*MockStreamI)(nil).popStreamFrame), arg0, arg1)
}
// updateSendWindow mocks base method.