diff options
author | dkf <dkf@noemail.net> | 2002-02-15 14:28:46 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2002-02-15 14:28:46 (GMT) |
commit | 76f21db3e4ff07d10bc0f4fb6b55feb05b67247a (patch) | |
tree | edaf81ee6d40edeacc9f3e2093ddcb2ba302c620 /tests/binary.test | |
parent | 128a1ec632cd69ee32ae5bb3095470002b277211 (diff) | |
download | tcl-76f21db3e4ff07d10bc0f4fb6b55feb05b67247a.zip tcl-76f21db3e4ff07d10bc0f4fb6b55feb05b67247a.tar.gz tcl-76f21db3e4ff07d10bc0f4fb6b55feb05b67247a.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.
FossilOrigin-Name: 8d82de1905ada4c5d06f5fb967721e8b681b7c82
Diffstat (limited to 'tests/binary.test')
-rw-r--r-- | tests/binary.test | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/binary.test b/tests/binary.test index 6e8b64a..b01ae3c 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -10,14 +10,14 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: binary.test,v 1.8 2000/05/26 08:50:34 hobbs Exp $ +# RCS: @(#) $Id: binary.test,v 1.9 2002/02/15 14:28:49 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import -force ::tcltest::* } -test binary-2.1 {DupByteArrayInternalRep} { +test binary-0.1 {DupByteArrayInternalRep} { set hdr [binary format cc 0 0316] set buf hellomatt @@ -1460,6 +1460,32 @@ test binary-42.1 {Tcl_BinaryObjCmd: bad arguments} {} { set result } {bad option "": must be format or scan} +# Wide int (guaranteed at least 64-bit) handling +test binary-43.1 {Tcl_BinaryObjCmd: format wide int} {} { + binary format w 7810179016327718216 +} HelloTcl +test binary-43.2 {Tcl_BinaryObjCmd: format wide int} {} { + binary format W 7810179016327718216 +} lcTolleH + +test binary-44.1 {Tcl_BinaryObjCmd: scan wide int} {} { + binary scan HelloTcl W x + set x +} 5216694956358656876 +test binary-44.2 {Tcl_BinaryObjCmd: scan wide int} {} { + binary scan lcTolleH w x + set x +} 5216694956358656876 + +test binary-45.1 {Tcl_BinaryObjCmd: combined wide int handling} { + binary scan [binary format sws 16450 -1 19521] c* x + set x +} {66 64 -1 -1 -1 -1 -1 -1 -1 -1 65 76} +test binary-45.2 {Tcl_BinaryObjCmd: combined wide int handling} { + binary scan [binary format sWs 16450 0x7fffffff 19521] c* x + set x +} {66 64 0 0 0 0 127 -1 -1 -1 65 76} + # cleanup ::tcltest::cleanupTests return |