MCPcopy Create free account
hub / github.com/cloudwego/netpoll / TestLinkBufferWriteBuffer

Function TestLinkBufferWriteBuffer

nocopy_linkbuffer_test.go:416–430  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

414}
415
416func TestLinkBufferWriteBuffer(t *testing.T) {
417 buf1 := NewLinkBuffer()
418 buf2 := NewLinkBuffer()
419 b2, _ := buf2.Malloc(1)
420 b2[0] = 2
421 buf2.Flush()
422 buf3 := NewLinkBuffer()
423 b3, _ := buf3.Malloc(1)
424 b3[0] = 3
425 buf3.Flush()
426 buf1.WriteBuffer(buf2)
427 buf1.WriteBuffer(buf3)
428 buf1.Flush()
429 MustTrue(t, bytes.Equal(buf1.Bytes(), []byte{2, 3}))
430}
431
432func TestLinkBufferCheckSingleNode(t *testing.T) {
433 buf := NewLinkBuffer(block4k)

Callers

nothing calls this directly

Calls 6

NewLinkBufferFunction · 0.85
MallocMethod · 0.65
FlushMethod · 0.65
MustTrueFunction · 0.50
WriteBufferMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…