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

Function TestReadVarUint32Small7RejectsOverflowFifthByte

go/fory/buffer_test.go:170–175  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

168}
169
170func TestReadVarUint32Small7RejectsOverflowFifthByte(t *testing.T) {
171 buf := NewByteBuffer([]byte{0x80, 0x80, 0x80, 0x80, 0x10})
172 var err Error
173 _ = buf.ReadVarUint32Small7(&err)
174 require.True(t, err.HasError())
175}
176
177func TestReadVarUint32Small7StreamRejectsOverflowFifthByte(t *testing.T) {
178 buf := NewByteBufferFromReader(bytes.NewReader([]byte{0x80, 0x80, 0x80, 0x80, 0x10}), 4)

Callers

nothing calls this directly

Calls 3

ReadVarUint32Small7Method · 0.95
HasErrorMethod · 0.95
NewByteBufferFunction · 0.85

Tested by

no test coverage detected