From 4b74451f9e9b976a2a0984130662f58bd39e1478 Mon Sep 17 00:00:00 2001 From: Joshua MacDonald Date: Fri, 27 Nov 2015 23:01:59 -0800 Subject: Regtest work --- xdelta3/go/src/xdelta/rstream.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 67d23e6..eafcfeb 100644 --- a/xdelta3/go/src/xdelta/rstream.go +++ b/xdelta3/go/src/xdelta/rstream.go @@ -7,15 +7,15 @@ import ( ) const ( - blocksize = 16380 + blocksize = 1<<20 ) -func WriteRstreams(t *TestGroup, desc string, seed, offset, len int64, +func WriteRstreams(t *TestGroup, seed, offset, len int64, src, tgt io.WriteCloser) { - t.Go("src-write:"+desc, func (g Goroutine) { + t.Go("src-write", func (g Goroutine) { writeOne(g, seed, 0, len, src, false) }) - t.Go("tgt-write:"+desc, func (g Goroutine) { + t.Go("tgt-write", func (g Goroutine) { writeOne(g, seed, offset, len, tgt, true) }) } @@ -60,9 +60,9 @@ func writeRand(r *rand.Rand, len int64, s io.Writer) error { } func fillRand(r *rand.Rand, blk []byte) { - for p := 0; p < blocksize; { + for p := 0; p < len(blk); { v := r.Int63() - for i := 7; i != 0; i-- { + for i := 7; i != 0 && p < len(blk); i-- { blk[p] = byte(v) p++ v >>= 8 -- cgit v1.2.3