summaryrefslogtreecommitdiff
path: root/libgo/go/compress/zlib/reader_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/compress/zlib/reader_test.go')
-rw-r--r--libgo/go/compress/zlib/reader_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/libgo/go/compress/zlib/reader_test.go b/libgo/go/compress/zlib/reader_test.go
index 218ccba1411..449f4460bcd 100644
--- a/libgo/go/compress/zlib/reader_test.go
+++ b/libgo/go/compress/zlib/reader_test.go
@@ -23,6 +23,30 @@ type zlibTest struct {
var zlibTests = []zlibTest{
{
+ "truncated empty",
+ "",
+ []byte{},
+ nil,
+ io.ErrUnexpectedEOF,
+ },
+ {
+ "truncated dict",
+ "",
+ []byte{0x78, 0xbb},
+ []byte{0x00},
+ io.ErrUnexpectedEOF,
+ },
+ {
+ "truncated checksum",
+ "",
+ []byte{0x78, 0xbb, 0x00, 0x01, 0x00, 0x01, 0xca, 0x48,
+ 0xcd, 0xc9, 0xc9, 0xd7, 0x51, 0x28, 0xcf, 0x2f,
+ 0xca, 0x49, 0x01, 0x04, 0x00, 0x00, 0xff, 0xff,
+ },
+ []byte{0x00},
+ io.ErrUnexpectedEOF,
+ },
+ {
"empty",
"",
[]byte{0x78, 0x9c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01},