summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/dstring.test9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/dstring.test b/tests/dstring.test
index 59b3459..cb1cc4f 100644
--- a/tests/dstring.test
+++ b/tests/dstring.test
@@ -425,13 +425,10 @@ test dstring-4.3 {truncation} -constraints testdstring -setup {
# Pass a negative length to Tcl_DStringSetLength();
# if not caught, causing '\0' to be written out-of-bounds,
# try corrupting dsPtr->length which begins
- # 2*sizeof(Tcl_Size) bytes before dsPtr->staticSpace[],
+ # 2*sizeof(int) bytes before dsPtr->staticSpace[],
# so that the result is -256 (on little endian systems)
- # rather than e.g. -8 or -16.
- # (sizeof(Tcl_Size) does not seem to be available via Tcl,
- # so assume sizeof(Tcl_Size) == sizeof(void*) for Tcl 9.)
- testdstring trunc [expr {-2*([package vsatisfies $tcl_version 9.0-]
- ? $tcl_platform(pointerSize) : 4)}]
+ # rather than e.g. -8.
+ testdstring trunc -8
list [testdstring get] [testdstring length]
} -cleanup {
testdstring free