forked from quic-go/quic-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_send_stream_internal_test.go
458 lines (385 loc) · 14.7 KB
/
mock_send_stream_internal_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/quic-go/quic-go (interfaces: SendStreamI)
//
// Generated by this command:
//
// mockgen -typed -build_flags=-tags=gomock -package quic -self_package github.com/quic-go/quic-go -destination mock_send_stream_internal_test.go github.com/quic-go/quic-go SendStreamI
//
// Package quic is a generated GoMock package.
package quic
import (
context "context"
reflect "reflect"
time "time"
ackhandler "github.com/xtls/quic-go/internal/ackhandler"
protocol "github.com/xtls/quic-go/internal/protocol"
qerr "github.com/xtls/quic-go/internal/qerr"
wire "github.com/xtls/quic-go/internal/wire"
gomock "go.uber.org/mock/gomock"
)
// MockSendStreamI is a mock of SendStreamI interface.
type MockSendStreamI struct {
ctrl *gomock.Controller
recorder *MockSendStreamIMockRecorder
}
// MockSendStreamIMockRecorder is the mock recorder for MockSendStreamI.
type MockSendStreamIMockRecorder struct {
mock *MockSendStreamI
}
// NewMockSendStreamI creates a new mock instance.
func NewMockSendStreamI(ctrl *gomock.Controller) *MockSendStreamI {
mock := &MockSendStreamI{ctrl: ctrl}
mock.recorder = &MockSendStreamIMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockSendStreamI) EXPECT() *MockSendStreamIMockRecorder {
return m.recorder
}
// CancelWrite mocks base method.
func (m *MockSendStreamI) CancelWrite(arg0 qerr.StreamErrorCode) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "CancelWrite", arg0)
}
// CancelWrite indicates an expected call of CancelWrite.
func (mr *MockSendStreamIMockRecorder) CancelWrite(arg0 any) *MockSendStreamICancelWriteCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelWrite", reflect.TypeOf((*MockSendStreamI)(nil).CancelWrite), arg0)
return &MockSendStreamICancelWriteCall{Call: call}
}
// MockSendStreamICancelWriteCall wrap *gomock.Call
type MockSendStreamICancelWriteCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamICancelWriteCall) Return() *MockSendStreamICancelWriteCall {
c.Call = c.Call.Return()
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamICancelWriteCall) Do(f func(qerr.StreamErrorCode)) *MockSendStreamICancelWriteCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamICancelWriteCall) DoAndReturn(f func(qerr.StreamErrorCode)) *MockSendStreamICancelWriteCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Close mocks base method.
func (m *MockSendStreamI) Close() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Close")
ret0, _ := ret[0].(error)
return ret0
}
// Close indicates an expected call of Close.
func (mr *MockSendStreamIMockRecorder) Close() *MockSendStreamICloseCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockSendStreamI)(nil).Close))
return &MockSendStreamICloseCall{Call: call}
}
// MockSendStreamICloseCall wrap *gomock.Call
type MockSendStreamICloseCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamICloseCall) Return(arg0 error) *MockSendStreamICloseCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamICloseCall) Do(f func() error) *MockSendStreamICloseCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamICloseCall) DoAndReturn(f func() error) *MockSendStreamICloseCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Context mocks base method.
func (m *MockSendStreamI) Context() context.Context {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Context")
ret0, _ := ret[0].(context.Context)
return ret0
}
// Context indicates an expected call of Context.
func (mr *MockSendStreamIMockRecorder) Context() *MockSendStreamIContextCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockSendStreamI)(nil).Context))
return &MockSendStreamIContextCall{Call: call}
}
// MockSendStreamIContextCall wrap *gomock.Call
type MockSendStreamIContextCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIContextCall) Return(arg0 context.Context) *MockSendStreamIContextCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIContextCall) Do(f func() context.Context) *MockSendStreamIContextCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIContextCall) DoAndReturn(f func() context.Context) *MockSendStreamIContextCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// SetWriteDeadline mocks base method.
func (m *MockSendStreamI) SetWriteDeadline(arg0 time.Time) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SetWriteDeadline", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// SetWriteDeadline indicates an expected call of SetWriteDeadline.
func (mr *MockSendStreamIMockRecorder) SetWriteDeadline(arg0 any) *MockSendStreamISetWriteDeadlineCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetWriteDeadline", reflect.TypeOf((*MockSendStreamI)(nil).SetWriteDeadline), arg0)
return &MockSendStreamISetWriteDeadlineCall{Call: call}
}
// MockSendStreamISetWriteDeadlineCall wrap *gomock.Call
type MockSendStreamISetWriteDeadlineCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamISetWriteDeadlineCall) Return(arg0 error) *MockSendStreamISetWriteDeadlineCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamISetWriteDeadlineCall) Do(f func(time.Time) error) *MockSendStreamISetWriteDeadlineCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamISetWriteDeadlineCall) DoAndReturn(f func(time.Time) error) *MockSendStreamISetWriteDeadlineCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// StreamID mocks base method.
func (m *MockSendStreamI) StreamID() protocol.StreamID {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StreamID")
ret0, _ := ret[0].(protocol.StreamID)
return ret0
}
// StreamID indicates an expected call of StreamID.
func (mr *MockSendStreamIMockRecorder) StreamID() *MockSendStreamIStreamIDCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StreamID", reflect.TypeOf((*MockSendStreamI)(nil).StreamID))
return &MockSendStreamIStreamIDCall{Call: call}
}
// MockSendStreamIStreamIDCall wrap *gomock.Call
type MockSendStreamIStreamIDCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIStreamIDCall) Return(arg0 protocol.StreamID) *MockSendStreamIStreamIDCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIStreamIDCall) Do(f func() protocol.StreamID) *MockSendStreamIStreamIDCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIStreamIDCall) DoAndReturn(f func() protocol.StreamID) *MockSendStreamIStreamIDCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// Write mocks base method.
func (m *MockSendStreamI) Write(arg0 []byte) (int, error) {
m.ctrl.T.Helper()
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 *MockSendStreamIMockRecorder) Write(arg0 any) *MockSendStreamIWriteCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockSendStreamI)(nil).Write), arg0)
return &MockSendStreamIWriteCall{Call: call}
}
// MockSendStreamIWriteCall wrap *gomock.Call
type MockSendStreamIWriteCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIWriteCall) Return(arg0 int, arg1 error) *MockSendStreamIWriteCall {
c.Call = c.Call.Return(arg0, arg1)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIWriteCall) Do(f func([]byte) (int, error)) *MockSendStreamIWriteCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIWriteCall) DoAndReturn(f func([]byte) (int, error)) *MockSendStreamIWriteCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// closeForShutdown mocks base method.
func (m *MockSendStreamI) closeForShutdown(arg0 error) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "closeForShutdown", arg0)
}
// closeForShutdown indicates an expected call of closeForShutdown.
func (mr *MockSendStreamIMockRecorder) closeForShutdown(arg0 any) *MockSendStreamIcloseForShutdownCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "closeForShutdown", reflect.TypeOf((*MockSendStreamI)(nil).closeForShutdown), arg0)
return &MockSendStreamIcloseForShutdownCall{Call: call}
}
// MockSendStreamIcloseForShutdownCall wrap *gomock.Call
type MockSendStreamIcloseForShutdownCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIcloseForShutdownCall) Return() *MockSendStreamIcloseForShutdownCall {
c.Call = c.Call.Return()
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIcloseForShutdownCall) Do(f func(error)) *MockSendStreamIcloseForShutdownCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIcloseForShutdownCall) DoAndReturn(f func(error)) *MockSendStreamIcloseForShutdownCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// handleStopSendingFrame mocks base method.
func (m *MockSendStreamI) handleStopSendingFrame(arg0 *wire.StopSendingFrame) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "handleStopSendingFrame", arg0)
}
// handleStopSendingFrame indicates an expected call of handleStopSendingFrame.
func (mr *MockSendStreamIMockRecorder) handleStopSendingFrame(arg0 any) *MockSendStreamIhandleStopSendingFrameCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "handleStopSendingFrame", reflect.TypeOf((*MockSendStreamI)(nil).handleStopSendingFrame), arg0)
return &MockSendStreamIhandleStopSendingFrameCall{Call: call}
}
// MockSendStreamIhandleStopSendingFrameCall wrap *gomock.Call
type MockSendStreamIhandleStopSendingFrameCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIhandleStopSendingFrameCall) Return() *MockSendStreamIhandleStopSendingFrameCall {
c.Call = c.Call.Return()
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIhandleStopSendingFrameCall) Do(f func(*wire.StopSendingFrame)) *MockSendStreamIhandleStopSendingFrameCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIhandleStopSendingFrameCall) DoAndReturn(f func(*wire.StopSendingFrame)) *MockSendStreamIhandleStopSendingFrameCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// hasData mocks base method.
func (m *MockSendStreamI) hasData() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "hasData")
ret0, _ := ret[0].(bool)
return ret0
}
// hasData indicates an expected call of hasData.
func (mr *MockSendStreamIMockRecorder) hasData() *MockSendStreamIhasDataCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "hasData", reflect.TypeOf((*MockSendStreamI)(nil).hasData))
return &MockSendStreamIhasDataCall{Call: call}
}
// MockSendStreamIhasDataCall wrap *gomock.Call
type MockSendStreamIhasDataCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIhasDataCall) Return(arg0 bool) *MockSendStreamIhasDataCall {
c.Call = c.Call.Return(arg0)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIhasDataCall) Do(f func() bool) *MockSendStreamIhasDataCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIhasDataCall) DoAndReturn(f func() bool) *MockSendStreamIhasDataCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// popStreamFrame mocks base method.
func (m *MockSendStreamI) popStreamFrame(arg0 protocol.ByteCount, arg1 protocol.Version) (ackhandler.StreamFrame, bool, bool) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "popStreamFrame", arg0, arg1)
ret0, _ := ret[0].(ackhandler.StreamFrame)
ret1, _ := ret[1].(bool)
ret2, _ := ret[2].(bool)
return ret0, ret1, ret2
}
// popStreamFrame indicates an expected call of popStreamFrame.
func (mr *MockSendStreamIMockRecorder) popStreamFrame(arg0, arg1 any) *MockSendStreamIpopStreamFrameCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "popStreamFrame", reflect.TypeOf((*MockSendStreamI)(nil).popStreamFrame), arg0, arg1)
return &MockSendStreamIpopStreamFrameCall{Call: call}
}
// MockSendStreamIpopStreamFrameCall wrap *gomock.Call
type MockSendStreamIpopStreamFrameCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIpopStreamFrameCall) Return(arg0 ackhandler.StreamFrame, arg1, arg2 bool) *MockSendStreamIpopStreamFrameCall {
c.Call = c.Call.Return(arg0, arg1, arg2)
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIpopStreamFrameCall) Do(f func(protocol.ByteCount, protocol.Version) (ackhandler.StreamFrame, bool, bool)) *MockSendStreamIpopStreamFrameCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIpopStreamFrameCall) DoAndReturn(f func(protocol.ByteCount, protocol.Version) (ackhandler.StreamFrame, bool, bool)) *MockSendStreamIpopStreamFrameCall {
c.Call = c.Call.DoAndReturn(f)
return c
}
// updateSendWindow mocks base method.
func (m *MockSendStreamI) updateSendWindow(arg0 protocol.ByteCount) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "updateSendWindow", arg0)
}
// updateSendWindow indicates an expected call of updateSendWindow.
func (mr *MockSendStreamIMockRecorder) updateSendWindow(arg0 any) *MockSendStreamIupdateSendWindowCall {
mr.mock.ctrl.T.Helper()
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "updateSendWindow", reflect.TypeOf((*MockSendStreamI)(nil).updateSendWindow), arg0)
return &MockSendStreamIupdateSendWindowCall{Call: call}
}
// MockSendStreamIupdateSendWindowCall wrap *gomock.Call
type MockSendStreamIupdateSendWindowCall struct {
*gomock.Call
}
// Return rewrite *gomock.Call.Return
func (c *MockSendStreamIupdateSendWindowCall) Return() *MockSendStreamIupdateSendWindowCall {
c.Call = c.Call.Return()
return c
}
// Do rewrite *gomock.Call.Do
func (c *MockSendStreamIupdateSendWindowCall) Do(f func(protocol.ByteCount)) *MockSendStreamIupdateSendWindowCall {
c.Call = c.Call.Do(f)
return c
}
// DoAndReturn rewrite *gomock.Call.DoAndReturn
func (c *MockSendStreamIupdateSendWindowCall) DoAndReturn(f func(protocol.ByteCount)) *MockSendStreamIupdateSendWindowCall {
c.Call = c.Call.DoAndReturn(f)
return c
}