prysm-pulse/shared/memorypool/memorypool_test.go
Nishant Das 3d12322103
Use Memory Pool for Randao Mixes (#4896)
* add mem pool

* use mem pool

* Update shared/memorypool/memorypool.go

Co-Authored-By: terence tsao <terence@prysmaticlabs.com>

* Update shared/memorypool/memorypool.go

Co-Authored-By: terence tsao <terence@prysmaticlabs.com>

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2020-02-18 08:25:39 +08:00

17 lines
372 B
Go

package memorypool
import (
"testing"
)
func TestRoundTripMemoryRetrieval(t *testing.T) {
byteSlice := make([][]byte, 1000)
PutDoubleByteSlice(byteSlice)
newSlice := GetDoubleByteSlice(1000)
if len(newSlice) != 1000 {
t.Errorf("Wanted same slice object, but got different object. "+
"Wanted slice with length %d but got length %d", 1000, len(newSlice))
}
}