Skip to content

Commit

Permalink
Fix ringhash_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aforge committed Sep 18, 2020
1 parent 3f741e3 commit bf74b3b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/ringhash/ringhash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ringhash
import (
"fmt"
"hash/crc32"
"hash/fnv"
"testing"
)

Expand Down Expand Up @@ -139,8 +140,14 @@ func TestSignature(t *testing.T) {
t.Errorf("Signatures must be different - different keys")
}

fnvHashfunc := func(data []byte) uint32 {
hash := fnv.New32a()
hash.Write(data)
return hash.Sum32()
}

ring1 = New(4, nil)
ring2 = New(4, crc32.ChecksumIEEE)
ring2 = New(4, fnvHashfunc)

ring1.Add("owl", "crow", "sparrow")
ring2.Add("owl", "crow", "sparrow")
Expand Down

0 comments on commit bf74b3b

Please sign in to comment.