summaryrefslogtreecommitdiffstats
path: root/tests/obj.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-07-28 18:42:28 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-07-28 18:42:28 (GMT)
commitcb789f51b77dd4702d548d9aa828a757472b725a (patch)
tree85f757e2612f551d93a44ffbca41b861711fe9b2 /tests/obj.test
parent97b69e6ac0b3bfe72f1e3e4a490af5a45fb22776 (diff)
downloadtcl-cb789f51b77dd4702d548d9aa828a757472b725a.zip
tcl-cb789f51b77dd4702d548d9aa828a757472b725a.tar.gz
tcl-cb789f51b77dd4702d548d9aa828a757472b725a.tar.bz2
* tests/compExpr-old.test: Still more conversion of "nonPortable"
* tests/error.test: tests into tests with constraints that * tests/expr-old.test: describe the limits of their * tests/expr.test: portability. Also more consolidation * tests/fileName.test: of constraint synonyms. * tests/format.test: wideis64bit, 64bitInts => wideIs64bit * tests/get.test: wideIntegerUnparsed => wideIs32bit * tests/load.test: wideIntExpressions => wideBiggerThanInt * tests/obj.test: * tests/parseExpr.test: Dropped "roundOffBug" constraint that * tests/string.test: protected from buggy sprintf.
Diffstat (limited to 'tests/obj.test')
-rw-r--r--tests/obj.test31
1 files changed, 5 insertions, 26 deletions
diff --git a/tests/obj.test b/tests/obj.test
index 76e008e..e905698 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -11,37 +11,16 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: obj.test,v 1.17 2005/07/27 18:12:43 dgp Exp $
+# RCS: @(#) $Id: obj.test,v 1.18 2005/07/28 18:42:32 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import -force ::tcltest::*
}
-# Procedure to determine the integer range of the machine
-proc int_range {} {
- for {set MIN_INT 1} {$MIN_INT > 0} {} {
- set MIN_INT [expr {$MIN_INT << 1}]
- }
- set MAX_INT [expr {~ $MIN_INT}]
- return [list $MIN_INT $MAX_INT]
-}
-
-# Procedure to determine the range of wide integers on the machine.
-proc wide_range {} {
- for {set MIN_WIDE [expr {wide(1)}] } {$MIN_WIDE > wide(0)} {} {
- set MIN_WIDE [expr {$MIN_WIDE << 1}]
- }
- set MAX_WIDE [expr {~ $MIN_WIDE}]
- return [list $MIN_WIDE $MAX_WIDE]
-}
-
-foreach {MIN_INT MAX_INT} [int_range] break
-foreach {MIN_WIDE MAX_WIDE} [wide_range] break
-
testConstraint testobj [llength [info commands testobj]]
testConstraint longIs32bit [expr {int(0x80000000) < 0}]
-testConstraint wideBiggerThanInt [expr {$MAX_WIDE > wide($MAX_INT)}]
+testConstraint wideBiggerThanInt [expr {wide(0x80000000) != int(0x80000000)}]
test obj-1.1 {Tcl_AppendAllObjTypes, and InitTypeTable, Tcl_RegisterObjType} testobj {
set r 1
@@ -446,7 +425,7 @@ test obj-23.4 {Tcl_GetIntFromObj, error converting from "empty string"} testobj
lappend result [catch {testintobj div10 1} msg]
lappend result $msg
} {{} 1 {expected integer but got ""}}
-test obj-23.5 {Tcl_GetIntFromObj, integer too large to represent as non-long error} {testobj nonPortable} {
+test obj-23.5 {Tcl_GetIntFromObj, integer too large to represent as non-long error} {testobj} {
set result ""
lappend result [testobj newobj 1]
lappend result [testintobj inttoobigtest 1]
@@ -490,7 +469,7 @@ test obj-25.5 {SetIntFromAny, error parsing string} testobj {
lappend result [catch {testintobj mult10 1} msg]
lappend result $msg
} {x17 1 {expected integer but got "x17"}}
-test obj-25.6 {SetIntFromAny, integer too large} {testobj nonPortable} {
+test obj-25.6 {SetIntFromAny, integer too large} {testobj} {
set result ""
lappend result [teststringobj set 1 123456789012345678901]
lappend result [catch {testintobj mult10 1} msg]
@@ -605,7 +584,7 @@ test obj-31.5 {regenerate string rep of "end--bigInteger"} testobj {
testobj convert 1 end-offset
testobj invalidateStringRep 1
} end--2147483647
-test obj-31.6 {regenerate string rep of "end--bigInteger"} {testobj nonPortable} {
+test obj-31.6 {regenerate string rep of "end--bigInteger"} {testobj longIs32bit} {
testobj freeallvars
teststringobj set 1 end--0x80000000
testobj convert 1 end-offset