Issue #21639: Add a test to check that PyMem_Malloc(0) with tracemalloc enabled

does not crash.
This commit is contained in:
Victor Stinner 2014-06-02 21:36:59 +02:00
parent 797bcb51d0
commit 8dd49fe09f
1 changed files with 6 additions and 0 deletions

View File

@ -807,6 +807,12 @@ class TestCommandLine(unittest.TestCase):
b'number of frames',
stderr)
def test_pymem_alloc0(self):
# Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled
# does not crash.
code = 'import _testcapi; _testcapi.test_pymem_alloc0(); 1'
assert_python_ok('-X', 'tracemalloc', '-c', code)
def test_main():
support.run_unittest(