crypto/sha256: add tests for Size() and BlockSize()

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46470043
This commit is contained in:
Shawn Smith 2014-01-01 07:46:00 +11:00 committed by Dave Cheney
parent 8f3fc547d0
commit e3040e2bba
1 changed files with 18 additions and 0 deletions

View 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)