mirror of https://github.com/golang/go.git
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:
parent
8f3fc547d0
commit
e3040e2bba
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue