1
0
mirror of https://github.com/Oxalide/vsphere-influxdb-go.git synced 2023-10-10 13:36:51 +02:00
vsphere-influxdb-go/vendor/github.com/influxdata/influxdb/models/inline_fnv_test.go

30 lines
506 B
Go
Raw Normal View History

2017-10-25 22:52:40 +02:00
package models_test
import (
"hash/fnv"
"testing"
"testing/quick"
"github.com/influxdata/influxdb/models"
)
func TestInlineFNV64aEquivalenceFuzz(t *testing.T) {
f := func(data []byte) bool {
stdlibFNV := fnv.New64a()
stdlibFNV.Write(data)
want := stdlibFNV.Sum64()
inlineFNV := models.NewInlineFNV64a()
inlineFNV.Write(data)
got := inlineFNV.Sum64()
return want == got
}
cfg := &quick.Config{
MaxCount: 10000,
}
if err := quick.Check(f, cfg); err != nil {
t.Fatal(err)
}
}