Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Move many tests assets into a proper subdir of the module. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | test-assets |
Files: | files | file ages | folders |
SHA3-256: |
af0b003dadc0e96954971a4e75777c65 |
User & Date: | andreask 2019-06-21 00:04:27.227 |
2019-06-21
| ||
05:05 | Reworked the amazon-s3 test setup to check for and tell about the AWS authentication requirements it has. check-in: c17997785d user: aku tags: test-assets | |
00:04 | Move many tests assets into a proper subdir of the module. check-in: af0b003dad user: andreask tags: test-assets | |
00:03 | mime - B, T, version bumped to 1.6.2. - Fixed missing export of documented `buildmessage` command through the mime ensemble. - Shifted asset access support in tests to general utilities. check-in: a6f1dc74fe user: andreask tags: trunk | |
1 2 3 | # -*- tcl -*- # bee.test: tests for the bee encoding. # | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 | # -*- tcl -*- # bee.test: tests for the bee encoding. # # Copyright (c) 2004,2018 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
303 304 305 306 307 308 309 | } test bee-12.0 {decoder, torrent file} { set end 0 # tcltest::viewFile does not do binary :( | | | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | } test bee-12.0 {decoder, torrent file} { set end 0 # tcltest::viewFile does not do binary :( set f [open [asset example.torrent] r] fconfigure $f -translation binary set d [read $f] close $f set data [bee::decode $d end] # Cut the binary stuff out of the result, to much, display problems |
︙ | ︙ | |||
378 379 380 381 382 383 384 | removeFile bee16.$n set res } [lrange $result 0 1] ; # {} } # ....... ............................................................ testsuiteCleanup | > | 376 377 378 379 380 381 382 383 | removeFile bee16.$n set res } [lrange $result 0 1] ; # {} } # ....... ............................................................ testsuiteCleanup return |
cannot compute difference between binary files
1 2 3 4 5 | # -*- tcl -*- # bibtex.test: tests for the bibtex parser. # # Copyright (c) 2005 by Andreas Kupries <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 | # -*- tcl -*- # bibtex.test: tests for the bibtex parser. # # Copyright (c) 2005 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
108 109 110 111 112 113 114 | year 1990 \ pages 471--478 \ address {Boston, MA} \ ]]] test bibtex-2.0 {Parse string, direct result} { | | | | | | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | year 1990 \ pages 471--478 \ address {Boston, MA} \ ]]] test bibtex-2.0 {Parse string, direct result} { set str [viewFile [asset bytecode.bib]] bibtex::parse $str } $bytecode test bibtex-2.1 {Parse string, sax mode} { set track {} set str [viewFile [asset bytecode.bib]] set t [bibtex::parse \ -progresscommand {track progress} \ -commentcommand {track comment_} \ -stringcommand {track string__} \ -preamblecommand {track preamble} \ -recordcommand {track record__} \ $str] bibtex::destroy $t list $t $track } [list bibtex2 [list \ {progress bibtex2 100} \ [linsert [lindex $bytecode 0] 0 record__ bibtex2] ]] test bibtex-2.2 {Parse channel, direct result} { # The contents of penn_sub.bib have been taken out of # ftp://ftp.cis.upenn.edu/pub/anoop/bib/pennbib.bib set chan [open [asset penn_sub.bib] r] set records [bibtex::parse -channel $chan] close $chan set records } $pennfull test bibtex-2.3 {Parse channel, sax mode} { set track {} set chan [open [asset penn_sub.bib] r] set t [bibtex::parse \ -progresscommand {track progress} \ -commentcommand {track comment_} \ -stringcommand {track string__} \ -preamblecommand {track preamble} \ -recordcommand {track record__} \ |
︙ | ︙ | |||
164 165 166 167 168 169 170 | {string__ bibtex4 {aaai90 {Proc. National Conference on Artificial Intelligence, Boston}}} \ {progress bibtex4 100} \ [linsert [lindex $penn 0] 0 record__ bibtex4] \ ] test bibtex-2.4 {Parse channel, sax mode 2} { set track {} | | | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | {string__ bibtex4 {aaai90 {Proc. National Conference on Artificial Intelligence, Boston}}} \ {progress bibtex4 100} \ [linsert [lindex $penn 0] 0 record__ bibtex4] \ ] test bibtex-2.4 {Parse channel, sax mode 2} { set track {} set chan [open [asset penn_sub.bib] r] set t [bibtex::parse \ -progresscommand {track progress} \ -commentcommand {track comment_} \ -stringcommand addstr \ -preamblecommand {track preamble} \ -recordcommand {track record__} \ |
︙ | ︙ | |||
188 189 190 191 192 193 194 | [linsert [lindex $pennfull 0] 0 record__ bibtex5] \ ] test bibtex-2.5 {Parse channel, async} { # The contents of penn_sub.bib have been taken out of # ftp://ftp.cis.upenn.edu/pub/anoop/bib/pennbib.bib | | | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | [linsert [lindex $pennfull 0] 0 record__ bibtex5] \ ] test bibtex-2.5 {Parse channel, async} { # The contents of penn_sub.bib have been taken out of # ftp://ftp.cis.upenn.edu/pub/anoop/bib/pennbib.bib set chan [open [asset penn_sub.bib] r] proc done {args} {global done ; set done $args ; return} set done "" set t [bibtex::parse -command done -channel $chan] vwait ::done bibtex::destroy $t close $chan |
︙ | ︙ | |||
217 218 219 220 221 222 223 | test bibtex-3.2 {Destroying a parser} { set code [catch {::bibtex::destroy foo} msg] list $code $msg } {1 {Illegal bibtex parser "foo"}} test bibtex-4.0 {Destroying a parser} { | | | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | test bibtex-3.2 {Destroying a parser} { set code [catch {::bibtex::destroy foo} msg] list $code $msg } {1 {Illegal bibtex parser "foo"}} test bibtex-4.0 {Destroying a parser} { set chan [open [asset bytecode.bib] r] proc done {args} {global done ; set done $args ; return} set done "" set t [bibtex::parse -command done -channel $chan] bibtex::destroy $t close $chan } {} # ... Tests of addStrings ... # (Requires introspection of parser state) testsuiteCleanup |
︙ | ︙ |
1 2 3 4 5 6 7 8 | # -*- tcl -*- # Tests for the comm module. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2001 by ActiveState Tool Corp. # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -*- tcl -*- # Tests for the comm module. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2001 by ActiveState Tool Corp. # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
29 30 31 32 33 34 35 | } # ------------------------------------------------------------------------ # First order of things is to spawn a separate tclsh into the background # and have it execute comm too, with some general code to respond to our # requests | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | } # ------------------------------------------------------------------------ # First order of things is to spawn a separate tclsh into the background # and have it execute comm too, with some general code to respond to our # requests source [asset comm.slaveboot] # ------------------------------------------------------------------------ test comm-1.0 {set remote variable} { ::comm::comm send [slave] {set foo b} } {b} |
︙ | ︙ |
1 2 3 | # -*- tcl -*- # Script to boot a child running an open comm server | | < < < < < < < < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # -*- tcl -*- # Script to boot a child running an open comm server set spawncode [asset slave.tcl] proc slaveat {id} { #puts "Slave @ $id" proc slave {} [list return $id] set ::go . } #puts "self @ [::comm::comm self]" exec \ [info nameofexecutable] $spawncode \ [tcllibPath snit/snit.tcl] \ [localPath comm.tcl] \ [::comm::comm self] & #puts "Waiting for spawned comm system to boot" # Wait for the slave to initialize itself. vwait ::go #puts "Running tests" |
︙ | ︙ |
> > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 | # -*- tcl -*- catch {wm withdraw .} ##puts [set fh [open ~/foo w]] $argv ; close $fh source [lindex $argv 0] ; # load 'snit' source [lindex $argv 1] ; # load 'comm' # and wait for commands. But first send our # own server socket to the initiator ::comm::comm send [lindex $argv 2] [list slaveat [::comm::comm self]] vwait forever |
1 2 3 4 5 6 7 8 | # -*- tcl -*- # Tests for the find function. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2001-2011 by Andreas Kupries <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -*- tcl -*- # Tests for the find function. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2001-2011 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
349 350 351 352 353 354 355 | ::struct::matrix m catch {::csv::read2matrix dummy m foo} result m destroy set result } {illegal separator character "foo", is a string} test csv-5.1 {reading csv files} { | | | | | | | | | | | | | 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | ::struct::matrix m catch {::csv::read2matrix dummy m foo} result m destroy set result } {illegal separator character "foo", is a string} test csv-5.1 {reading csv files} { set f [open [asset mem_debug_bench.csv] r] ::struct::queue q ::csv::read2queue $f q close $f set result [list [q size] [q get 2]] q destroy set result } {251 {{000 VERSIONS: 2:8.4a3 1:8.4a3 1:8.4a3%} {001 {CATCH return ok} 7 13 53.85}}} test csv-5.2 {reading csv files} { set f [open [asset mem_debug_bench_a.csv] r] ::struct::queue q ::csv::read2queue $f q close $f set result [list [q size] [q get 2]] q destroy set result } {251 {{000 VERSIONS: 2:8.4a3 1:8.4a3 1:8.4a3%} {001 {CATCH return ok} 7 13 53.85}}} test csv-5.3 {reading csv files} { set f [open [asset mem_debug_bench.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f set result [m get rect 0 227 end 231] m destroy set result } {{227 {STR append (1MB + 1MB * 3)} 125505 327765 38.29} {228 {STR append (1MB + 1MB * 5)} 158507 855295 18.53} {229 {STR append (1MB + (1b + 1K + 1b) * 100)} 33101 174031 19.02} {230 {STR info locals match} 946 1521 62.20} {231 {TRACE no trace set} 34 121 28.10}} test csv-5.4 {reading csv files} { set f [open [asset mem_debug_bench_a.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f set result [m get rect 0 227 end 231] m destroy set result } {{227 {STR append (1MB + 1MB * 3)} 125505 327765 38.29} {228 {STR append (1MB + 1MB * 5)} 158507 855295 18.53} {229 {STR append (1MB + (1b + 1K + 1b) * 100)} 33101 174031 19.02} {230 {STR info locals match} 946 1521 62.20} {231 {TRACE no trace set} 34 121 28.10}} test csv-5.5 {reading csv files} { set f [open [asset mem_debug_bench.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f set result [list] foreach c {0 1 2 3 4} { lappend result [m columnwidth $c] } m destroy set result } {3 39 7 7 8} test csv-5.6 {reading csv files, linking} { set f [open [asset mem_debug_bench.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f m link a set result [array size a] m destroy set result } {1255} test csv-5.7 {reading csv files, empty expansion mode} { set f [open [asset mem_debug_bench.csv] r] ::struct::matrix m ::csv::read2matrix $f m , empty close $f set result [m get rect 0 227 end 231] m destroy set result } {{227 {STR append (1MB + 1MB * 3)} 125505 327765 38.29} {228 {STR append (1MB + 1MB * 5)} 158507 855295 18.53} {229 {STR append (1MB + (1b + 1K + 1b) * 100)} 33101 174031 19.02} {230 {STR info locals match} 946 1521 62.20} {231 {TRACE no trace set} 34 121 28.10}} test csv-5.8 {reading csv files, auto expansion mode} { set f [open [asset mem_debug_bench.csv] r] ::struct::matrix m m add columns 1 ::csv::read2matrix $f m , auto close $f set result [m get rect 0 227 end 231] m destroy set result } {{227 {STR append (1MB + 1MB * 3)} 125505 327765 38.29} {228 {STR append (1MB + 1MB * 5)} 158507 855295 18.53} {229 {STR append (1MB + (1b + 1K + 1b) * 100)} 33101 174031 19.02} {230 {STR info locals match} 946 1521 62.20} {231 {TRACE no trace set} 34 121 28.10}} # ========================================================================= # Bug 2926387 test csv-5.9.0 {reading csv files, inner field newline processing, bug 2926387} { set m [struct::matrix] set f [open [asset 2926387.csv] r] csv::read2matrix $f $m , auto close $f set result [$m serialize] $m destroy set result } {2 3 {{a b c} {d {e, e} f}}} test csv-5.9.1 {reading csv files, inner field newline processing, bug 2926387} { set q [struct::queue] set f [open [asset 2926387.csv] r] csv::read2queue $f $q close $f set result [$q get [$q size]] $q destroy set result } {{a b c} {d {e, e} f}} # ========================================================================= test csv-6.1 {writing csv files} { set f [open [asset eval.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f set f [open [makeFile {} eval-out1.csv] w] ::csv::writematrix m $f |
︙ | ︙ | |||
489 490 491 492 493 494 495 | 024,EVAL cmd eval as list,23,42,54.76 025,EVAL cmd eval as string,53,92,57.61 026,EVAL cmd and mixed lists,3805,11276,33.74 027,EVAL list cmd and mixed lists,3812,11325,33.66 028,EVAL list cmd and pure lists,592,1598,37.05} test csv-6.2 {writing csv files} { | | | 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | 024,EVAL cmd eval as list,23,42,54.76 025,EVAL cmd eval as string,53,92,57.61 026,EVAL cmd and mixed lists,3805,11276,33.74 027,EVAL list cmd and mixed lists,3812,11325,33.66 028,EVAL list cmd and pure lists,592,1598,37.05} test csv-6.2 {writing csv files} { set f [open [asset eval.csv] r] ::struct::queue q ::csv::read2queue $f q close $f set f [open [makeFile {} eval-out2.csv] w] ::csv::writequeue q $f close $f |
︙ | ︙ | |||
511 512 513 514 515 516 517 | 025,EVAL cmd eval as string,53,92,57.61 026,EVAL cmd and mixed lists,3805,11276,33.74 027,EVAL list cmd and mixed lists,3812,11325,33.66 028,EVAL list cmd and pure lists,592,1598,37.05} test csv-7.1 {reporting} { | | | | 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | 025,EVAL cmd eval as string,53,92,57.61 026,EVAL cmd and mixed lists,3805,11276,33.74 027,EVAL list cmd and mixed lists,3812,11325,33.66 028,EVAL list cmd and pure lists,592,1598,37.05} test csv-7.1 {reporting} { set f [open [asset eval.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f set result [m format 2string csv::report] m destroy set result } {023,EVAL cmd eval in list obj var,26,45,57.78 024,EVAL cmd eval as list,23,42,54.76 025,EVAL cmd eval as string,53,92,57.61 026,EVAL cmd and mixed lists,3805,11276,33.74 027,EVAL list cmd and mixed lists,3812,11325,33.66 028,EVAL list cmd and pure lists,592,1598,37.05 } test csv-7.2 {reporting} { set f [open [asset eval.csv] r] ::struct::matrix m m add columns 5 ::csv::read2matrix $f m close $f set f [open [makeFile {} eval-out3.csv] w] m format 2chan csv::report $f |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
1 2 3 4 5 6 7 8 9 | # -*- tcl -*- # exif.test: tests for the exif structure. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2001-2006 by Andreas Kupries <[email protected]> # All rights reserved. | < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # -*- tcl -*- # exif.test: tests for the exif structure. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 2001-2006 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] testsNeedTcl 8.3 testsNeedTcltest 1.0 testing { useLocal exif.tcl exif } # ------------------------------------------------------------------------- test exif-makernote-19.0 {makernote field 19 (afpoint) is optional} { # AFPoint == AutoFocus Point set f [open [asset noafpoint.jpg] r] fconfigure $f -translation binary array set resa [exif::analyze $f] close $f set resa(FocalPlaneXResolution) [format %13.8f $resa(FocalPlaneXResolution)] set resa(FocalPlaneYResolution) [format %13.8f $resa(FocalPlaneYResolution)] set res [dictsort [array get resa]] unset resa set res } {AFPointsUsed {3 right} AperatureValue 7.1 AutoFocusMode {AI servo} CameraMake Canon CameraModel {Canon PowerShot S100} ColorSpace 1 ComponentsConfigured 0x00030201 Contrast Normal DateTime {2004:09:06 05:22:56} DateTimeDigitized {2004:09:06 05:22:56} DateTimeOriginal {2004:09:06 05:22:56} ExifImageHeight 1200 ExifImageWidth 1600 ExifInteroperabilityOffset 1088 ExifVersion 0210 ExposureBiasValue 0 ExposureTime {1/250.0 seconds} FNumber 7.1 FileSource {3 - Digital camera} FirmwareVersion {Firmware Version 1.0} Flash no FlashMode auto FlashPixVersion 0100 FocalLength {5.40625 mm} FocalPlaneResolutionUnit inch FocalPlaneXResolution 7766.99029126 FocalPlaneYResolution 7741.93548387 ISO unknown ImageFormat {IMG:JPEG file} ImageNumber 140-4060 ImageQuality Fine ImageSize large MacroMode normal MeteringMode unknown Orientation 1 Owner Irochka ResolutionUnit inch Saturation Normal SensingMethod 2 Sharpness Normal ShootingMode {Single frame} ShutterSpeedValue {250 Hz} SubjectDistance {3.358 m} UnknownTag-0x10 100925440 UserComment {554 - } WhiteBalance Auto XResolution 180.0 YCbCrPositioning {Center of pixel array} YResolution 180.0} testsuiteCleanup |
cannot compute difference between binary files
1 2 3 4 5 6 7 8 9 10 | # -*- tcl -*- # Tests for the find function. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 1998-2000 by Ajuba Solutions. # Copyright (c) 2001 by ActiveState Tool Corp. # Copyright (c) 2005-2007,2017 by Andreas Kupries <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # -*- tcl -*- # Tests for the find function. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 1998-2000 by Ajuba Solutions. # Copyright (c) 2001 by ActiveState Tool Corp. # Copyright (c) 2005-2007,2017 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
177 178 179 180 181 182 183 | set f [makeGzipFile] set res [catch {fileutil::fileType $f} msg] removeGzipFile list $res $msg } [list 0 [list binary compressed gzip]] test fileType-1.22 {text pdf} { | | | | | | | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | set f [makeGzipFile] set res [catch {fileutil::fileType $f} msg] removeGzipFile list $res $msg } [list 0 [list binary compressed gzip]] test fileType-1.22 {text pdf} { set f [asset pdf4tcl_01.pdf] set res [catch {fileutil::fileType $f} msg] list $res $msg } [list 0 [list text pdf]] # ------------------------------------------------------------------------- test fileType-1.23 {sqlite3, fossil repo} { set f [asset p.fossil] set res [catch {fileutil::fileType $f} msg] list $res $msg } [list 0 [list binary sqlite3 fossil-repository]] test fileType-1.24 {sqlite3, fossil checkout} { set f [asset p.ckout] set res [catch {fileutil::fileType $f} msg] list $res $msg } [list 0 [list binary sqlite3 fossil-checkout]] test fileType-1.25 {sqlite3, fossil global config} { set f [asset p.global] set res [catch {fileutil::fileType $f} msg] list $res $msg } [list 0 [list binary sqlite3 fossil-global-config]] test fileType-1.26 {sqlite3, no app} { set f [asset p.sqlite] set res [catch {fileutil::fileType $f} msg] list $res $msg } [list 0 [list binary sqlite3 A00000000]] # ------------------------------------------------------------------------- unset path testsuiteCleanup return |
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
︙ | ︙ |
1 2 3 4 5 6 7 8 9 | # -*- tcl -*- # # Testing "fumagic" (FileUtil Magic). Filetype recognizer. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2005-2006 by Andreas Kupries <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # -*- tcl -*- # # Testing "fumagic" (FileUtil Magic). Filetype recognizer. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2005-2006 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- package require tcltest source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ |
︙ | ︙ | |||
13 14 15 16 17 18 19 | testing { useLocal ini.tcl inifile } #--------------------------------------------------------------------- set inifile [localPath ini.tcl] | | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | testing { useLocal ini.tcl inifile } #--------------------------------------------------------------------- set inifile [localPath ini.tcl] set testini [asset test.ini] set sampini [asset sample.ini] #--------------------------------------------------------------------- test inifile-1.1 {ini::open} { set res [ini::open $testini r] ini::close $res set res |
︙ | ︙ |
︙ | ︙ |
1 2 3 4 5 | # -*- tcl -*- # jpeg.test: Tests for the JPEG utilities. # # Copyright (c) 2008-2013 by Andreas Kupries <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 | # -*- tcl -*- # jpeg.test: Tests for the JPEG utilities. # # Copyright (c) 2008-2013 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
67 68 69 70 71 72 73 | test jpeg-1.1 {isJPEG error, wrong#args, too many} -body { ::jpeg::isJPEG foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::isJPEG} {file}] # ------------------------------------------------------------------------- set n 0 | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | test jpeg-1.1 {isJPEG error, wrong#args, too many} -body { ::jpeg::isJPEG foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::isJPEG} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-2.$n "isJPEG, ok, [file tail $f]" -body { ::jpeg::isJPEG $f } -result 1 incr n } test jpeg-2.$n "isJPEG, fail, [file tail [info script]]" -body { |
︙ | ︙ | |||
91 92 93 94 95 96 97 | test jpeg-2.1 {imageInfo error, wrong#args, too many} -body { ::jpeg::imageInfo foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::imageInfo} {file}] # ------------------------------------------------------------------------- set n 0 | | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | test jpeg-2.1 {imageInfo error, wrong#args, too many} -body { ::jpeg::imageInfo foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::imageInfo} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.JPG] { test jpeg-3.$n "imageInfo regular, [file tail $f]" -body { ::jpeg::imageInfo $f } -result [string trim [fileutil::cat [file rootname $f].info.txt]] incr n } set n 0 foreach f [TestFilesGlob test-assets/*.thumb] { test jpeg-4.$n "imageInfo thumbnails, [file tail $f]" -body { ::jpeg::imageInfo $f } -result {} incr n } test jpeg-5.0 "imageInfo, fail, [file tail [info script]]" -body { |
︙ | ︙ | |||
123 124 125 126 127 128 129 | test jpeg-6.1 {dimensions error, wrong#args, too many} -body { ::jpeg::dimensions foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::dimensions} {file}] # ------------------------------------------------------------------------- set n 0 | | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | test jpeg-6.1 {dimensions error, wrong#args, too many} -body { ::jpeg::dimensions foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::dimensions} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.JPG] { test jpeg-7.$n "dimensions regular, [file tail $f]" -body { ::jpeg::dimensions $f } -result [string trim [fileutil::cat [file rootname $f].WxH.txt]] incr n } set n 0 foreach f [TestFilesGlob test-assets/*.thumb] { test jpeg-8.$n "dimensions thumbnails, [file tail $f]" -body { ::jpeg::dimensions $f } -result {160 120} incr n } test jpeg-9.0 "dimensions, fail, [file tail [info script]]" -body { |
︙ | ︙ | |||
155 156 157 158 159 160 161 | test jpeg-10.1 {getThumbnail error, wrong#args, too many} -body { ::jpeg::getThumbnail foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getThumbnail} {file}] # ------------------------------------------------------------------------- set n 0 | | | | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | test jpeg-10.1 {getThumbnail error, wrong#args, too many} -body { ::jpeg::getThumbnail foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getThumbnail} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.JPG] { if {![file exists $f.thumb]} { test jpeg-11.$n "getThumbnail - no thumbnail, [file tail $f]" -body { ::jpeg::getThumbnail $f } -result {} } else { test jpeg-11.$n "getThumbnail regular, [file tail $f]" -body { #fileutil::writeFile -translation binary ${f}.x.jpg [::jpeg::getThumbnail $f] # Note: The .thumb files were created from the .JPG files # using 'jhead -st', version 2.6. set expected [fileutil::cat -translation binary ${f}.thumb] set have [::jpeg::getThumbnail $f] list [string equal $expected $have] [strdiff $expected $have] } -result {1 -} } incr n } set n 0 foreach f [TestFilesGlob test-assets/*.thumb] { test jpeg-12.$n "getThumbnail thumbnails, [file tail $f]" -body { ::jpeg::getThumbnail $f } -result {} incr n } test jpeg-13.0 "getThumbnail, fail, [file tail [info script]]" -body { |
︙ | ︙ | |||
211 212 213 214 215 216 217 | test jpeg-16.1 {getComments error, wrong#args, too many} -body { ::jpeg::getComments foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getComments} {file}] # ------------------------------------------------------------------------- set n 0 | | | | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | test jpeg-16.1 {getComments error, wrong#args, too many} -body { ::jpeg::getComments foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getComments} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.JPG] { test jpeg-17.$n "getComments regular, [file tail $f]" -body { ::jpeg::getComments $f } -result {} incr n } set n 0 foreach f [TestFilesGlob test-assets/*.thumb] { test jpeg-18.$n "getComments thumbnails, [file tail $f]" -body { ::jpeg::getComments $f } -result {} incr n } test jpeg-19.0 "getComments, fail, [file tail [info script]]" -body { |
︙ | ︙ | |||
243 244 245 246 247 248 249 | test jpeg-20.1 {addComment error, wrong#args, not enough} -body { ::jpeg::addComment foo } -returnCodes error -result [tcltest::wrongNumArgs {::jpeg::addComment} {file comment args} 1] # ------------------------------------------------------------------------- set n 0 | | | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | test jpeg-20.1 {addComment error, wrong#args, not enough} -body { ::jpeg::addComment foo } -returnCodes error -result [tcltest::wrongNumArgs {::jpeg::addComment} {file comment args} 1] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-21.$n "addComment regular, [file tail $f]" -setup { file copy -force $f [set fx [makeFile {} jtmp]] ::jpeg::addComment $fx {a b} {c d} } -body { ::jpeg::getComments $fx } -cleanup { removeFile $fx |
︙ | ︙ | |||
273 274 275 276 277 278 279 | test jpeg-23.1 {removeComments error, wrong#args, too many} -body { ::jpeg::removeComments foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::removeComments} {file}] # ------------------------------------------------------------------------- set n 0 | | | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | test jpeg-23.1 {removeComments error, wrong#args, too many} -body { ::jpeg::removeComments foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::removeComments} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-24.$n "removeComments regular, [file tail $f]" -setup { file copy -force $f [set fx [makeFile {} jtmp]] ::jpeg::addComment $fx {a b} {c d} } -body { ::jpeg::removeComments $fx ::jpeg::getComments $fx } -cleanup { |
︙ | ︙ | |||
308 309 310 311 312 313 314 | test jpeg-26.2 {replaceComment error, wrong#args, too many} -body { ::jpeg::replaceComment foo bar barf } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::replaceComment} {file comment}] # ------------------------------------------------------------------------- set n 0 | | | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | test jpeg-26.2 {replaceComment error, wrong#args, too many} -body { ::jpeg::replaceComment foo bar barf } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::replaceComment} {file comment}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-27.$n "replaceComment regular, [file tail $f]" -setup { file copy -force $f [set fx [makeFile {} jtmp]] ::jpeg::addComment $fx {a b} {c d} } -body { ::jpeg::replaceComment $fx new ::jpeg::getComments $fx } -cleanup { |
︙ | ︙ | |||
337 338 339 340 341 342 343 | } -returnCodes error -result [tcltest::wrongNumArgs {::jpeg::getExif} {file ?type?} 0] test jpeg-29.1 {getExif error, wrong#args, too many} -body { ::jpeg::getExif foo bar barf } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getExif} {file ?type?}] test jpeg-29.2 {getExif error, bad section type} -body { | | | | | | | | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | } -returnCodes error -result [tcltest::wrongNumArgs {::jpeg::getExif} {file ?type?} 0] test jpeg-29.1 {getExif error, wrong#args, too many} -body { ::jpeg::getExif foo bar barf } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getExif} {file ?type?}] test jpeg-29.2 {getExif error, bad section type} -body { ::jpeg::getExif [asset IMG_7950.JPG] fufara } -returnCodes error -result {Bad type "fufara", expected one of "main", or "thumbnail"} test jpeg-29.3 {getExifFromChannel error, wrong#args, not enough} -body { ::jpeg::getExifFromChannel } -returnCodes error -result [tcltest::wrongNumArgs {::jpeg::getExifFromChannel} {chan ?type?} 0] test jpeg-29.4 {getExifFromChannel error, wrong#args, too many} -body { ::jpeg::getExifFromChannel foo bar barf } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::getExifFromChannel} {chan ?type?}] test jpeg-29.5 {getExifFromChannel error, bad section type} -setup { set fd [::jpeg::openJFIF [asset IMG_7950.JPG] r] } -body { ::jpeg::getExifFromChannel $fd fufara } -cleanup { close $fd unset fd } -returnCodes error -result {Bad type "fufara", expected one of "main", or "thumbnail"} # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.JPG] { test jpeg-30.$n "getExif, main section, $f" -body { dictsort [fixupdata [::jpeg::formatExif [::jpeg::getExif $f]]] } -result [string trimright [fileutil::cat [file rootname $f].exif.txt]] incr n } set n 0 foreach f [TestFilesGlob test-assets/*.thumb] { test jpeg-31.$n "getExif, main section, $f" -body { dictsort [fixupdata [::jpeg::formatExif [::jpeg::getExif $f]]] } -result {} incr n } set n 0 foreach f [TestFilesGlob test-assets/*.JPG] { test jpeg-32.$n "getExif, thumbnail section, $f" -body { dictsort [fixupdata [::jpeg::formatExif [::jpeg::getExif $f thumbnail]]] } -result [string trimright [fileutil::cat [file rootname $f].thumbexif.txt]] incr n } set n 0 foreach f [TestFilesGlob test-assets/*.thumb] { test jpeg-33.$n "getExif, thumbnail section, $f" -body { dictsort [fixupdata [::jpeg::formatExif [::jpeg::getExif $f thumbnail]]] } -result {} incr n } test jpeg-34.0 "getExif, fail, [file tail [info script]]" -body { |
︙ | ︙ | |||
419 420 421 422 423 424 425 | test jpeg-34.1 {removeExif error, wrong#args, too many} -body { ::jpeg::removeExif foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::removeExif} {file}] # ------------------------------------------------------------------------- set n 0 | | | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | test jpeg-34.1 {removeExif error, wrong#args, too many} -body { ::jpeg::removeExif foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::removeExif} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-35.$n "removeExif ok, [file tail $f]" -setup { file copy -force $f [set fx [makeFile {} jtmp]] ::jpeg::addComment $fx {a b} {c d} } -body { ::jpeg::removeExif $fx set res [list [::jpeg::getComments $fx] [::jpeg::getExif $fx] [::jpeg::getExif $fx thumbnail]] } -cleanup { |
︙ | ︙ | |||
450 451 452 453 454 455 456 | test jpeg-37.1 {stripJPEG error, wrong#args, too many} -body { ::jpeg::stripJPEG foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::stripJPEG} {file}] # ------------------------------------------------------------------------- set n 0 | | | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | test jpeg-37.1 {stripJPEG error, wrong#args, too many} -body { ::jpeg::stripJPEG foo bar } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::stripJPEG} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-38.$n "stripJPEG ok, [file tail $f]" -setup { file copy -force $f [set fx [makeFile {} jtmp]] ::jpeg::addComment $fx {a b} {c d} } -body { ::jpeg::stripJPEG $fx set res [list [::jpeg::getComments $fx] [::jpeg::getExif $fx] [::jpeg::getExif $fx thumbnail]] } -cleanup { |
︙ | ︙ | |||
483 484 485 486 487 488 489 | } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::debug} {file}] # ------------------------------------------------------------------------- # We do not try to actually run 'debug', because it prints its results # to stdout. This may change when we can capture stdout as test result set n 0 | | | 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | } -returnCodes error -result [tcltest::tooManyArgs {::jpeg::debug} {file}] # ------------------------------------------------------------------------- # We do not try to actually run 'debug', because it prints its results # to stdout. This may change when we can capture stdout as test result set n 0 foreach f [TestFilesGlob test-assets/*JPG*] { test jpeg-41.$n "debug ok, [file tail $f]" -constraints donotrun -body { ::jpeg::debug $f } -result {} incr n } test jpeg-42.0 "debug, fail, [file tail [info script]]" -body { ::jpeg::debug [info script] } -returnCodes error -result {not a jpg file} # ------------------------------------------------------------------------- rename strdiff {} testsuiteCleanup |
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
1 2 3 4 5 6 7 8 | # ldap.test - Copyright (C) 2006 Michael Schlenker <[email protected]> # # Tests for the Tcllib ldap package # # ------------------------------------------------------------------------- # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ------------------------------------------------------------------------- | < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # ldap.test - Copyright (C) 2006 Michael Schlenker <[email protected]> # # Tests for the Tcllib ldap package # # ------------------------------------------------------------------------- # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ------------------------------------------------------------------------- # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] testsNeedTcl 8.4 testsNeedTcltest 2.0 testing { useLocal ldap.tcl ldap use asn/asn.tcl asn } namespace import ::asn::* # ------------------------------------------------------------------------- # Tests |
︙ | ︙ |
1 2 3 4 5 6 7 8 | # -*- tcl -*- # ldapx.test: tests for the ldapx module. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2006 by Pierre David <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -*- tcl -*- # ldapx.test: tests for the ldapx module. # # Sourcing this file into Tcl runs the tests and generates output for errors. # No output means no errors were found. # # Copyright (c) 2006 by Pierre David <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
371 372 373 374 375 376 377 | } {} # ------------------------------------------------------------------------- test ldax-d6c9cfba {ldapx continuation line handling} { ::ldapx::ldif create ldin | | | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | } {} # ------------------------------------------------------------------------- test ldax-d6c9cfba {ldapx continuation line handling} { ::ldapx::ldif create ldin ldin channel [open [asset d6c9cfba.ldif] r] ::ldapx::entry create entr ldin read entr set r [entr get1 files] entr destroy ldin destroy |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
1 2 3 4 5 6 7 8 | # -*- tcl -*- # Tests for the cgi module. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 1998-2000 by Ajuba Solutions | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -*- tcl -*- # Tests for the cgi module. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 1998-2000 by Ajuba Solutions # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
586 587 588 589 590 591 592 | test ncgi-14.2 {ncgi::multipart} { catch {ncgi::multipart "multipart/form-data" {}} err set err } {No boundary given for multipart document} test ncgi-14.3 {ncgi::multipart} { | | | 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | test ncgi-14.2 {ncgi::multipart} { catch {ncgi::multipart "multipart/form-data" {}} err set err } {No boundary given for multipart document} test ncgi-14.3 {ncgi::multipart} { set in [open [asset formdata.txt]] set X [read $in] close $in foreach line [split $X \n] { if {[string length $line] == 0} { break } |
︙ | ︙ | |||
612 613 614 615 616 617 618 | User Guide </h1></center> }}} test ncgi-14.4 {ncgi::multipart} { | | | 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | User Guide </h1></center> }}} test ncgi-14.4 {ncgi::multipart} { set in [open [asset formdata.txt]] set X [read $in] close $in foreach line [split $X \n] { if {[string length $line] == 0} { break } |
︙ | ︙ | |||
640 641 642 643 644 645 646 | </h1></center> }} test ncgi-14.6 {ncgi::multipart setValue} { | | | 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | </h1></center> }} test ncgi-14.6 {ncgi::multipart setValue} { set in [open [asset formdata.txt]] set X [read $in] close $in foreach line [split $X \n] { if {[string length $line] == 0} { break } |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
1 2 3 4 | # -*- tcl -*- # png.test: tests for png decoding and manipulation. # # Copyright (c) 2004 by Andreas Kupries <[email protected]> | < < | 1 2 3 4 5 6 7 8 9 10 11 | # -*- tcl -*- # png.test: tests for png decoding and manipulation. # # Copyright (c) 2004 by Andreas Kupries <[email protected]> # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
21 22 23 24 25 26 27 | testing { useLocal png.tcl png } # ------------------------------------------------------------------------- # Validation | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | testing { useLocal png.tcl png } # ------------------------------------------------------------------------- # Validation foreach f [TestFilesGlob test-assets/*.png] { set root [file rootname [file tail $f]] # All files have a valid signature, except for two. test png-ispng-$root {is png} { ::png::isPNG $f } [expr { |
︙ | ︙ | |||
44 45 46 47 48 49 50 | test png-validate-$root {full validation} { ::png::validate $f } OK ;# {} } # Validation II, the bad files ... | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | test png-validate-$root {full validation} { ::png::validate $f } OK ;# {} } # Validation II, the bad files ... foreach f [TestFilesGlob test-assets/x*.png] { set root [file rootname [file tail $f]] test png-validate-$root {full validation} { ::png::validate $f } [expr {[string match x00n0g01 $root] ? "NODATA" : "SIG"}] ;# {} } |
︙ | ︙ | |||
213 214 215 216 217 218 219 | tp1n3p08 {color 3 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z00n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z03n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z06n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z09n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} } | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | tp1n3p08 {color 3 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z00n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z03n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z06n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} z09n2c08 {color 2 compression 0 depth 8 filter 0 height 32 interlace 0 width 32} } foreach f [TestFilesGlob test-assets/*.png] { set root [file rootname [file tail $f]] # Files beginning with x are invalid, and thus not usable in these # tests. if {[string match x* $root]} continue |
︙ | ︙ | |||
235 236 237 238 239 240 241 | array set exptime { cm0n0g04 946730096 cm7n0g04 0 cm9n0g04 946684799 } | | | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | array set exptime { cm0n0g04 946730096 cm7n0g04 0 cm9n0g04 946684799 } foreach f [TestFilesGlob test-assets/cm*.png] { set root [file rootname [file tail $f]] #puts [clock format $exptime($root) -gmt 1] test png-gettimestamp-$root {retrieve timestamp} { ::png::getTimestamp $f } $exptime($root) ; # {} |
︙ | ︙ | |||
261 262 263 264 265 266 267 | to the spec are present.}} {Software {Created on a NeXTstation color using "pnmtopng".}} {Disclaimer Freeware.}} ctzn0g04 {{Title PngSuite} {Author {Willem A.J. van Schaik ([email protected])}}} } # - Retrieval | | | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | to the spec are present.}} {Software {Created on a NeXTstation color using "pnmtopng".}} {Disclaimer Freeware.}} ctzn0g04 {{Title PngSuite} {Author {Willem A.J. van Schaik ([email protected])}}} } # - Retrieval foreach f [TestFilesGlob test-assets/*.png] { set root [file rootname [file tail $f]] # All files have a valid signature, except for two. These we ignore. if {[string equal $root xcrn0g04]} continue if {[string equal $root xlfn0g04]} continue # All files are fully valid, except for all beginning with an # 'x'. We ignore them as well. |
︙ | ︙ | |||
285 286 287 288 289 290 291 | # - Removal # Note: For a bad removeComments tests fail only on platforms where # the system encoding is not ASCII like, or the EOL is not a plain # LF. Windows for example, or asian systems. foreach root [array names comex] { | | | < < | < < | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | # - Removal # Note: For a bad removeComments tests fail only on platforms where # the system encoding is not ASCII like, or the EOL is not a plain # LF. Windows for example, or asian systems. foreach root [array names comex] { set f [asset ${root}.png] test png-removecomment-$root {remove comments} { set copy [makeFile {} pngrc.$root] file copy -force $f $copy ::png::removeComments $copy set res [list [::png::validate $copy] [::png::getComments $copy]] removeFile pngrc.$root set res } {OK {}} } # ------------------------------------------------------------------------- # PhysicalDimensions test png-physical-dimensions-missing {Test for empty list if no physical dimensions present} { ::png::getPixelDimension [asset physicaldimensions/basi0g01.png] } {} test png-physical-dimensions-present {Test to extract physical dimensions} { ::png::getPixelDimension [asset physicaldimensions/basi0g01_300dpi.png] } {ppux 11811 ppuy 11811 unit meter} # ------------------------------------------------------------------------- testsuiteCleanup |
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
︙ | ︙ |
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
︙ | ︙ |
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
cannot compute difference between binary files
cannot compute difference between binary files
cannot compute difference between binary files
1 2 3 4 5 | # -*- tcl -*- # tiff.test: Tests for the TIFF utilities. # # Copyright (c) 2008 by Andreas Kupries <[email protected]> # All rights reserved. | < < | 1 2 3 4 5 6 7 8 9 10 11 12 | # -*- tcl -*- # tiff.test: Tests for the TIFF utilities. # # Copyright (c) 2008 by Andreas Kupries <[email protected]> # All rights reserved. # ------------------------------------------------------------------------- source [file join \ [file dirname [file dirname [file join [pwd] [info script]]]] \ devtools testutilities.tcl] |
︙ | ︙ | |||
44 45 46 47 48 49 50 | catch {::tiff::isTIFF foo bar} msg set msg } [tcltest::tooManyArgs {::tiff::isTIFF} {file}] # ------------------------------------------------------------------------- set n 0 | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | catch {::tiff::isTIFF foo bar} msg set msg } [tcltest::tooManyArgs {::tiff::isTIFF} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-2.$n "isTIFF, ok, [file tail $f]" { ::tiff::isTIFF $f } 1 incr n } test tiff-2.$n "isTIFF, fail, [file tail [info script]]" { |
︙ | ︙ | |||
70 71 72 73 74 75 76 | catch {::tiff::byteOrder foo bar} msg set msg } [tcltest::tooManyArgs {::tiff::byteOrder} {file}] # ------------------------------------------------------------------------- set n 0 | | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | catch {::tiff::byteOrder foo bar} msg set msg } [tcltest::tooManyArgs {::tiff::byteOrder} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-4.$n "byteOrder regular, [file tail $f]" { ::tiff::byteOrder $f } little incr n } test tiff-5.0 "byteOrder, fail, [file tail [info script]]" { |
︙ | ︙ | |||
96 97 98 99 100 101 102 | catch {::tiff::numImages foo bar} msg set msg } [tcltest::tooManyArgs {::tiff::numImages} {file}] # ------------------------------------------------------------------------- set n 0 | | | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | catch {::tiff::numImages foo bar} msg set msg } [tcltest::tooManyArgs {::tiff::numImages} {file}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-7.$n "numImages regular, [file tail $f]" { ::tiff::numImages $f } 1 incr n } test tiff-8.0 "numImages, fail, [file tail [info script]]" { |
︙ | ︙ | |||
122 123 124 125 126 127 128 | catch {::tiff::dimensions foo bar glop} msg set msg } [tcltest::tooManyArgs {::tiff::dimensions} {file ?image?}] # ------------------------------------------------------------------------- set n 0 | | | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | catch {::tiff::dimensions foo bar glop} msg set msg } [tcltest::tooManyArgs {::tiff::dimensions} {file ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-10.$n "dimensions regular, [file tail $f]" { ::tiff::dimensions $f } {320 240} incr n } test tiff-11.0 "dimensions, fail, [file tail [info script]]" { |
︙ | ︙ | |||
148 149 150 151 152 153 154 | catch {::tiff::imageInfo foo bar glop} msg set msg } [tcltest::tooManyArgs {::tiff::imageInfo} {file ?image?}] # ------------------------------------------------------------------------- set n 0 | | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | catch {::tiff::imageInfo foo bar glop} msg set msg } [tcltest::tooManyArgs {::tiff::imageInfo} {file ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-13.$n "imageInfo regular, [file tail $f]" { dictsort [::tiff::imageInfo $f] } {Artist {} BitsPerSample {8 8 8} Compression 7 DateTime {} HostComputer {} ImageDescription {} ImageLength 240 ImageWidth 320 Orientation 1 PhotometricInterpretation 2 ResolutionUnit 2 XResolution 180 YResolution 180} incr n } test tiff-14.0 "imageInfo, fail, [file tail [info script]]" { |
︙ | ︙ | |||
174 175 176 177 178 179 180 | catch {::tiff::entries foo bar glop} msg set msg } [tcltest::tooManyArgs {::tiff::entries} {file ?image?}] # ------------------------------------------------------------------------- set n 0 | | | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | catch {::tiff::entries foo bar glop} msg set msg } [tcltest::tooManyArgs {::tiff::entries} {file ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-16.$n "entries regular, [file tail $f]" { lsort [::tiff::entries $f] } {BitsPerSample Compression DocumentName FillOrder ImageLength ImageWidth JPEGTables Orientation PhotometricInterpretation PlanarConfiguration ResolutionUnit RowsPerStrip SamplesPerPixel Software StripByteCounts StripOffsets XResolution YCbCrSubSampling YResolution} incr n } test tiff-17.0 "entries, fail, [file tail [info script]]" { |
︙ | ︙ | |||
205 206 207 208 209 210 211 | catch {::tiff::getEntry foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::getEntry} {file entry ?image?}] # ------------------------------------------------------------------------- set n 0 | | | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | catch {::tiff::getEntry foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::getEntry} {file entry ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-19.$n "getEntry regular, [file tail $f]" { ::tiff::getEntry $f {Artist Compression} } {Artist {} Compression 7} incr n } test tiff-20.0 "getEntry, fail, [file tail [info script]]" { |
︙ | ︙ | |||
236 237 238 239 240 241 242 | catch {::tiff::addEntry foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::addEntry} {file entry ?image?}] # ------------------------------------------------------------------------- set n 0 | | | | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | catch {::tiff::addEntry foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::addEntry} {file entry ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-22.$n "addEntry, new tag, [file tail $f]" { file copy -force $f [set fx [makeFile {} ttmp]] set res {} lappend res [tiff::getEntry $fx Artist] ::tiff::addEntry $fx {{Artist 2 Andreas}} lappend res [tiff::getEntry $fx Artist] removeFile ttmp set res } {{Artist {}} {Artist Andreas}} incr n } set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-23.$n "addEntry, overwrite tag, [file tail $f]" knownBug { file copy -force $f [set fx [makeFile {} ttmp]] set res {} ::tiff::addEntry $fx {{Artist 2 Andreas}} lappend res [tiff::getEntry $fx Artist] ::tiff::addEntry $fx {{Artist 2 AK}} lappend res [tiff::getEntry $fx Artist] |
︙ | ︙ | |||
291 292 293 294 295 296 297 | catch {::tiff::deleteEntry foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::deleteEntry} {file entry ?image?}] # ------------------------------------------------------------------------- set n 0 | | | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | catch {::tiff::deleteEntry foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::deleteEntry} {file entry ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-26.$n "deleteEntry, [file tail $f]" { file copy -force $f [set fx [makeFile {} ttmp]] set res {} lappend res [tiff::getEntry $fx Artist] ::tiff::addEntry $fx {{Artist 2 Andreas}} lappend res [tiff::getEntry $fx Artist] ::tiff::deleteEntry $fx Artist |
︙ | ︙ | |||
325 326 327 328 329 330 331 | catch {::tiff::getImage foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::getImage} {file ?image?}] # ------------------------------------------------------------------------- set n 0 | | | 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | catch {::tiff::getImage foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::getImage} {file ?image?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-29.$n "getImage, [file tail $f]" {tk unkownFormat} { set image [tiff::getImage $f] lappend res [image width $image] lappend res [image height $image] image delete $image set res } {320 240} |
︙ | ︙ | |||
360 361 362 363 364 365 366 | catch {::tiff::writeImage foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::writeImage} {image file ?entry?}] # ------------------------------------------------------------------------- set n 0 | | | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | catch {::tiff::writeImage foo bar glop snarf} msg set msg } [tcltest::tooManyArgs {::tiff::writeImage} {image file ?entry?}] # ------------------------------------------------------------------------- set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-32.$n "writeImage, [file tail $f]" {tk unkownFormat} { set image [tiff::getImage $f] set fx [makeFile {} ttmp] tiff::writeImage $image $fx image delete $image foreach k [lsort [::tiff::entries $fx]] { lappend res [tiff::getEntry $fx $k] |
︙ | ︙ | |||
537 538 539 540 541 542 543 | } [tcltest::tooManyArgs {::tiff::debug} {file}] # ------------------------------------------------------------------------- # We do not try to actually run 'debug', because it prints its results # to stdout. This may change when we can capture stdout as test result set n 0 | | | 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | } [tcltest::tooManyArgs {::tiff::debug} {file}] # ------------------------------------------------------------------------- # We do not try to actually run 'debug', because it prints its results # to stdout. This may change when we can capture stdout as test result set n 0 foreach f [TestFilesGlob test-assets/*.tiff] { test tiff-41.$n "debug ok, [file tail $f]" donotrun { ::tiff::debug $f } {} incr n } test tiff-42.0 "debug, fail, [file tail [info script]]" { list [catch {::tiff::debug [info script]} msg] $msg } {1 {not a tiff file}} # ------------------------------------------------------------------------- testsuiteCleanup |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ | |||
140 141 142 143 144 145 146 | # } # set val [eval huddle list $subs] # } # lappend result $key $val # } # return [eval huddle create $result] # } | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | # } # set val [eval huddle list $subs] # } # lappend result $key $val # } # return [eval huddle create $result] # } # set fd [open [asset layers.txt] r] # set json1 [read $fd] # close $fd # # set data [json::json2dict $json1] ## set data [huddle_build $data] ## ## set json2 [huddle jsondump $data] |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ |
︙ | ︙ | |||
70 71 72 73 74 75 76 | } error } # ------------ test yaml-21.0.06eef112da {ticket 06eef112da} -body { | | | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | } error } # ------------ test yaml-21.0.06eef112da {ticket 06eef112da} -body { yaml::yaml2dict -file [asset 06eef112da.data] } -result {{} {} {alpha 43 beta {houston {{}} newyork {{{} aaa}}}}} # ------------ # error ..... test yaml-1.1 "error" -body { set error1 { |
︙ | ︙ |