diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2002-02-15 14:28:47 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2002-02-15 14:28:47 (GMT) |
commit | 66a15c6f8be47c3acbdddffadc67f50dec8a56e6 (patch) | |
tree | edaf81ee6d40edeacc9f3e2093ddcb2ba302c620 /tests/io.test | |
parent | 2827a2692798a7a0ec46e684a4ccc83afb39859e (diff) | |
download | tcl-66a15c6f8be47c3acbdddffadc67f50dec8a56e6.zip tcl-66a15c6f8be47c3acbdddffadc67f50dec8a56e6.tar.gz tcl-66a15c6f8be47c3acbdddffadc67f50dec8a56e6.tar.bz2 |
TIP#72 implementation. See ChangeLog for details.
This version builds clean on Solaris/SPARC, with GCC and CC, both with and
without threads and both in 32-bit and 64-bit mode.
Diffstat (limited to 'tests/io.test')
-rw-r--r-- | tests/io.test | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/tests/io.test b/tests/io.test index 5cb1ccf..6c8cf79 100644 --- a/tests/io.test +++ b/tests/io.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: io.test,v 1.25 2002/02/01 21:19:03 andreas_kupries Exp $ +# RCS: @(#) $Id: io.test,v 1.26 2002/02/15 14:28:50 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -21,6 +21,10 @@ if {[lsearch [namespace children] ::tcltest] == -1} { tcltest::testConstraint testchannel [string equal testchannel [info commands testchannel]] +# You need a *very* special environment to do some tests. In +# particular, many file systems do not support large-files... +tcltest::testConstraint largefileSupport 0 + ::tcltest::saveState removeFile test1 @@ -3811,12 +3815,12 @@ test io-32.8 {Tcl_Read, nonblocking, file} {nonBlockFiles} { set z [read $f1 1000000] close $f1 set x ok - set l [string length $z]] - set z [file size longfile]] + set l [string length $z] + set z [file size longfile] if {$z != $l} { set x broken } - set x + set x } ok test io-32.9 {Tcl_Read, read to end of file} { set f1 [open longfile r] @@ -4317,6 +4321,28 @@ test io-34.20 {Tcl_Tell combined with writing} { close $f set l } {29 39 40 447} +test io-34.21 {Tcl_Seek and Tcl_Tell on large files} {largefileSupport} { + removeFile test3 + set f [open test3 w] + fconfigure $f -encoding binary + set l "" + lappend l [tell $f] + puts -nonewline $f abcdef + lappend l [tell $f] + flush $f + lappend l [tell $f] + # 4GB offset! + seek $f 0x100000000 + lappend l [tell $f] + puts -nonewline $f abcdef + lappend l [tell $f] + close $f + lappend l [file size $f] + # truncate... + close [open test3 w] + lappend l [file size $f] + set l +} {0 6 6 4294967296 4294967302 4294967302 0} # Test Tcl_Eof |