-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathautofuzzchain_test.go
56 lines (48 loc) · 1.34 KB
/
autofuzzchain_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package xsyncmapfuzz
// Edit if desired. Code generated by "fzgen -chain -parallel github.com/thepudds/fzgen/examples/inputs/race-xsync-map".
import (
"testing"
xsyncmap "github.com/thepudds/fzgen/examples/inputs/race-xsync-map"
"github.com/thepudds/fzgen/fuzzer"
)
func Fuzz_NewXSyncMap_Chain(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
fz := fuzzer.NewFuzzer(data)
target := xsyncmap.NewXSyncMap()
steps := []fuzzer.Step{
{
Name: "Fuzz_XSyncMap_Delete",
Func: func(key string) {
target.Delete(key)
},
},
{
Name: "Fuzz_XSyncMap_Load",
Func: func(key string) (int8, bool) {
return target.Load(key)
},
},
{
Name: "Fuzz_XSyncMap_LoadAndDelete",
Func: func(key string) (int8, bool) {
return target.LoadAndDelete(key)
},
},
{
Name: "Fuzz_XSyncMap_LoadOrStore",
Func: func(key string, value int8) (int8, bool) {
return target.LoadOrStore(key, value)
},
},
// skipping Fuzz_XSyncMap_Range because parameters include unsupported func or chan: func(key string, value interface{}) bool
{
Name: "Fuzz_XSyncMap_Store",
Func: func(key string, value int8) {
target.Store(key, value)
},
},
}
// Execute a specific chain of steps, with the count, sequence and arguments controlled by fz.Chain
fz.Chain(steps, fuzzer.ChainParallel)
})
}