Skip to content

Commit

Permalink
Add basic fuzz test and basic corpus
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubuxu committed Nov 17, 2016
1 parent eae3431 commit 832b6a0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cid_fuzz.go
@@ -0,0 +1,17 @@
// +build gofuzz

package cid

func Fuzz(data []byte) int {
cid, err := Cast(data)

if err != nil {
return 0
}

_ = cid.Bytes()
if !cid.Equals(cid) {
panic("inequality")
}
return 1
}
1 change: 1 addition & 0 deletions fuzz-data/corpus/cid0
@@ -0,0 +1 @@
 �g�D1���e�-D�/�q3�~�(�7`8���n
1 change: 1 addition & 0 deletions fuzz-data/corpus/cid1
@@ -0,0 +1 @@
q -[�ï�h�[����(ΰ[�)���D��
Expand Down

0 comments on commit 832b6a0

Please sign in to comment.