[#216] netmap: Add policy decode fuzz test
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
99e02858af
commit
02c936f397
5 changed files with 48 additions and 16 deletions
14
netmap/policy_fuzz.go
Normal file
14
netmap/policy_fuzz.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzPlacementPolicyDecode(data []byte) int {
|
||||
p := string(data)
|
||||
if p == "" {
|
||||
return 0
|
||||
}
|
||||
var pp PlacementPolicy
|
||||
_ = pp.DecodeString(p)
|
||||
return 1
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue