summaryrefslogtreecommitdiffstats
path: root/tests/format.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-09-03 12:53:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-09-03 12:53:15 (GMT)
commit2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2 (patch)
treeed9189deb7f4bee3b751fa2588d626b12111cffd /tests/format.test
parent5f1bd2f2e3aa755c4216fb0e47dd2c04f47a1453 (diff)
downloadtcl-2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2.zip
tcl-2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2.tar.gz
tcl-2f2b7f6ac7122f3b6be07e793e1658cdb5791aa2.tar.bz2
Eliminate use of wideBiggerThanInt test constraint, since it's the same as {longIs32bit wideIs64bit}. And ... it's name is actually wrong ...
Don't use int() any more in any test constraint, since it's semantics might change. We don't want the test constraints to change with it. (See: TIP# 514) Simplify implementation of wideIs64bit test constraint, just testing for 64-bit sign bit is enough.
Diffstat (limited to 'tests/format.test')
-rw-r--r--tests/format.test12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/format.test b/tests/format.test
index cdea545..1bf46a1 100644
--- a/tests/format.test
+++ b/tests/format.test
@@ -16,11 +16,9 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
}
# %u output depends on word length, so this test is not portable.
-testConstraint longIs32bit [expr {int(0x80000000) < 0}]
-testConstraint longIs64bit [expr {int(0x8000000000000000) < 0}]
-testConstraint wideIs64bit \
- [expr {(wide(0x80000000) > 0) && (wide(0x8000000000000000) < 0)}]
-testConstraint wideBiggerThanInt [expr {wide(0x80000000) != int(0x80000000)}]
+testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}]
+testConstraint longIs64bit [expr {$tcl_platform(wordSize) == 8}]
+testConstraint wideIs64bit [expr {wide(0x8000000000000000) < 0}]
testConstraint pointerIs64bit [expr {$tcl_platform(pointerSize) >= 8}]
test format-1.1 {integer formatting} {
@@ -547,7 +545,7 @@ for {set i 290} {$i < 400} {incr i} {
append b "x"
}
-test format-17.1 {testing %d with wide} {wideIs64bit wideBiggerThanInt} {
+test format-17.1 {testing %d with wide} {longIs32bit wideIs64bit} {
format %d 7810179016327718216
} 1819043144
test format-17.2 {testing %ld with wide} {wideIs64bit} {
@@ -580,7 +578,7 @@ test format-18.1 {do not demote existing numeric values} {
format %08x $b
lappend result [expr {$a == $b}]
} {1 1 1 1}
-test format-18.2 {do not demote existing numeric values} {wideBiggerThanInt} {
+test format-18.2 {do not demote existing numeric values} {longIs32bit wideIs64bit} {
set a [expr {0xaaaaaaaaaa + 1}]
set b 0xaaaaaaaaab
list [format %08x $a] [expr {$a == $b}]