diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-02-27 04:15:07 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-02-27 04:15:07 (GMT) |
commit | e2d89615d52e47ed3b683498567e058e809aea39 (patch) | |
tree | 1e350e0b2e30bbc0d1da59a895173f4ec17fb634 /tests | |
parent | 5ffda39949b785859a8ab5b9b4977536dde6f9f2 (diff) | |
download | tcl-e2d89615d52e47ed3b683498567e058e809aea39.zip tcl-e2d89615d52e47ed3b683498567e058e809aea39.tar.gz tcl-e2d89615d52e47ed3b683498567e058e809aea39.tar.bz2 |
Tests for encoding strings > 4GB (under perf constraint)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/encoding.test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index e0e1598..8b14353 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -1046,6 +1046,32 @@ test encoding-29.0 {get encoding nul terminator lengths} -constraints { [testencoding nullength ksc5601] } -result {1 2 4 2 2} +test encoding-30.0 {encoding convertto large strings UINT_MAX} -constraints { + perf +} -body { + # Test to ensure not misinterpreted as -1 + list [string length [set s [string repeat A 0xFFFFFFFF]]] [string equal $s [encoding convertto ascii $s]] +} -result {4294967295 1} + +test encoding-30.1 {encoding convertto large strings > 4GB} -constraints { + perf +} -body { + list [string length [set s [string repeat A 0x100000000]]] [string equal $s [encoding convertto ascii $s]] +} -result {4294967296 1} + +test encoding-30.2 {encoding convertfrom large strings UINT_MAX} -constraints { + perf +} -body { + # Test to ensure not misinterpreted as -1 + list [string length [set s [string repeat A 0xFFFFFFFF]]] [string equal $s [encoding convertfrom ascii $s]] +} -result {4294967295 1} + +test encoding-30.3 {encoding convertfrom large strings > 4GB} -constraints { + perf +} -body { + list [string length [set s [string repeat A 0x100000000]]] [string equal $s [encoding convertfrom ascii $s]] +} -result {4294967296 1} + # cleanup namespace delete ::tcl::test::encoding |