diff options
author | andreas_kupries <akupries@shaw.ca> | 2008-04-09 18:37:08 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2008-04-09 18:37:08 (GMT) |
commit | 9bb2ff4b525caf08e3d48cadac6631b5693687aa (patch) | |
tree | 14005dcd3edeb271e777161dca86672a240587e2 /tests/ioCmd.test | |
parent | dc2f74c6070596e4d5a19fbf284d1c20d447453a (diff) | |
download | tcl-9bb2ff4b525caf08e3d48cadac6631b5693687aa.zip tcl-9bb2ff4b525caf08e3d48cadac6631b5693687aa.tar.gz tcl-9bb2ff4b525caf08e3d48cadac6631b5693687aa.tar.bz2 |
* generic/tclIOCmd.c (Tcl_FcopyObjCmd): Added checking of -size
* tests/ioCmd.test (iocmd-15.{13,14}): value to reject negative
values, and values overflowing 32-bit signed. [Bug 1557855]. Basic
patch by Alexandre Ferrieux <ferrieux@users.sourceforge.net>, with
modifications from me to separate overflow from true negative
value. Extended testsuite.
Diffstat (limited to 'tests/ioCmd.test')
-rw-r--r-- | tests/ioCmd.test | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test index e246d2a..d48d1cf 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ioCmd.test,v 1.38 2008/04/04 17:18:32 andreas_kupries Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.39 2008/04/09 18:37:09 andreas_kupries Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -606,6 +606,12 @@ test iocmd-15.11 {Tcl_FcopyObjCmd} {fcopy} { test iocmd-15.12 {Tcl_FcopyObjCmd} {fcopy} { list [catch {fcopy $rfile $wfile -command bar -size foo} msg] $msg } {1 {expected integer but got "foo"}} +test iocmd-15.13 {Tcl_FcopyObjCmd} {fcopy} { + list [catch {fcopy $rfile $wfile -command bar -size 3221176172} msg] $msg +} {1 {integer value to large to represent as 32bit signed value}} +test iocmd-15.14 {Tcl_FcopyObjCmd} {fcopy} { + list [catch {fcopy $rfile $wfile -command bar -size -2} msg] $msg +} {1 {negative size forbidden}} close $rfile close $wfile |