MCPcopy
hub / github.com/deepflowio/deepflow / TestByteBufferReset

Function TestByteBufferReset

server/libs/utils/byte_buffer_test.go:44–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestByteBufferReset(t *testing.T) {
45 bytes := &ByteBuffer{quota: 10}
46 buf := bytes.Use(10)
47 if len(buf) != 10 || len(bytes.Bytes()) != 10 {
48 t.Error("Use函数处理不正确")
49 }
50 bytes.Reset()
51 if len(bytes.Bytes()) != 0 {
52 t.Error("Reset函数处理不正确")
53 }
54}

Callers

nothing calls this directly

Calls 4

UseMethod · 0.95
BytesMethod · 0.95
ResetMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected