]> Cypherpunks repositories - gostls13.git/commit
encoding: fix endless loop in TestDecoderBuffering
authorMark Ryan <mark.d.ryan@intel.com>
Fri, 16 Jun 2017 10:34:28 +0000 (11:34 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 16 Jun 2017 14:53:17 +0000 (14:53 +0000)
commit3e0c21e0335f5ec01ea13a86e1fd32ee066f369d
treecdfdf712a0ae1a02e9931e21d25b5e4805a42fcf
parentc52aca1c761f724c3192ee0ac4f4a19754fc5948
encoding: fix endless loop in TestDecoderBuffering

The ascii85, base32 and base64 packages all contain a test called
TestDecoderBuffering.  Each of these tests contain a loop that ignores
the error returned from the Read method of their decoders.  The result
being that the tests loop for ever if the decoders actually return an
error.  This commit fixes the issue by terminating the loops if an error
occurs and failing the tests with a suitable error message.

Change-Id: Idb385673cf9f3f6f8befe4288b4be366ab0985fd
Reviewed-on: https://go-review.googlesource.com/46010
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/ascii85/ascii85_test.go
src/encoding/base32/base32_test.go
src/encoding/base64/base64_test.go