diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-21 18:46:12 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-21 18:46:12 (GMT) |
commit | 4203570d01e8752288a5aed95f5a832f15a5b548 (patch) | |
tree | a77fb11308dcdafe1c1595e83cc1128ff6fe798b /Lib/test | |
parent | b817faa4ce2e975da009d35493146929f4024308 (diff) | |
download | cpython-4203570d01e8752288a5aed95f5a832f15a5b548.zip cpython-4203570d01e8752288a5aed95f5a832f15a5b548.tar.gz cpython-4203570d01e8752288a5aed95f5a832f15a5b548.tar.bz2 |
Issue #17119: Fixed integer overflows when processing large Unicode strings
and tuples in the tkinter module.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tcl.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index 3da87d9..3460262 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 test_support from subprocess import Popen, PIPE @@ -245,8 +246,22 @@ class TclTest(unittest.TestCase): self.assertEqual(split(arg), res) +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") + @test_support.precisionbigmemtest(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(): - test_support.run_unittest(TclTest, TkinterTest) + test_support.run_unittest(TclTest, TkinterTest, BigmemTclTest) if __name__ == "__main__": test_main() |