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

src/pkg/crypto/sha1/sha1_test.go

index c3868d702accc61b5f2f633be8d1a7ddeb80d7c5..6d2a9f24dcb9966ecb4f454b2fddd44a73a17d09 100644 (file)
@@ -76,6 +76,20 @@ 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)
+       }
+}
+
+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)