Skip to content

Commit

Permalink
Added extra verification to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Emyrk committed Feb 4, 2017
1 parent 5d82618 commit 79b404e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions addresses_test.go
Expand Up @@ -5,6 +5,7 @@
package factom_test

import (
"bytes"
"crypto/rand"
"testing"

Expand Down Expand Up @@ -42,6 +43,14 @@ func TestMarshalAddresses(t *testing.T) {
if len(newdata) != 0 {
t.Errorf("UnmarshalBinary left %d bytes remaining", len(newdata))
}

if bytes.Compare(ec.SecBytes(), ec2.SecBytes()) != 0 {
t.Errorf("Unmarshaled object has different secret.")
}

if bytes.Compare(ec.PubBytes(), ec2.PubBytes()) != 0 {
t.Errorf("Unmarshaled object has different secret.")
}
}

for i := 0; i < 100; i++ {
Expand Down Expand Up @@ -70,6 +79,14 @@ func TestMarshalAddresses(t *testing.T) {
if len(newdata) != 0 {
t.Errorf("UnmarshalBinary left %d bytes remaining", len(newdata))
}

if bytes.Compare(fa.SecBytes(), fa2.SecBytes()) != 0 {
t.Errorf("Unmarshaled object has different secret.")
}

if bytes.Compare(fa.PubBytes(), fa2.PubBytes()) != 0 {
t.Errorf("Unmarshaled object has different secret.")
}
}
}

Expand Down

0 comments on commit 79b404e

Please sign in to comment.