(t *testing.T)
| 224 | } |
| 225 | |
| 226 | func (s) TestBuffer_RefAfterFree(t *testing.T) { |
| 227 | // Verify that acquiring a ref before freeing does not panic. |
| 228 | buf := newBuffer([]byte("abcd"), mem.NopBufferPool{}) |
| 229 | buf.Ref() |
| 230 | |
| 231 | // This first call should not panic and bring the ref counter down to 1 |
| 232 | buf.Free() |
| 233 | // This second call actually frees the buffer |
| 234 | buf.Free() |
| 235 | defer checkForPanic(t, "Cannot ref freed buffer") |
| 236 | buf.Ref() |
| 237 | } |
| 238 | |
| 239 | func (s) TestBuffer_SplitAfterFree(t *testing.T) { |
| 240 | // Verify that splitting before freeing does not panic. |
nothing calls this directly
no test coverage detected