summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-21 18:43:08 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-21 18:43:08 (GMT)
commit4e4088d2734e9f53b4947b8fc1024c4884d26c5e (patch)
treeef00bfb0a0876b1ab2f87ebf2ff8b6de283048f8 /Lib/test
parent6acbe2aaa385ada342ac9421333fce083041f06f (diff)
parent9e6b97502f3a0c5f7d24e0b7f05dc9b41b0d0b85 (diff)
downloadcpython-4e4088d2734e9f53b4947b8fc1024c4884d26c5e.zip
cpython-4e4088d2734e9f53b4947b8fc1024c4884d26c5e.tar.gz
cpython-4e4088d2734e9f53b4947b8fc1024c4884d26c5e.tar.bz2
Issue #17119: Fixed integer overflows when processing large strings and tuples
in the tkinter module.
Diffstat (limited to 'Lib/test')
-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()