mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes: delete the test for huge buffers
It takes too much memory to be reliable and causes trouble on 32-bit machines. Sigh. Fixes #2756. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5567043
This commit is contained in:
parent
e17afa4d0c
commit
87079cc14c
1 changed files with 0 additions and 21 deletions
|
|
@ -386,24 +386,3 @@ func TestReadEmptyAtEOF(t *testing.T) {
|
||||||
t.Errorf("wrong count; got %d want 0", n)
|
t.Errorf("wrong count; got %d want 0", n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestHuge(t *testing.T) {
|
|
||||||
// About to use tons of memory, so avoid for simple installation testing.
|
|
||||||
if testing.Short() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// We expect a panic.
|
|
||||||
defer func() {
|
|
||||||
if err, ok := recover().(error); ok && err == ErrTooLarge {
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
t.Error(`expected "too large" error; got`, err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
b := new(Buffer)
|
|
||||||
big := make([]byte, 500e6)
|
|
||||||
for i := 0; i < 1000; i++ {
|
|
||||||
b.Write(big)
|
|
||||||
}
|
|
||||||
t.Error("panic expected")
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue