Commit 6a9ca360 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

In TestReadLargeMemCheck, allow for more memory use on 64 bit

platform.
parent d0f58fe6
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
"syscall" "syscall"
"testing" "testing"
"time" "time"
"unsafe"
) )
var _ = strings.Join var _ = strings.Join
...@@ -537,7 +538,7 @@ func TestReadZero(t *testing.T) { ...@@ -537,7 +538,7 @@ func TestReadZero(t *testing.T) {
func RandomData(size int) []byte { func RandomData(size int) []byte {
// Make blocks that are not period on 1024 bytes, so we can // Make blocks that are not period on 1024 bytes, so we can
// catch errors due to misalignments. // catch errors due to misalignments.
block := make([]byte, 1023) block := make([]byte, 1023)
content := make([]byte, size) content := make([]byte, size)
for i := range block { for i := range block {
...@@ -601,6 +602,9 @@ func TestReadLargeMemCheck(t *testing.T) { ...@@ -601,6 +602,9 @@ func TestReadLargeMemCheck(t *testing.T) {
delta = (delta - 40000) / N delta = (delta - 40000) / N
limit := 5000 limit := 5000
if unsafe.Sizeof(uintptr(0)) == 8 {
limit = 10000
}
if delta > limit { if delta > limit {
t.Errorf("bytes per loop: %d, limit %d", delta, limit) t.Errorf("bytes per loop: %d, limit %d", delta, limit)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment