Skip to content

Commit

Permalink
skip tests that overflow uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvanloon committed Jun 20, 2019
1 parent 5b1c703 commit ef9662d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions shared/bls/spectest/sign_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ func TestSignMessageYaml(t *testing.T) {
if err != nil {
t.Fatalf("Cannot unmarshal input to secret key: %v", err)
}
domain, _ := binary.Uvarint(tt.Input.Domain)
domain, n := binary.Uvarint(tt.Input.Domain)
if err != nil {
t.Fatal(err)
}
if n == 0 { // overflow
t.Skipf("Domain overflows uint64. Skipping test. Domain=%#x",
tt.Input.Domain)
}
sig := sk.Sign(tt.Input.Message, domain)
if !bytes.Equal(tt.Output, sig.Marshal()) {
t.Errorf("Signature does not match the expected output. Expected %#x but received %#x", tt.Output, sig.Marshal())
t.Logf("Domain=%d", domain)
t.Fatalf("Signature does not match the expected output. " +
"Expected %#x but received %#x", tt.Output, sig.Marshal())
}
t.Logf("Success. Domain=%d", domain)
})
}
}

0 comments on commit ef9662d

Please sign in to comment.