summaryrefslogtreecommitdiff
path: root/libgo/go/hash/crc64/crc64_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/hash/crc64/crc64_test.go')
-rw-r--r--libgo/go/hash/crc64/crc64_test.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/libgo/go/hash/crc64/crc64_test.go b/libgo/go/hash/crc64/crc64_test.go
index e932524e092..81a87b56e35 100644
--- a/libgo/go/hash/crc64/crc64_test.go
+++ b/libgo/go/hash/crc64/crc64_test.go
@@ -64,15 +64,18 @@ func TestGolden(t *testing.T) {
}
func BenchmarkCrc64KB(b *testing.B) {
- b.StopTimer()
- data := make([]uint8, 1024)
- for i := 0; i < 1024; i++ {
- data[i] = uint8(i)
+ b.SetBytes(1024)
+ data := make([]byte, 1024)
+ for i := range data {
+ data[i] = byte(i)
}
- c := New(tab)
- b.StartTimer()
+ h := New(tab)
+ in := make([]byte, 0, h.Size())
+ b.ResetTimer()
for i := 0; i < b.N; i++ {
- c.Write(data)
+ h.Reset()
+ h.Write(data)
+ h.Sum(in)
}
}