mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 19:08:55 +00:00
chunker: Add benchmark for reducibility test
This commit is contained in:
parent
35af933f24
commit
f8804d4265
@ -276,6 +276,22 @@ func TestPolIrreducible(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkPolIrreducible(b *testing.B) {
|
||||
// find first irreducible polynomial
|
||||
var pol chunker.Pol
|
||||
for _, test := range polIrredTests {
|
||||
if test.irred {
|
||||
pol = test.f
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
Assert(b, pol.Irreducible(),
|
||||
"Irreducibility test for Polynomial %v failed", pol)
|
||||
}
|
||||
}
|
||||
|
||||
var polGCDTests = []struct {
|
||||
f1 chunker.Pol
|
||||
f2 chunker.Pol
|
||||
|
Loading…
Reference in New Issue
Block a user