]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: add Encode-Decode Int slices tests
authorAlberto Donizetti <alb.donizetti@gmail.com>
Mon, 13 Mar 2017 19:35:07 +0000 (20:35 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 13 Mar 2017 20:22:39 +0000 (20:22 +0000)
commit2e7c3b3f555853202fe0bdf2ea5ce37d7a56a7f7
tree91854e14d175016b6b1131337b98f71a7c96e378
parent08d8d5c986cd11951a6c2eb76587d4ec3ea9ecc7
encoding/gob: add Encode-Decode Int slices tests

Tinkering with the gob package shows that is currently possible to
*completely destroy* Int slices encoding without triggering a single
test failure.

The various encInt{8,16,32,64}Slice methods are only called during the
execution of the GobMapInterfaceEncode test, which only encodes a few
slices of length exactly 1 and then just checks that the error
returned by Encode is nil (without trying to Decode back the data).

This patch adds a few tests for signed integer slices encoding.

Change-Id: Ifaaee2f32132873118b241f79aa8203e4ad31416
Reviewed-on: https://go-review.googlesource.com/38066
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/gob/encoder_test.go