diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-09-06 18:12:46 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-06 18:12:46 +0000 |
commit | aa8901e9bb0399d2c16f988ba2fe46eb0c0c5d13 (patch) | |
tree | 7e63b06d1eec92beec6997c9d3ab47a5d6a835be /libgo/go/compress | |
parent | 920ea3b8ba3164b61ac9490dfdfceb6936eda6dd (diff) | |
download | gcc-aa8901e9bb0399d2c16f988ba2fe46eb0c0c5d13.zip gcc-aa8901e9bb0399d2c16f988ba2fe46eb0c0c5d13.tar.gz gcc-aa8901e9bb0399d2c16f988ba2fe46eb0c0c5d13.tar.bz2 |
libgo: update to Go 1.13beta1 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/193497
From-SVN: r275473
Diffstat (limited to 'libgo/go/compress')
-rw-r--r-- | libgo/go/compress/flate/deflate_test.go | 8 | ||||
-rw-r--r-- | libgo/go/compress/flate/huffman_bit_writer.go | 6 | ||||
-rw-r--r-- | libgo/go/compress/gzip/gunzip.go | 4 | ||||
-rw-r--r-- | libgo/go/compress/gzip/gzip_test.go | 3 |
4 files changed, 15 insertions, 6 deletions
diff --git a/libgo/go/compress/flate/deflate_test.go b/libgo/go/compress/flate/deflate_test.go index 034040e..4288f62 100644 --- a/libgo/go/compress/flate/deflate_test.go +++ b/libgo/go/compress/flate/deflate_test.go @@ -161,7 +161,7 @@ func TestVeryLongSparseChunk(t *testing.T) { t.Errorf("NewWriter: %v", err) return } - if _, err = io.Copy(w, &sparseReader{l: 23E8}); err != nil { + if _, err = io.Copy(w, &sparseReader{l: 23e8}); err != nil { t.Errorf("Compress failed: %v", err) return } @@ -345,6 +345,9 @@ func testToFromWithLimit(t *testing.T, input []byte, name string, limit [11]int) func TestDeflateInflate(t *testing.T) { t.Parallel() for i, h := range deflateInflateTests { + if testing.Short() && len(h.in) > 10000 { + continue + } testToFromWithLimit(t, h.in, fmt.Sprintf("#%d", i), [11]int{}) } } @@ -591,6 +594,9 @@ func TestBestSpeed(t *testing.T) { } for i, tc := range testCases { + if i >= 3 && testing.Short() { + break + } for _, firstN := range []int{1, 65534, 65535, 65536, 65537, 131072} { tc[0] = firstN outer: diff --git a/libgo/go/compress/flate/huffman_bit_writer.go b/libgo/go/compress/flate/huffman_bit_writer.go index f42a921..3e19061 100644 --- a/libgo/go/compress/flate/huffman_bit_writer.go +++ b/libgo/go/compress/flate/huffman_bit_writer.go @@ -609,10 +609,10 @@ func (w *huffmanBitWriter) writeTokens(tokens []token, leCodes, oeCodes []hcode) var huffOffset *huffmanEncoder func init() { - w := newHuffmanBitWriter(nil) - w.offsetFreq[0] = 1 + offsetFreq := make([]int32, offsetCodeCount) + offsetFreq[0] = 1 huffOffset = newHuffmanEncoder(offsetCodeCount) - huffOffset.generate(w.offsetFreq, 15) + huffOffset.generate(offsetFreq, 15) } // writeBlockHuff encodes a block of bytes as either diff --git a/libgo/go/compress/gzip/gunzip.go b/libgo/go/compress/gzip/gunzip.go index 85d52e8..924bce1 100644 --- a/libgo/go/compress/gzip/gunzip.go +++ b/libgo/go/compress/gzip/gunzip.go @@ -126,8 +126,8 @@ func (z *Reader) Reset(r io.Reader) error { // can be useful when reading file formats that distinguish individual gzip // data streams or mix gzip data streams with other data streams. // In this mode, when the Reader reaches the end of the data stream, -// Read returns io.EOF. If the underlying reader implements io.ByteReader, -// it will be left positioned just after the gzip stream. +// Read returns io.EOF. The underlying reader must implement io.ByteReader +// in order to be left positioned just after the gzip stream. // To start the next stream, call z.Reset(r) followed by z.Multistream(false). // If there is no next stream, z.Reset(r) will return io.EOF. func (z *Reader) Multistream(ok bool) { diff --git a/libgo/go/compress/gzip/gzip_test.go b/libgo/go/compress/gzip/gzip_test.go index e16aba1..f18c5cb 100644 --- a/libgo/go/compress/gzip/gzip_test.go +++ b/libgo/go/compress/gzip/gzip_test.go @@ -214,6 +214,9 @@ func TestConcat(t *testing.T) { w.Close() r, err := NewReader(&buf) + if err != nil { + t.Fatal(err) + } data, err := ioutil.ReadAll(r) if string(data) != "hello world\n" || err != nil { t.Fatalf("ReadAll = %q, %v, want %q, nil", data, err, "hello world") |