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

Function TestPrimitiveMapReaderRejectsInvalidChunkSize

go/fory/map_primitive_test.go:26–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestPrimitiveMapReaderRejectsInvalidChunkSize(t *testing.T) {
27 f := NewFory(WithXlang(false), WithCompatible(false))
28 buf := NewByteBuffer(nil)
29 buf.WriteLength(1)
30 buf.WriteUint8(KEY_DECL_TYPE | VALUE_DECL_TYPE)
31 buf.WriteUint8(2)
32
33 f.readCtx.SetData(buf.Bytes())
34 _ = f.readCtx.ReadStringStringMap(RefModeNone, false)
35 require.Error(t, f.readCtx.CheckError())
36}
37
38func TestPrimitiveMapReaderRejectsUnexpectedTypeInfo(t *testing.T) {
39 f := NewFory(WithXlang(false), WithCompatible(false))

Callers

nothing calls this directly

Calls 11

WriteLengthMethod · 0.95
WriteUint8Method · 0.95
BytesMethod · 0.95
NewForyFunction · 0.85
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
NewByteBufferFunction · 0.85
SetDataMethod · 0.80
ReadStringStringMapMethod · 0.80
ErrorMethod · 0.45
CheckErrorMethod · 0.45

Tested by

no test coverage detected