summaryrefslogtreecommitdiffstats
path: root/tests/indexObj.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/indexObj.test')
-rw-r--r--tests/indexObj.test22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/indexObj.test b/tests/indexObj.test
index f8cdf3e..f157637 100644
--- a/tests/indexObj.test
+++ b/tests/indexObj.test
@@ -20,6 +20,7 @@ testConstraint testindexobj [llength [info commands testindexobj]]
testConstraint testgetintforindex [llength [info commands testgetintforindex]]
testConstraint testparseargs [llength [info commands testparseargs]]
testConstraint has64BitLengths [expr {$tcl_platform(pointerSize) == 8}]
+testConstraint has32BitLengths [expr {$tcl_platform(pointerSize) == 4}]
test indexObj-1.1 {exact match} testindexobj {
testindexobj 1 1 xyz abc def xyz alm
@@ -203,25 +204,26 @@ test indexObj-8.10 {Tcl_GetIntForIndex end-1} testgetintforindex {
} -2
test indexObj-8.11 {Tcl_GetIntForIndex end-1} testgetintforindex {
testgetintforindex end-1 -2
-} [expr {[testConstraint has64BitLengths] ? -3 : 2147483647}]
+} -3
test indexObj-8.12 {Tcl_GetIntForIndex end} testgetintforindex {
testgetintforindex end -1
} -1
test indexObj-8.13 {Tcl_GetIntForIndex end} testgetintforindex {
testgetintforindex end -2
-} [expr {[testConstraint has64BitLengths] ? -2 : 2147483647}]
-test indexObj-8.14 {Tcl_GetIntForIndex end+1} testgetintforindex {
+} -2
+test indexObj-8.14 {Tcl_GetIntForIndex end+1} -constraints {
+ testgetintforindex has64BitLengths
+} -body {
+ testgetintforindex end+1 -1
+} -result 9223372036854775807
+test indexObj-8.14.32bits {Tcl_GetIntForIndex end+1} -constraints {
+ testgetintforindex has32BitLengths
+} -body {
testgetintforindex end+1 -1
-} [expr {[testConstraint has64BitLengths] ? 9223372036854775807 : 2147483647}]
+} -result 2147483647
test indexObj-8.15 {Tcl_GetIntForIndex end+1} testgetintforindex {
testgetintforindex end+1 -2
} -1
-test indexObj-8.16 {Tcl_GetIntForIndex integer} testgetintforindex {
- testgetintforindex -1 -1
-} [expr {[testConstraint has64BitLengths] ? -9223372036854775808 : -2147483648}]
-test indexObj-8.17 {Tcl_GetIntForIndex integer} testgetintforindex {
- testgetintforindex -2 -1
-} [expr {[testConstraint has64BitLengths] ? -9223372036854775808 : -2147483648}]
# cleanup
::tcltest::cleanupTests