mirror of https://github.com/poanetwork/gecko.git
fixed test + improved coverage
This commit is contained in:
parent
741d5fde66
commit
12c8d6c44f
|
@ -151,7 +151,7 @@ func TestBinarySnowballAcceptWeirdColor(t *testing.T) {
|
|||
t.Fatalf("Finalized too late")
|
||||
}
|
||||
|
||||
expected := "SB(Preference = 0, NumSuccessfulPolls[0] = 2, NumSuccessfulPolls[1] = 2, SF(Confidence = 2, Finalized = true, SL(Preference = 1)))"
|
||||
expected := "SB(Preference = 1, NumSuccessfulPolls[0] = 2, NumSuccessfulPolls[1] = 2, SF(Confidence = 2, Finalized = true, SL(Preference = 0)))"
|
||||
if str := sb.String(); str != expected {
|
||||
t.Fatalf("Wrong state. Expected:\n%s\nGot:\n%s", expected, str)
|
||||
}
|
||||
|
|
|
@ -90,7 +90,21 @@ func TestParametersAnotherInvalidBetaRogue(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestParametersInvalidConcurrentRepolls(t *testing.T) {
|
||||
func TestParametersTooFewConcurrentRepolls(t *testing.T) {
|
||||
p := Parameters{
|
||||
K: 1,
|
||||
Alpha: 1,
|
||||
BetaVirtuous: 1,
|
||||
BetaRogue: 1,
|
||||
ConcurrentRepolls: 0,
|
||||
}
|
||||
|
||||
if err := p.Valid(); err == nil {
|
||||
t.Fatalf("Should have failed due to invalid concurrent repolls")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParametersTooManyConcurrentRepolls(t *testing.T) {
|
||||
p := Parameters{
|
||||
K: 1,
|
||||
Alpha: 1,
|
||||
|
|
Loading…
Reference in New Issue