diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-08-16 18:54:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-08-16 18:54:44 (GMT) |
commit | bb8a3f52d5021d20ce0ca8657eb10e0333f66774 (patch) | |
tree | b78dc4daeaf04a878dcf8e2f524de422cf344adb /tests/obj.test | |
parent | 310ea12f037e873c15782f5a7581220d09e8fe04 (diff) | |
download | tcl-bb8a3f52d5021d20ce0ca8657eb10e0333f66774.zip tcl-bb8a3f52d5021d20ce0ca8657eb10e0333f66774.tar.gz tcl-bb8a3f52d5021d20ce0ca8657eb10e0333f66774.tar.bz2 |
Undo various test-case changes, in order to prove platform compatibility
Diffstat (limited to 'tests/obj.test')
-rw-r--r-- | tests/obj.test | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/obj.test b/tests/obj.test index 41b1428..ffd1a59 100644 --- a/tests/obj.test +++ b/tests/obj.test @@ -20,6 +20,8 @@ if {[lsearch [namespace children] ::tcltest] == -1} { catch [list package require -exact Tcltest [info patchlevel]] testConstraint testobj [llength [info commands testobj]] +testConstraint longIs32bit [expr {int(0x80000000) < 0}] +testConstraint wideBiggerThanInt [expr {wide(0x80000000) != int(0x80000000)}] test obj-1.1 {Tcl_AppendAllObjTypes, and InitTypeTable, Tcl_RegisterObjType} testobj { set r 1 @@ -547,34 +549,34 @@ test obj-32.1 {freeing very large object trees} { unset x } {} -test obj-33.1 {integer overflow on input} { +test obj-33.1 {integer overflow on input} {longIs32bit wideBiggerThanInt} { set x 0x8000; append x 0000 list [string is integer $x] [expr { wide($x) }] } {1 2147483648} -test obj-33.2 {integer overflow on input} { +test obj-33.2 {integer overflow on input} {longIs32bit wideBiggerThanInt} { set x 0xffff; append x ffff list [string is integer $x] [expr { wide($x) }] } {1 4294967295} test obj-33.3 {integer overflow on input} { - set x 0x10000; append x 0000 - list [string is integer $x] [expr { wide($x) }] -} {1 4294967296} -test obj-33.4 {integer overflow on input} { + set x 0x100000000; append x 00000000 + list [string is integer $x] [expr { $x }] +} {0 18446744073709551616} +test obj-33.4 {integer overflow on input} {longIs32bit wideBiggerThanInt} { set x -0x8000; append x 0000 list [string is integer $x] [expr { wide($x) }] } {1 -2147483648} -test obj-33.5 {integer overflow on input} { +test obj-33.5 {integer overflow on input} {longIs32bit wideBiggerThanInt} { set x -0x8000; append x 0001 list [string is integer $x] [expr { wide($x) }] } {1 -2147483649} -test obj-33.6 {integer overflow on input} { +test obj-33.6 {integer overflow on input} {longIs32bit wideBiggerThanInt} { set x -0xffff; append x ffff list [string is integer $x] [expr { wide($x) }] } {1 -4294967295} test obj-33.7 {integer overflow on input} { - set x -0x10000; append x 0000 - list [string is integer $x] [expr { wide($x) }] -} {1 -4294967296} + set x -0x100000000; append x 00000000 + list [string is integer $x] [expr { $x }] +} {0 -18446744073709551616} test obj-34.1 {mp_iseven} testobj { set result "" |