Attachment "patch" to
ticket [958919ffff]
added by
aotto1968
2004-05-23 20:56:54.
Index: binary.test
===================================================================
RCS file: TclBase/src/tcl8.4.6/tests/binary.test,v
retrieving revision 1.1
diff -C2 -r1.1 binary.test
*** binary.test 30 Apr 2004 07:10:40 -0000 1.1
--- binary.test 23 May 2004 13:57:10 -0000
***************
*** 18,21 ****
--- 18,25 ----
}
+ testConstraint bigEndian [expr {$tcl_platform(byteOrder) == "bigEndian"}]
+ testConstraint littleEndian [expr {$tcl_platform(byteOrder) == "littleEndian"}]
+ testConstraint hasNan [expr {![catch {binary format d NaN}]}]
+
test binary-0.1 {DupByteArrayInternalRep} {
set hdr [binary format cc 0 0316]
***************
*** 427,464 ****
binary format f0 1.6
} {}
! test binary-13.4 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format f 1.6
} \x3f\xcc\xcc\xcd
! test binary-13.5 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format f 1.6
} \xcd\xcc\xcc\x3f
! test binary-13.6 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format f* {1.6 3.4}
} \x3f\xcc\xcc\xcd\x40\x59\x99\x9a
! test binary-13.7 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format f* {1.6 3.4}
} \xcd\xcc\xcc\x3f\x9a\x99\x59\x40
! test binary-13.8 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format f2 {1.6 3.4}
} \x3f\xcc\xcc\xcd\x40\x59\x99\x9a
! test binary-13.9 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format f2 {1.6 3.4}
} \xcd\xcc\xcc\x3f\x9a\x99\x59\x40
! test binary-13.10 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format f2 {1.6 3.4 5.6}
} \x3f\xcc\xcc\xcd\x40\x59\x99\x9a
! test binary-13.11 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format f2 {1.6 3.4 5.6}
} \xcd\xcc\xcc\x3f\x9a\x99\x59\x40
! test binary-13.12 {Tcl_BinaryObjCmd: float overflow} {nonPortable macOrUnix} {
binary format f -3.402825e+38
} \xff\x7f\xff\xff
! test binary-13.13 {Tcl_BinaryObjCmd: float overflow} {nonPortable pcOnly} {
binary format f -3.402825e+38
} \xff\xff\x7f\xff
! test binary-13.14 {Tcl_BinaryObjCmd: float underflow} {nonPortable macOrUnix} {
binary format f -3.402825e-100
} \x80\x00\x00\x00
! test binary-13.15 {Tcl_BinaryObjCmd: float underflow} {nonPortable pcOnly} {
binary format f -3.402825e-100
} \x00\x00\x00\x80
--- 431,468 ----
binary format f0 1.6
} {}
! test binary-13.4 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format f 1.6
} \x3f\xcc\xcc\xcd
! test binary-13.5 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format f 1.6
} \xcd\xcc\xcc\x3f
! test binary-13.6 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format f* {1.6 3.4}
} \x3f\xcc\xcc\xcd\x40\x59\x99\x9a
! test binary-13.7 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format f* {1.6 3.4}
} \xcd\xcc\xcc\x3f\x9a\x99\x59\x40
! test binary-13.8 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format f2 {1.6 3.4}
} \x3f\xcc\xcc\xcd\x40\x59\x99\x9a
! test binary-13.9 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format f2 {1.6 3.4}
} \xcd\xcc\xcc\x3f\x9a\x99\x59\x40
! test binary-13.10 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format f2 {1.6 3.4 5.6}
} \x3f\xcc\xcc\xcd\x40\x59\x99\x9a
! test binary-13.11 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format f2 {1.6 3.4 5.6}
} \xcd\xcc\xcc\x3f\x9a\x99\x59\x40
! test binary-13.12 {Tcl_BinaryObjCmd: float overflow} {bigEndian} {
binary format f -3.402825e+38
} \xff\x7f\xff\xff
! test binary-13.13 {Tcl_BinaryObjCmd: float overflow} {littleEndian} {
binary format f -3.402825e+38
} \xff\xff\x7f\xff
! test binary-13.14 {Tcl_BinaryObjCmd: float underflow} {bigEndian} {
binary format f -3.402825e-100
} \x80\x00\x00\x00
! test binary-13.15 {Tcl_BinaryObjCmd: float underflow} {littleEndian} {
binary format f -3.402825e-100
} \x00\x00\x00\x80
***************
*** 470,478 ****
list [catch {binary format f $a} msg] $msg
} [list 1 "expected floating-point number but got \"1.6 3.4\""]
! test binary-13.18 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
set a {1.6 3.4}
binary format f1 $a
} \x3f\xcc\xcc\xcd
! test binary-13.19 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
set a {1.6 3.4}
binary format f1 $a
--- 474,482 ----
list [catch {binary format f $a} msg] $msg
} [list 1 "expected floating-point number but got \"1.6 3.4\""]
! test binary-13.18 {Tcl_BinaryObjCmd: format} {bigEndian} {
set a {1.6 3.4}
binary format f1 $a
} \x3f\xcc\xcc\xcd
! test binary-13.19 {Tcl_BinaryObjCmd: format} {littleEndian} {
set a {1.6 3.4}
binary format f1 $a
***************
*** 488,519 ****
binary format d0 1.6
} {}
! test binary-14.4 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format d 1.6
} \x3f\xf9\x99\x99\x99\x99\x99\x9a
! test binary-14.5 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format d 1.6
} \x9a\x99\x99\x99\x99\x99\xf9\x3f
! test binary-14.6 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format d* {1.6 3.4}
} \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33
! test binary-14.7 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format d* {1.6 3.4}
} \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40
! test binary-14.8 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format d2 {1.6 3.4}
} \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33
! test binary-14.9 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format d2 {1.6 3.4}
} \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40
! test binary-14.10 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
binary format d2 {1.6 3.4 5.6}
} \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33
! test binary-14.11 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
binary format d2 {1.6 3.4 5.6}
} \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40
! test binary-14.12 {Tcl_BinaryObjCmd: float overflow} {nonPortable unixOnly} {
binary format d NaN
} \x7f\xff\xff\xff\xff\xff\xff\xff
! test binary-14.13 {Tcl_BinaryObjCmd: float overflow} {nonPortable macOnly} {
binary format d NaN
} \x7f\xf8\x02\xa0\x00\x00\x00\x00
--- 492,523 ----
binary format d0 1.6
} {}
! test binary-14.4 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format d 1.6
} \x3f\xf9\x99\x99\x99\x99\x99\x9a
! test binary-14.5 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format d 1.6
} \x9a\x99\x99\x99\x99\x99\xf9\x3f
! test binary-14.6 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format d* {1.6 3.4}
} \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33
! test binary-14.7 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format d* {1.6 3.4}
} \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40
! test binary-14.8 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format d2 {1.6 3.4}
} \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33
! test binary-14.9 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format d2 {1.6 3.4}
} \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40
! test binary-14.10 {Tcl_BinaryObjCmd: format} {bigEndian} {
binary format d2 {1.6 3.4 5.6}
} \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33
! test binary-14.11 {Tcl_BinaryObjCmd: format} {littleEndian} {
binary format d2 {1.6 3.4 5.6}
} \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40
! test binary-14.12 {Tcl_BinaryObjCmd: float overflow} {bigEndian unixOnly hasNan} {
binary format d NaN
} \x7f\xff\xff\xff\xff\xff\xff\xff
! test binary-14.13 {Tcl_BinaryObjCmd: float overflow} {bigEndian macOnly hasNan} {
binary format d NaN
} \x7f\xf8\x02\xa0\x00\x00\x00\x00
***************
*** 525,533 ****
list [catch {binary format d $a} msg] $msg
} [list 1 "expected floating-point number but got \"1.6 3.4\""]
! test binary-14.16 {Tcl_BinaryObjCmd: format} {nonPortable macOrUnix} {
set a {1.6 3.4}
binary format d1 $a
} \x3f\xf9\x99\x99\x99\x99\x99\x9a
! test binary-14.17 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} {
set a {1.6 3.4}
binary format d1 $a
--- 529,537 ----
list [catch {binary format d $a} msg] $msg
} [list 1 "expected floating-point number but got \"1.6 3.4\""]
! test binary-14.16 {Tcl_BinaryObjCmd: format} {bigEndian} {
set a {1.6 3.4}
binary format d1 $a
} \x3f\xf9\x99\x99\x99\x99\x99\x9a
! test binary-14.17 {Tcl_BinaryObjCmd: format} {littleEndian} {
set a {1.6 3.4}
binary format d1 $a
***************
*** 1070,1110 ****
list [catch {binary scan abc f} msg] $msg
} {1 {not enough arguments for all format specifiers}}
! test binary-31.2 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a f* arg1] $arg1
} {1 {1.60000002384 3.40000009537}}
! test binary-31.3 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f\x9a\x99\x59\x40 f* arg1] $arg1
} {1 {1.60000002384 3.40000009537}}
! test binary-31.4 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a f arg1] $arg1
} {1 1.60000002384}
! test binary-31.5 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f\x9a\x99\x59\x40 f arg1] $arg1
} {1 1.60000002384}
! test binary-31.6 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd f1 arg1] $arg1
} {1 1.60000002384}
! test binary-31.7 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f f1 arg1] $arg1
} {1 1.60000002384}
! test binary-31.8 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd f0 arg1] $arg1
} {1 {}}
! test binary-31.9 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f f0 arg1] $arg1
} {1 {}}
! test binary-31.10 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a f2 arg1] $arg1
} {1 {1.60000002384 3.40000009537}}
! test binary-31.11 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f\x9a\x99\x59\x40 f2 arg1] $arg1
--- 1074,1114 ----
list [catch {binary scan abc f} msg] $msg
} {1 {not enough arguments for all format specifiers}}
! test binary-31.2 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a f* arg1] $arg1
} {1 {1.60000002384 3.40000009537}}
! test binary-31.3 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f\x9a\x99\x59\x40 f* arg1] $arg1
} {1 {1.60000002384 3.40000009537}}
! test binary-31.4 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a f arg1] $arg1
} {1 1.60000002384}
! test binary-31.5 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f\x9a\x99\x59\x40 f arg1] $arg1
} {1 1.60000002384}
! test binary-31.6 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd f1 arg1] $arg1
} {1 1.60000002384}
! test binary-31.7 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f f1 arg1] $arg1
} {1 1.60000002384}
! test binary-31.8 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd f0 arg1] $arg1
} {1 {}}
! test binary-31.9 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f f0 arg1] $arg1
} {1 {}}
! test binary-31.10 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a f2 arg1] $arg1
} {1 {1.60000002384 3.40000009537}}
! test binary-31.11 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \xcd\xcc\xcc\x3f\x9a\x99\x59\x40 f2 arg1] $arg1
***************
*** 1120,1124 ****
list [catch {binary scan \x3f\xcc\xcc\xcd f1 arg1(a)} msg] $msg
} {1 {can't set "arg1(a)": variable isn't array}}
! test binary-31.14 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1 arg2}
set arg1 foo
--- 1124,1128 ----
list [catch {binary scan \x3f\xcc\xcc\xcd f1 arg1(a)} msg] $msg
} {1 {can't set "arg1(a)": variable isn't array}}
! test binary-31.14 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1 arg2}
set arg1 foo
***************
*** 1126,1130 ****
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a\x05 f2c* arg1 arg2] $arg1 $arg2
} {2 {1.60000002384 3.40000009537} 5}
! test binary-31.15 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1 arg2}
set arg1 foo
--- 1130,1134 ----
list [binary scan \x3f\xcc\xcc\xcd\x40\x59\x99\x9a\x05 f2c* arg1 arg2] $arg1 $arg2
} {2 {1.60000002384 3.40000009537} 5}
! test binary-31.15 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1 arg2}
set arg1 foo
***************
*** 1136,1176 ****
list [catch {binary scan abc d} msg] $msg
} {1 {not enough arguments for all format specifiers}}
! test binary-32.2 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 d* arg1] $arg1
} {1 {1.6 3.4}}
! test binary-32.3 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 d* arg1] $arg1
} {1 {1.6 3.4}}
! test binary-32.4 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 d arg1] $arg1
} {1 1.6}
! test binary-32.5 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 d arg1] $arg1
} {1 1.6}
! test binary-32.6 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a d1 arg1] $arg1
} {1 1.6}
! test binary-32.7 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f d1 arg1] $arg1
} {1 1.6}
! test binary-32.8 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a d0 arg1] $arg1
} {1 {}}
! test binary-32.9 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f d0 arg1] $arg1
} {1 {}}
! test binary-32.10 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 d2 arg1] $arg1
} {1 {1.6 3.4}}
! test binary-32.11 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 d2 arg1] $arg1
--- 1140,1180 ----
list [catch {binary scan abc d} msg] $msg
} {1 {not enough arguments for all format specifiers}}
! test binary-32.2 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 d* arg1] $arg1
} {1 {1.6 3.4}}
! test binary-32.3 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 d* arg1] $arg1
} {1 {1.6 3.4}}
! test binary-32.4 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 d arg1] $arg1
} {1 1.6}
! test binary-32.5 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 d arg1] $arg1
} {1 1.6}
! test binary-32.6 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a d1 arg1] $arg1
} {1 1.6}
! test binary-32.7 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f d1 arg1] $arg1
} {1 1.6}
! test binary-32.8 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a d0 arg1] $arg1
} {1 {}}
! test binary-32.9 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f d0 arg1] $arg1
} {1 {}}
! test binary-32.10 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1}
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 d2 arg1] $arg1
} {1 {1.6 3.4}}
! test binary-32.11 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1}
list [binary scan \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 d2 arg1] $arg1
***************
*** 1186,1190 ****
list [catch {binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a d1 arg1(a)} msg] $msg
} {1 {can't set "arg1(a)": variable isn't array}}
! test binary-32.14 {Tcl_BinaryObjCmd: scan} {nonPortable macOrUnix} {
catch {unset arg1 arg2}
set arg1 foo
--- 1190,1194 ----
list [catch {binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a d1 arg1(a)} msg] $msg
} {1 {can't set "arg1(a)": variable isn't array}}
! test binary-32.14 {Tcl_BinaryObjCmd: scan} {bigEndian} {
catch {unset arg1 arg2}
set arg1 foo
***************
*** 1192,1196 ****
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33\x05 d2c* arg1 arg2] $arg1 $arg2
} {2 {1.6 3.4} 5}
! test binary-32.15 {Tcl_BinaryObjCmd: scan} {nonPortable pcOnly} {
catch {unset arg1 arg2}
set arg1 foo
--- 1196,1200 ----
list [binary scan \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33\x05 d2c* arg1 arg2] $arg1 $arg2
} {2 {1.6 3.4} 5}
! test binary-32.15 {Tcl_BinaryObjCmd: scan} {littleEndian} {
catch {unset arg1 arg2}
set arg1 foo
***************
*** 1352,1365 ****
set x [binary format c1I1 1 1]
} \x01\x00\x00\x00\x01
! test binary-38.5 {FormatNumber: word alignment} {nonPortable macOrUnix} {
set x [binary format c1d1 1 1.6]
} \x01\x3f\xf9\x99\x99\x99\x99\x99\x9a
! test binary-38.6 {FormatNumber: word alignment} {nonPortable pcOnly} {
set x [binary format c1d1 1 1.6]
} \x01\x9a\x99\x99\x99\x99\x99\xf9\x3f
! test binary-38.7 {FormatNumber: word alignment} {nonPortable macOrUnix} {
set x [binary format c1f1 1 1.6]
} \x01\x3f\xcc\xcc\xcd
! test binary-38.8 {FormatNumber: word alignment} {nonPortable pcOnly} {
set x [binary format c1f1 1 1.6]
} \x01\xcd\xcc\xcc\x3f
--- 1356,1369 ----
set x [binary format c1I1 1 1]
} \x01\x00\x00\x00\x01
! test binary-38.5 {FormatNumber: word alignment} {bigEndian} {
set x [binary format c1d1 1 1.6]
} \x01\x3f\xf9\x99\x99\x99\x99\x99\x9a
! test binary-38.6 {FormatNumber: word alignment} {littleEndian} {
set x [binary format c1d1 1 1.6]
} \x01\x9a\x99\x99\x99\x99\x99\xf9\x3f
! test binary-38.7 {FormatNumber: word alignment} {bigEndian} {
set x [binary format c1f1 1 1.6]
} \x01\x3f\xcc\xcc\xcd
! test binary-38.8 {FormatNumber: word alignment} {littleEndian} {
set x [binary format c1f1 1 1.6]
} \x01\xcd\xcc\xcc\x3f
***************
*** 1386,1402 ****
} {1 {16843010 -2130640639 25297153 16876033 16843137}}
! test binary-40.1 {ScanNumber: floating point overflow} {nonPortable unixOnly} {
! catch {unset arg1}
! list [binary scan \xff\xff\xff\xff f1 arg1] $arg1
! } {1 -NaN}
! test binary-40.2 {ScanNumber: floating point overflow} {nonPortable macOnly} {
catch {unset arg1}
list [binary scan \xff\xff\xff\xff f1 arg1] $arg1
} {1 -NAN(255)}
! test binary-40.3 {ScanNumber: floating point overflow} {nonPortable pcOnly} {
catch {unset arg1}
set result [binary scan \xff\xff\xff\xff f1 arg1]
if {([string compare $arg1 -1.\#QNAN] == 0)
! || ([string compare $arg1 -NAN] == 0)} {
lappend result success
} else {
--- 1390,1411 ----
} {1 {16843010 -2130640639 25297153 16876033 16843137}}
! test binary-40.1 {ScanNumber: floating point overflow} \
! -constraints {bigEndian unixOnly} \
! -body {
! catch {unset arg1}
! list [binary scan \xff\xff\xff\xff f1 arg1] $arg1
! } \
! -match regexp \
! -result {1 -?[nN]a[nN]}
! test binary-40.2 {ScanNumber: floating point overflow} {bigEndian macOnly} {
catch {unset arg1}
list [binary scan \xff\xff\xff\xff f1 arg1] $arg1
} {1 -NAN(255)}
! test binary-40.3 {ScanNumber: floating point overflow} {littleEndian hasNan} {
catch {unset arg1}
set result [binary scan \xff\xff\xff\xff f1 arg1]
if {([string compare $arg1 -1.\#QNAN] == 0)
! || ([string compare $arg1 -NAN] == 0)
! || ([string compare $arg1 nan] == 0)} {
lappend result success
} else {
***************
*** 1404,1420 ****
}
} {1 success}
! test binary-40.4 {ScanNumber: floating point overflow} {nonPortable unixOnly} {
! catch {unset arg1}
! list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1
! } {1 -NaN}
! test binary-40.5 {ScanNumber: floating point overflow} {nonPortable macOnly} {
catch {unset arg1}
list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1
} {1 -NAN(255)}
! test binary-40.6 {ScanNumber: floating point overflow} {nonPortable pcOnly} {
catch {unset arg1}
set result [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1]
if {([string compare $arg1 -1.\#QNAN] == 0)
! || ([string compare $arg1 -NAN] == 0)} {
lappend result success
} else {
--- 1413,1434 ----
}
} {1 success}
! test binary-40.4 {ScanNumber: floating point overflow} \
! -constraints {bigEndian unixOnly} \
! -body {
! catch {unset arg1}
! list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1
! } \
! -match regexp \
! -result {1 -?[nN]a[nN]}
! test binary-40.5 {ScanNumber: floating point overflow} {bigEndian macOnly} {
catch {unset arg1}
list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1
} {1 -NAN(255)}
! test binary-40.6 {ScanNumber: floating point overflow} {littleEndian hasNan} {
catch {unset arg1}
set result [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1]
if {([string compare $arg1 -1.\#QNAN] == 0)
! || ([string compare $arg1 -NAN] == 0)
! || ([string compare $arg1 nan] == 0)} {
lappend result success
} else {
***************
*** 1439,1455 ****
list [binary scan \x01\x00\x00\x00\x01 c1I1 arg1 arg2] $arg1 $arg2
} {2 1 1}
! test binary-41.5 {ScanNumber: word alignment} {nonPortable macOrUnix} {
catch {unset arg1; unset arg2}
list [binary scan \x01\x3f\xcc\xcc\xcd c1f1 arg1 arg2] $arg1 $arg2
} {2 1 1.60000002384}
! test binary-41.6 {ScanNumber: word alignment} {nonPortable pcOnly} {
catch {unset arg1; unset arg2}
list [binary scan \x01\xcd\xcc\xcc\x3f c1f1 arg1 arg2] $arg1 $arg2
} {2 1 1.60000002384}
! test binary-41.7 {ScanNumber: word alignment} {nonPortable macOrUnix} {
catch {unset arg1; unset arg2}
list [binary scan \x01\x3f\xf9\x99\x99\x99\x99\x99\x9a c1d1 arg1 arg2] $arg1 $arg2
} {2 1 1.6}
! test binary-41.8 {ScanNumber: word alignment} {nonPortable pcOnly} {
catch {unset arg1; unset arg2}
list [binary scan \x01\x9a\x99\x99\x99\x99\x99\xf9\x3f c1d1 arg1 arg2] $arg1 $arg2
--- 1453,1469 ----
list [binary scan \x01\x00\x00\x00\x01 c1I1 arg1 arg2] $arg1 $arg2
} {2 1 1}
! test binary-41.5 {ScanNumber: word alignment} {bigEndian} {
catch {unset arg1; unset arg2}
list [binary scan \x01\x3f\xcc\xcc\xcd c1f1 arg1 arg2] $arg1 $arg2
} {2 1 1.60000002384}
! test binary-41.6 {ScanNumber: word alignment} {littleEndian} {
catch {unset arg1; unset arg2}
list [binary scan \x01\xcd\xcc\xcc\x3f c1f1 arg1 arg2] $arg1 $arg2
} {2 1 1.60000002384}
! test binary-41.7 {ScanNumber: word alignment} {bigEndian} {
catch {unset arg1; unset arg2}
list [binary scan \x01\x3f\xf9\x99\x99\x99\x99\x99\x9a c1d1 arg1 arg2] $arg1 $arg2
} {2 1 1.6}
! test binary-41.8 {ScanNumber: word alignment} {littleEndian} {
catch {unset arg1; unset arg2}
list [binary scan \x01\x9a\x99\x99\x99\x99\x99\xf9\x3f c1d1 arg1 arg2] $arg1 $arg2