Skip to content

Commit

Permalink
Merge "Fix failing utils unit test"
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborh-da authored and Gerrit Code Review committed Aug 12, 2016
2 parents 0fa8e89 + d9596b4 commit 457635a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions core/util/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,16 @@ func TestGenerateHashFromSignature(t *testing.T) {
}
}

func TestGenerateUUIDfromTxSHAHash(t *testing.T) {
uuid := GenerateUUIDfromTxSHAHash([]byte("foobar"))
if len(uuid) != 36 {
t.Fatalf("UUID length is not correct. Expected = 36, Got = %d", len(uuid))
}
uuid2 := GenerateUUIDfromTxSHAHash([]byte("foobar1"))
if uuid == uuid2 {
t.Fatalf("Two UUIDs are equal. This should never occur")
func TestGeneratIDfromTxSHAHash(t *testing.T) {
txid := GenerateIDfromTxSHAHash([]byte("foobar"))
txid2 := GenerateIDfromTxSHAHash([]byte("foobar1"))
if txid == txid2 {
t.Fatalf("Two TxIDs are equal. This should never occur")
}
}

func TestGenerateIDWithAlg(t *testing.T) {
_, err := GenerateIDWithAlg("sha256base64", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
_, err := GenerateIDWithAlg("sha256", []byte{1, 1, 1, 1})
if err != nil {
t.Fatalf("Decoder failure: %v", err)
}
Expand Down

0 comments on commit 457635a

Please sign in to comment.