mirror of https://github.com/poanetwork/gecko.git
Merge branch 'master' into test-utils-ip
This commit is contained in:
commit
00e50e60e1
|
@ -4,6 +4,7 @@
|
|||
package snowball
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
@ -78,16 +79,28 @@ func TestParametersInvalidBetaRogue(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestParametersInvalidConcurrentRepolls(t *testing.T) {
|
||||
p := Parameters{
|
||||
K: 1,
|
||||
Alpha: 1,
|
||||
BetaVirtuous: 1,
|
||||
BetaRogue: 1,
|
||||
ConcurrentRepolls: 2,
|
||||
}
|
||||
|
||||
if err := p.Valid(); err == nil {
|
||||
t.Fatalf("Should have failed due to invalid concurrent repolls")
|
||||
}
|
||||
tests := []Parameters{
|
||||
Parameters{
|
||||
K: 1,
|
||||
Alpha: 1,
|
||||
BetaVirtuous: 1,
|
||||
BetaRogue: 1,
|
||||
ConcurrentRepolls: 2,
|
||||
},
|
||||
Parameters{
|
||||
K: 1,
|
||||
Alpha: 1,
|
||||
BetaVirtuous: 1,
|
||||
BetaRogue: 1,
|
||||
ConcurrentRepolls: 0,
|
||||
},
|
||||
}
|
||||
for _, p := range tests {
|
||||
label := fmt.Sprintf("ConcurrentRepolls=%d", p.ConcurrentRepolls)
|
||||
t.Run(label, func(t *testing.T) {
|
||||
if err := p.Valid(); err == nil {
|
||||
t.Error("Should have failed due to invalid concurrent repolls")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue