From 9586b8668bc752d306f9809dcf74e955331e2f8e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 5 Jun 2009 10:59:37 -0700 Subject: fix 386 malloc tests, detect 386 darwin breakpoint line. R=r DELTA=22 (4 added, 0 deleted, 18 changed) OCL=29929 CL=29944 --- test/mallocrep.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/mallocrep.go') diff --git a/test/mallocrep.go b/test/mallocrep.go index 6aa8fdf8c..6306e59eb 100644 --- a/test/mallocrep.go +++ b/test/mallocrep.go @@ -36,11 +36,14 @@ func main() { if i == 0 && *chatty { println("First alloc:", j); } - b := malloc.Alloc(uint64(j)); + if a := malloc.GetStats().Alloc; a != 0 { + panicln("no allocations but stats report", a, "bytes allocated"); + } + b := malloc.Alloc(uintptr(j)); during := malloc.GetStats().Alloc; malloc.Free(b); if a := malloc.GetStats().Alloc; a != 0 { - panicln("malloc wrong count", a, "after", j, "during", during); + panic("allocated ", j, ": wrong stats: during=", during, " after=", a, " (want 0)"); } bigger(); } -- cgit v1.2.3