Skip to content

Commit

Permalink
Fuzz testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tv42 committed Aug 17, 2015
1 parent 53dc960 commit af67ea7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,3 +1,6 @@
TAGS
tags
.*.swp

/confl-fuzz.zip
/fuzz
26 changes: 26 additions & 0 deletions fuzz.go
@@ -0,0 +1,26 @@
// +build gofuzz

package confl

/*
Fuzz testing support files
https://github.com/dvyukov/go-fuzz
Usage:
go-fuzz-build github.com/lytics/confl
mkdir fuzz
cp _examples/*.conf fuzz/
go-fuzz -bin=confl-fuzz.zip -workdir=fuzz
See fuzz/crashers for results.
*/

func Fuzz(data []byte) int {
var v map[string]interface{}
if err := Unmarshal(data, &v); err != nil {
return 0
}
return 1
}

0 comments on commit af67ea7

Please sign in to comment.