Add C++ loop memory leak test for MemoryChecker
PiperOrigin-RevId: 346579012 Change-Id: I4dcf861efac18f665ec9b8f951ab8b082a0d7777
This commit is contained in:
parent
103262b754
commit
e874244346
@ -108,6 +108,18 @@ class MemoryCheckerTest(test.TestCase):
|
||||
with self.assertRaises(AssertionError):
|
||||
memory_checker.assert_no_leak_if_all_possibly_except_one()
|
||||
|
||||
def testLeak4(self):
|
||||
helper = _memory_checker_test_helper.MemoryCheckerTestHelper()
|
||||
|
||||
with MemoryChecker() as memory_checker:
|
||||
for i in range(10):
|
||||
helper.list_push_back(i)
|
||||
memory_checker.record_snapshot()
|
||||
|
||||
memory_checker.report()
|
||||
with self.assertRaises(AssertionError):
|
||||
memory_checker.assert_no_leak_if_all_possibly_except_one()
|
||||
|
||||
def testNoNewPythonObjectsEmpty(self):
|
||||
self.skipTest('TODO(b/150324603): Flaky test.')
|
||||
with MemoryChecker() as memory_checker:
|
||||
|
Loading…
Reference in New Issue
Block a user