From 6d9ad86987f926068d0d4d503c4c23efa7af511f Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Wed, 2 Dec 2015 22:06:38 -0800 Subject: Fixes regtest.go running against xdelta3 head --- xdelta3/go/src/xdelta/rstream.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'xdelta3/go/src/xdelta/rstream.go') diff --git a/xdelta3/go/src/xdelta/rstream.go b/xdelta3/go/src/xdelta/rstream.go index 7d205c6..9481f22 100644 --- a/xdelta3/go/src/xdelta/rstream.go +++ b/xdelta3/go/src/xdelta/rstream.go @@ -13,15 +13,15 @@ const ( func (t *TestGroup) WriteRstreams(desc string, seed, offset, len int64, src, tgt io.WriteCloser) { - t.Go("src-write:"+desc, func (g Goroutine) { + t.Go("src-write:"+desc, func (g *Goroutine) { writeOne(g, seed, 0, len, src, false) }) - t.Go("tgt-write:"+desc, func (g Goroutine) { + t.Go("tgt-write:"+desc, func (g *Goroutine) { writeOne(g, seed, offset, len, tgt, true) }) } -func writeOne(g Goroutine, seed, offset, len int64, stream io.WriteCloser, readall bool) { +func writeOne(g *Goroutine, seed, offset, len int64, stream io.WriteCloser, readall bool) { if !readall { // Allow the source-read to fail or block until the process terminates. // This behavior is reserved for the decoder, which is not required to @@ -40,27 +40,23 @@ func writeOne(g Goroutine, seed, offset, len int64, stream io.WriteCloser, reada len - offset, stream); err != nil { g.Panic(err) } - fmt.Println(g, "closing", len) if err := stream.Close(); err != nil { g.Panic(err) } g.OK() } -func writeRand(g Goroutine, r *rand.Rand, len int64, s io.Writer) error { +func writeRand(g *Goroutine, r *rand.Rand, len int64, s io.Writer) error { blk := make([]byte, blocksize) - fmt.Println(g, "rstream", len) for len > 0 { fillRand(r, blk) c := blocksize if len < blocksize { c = int(len) } - fmt.Println(g, "writing...", c, s) if _, err := s.Write(blk[0:c]); err != nil { return err } - fmt.Println(g, "...written", c) len -= int64(c) } return nil -- cgit v1.2.3