summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tcl.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-21 18:38:21 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-21 18:38:21 (GMT)
commit9e6b97502f3a0c5f7d24e0b7f05dc9b41b0d0b85 (patch)
tree772f1f1b8b287cde7bdb62f974f33f9a242cf15d /Lib/test/test_tcl.py
parentf77b4b20e931dd0247a176db856723fe1203d32e (diff)
downloadcpython-9e6b97502f3a0c5f7d24e0b7f05dc9b41b0d0b85.zip
cpython-9e6b97502f3a0c5f7d24e0b7f05dc9b41b0d0b85.tar.gz
cpython-9e6b97502f3a0c5f7d24e0b7f05dc9b41b0d0b85.tar.bz2
Issue #17119: Fixed integer overflows when processing large strings and tuples
in the tkinter module.
Diffstat (limited to 'Lib/test/test_tcl.py')
-rw-r--r--Lib/test/test_tcl.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index a5aaf9b..91d324d 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -3,6 +3,7 @@
import unittest
import sys
import os
+import _testcapi
from test import support
# Skip this test if the _tkinter module wasn't built.
@@ -236,8 +237,21 @@ class TclTest(unittest.TestCase):
self.assertEqual(split(arg), res, msg=arg)
+class BigmemTclTest(unittest.TestCase):
+
+ def setUp(self):
+ self.interp = Tcl()
+
+ @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
+ "needs UINT_MAX < SIZE_MAX")
+ @support.bigmemtest(size=_testcapi.INT_MAX + 1, memuse=5, dry_run=False)
+ def test_huge_string(self, size):
+ value = ' ' * size
+ self.assertRaises(OverflowError, self.interp.call, 'set', '_', value)
+
+
def test_main():
- support.run_unittest(TclTest, TkinterTest)
+ support.run_unittest(TclTest, TkinterTest, BigmemTclTest)
if __name__ == "__main__":
test_main()