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

Function TestSkipMapRejectsInvalidChunkSize

go/fory/skip_test.go:116–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestSkipMapRejectsInvalidChunkSize(t *testing.T) {
117 f := New(WithXlang(true), WithCompatible(false))
118 buf := NewByteBuffer(nil)
119 buf.WriteLength(1)
120 buf.WriteByte(KEY_DECL_TYPE | VALUE_DECL_TYPE)
121 buf.WriteByte(2)
122
123 f.readCtx.SetData(buf.Bytes())
124 skipMap(
125 f.readCtx,
126 FieldDef{
127 typeSpec: NewMapTypeSpec(MAP, NewSimpleTypeSpec(INT32), NewSimpleTypeSpec(INT32)),
128 nullable: true,
129 },
130 )
131 require.Error(t, f.readCtx.CheckError())
132}

Callers

nothing calls this directly

Calls 13

WriteLengthMethod · 0.95
WriteByteMethod · 0.95
BytesMethod · 0.95
WithXlangFunction · 0.85
WithCompatibleFunction · 0.85
NewByteBufferFunction · 0.85
skipMapFunction · 0.85
NewMapTypeSpecFunction · 0.85
NewSimpleTypeSpecFunction · 0.85
SetDataMethod · 0.80
NewFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected