summaryrefslogtreecommitdiffstats
path: root/tests/platform.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/platform.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/platform.test')
-rw-r--r--tests/platform.test14
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/platform.test b/tests/platform.test
index fa533e8..5880fb9 100644
--- a/tests/platform.test
+++ b/tests/platform.test
@@ -25,6 +25,7 @@ namespace eval ::tcl::test::platform {
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testCPUID [llength [info commands testcpuid]]
+testConstraint testlongsize [llength [info commands testlongsize]]
test platform-1.0 {tcl_platform(engine)} {
set tcl_platform(engine)
@@ -39,16 +40,9 @@ test platform-1.1 {TclpSetVariables: tcl_platform} {
set result
} {byteOrder engine machine os osVersion pathSeparator platform pointerSize user wordSize}
-# Test assumes twos-complement arithmetic, which is true of virtually
-# everything these days. Note that this does *not* use wide(), and
-# this is intentional since that could make Tcl's numbers wider than
-# the machine-integer on some platforms...
-test platform-2.1 {tcl_platform(wordSize) indicates size of native word} {
- set result [expr {int(1 << (8 * $tcl_platform(wordSize) - 1))}]
- # Result must be the largest bit in a machine word, which this checks
- # without assuming how wide the word really is
- list [expr {$result < 0}] [expr {$result ^ int($result - 1)}]
-} {1 -1}
+test platform-2.1 {tcl_platform(wordSize) indicates size of native word} testlongsize {
+ expr {$tcl_platform(wordSize) == [testlongsize]}
+} {1}
# On Windows/UNIX, test that the CPU ID works