diff options
author | sebres <sebres@users.sourceforge.net> | 2017-03-06 20:19:39 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-03-06 20:19:39 (GMT) |
commit | a307956de52eb22f4299959a93df2172b8a40b23 (patch) | |
tree | e533d7a219281f35c1f76db707b49db9f39a6946 /tests/zlib.test | |
parent | d5c91a755cafe40630668464ed4e070fdd647852 (diff) | |
parent | ae0c48521551ffe6af28967e0c3b848836fb632e (diff) | |
download | tcl-a307956de52eb22f4299959a93df2172b8a40b23.zip tcl-a307956de52eb22f4299959a93df2172b8a40b23.tar.gz tcl-a307956de52eb22f4299959a93df2172b8a40b23.tar.bz2 |
merge trunk
Diffstat (limited to 'tests/zlib.test')
-rw-r--r-- | tests/zlib.test | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/tests/zlib.test b/tests/zlib.test index ae8742b..63bac7e 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -157,6 +157,48 @@ test zlib-7.8 {zlib stream: Bug b26e38a3e4} -constraints zlib -setup { catch {$strm close} unset -nocomplain randdata data } -result {120185 18003000} +test zlib-7.9 {zlib stream finalize (bug 25842c161)} -constraints zlib -setup { + set z1 [zlib stream gzip] + set z2 [zlib stream gzip] +} -body { + $z1 put ABCDEedbca.. + $z1 finalize + zlib gunzip [$z1 get] +} -cleanup { + $z1 close +} -result ABCDEedbca.. +test zlib-7.10 {zlib stream finalize (bug 25842c161)} -constraints zlib -setup { + set z2 [zlib stream gzip] +} -body { + $z2 put -finalize ABCDEedbca.. + zlib gunzip [$z2 get] +} -cleanup { + $z2 close +} -result ABCDEedbca.. +test zlib-7.11 {zlib stream put -finalize (bug 25842c161)} -constraints zlib -setup { + set c [zlib stream gzip] + set d [zlib stream gunzip] +} -body { + $c put abcdeEDCBA.. + $c finalize + $d put [$c get] + $d finalize + $d get +} -cleanup { + $c close + $d close +} -result abcdeEDCBA.. +test zlib-7.12 {zlib stream put; zlib stream finalize (bug 25842c161)} -constraints zlib -setup { + set c [zlib stream gzip] + set d [zlib stream gunzip] +} -body { + $c put -finalize abcdeEDCBA.. + $d put -finalize [$c get] + $d get +} -cleanup { + $c close + $d close +} -result abcdeEDCBA.. test zlib-8.1 {zlib transformation} -constraints zlib -setup { set file [makeFile {} test.gz] @@ -269,7 +311,7 @@ test zlib-8.8 {transformation and fconfigure} -setup { lassign [chan pipe] inSide outSide } -constraints zlib -body { zlib push compress $outSide -dictionary $spdyDict - fconfigure $outSide -blocking 0 -translation binary -buffering none + fconfigure $outSide -blocking 1 -translation binary -buffering none fconfigure $inSide -blocking 1 -translation binary puts -nonewline $outSide $spdyHeaders chan pop $outSide @@ -466,6 +508,7 @@ test zlib-9.2 "socket fcopy with push" -constraints zlib -setup { chan configure $c -translation binary -buffering none -blocking 0 puts -nonewline $c [zlib gzip [string repeat a 81920]] close $c + set ::total -1 }}} 0] set file [makeFile {} test.gz] } -body { @@ -473,7 +516,10 @@ test zlib-9.2 "socket fcopy with push" -constraints zlib -setup { set sin [socket $addr $port] chan configure $sin -translation binary zlib push gunzip $sin - update + after 1000 {set ::total timeout} + vwait ::total + after cancel {set ::total timeout} + if {$::total != -1} {error "unexpected value $::total of ::total"} set total [fcopy $sin [set fout [open $file wb]]] close $sin close $fout |