summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-05-02 11:28:55 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-05-02 11:28:55 (GMT)
commiteb23b011d0a81051dda86fd13ec6115cc39675d4 (patch)
treefe44f47f7add199fc80146215d0d3955d15571a3
parent694c4505cd26d54934847d0e5442ae3d5dca36fd (diff)
parent03d0f99e6ccaa554c9e7a7e3c9f71d7efb03e0f6 (diff)
downloadtcl-eb23b011d0a81051dda86fd13ec6115cc39675d4.zip
tcl-eb23b011d0a81051dda86fd13ec6115cc39675d4.tar.gz
tcl-eb23b011d0a81051dda86fd13ec6115cc39675d4.tar.bz2
Merge trunk
-rw-r--r--generic/tclExecute.c2
-rw-r--r--tests/bigdata.test27
-rw-r--r--tests/binary.test4
3 files changed, 16 insertions, 17 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 56c8207..647e3db 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5492,7 +5492,7 @@ TEBCresume(
NEXT_INST_F(1, 2, 1);
case INST_STR_FIND_LAST:
- objResultPtr = TclStringLast(OBJ_UNDER_TOS, OBJ_AT_TOS, INT_MAX - 1);
+ objResultPtr = TclStringLast(OBJ_UNDER_TOS, OBJ_AT_TOS, TCL_SIZE_MAX - 1);
TRACE(("%.20s %.20s => %s\n",
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(objResultPtr)));
diff --git a/tests/bigdata.test b/tests/bigdata.test
index bd39a7f..bf61f34 100644
--- a/tests/bigdata.test
+++ b/tests/bigdata.test
@@ -196,7 +196,7 @@ bigtestRO string-first-bigdata-1 "string first > INT_MAX" {2147483648 -1 2147483
set s [bigString 0x8000000a 0x80000000]
} -cleanup {
bigClean
-} -constraints bug-a814ee5bbd
+}
bigtestRO string-first-bigdata-2 "string first > UINT_MAX" {4294967296 -1 4294967300 1} -body {
list \
@@ -208,7 +208,7 @@ bigtestRO string-first-bigdata-2 "string first > UINT_MAX" {4294967296 -1 429496
set s [bigString 0x10000000a 0x100000000]
} -cleanup {
bigClean
-} -constraints bug-a814ee5bbd
+}
bigtestRO string-first-bigdata-3 "string first - long needle" 10 -body {
string first $needle $s
@@ -217,7 +217,7 @@ bigtestRO string-first-bigdata-3 "string first - long needle" 10 -body {
set needle [bigString 0x100000000]
} -cleanup {
bigClean needle
-} -constraints bug-a814ee5bbd
+}
#
# string index
@@ -274,8 +274,7 @@ bigtestRO string-last-bigdata-1 "string last > INT_MAX" {2 -1 2147483640 11} -bo
set s [bigString 0x80000010 2]
} -cleanup {
bigClean
-} -constraints bug-a814ee5bbd
-
+}
bigtestRO string-last-bigdata-2 "string last > UINT_MAX" {4294967300 -1 4294967290 1} -body {
list \
[string last 0 $s] \
@@ -286,8 +285,7 @@ bigtestRO string-last-bigdata-2 "string last > UINT_MAX" {4294967300 -1 42949672
set s [bigString 0x10000000a 2]
} -cleanup {
bigClean
-} -constraints bug-a814ee5bbd
-
+}
bigtestRO string-last-bigdata-3 "string last - long needle" 0 -body {
string last $needle $s
} -setup {
@@ -295,7 +293,7 @@ bigtestRO string-last-bigdata-3 "string last - long needle" 0 -body {
set needle [bigString 0x100000000]
} -cleanup {
bigClean needle
-} -constraints bug-a814ee5bbd
+}
#
# string length
@@ -723,7 +721,6 @@ bigtestRO binary-format-bigdata-1 "binary format aN" [list 4294967296 X\0\0\0 \
} -cleanup {
bigClean
}
-# -constraints bug-9369f83649
# TODO - do string compare and add other format specifiers
bigtestRO binary-format-bigdata-2 "binary format a*" 1 -body {
@@ -751,7 +748,6 @@ bigtestRO binary-scan-bigdata-1 "binary scan aN" {4294967296 0123 2345} -body {
} -cleanup {
bigClean
}
-# -constraints bug-9369f83649
# TODO - do string compare and add other format specifiers once above bug is fixed
bigtestRO binary-scan-bigdata-2 "binary scan a*" 1 -body {
@@ -863,14 +859,15 @@ bigtest ledit-bigdata-2 "ledit - large result" {4294967304 4294967304 {a b c d e
bigClean
}
-bigtest ledit-bigdata-3 "ledit - small -> large result" {2147483651 2147483651} -body {
- set l2 {a b c x y z}
- list [llength [ledit l2 2 3 {*}$l]] [llength $l2]
+bigtest ledit-bigdata-3 "ledit - small -> large result" {2147483650 2147483650 {a b 0 1 2 3 4 5} {0 1 e f g h i j}} -body {
+ set l2 {a b c d e f g h i j}
+ list [llength [ledit l2 2 3 {*}$l]] [llength $l2] [lrange $l2 0 7] [lrange $l2 end-7 end]
} -setup {
- set l [bigList 2147483647]
+ # Note total number of arguments has to be less than INT_MAX
+ set l [bigList 2147483642]
} -cleanup {
bigClean
-} -constraints bug-7cddd2845c
+} -constraints memory-allocation-panic
#
# lindex
diff --git a/tests/binary.test b/tests/binary.test
index 2984fec..be8dd10 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -15,6 +15,8 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
::tcltest::loadTestedCommands
+source [file join [file dirname [info script]] tcltests.tcl]
+
catch [list package require -exact tcl::test [info patchlevel]]
testConstraint bigEndian [expr {$tcl_platform(byteOrder) eq "bigEndian"}]
@@ -3040,7 +3042,7 @@ test binary-80.3 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes
test binary-80.4 {Tcl_GetBytesFromObj} -constraints testbytestring -returnCodes 1 -body {
testbytestring [testbytestring "\xC0\x80\xA0\xA0\xA0\xF0\x9F\x98\x81"]
} -result "expected byte sequence but character 4 was '\U01F601' (U+01F601)"
-test binary-80.5 {Tcl_GetBytesFromObj} -constraints testbytestring -constraints pointerIs64bit -body {
+test binary-80.5 {Tcl_GetBytesFromObj} -constraints testbytestring -constraints {pointerIs64bit deprecated} -body {
testbytestring [string repeat A [expr 2**31]]
} -returnCodes 1 -result "byte sequence length exceeds INT_MAX"