(askedSize int32, dataSize int)
| 117 | } |
| 118 | |
| 119 | func generateSafeReadBytesBenchmark(askedSize int32, dataSize int) func(b *testing.B) { |
| 120 | return func(b *testing.B) { |
| 121 | data := make([]byte, dataSize) |
| 122 | b.ResetTimer() |
| 123 | for range b.N { |
| 124 | safeReadBytes(askedSize, bytes.NewReader(data)) |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | func TestSafeReadBytesAlloc(t *testing.T) { |
| 130 | if testing.Short() { |
no test coverage detected