Check-in [de59e55104]
Overview
Comment:Added regression suite tests for small zip files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:de59e55104edeffcc09046067ebb85b8eadd95c2
User & Date: rkeene on 2010-09-28 22:03:23
Other Links: manifest | tags
Context
2010-09-28
22:10
Updated vfs::zip tests to require zip::vfs package check-in: fedad6f886 user: rkeene tags: trunk
22:03
Added regression suite tests for small zip files check-in: de59e55104 user: rkeene tags: trunk
21:52
Fixed issue with vfs::zip opening zip files smaller than 512b, fixes issue [0c5bcad642] check-in: c0cb33bec5 user: rkeene tags: trunk
Changes

Added build/test/tests/09-smallzip-nobase.sh version [6b8d43f5fd].

            1  +#! /bin/bash
            2  +
            3  +TMPFILE="${TMPDIR:-/tmp}/testzip-$$${RANDOM}${RANDOM}${RANDOM}.zip"
            4  +export TMPFILE
            5  +
            6  +cat << \__EOF__ | base64 -d > "${TMPFILE}"
            7  +IyEvdXNyL2Jpbi9lbnYgdGNsa2l0CiMgVGhpcyBpcyBhIHppcC1iYXNlZCBUY2wgTW9kdWxlCnBh
            8  +Y2thZ2UgcmVxdWlyZSB2ZnM6OnppcAp2ZnM6OnppcDo6TW91bnQgW2luZm8gc2NyaXB0XSBbaW5m
            9  +byBzY3JpcHRdCmlmIHtbZmlsZSBleGlzdHMgW2ZpbGUgam9pbiBbaW5mbyBzY3JpcHRdIG1haW4u
           10  +dGNsXV19IHsKICAgIHNvdXJjZSBbZmlsZSBqb2luIFtpbmZvIHNjcmlwdF0gbWFpbi50Y2xdCn0K
           11  +GlBLAwQUAAAIAABMfzw9CG+kfTQAAAA0AAAACAAAAG1haW4udGNsIyEgL3Vzci9iaW4vZW52IHRj
           12  +bHNoCgpwdXRzICJIZWxsbyBXb3JsZCEiCgpleGl0IDAgClBLAQIXAxQAAAgAAEx/PD0Ib6R9NAAA
           13  +ADQAAAAIAAAAAAAAAAEAIAC2geUAAABtYWluLnRjbFBLBQYAAAAAAQABADYAAAA/AQAAAAA=
           14  +__EOF__

Added build/test/tests/09-smallzip-nobase.tcl version [ff8c61f8fa].

            1  +#! /usr/bin/env tclsh
            2  +
            3  +# Abort if we cant read the tmpfile path from the environment
            4  +if {![info exists ::env(TMPFILE)]} {
            5  +	exit 0
            6  +}
            7  +
            8  +set tmpfile $::env(TMPFILE)
            9  +
           10  +vfs::zip::Mount $tmpfile $tmpfile
           11  +
           12  +set fd [open [file join $tmpfile main.tcl]]
           13  +set data [read $fd]
           14  +close $fd
           15  +
           16  +catch {
           17  +	vfs::unmount $tmpfile
           18  +}
           19  +
           20  +catch {
           21  +	file delete -force -- $tmpfile
           22  +}
           23  +
           24  +if {[string match "*Hello World*" $data]} {
           25  +	exit 0
           26  +}
           27  +
           28  +puts "Got:              $data"
           29  +puts "Expected (match): *Hello World*"
           30  +
           31  +exit 1

Added build/test/tests/10-smallzip-withbase.sh version [dac12cd6f6].

            1  +#! /bin/bash
            2  +
            3  +TMPFILE="${TMPDIR:-/tmp}/testzip-$$${RANDOM}${RANDOM}${RANDOM}.zip"
            4  +export TMPFILE
            5  +
            6  +cat << \__EOF__ | base64 -d > "${TMPFILE}"
            7  +IyEgL3Vzci9iaW4vZW52IHRjbHNoCgpwYWNrYWdlIHJlcXVpcmUgdmZzOjp6aXAKdmZzOjp6aXA6
            8  +Ok1vdW50IFtpbmZvIHNjcmlwdF0gW2luZm8gc2NyaXB0XQpzb3VyY2UgW2ZpbGUgam9pbiBbaW5m
            9  +byBzY3JpcHRdIG1haW4udGNsXQoKcmV0dXJuClBLAwQKAAAAAABNfzw9CG+kfTQAAAA0AAAACAAc
           10  +AG1haW4udGNsVVQJAAPxVqJM8VaiTHV4CwABBPMDAAAEZAAAACMhIC91c3IvYmluL2VudiB0Y2xz
           11  +aAoKcHV0cyAiSGVsbG8gV29ybGQhIgoKZXhpdCAwIApQSwECHgMKAAAAAABNfzw9CG+kfTQAAAA0
           12  +AAAACAAYAAAAAAABAAAApIEAAAAAbWFpbi50Y2xVVAUAA/FWokx1eAsAAQTzAwAABGQAAABQSwUG
           13  +AAAAAAEAAQBOAAAAdgAAAAAA
           14  +__EOF__

Added build/test/tests/10-smallzip-withbase.tcl version [ff8c61f8fa].

            1  +#! /usr/bin/env tclsh
            2  +
            3  +# Abort if we cant read the tmpfile path from the environment
            4  +if {![info exists ::env(TMPFILE)]} {
            5  +	exit 0
            6  +}
            7  +
            8  +set tmpfile $::env(TMPFILE)
            9  +
           10  +vfs::zip::Mount $tmpfile $tmpfile
           11  +
           12  +set fd [open [file join $tmpfile main.tcl]]
           13  +set data [read $fd]
           14  +close $fd
           15  +
           16  +catch {
           17  +	vfs::unmount $tmpfile
           18  +}
           19  +
           20  +catch {
           21  +	file delete -force -- $tmpfile
           22  +}
           23  +
           24  +if {[string match "*Hello World*" $data]} {
           25  +	exit 0
           26  +}
           27  +
           28  +puts "Got:              $data"
           29  +puts "Expected (match): *Hello World*"
           30  +
           31  +exit 1