MCPcopy Create free account
hub / github.com/apache/fory / checkVarintWrite

Function checkVarintWrite

go/fory/buffer_test.go:77–84  ·  view source on GitHub ↗
(t *testing.T, buf *ByteBuffer, value int32)

Source from the content-addressed store, hash-verified

75}
76
77func checkVarintWrite(t *testing.T, buf *ByteBuffer, value int32) {
78 err := &Error{}
79 require.Equal(t, buf.WriterIndex(), buf.ReaderIndex())
80 buf.WriteVarint32(value)
81 varInt := buf.ReadVarint32(err)
82 require.Equal(t, buf.ReaderIndex(), buf.WriterIndex())
83 require.Equal(t, value, varInt)
84}
85
86// TestUnsafePutVarUint32PhysicalWriteWidth verifies that UnsafePutVarUint32 performs
87// an 8-byte physical write for 5-byte varints and that Reserve(8) (as required by

Callers 1

TestVarintFunction · 0.85

Calls 5

WriterIndexMethod · 0.80
ReaderIndexMethod · 0.80
EqualMethod · 0.45
WriteVarint32Method · 0.45
ReadVarint32Method · 0.45

Tested by

no test coverage detected