added tests for if malloc_object_size small allocations are free

This commit is contained in:
rwarr627
2020-06-17 18:59:44 -07:00
committed by Daniel Micay
parent de3fb50dcc
commit 7804e263e9
5 changed files with 50 additions and 2 deletions

View File

@ -186,8 +186,24 @@ class TestSimpleMemoryCorruption(unittest.TestCase):
self.assertEqual(returncode, 0)
def test_malloc_object_size_offset(self):
_stdout, _stderr, returncode = self.run_test("malloc_object_size_offset")
_stdout, _stderr, returncode = self.run_test(
"malloc_object_size_offset")
self.assertEqual(returncode, 0)
def test_invalid_malloc_object_size_small(self):
_stdout, stderr, returncode = self.run_test(
"invalid_malloc_object_size_small")
self.assertEqual(returncode, -6)
self.assertEqual(stderr.decode(
"utf-8"), "fatal allocator error: invalid malloc_object_size\n")
def test_invalid_malloc_object_size_small_quarantine(self):
_stdout, stderr, returncode = self.run_test(
"invalid_malloc_object_size_small_quarantine")
self.assertEqual(returncode, -6)
self.assertEqual(stderr.decode(
"utf-8"), "fatal allocator error: invalid malloc_object_size (quarantine)\n")
if __name__ == '__main__':
unittest.main()