MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / Fuzz

Function Fuzz

consensus/wal_fuzz.go:11–32  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

9)
10
11func Fuzz(data []byte) int {
12 dec := NewWALDecoder(bytes.NewReader(data))
13 for {
14 msg, err := dec.Decode()
15 if err == io.EOF {
16 break
17 }
18 if err != nil {
19 if msg != nil {
20 panic("msg != nil on error")
21 }
22 return 0
23 }
24 var w bytes.Buffer
25 enc := NewWALEncoder(&w)
26 err = enc.Encode(msg)
27 if err != nil {
28 panic(err)
29 }
30 }
31 return 1
32}

Callers

nothing calls this directly

Calls 5

DecodeMethod · 0.95
EncodeMethod · 0.95
NewReaderMethod · 0.80
NewWALDecoderFunction · 0.70
NewWALEncoderFunction · 0.70

Tested by

no test coverage detected