mirror of https://github.com/python/cpython
Issue #21639: Add a test to check that PyMem_Malloc(0) with tracemalloc enabled
does not crash.
This commit is contained in:
parent
797bcb51d0
commit
8dd49fe09f
|
@ -807,6 +807,12 @@ class TestCommandLine(unittest.TestCase):
|
||||||
b'number of frames',
|
b'number of frames',
|
||||||
stderr)
|
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():
|
def test_main():
|
||||||
support.run_unittest(
|
support.run_unittest(
|
||||||
|
|
Loading…
Reference in New Issue