open-vault/vault/util_test.go
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

22 lines
363 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package vault
import "testing"
func TestMemZero(t *testing.T) {
b := []byte{1, 2, 3, 4}
memzero(b)
if b[0] != 0 || b[1] != 0 || b[2] != 0 || b[3] != 0 {
t.Fatalf("bad: %v", b)
}
}
func TestRandBytes(t *testing.T) {
b := randbytes(12)
if len(b) != 12 {
t.Fatalf("bad: %v", b)
}
}