diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2016-10-30 05:05:46 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2016-10-30 05:05:46 (GMT) |
commit | 45a4c375a86403b18e66a8401235bf8a3a53f867 (patch) | |
tree | f8c263b16e871e11acf0848cbce5457da1ed0961 /tests | |
parent | dff4ed85a2e6fac50d5e9d7caee4a7f1dffcd835 (diff) | |
parent | 51bce8152fb964591bf095135d365d1586291d1c (diff) | |
download | tcl-45a4c375a86403b18e66a8401235bf8a3a53f867.zip tcl-45a4c375a86403b18e66a8401235bf8a3a53f867.tar.gz tcl-45a4c375a86403b18e66a8401235bf8a3a53f867.tar.bz2 |
[b26e38a3e4] Ensure that compressing streams manage buffers correctly in all cases.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zlib.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/zlib.test b/tests/zlib.test index 15dbb34..ae8742b 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -138,6 +138,25 @@ test zlib-7.7 {zlib stream: Bug 25842c161} -constraints zlib -body { } -cleanup { catch {$s close} } -result "" +# Also causes Tk Bug 10f2e7872b +test zlib-7.8 {zlib stream: Bug b26e38a3e4} -constraints zlib -setup { + expr srand(12345) + set randdata {} + for {set i 0} {$i<6001} {incr i} { + append randdata [binary format c [expr {int(256*rand())}]] + } +} -body { + set strm [zlib stream compress] + for {set i 1} {$i<3000} {incr i} { + $strm put $randdata + } + $strm put -finalize $randdata + set data [$strm get] + list [string length $data] [string length [zlib decompress $data]] +} -cleanup { + catch {$strm close} + unset -nocomplain randdata data +} -result {120185 18003000} test zlib-8.1 {zlib transformation} -constraints zlib -setup { set file [makeFile {} test.gz] |