MCPcopy Create free account
hub / github.com/pquerna/ffjson / FuzzGenerate

Function FuzzGenerate

tests/fuzz/generator_fuzz.go:14–35  ·  view source on GitHub ↗

Fuzz tests code generation.

(fuzz []byte)

Source from the content-addressed store, hash-verified

12
13// Fuzz tests code generation.
14func FuzzGenerate(fuzz []byte) int {
15 err := os.MkdirAll("fuzzing", os.ModePerm)
16 if err != nil {
17 panic("could not make fuzzing dir")
18 }
19 err = ioutil.WriteFile("fuzzing/input.go", fuzz, 0644)
20 if err != nil {
21 panic("could not write input file")
22 }
23 err = generator.GenerateFiles(
24 "go",
25 "fuzzing/input.go",
26 "fuzzing/output.go",
27 "",
28 true,
29 true,
30 )
31 if err != nil {
32 return 0
33 }
34 return 1
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…