diff options
| author | Rob Pike <r@golang.org> | 2010-03-24 16:46:53 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2010-03-24 16:46:53 -0700 |
| commit | 325cf8ef217b4e9ae2caf53fa0d4534cd5003bd8 (patch) | |
| tree | 72405fbc32b0bef0850cac2797f818bccc12b44e /test/mallocrep1.go | |
| parent | acfd6d5f055ca5283dff5de16390c1d0cfc9f0ca (diff) | |
| download | go-325cf8ef217b4e9ae2caf53fa0d4534cd5003bd8.tar.xz | |
delete all uses of panicln by rewriting them using panic or,
in the tests, println+panic.
gofmt some tests too.
R=rsc
CC=golang-dev
https://golang.org/cl/741041
Diffstat (limited to 'test/mallocrep1.go')
| -rw-r--r-- | test/mallocrep1.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/mallocrep1.go b/test/mallocrep1.go index 99cdcfb85f..eb67bed86b 100644 --- a/test/mallocrep1.go +++ b/test/mallocrep1.go @@ -47,10 +47,12 @@ func AllocAndFree(size, count int) { b[i] = runtime.Alloc(uintptr(size)) base, n := runtime.Lookup(b[i]) if base != b[i] || !OkAmount(uintptr(size), n) { - panicln("lookup failed: got", base, n, "for", b[i]) + println("lookup failed: got", base, n, "for", b[i]) + panic("fail") } if runtime.MemStats.Sys > 1e9 { - panicln("too much memory allocated") + println("too much memory allocated") + panic("fail") } } n2 := stats.Alloc @@ -66,14 +68,17 @@ func AllocAndFree(size, count int) { alloc := uintptr(stats.Alloc) base, n := runtime.Lookup(b[i]) if base != b[i] || !OkAmount(uintptr(size), n) { - panicln("lookup failed: got", base, n, "for", b[i]) + println("lookup failed: got", base, n, "for", b[i]) + panic("fail") } runtime.Free(b[i]) if stats.Alloc != uint64(alloc-n) { - panicln("free alloc got", stats.Alloc, "expected", alloc-n, "after free of", n) + println("free alloc got", stats.Alloc, "expected", alloc-n, "after free of", n) + panic("fail") } if runtime.MemStats.Sys > 1e9 { - panicln("too much memory allocated") + println("too much memory allocated") + panic("fail") } } n4 := stats.Alloc @@ -82,7 +87,8 @@ func AllocAndFree(size, count int) { fmt.Printf("size=%d count=%d stats=%+v\n", size, count, *stats) } if n2-n1 != n3-n4 { - panicln("wrong alloc count: ", n2-n1, n3-n4) + println("wrong alloc count: ", n2-n1, n3-n4) + panic("fail") } } |
