summaryrefslogtreecommitdiffstats
path: root/tests/get.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/get.test')
-rw-r--r--tests/get.test22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/get.test b/tests/get.test
index a04e131..ceed09d 100644
--- a/tests/get.test
+++ b/tests/get.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: get.test,v 1.9 2004/05/19 10:38:24 dkf Exp $
+# RCS: @(#) $Id: get.test,v 1.10 2005/07/27 18:12:43 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -18,7 +18,9 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
}
testConstraint testgetint [llength [info commands testgetint]]
-testConstraint intsAre64bit [expr {int(0x80000000) > 0}]
+testConstraint longIs32bit [expr {int(0x80000000) < 0}]
+testConstraint longIs64bit [expr {int(0x8000000000000000) < 0}]
+#testConstraint longIsMoreThan32bit [expr {![testConstraint longIs32bit]}]
test get-1.1 {Tcl_GetInt procedure} testgetint {
testgetint 44 { 22}
@@ -38,28 +40,28 @@ test get-1.5 {Tcl_GetInt procedure} testgetint {
test get-1.6 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint 44 {16 x}} msg] $msg
} {1 {expected integer but got "16 x"}}
-test get-1.7 {Tcl_GetInt procedure} {testgetint intsAre64bit} {
+test get-1.7 {Tcl_GetInt procedure} {testgetint longIs64bit} {
list [catch {testgetint 44 18446744073709551616} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test get-1.8 {Tcl_GetInt procedure} {testgetint intsAre64bit} {
+test get-1.8 {Tcl_GetInt procedure} {testgetint longIs64bit} {
list [catch {testgetint 18446744073709551614} msg] $msg
} {0 -2}
-test get-1.9 {Tcl_GetInt procedure} {testgetint intsAre64bit} {
+test get-1.9 {Tcl_GetInt procedure} {testgetint longIs64bit} {
list [catch {testgetint +18446744073709551614} msg] $msg
} {0 -2}
-test get-1.10 {Tcl_GetInt procedure} {testgetint intsAre64bit} {
+test get-1.10 {Tcl_GetInt procedure} {testgetint longIs64bit} {
list [catch {testgetint -18446744073709551614} msg] $msg
} {0 2}
-test get-1.11 {Tcl_GetInt procedure} {testgetint && !intsAre64bit} {
+test get-1.11 {Tcl_GetInt procedure} {testgetint longIs32bit} {
list [catch {testgetint 44 4294967296} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test get-1.12 {Tcl_GetInt procedure} {testgetint && !intsAre64bit} {
+test get-1.12 {Tcl_GetInt procedure} {testgetint longIs32bit} {
list [catch {testgetint 4294967294} msg] $msg
} {0 -2}
-test get-1.13 {Tcl_GetInt procedure} {testgetint && !intsAre64bit} {
+test get-1.13 {Tcl_GetInt procedure} {testgetint longIs32bit} {
list [catch {testgetint +4294967294} msg] $msg
} {0 -2}
-test get-1.14 {Tcl_GetInt procedure} {testgetint && !intsAre64bit} {
+test get-1.14 {Tcl_GetInt procedure} {testgetint longIs32bit} {
list [catch {testgetint -4294967294} msg] $msg
} {0 2}