(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestStdNetBindReceiveFuncAfterClose(t *testing.T) { |
| 12 | bind := NewStdNetBind().(*StdNetBind) |
| 13 | fns, _, err := bind.Open(0) |
| 14 | if err != nil { |
| 15 | t.Fatal(err) |
| 16 | } |
| 17 | bind.Close() |
| 18 | bufs := make([][]byte, 1) |
| 19 | bufs[0] = make([]byte, 1) |
| 20 | sizes := make([]int, 1) |
| 21 | eps := make([]Endpoint, 1) |
| 22 | for _, fn := range fns { |
| 23 | // The ReceiveFuncs must not access conn-related fields on StdNetBind |
| 24 | // unguarded. Close() nils the conn-related fields resulting in a panic |
| 25 | // if they violate the mutex. |
| 26 | fn(bufs, sizes, eps) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func mockSetGSOSize(control *[]byte, gsoSize uint16) { |
| 31 | *control = (*control)[:cap(*control)] |
nothing calls this directly
no test coverage detected