Add case for SetMask

pull/499/head
Animesh Gaitonde 6 years ago committed by animeshg
parent 9db2423c6f
commit cc8b644272
  1. 10
      crypto/bls/bls_test.go

@ -232,10 +232,16 @@ func TestSetMask(test *testing.T) {
mask, _ := NewMask([]*bls.PublicKey{pubKey1, pubKey2}, pubKey1)
_ = mask
left := []byte{3}
mask.SetMask(left)
maskBytes := []byte{3}
mask.SetMask(maskBytes)
if mask.CountEnabled() != 2 {
test.Error("Count of Enabled nodes doesn't match")
}
newMaskBytes := []byte{3, 2}
if err := mask.SetMask(newMaskBytes); err == nil {
test.Error("Expected mismatching Bitmap lengths")
}
}

Loading…
Cancel
Save