]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/sha256: add tests for Size() and BlockSize()
authorShawn Smith <shawn.p.smith@gmail.com>
Tue, 31 Dec 2013 20:46:00 +0000 (07:46 +1100)
committerDave Cheney <dave@cheney.net>
Tue, 31 Dec 2013 20:46:00 +0000 (07:46 +1100)
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46470043

src/pkg/crypto/sha256/sha256_test.go

index bb1ec3b162675d3d32edc9506e6063e42ba3bc23..1d883d39059577224fd98faa37c1f80c0f353221 100644 (file)
@@ -132,6 +132,24 @@ func TestGolden(t *testing.T) {
        }
 }
 
+func TestSize(t *testing.T) {
+       c := New()
+       if got := c.Size(); got != Size {
+               t.Errorf("Size = %d; want %d", got, Size)
+       }
+       c = New224()
+       if got := c.Size(); got != Size224 {
+               t.Errorf("New224.Size = %d; want %d", got, Size224)
+       }
+}
+
+func TestBlockSize(t *testing.T) {
+       c := New()
+       if got := c.BlockSize(); got != BlockSize {
+               t.Errorf("BlockSize = %d want %d", got, BlockSize)
+       }
+}
+
 var bench = New()
 var buf = make([]byte, 8192)