diff options
Diffstat (limited to 'lldb/test/API/python_api/debugger/TestDebuggerAPI.py')
| -rw-r--r-- | lldb/test/API/python_api/debugger/TestDebuggerAPI.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py index 6bc6b3bcbba8..dcc8e2477468 100644 --- a/lldb/test/API/python_api/debugger/TestDebuggerAPI.py +++ b/lldb/test/API/python_api/debugger/TestDebuggerAPI.py @@ -30,7 +30,7 @@ class DebuggerAPITestCase(TestBase): self.dbg.SetPrompt(None) self.dbg.SetCurrentPlatform(None) self.dbg.SetCurrentPlatformSDKRoot(None) - + fresh_dbg = lldb.SBDebugger() self.assertEquals(len(fresh_dbg), 0) @@ -146,3 +146,16 @@ class DebuggerAPITestCase(TestBase): self.assertEqual(platform2.GetName(), expected_platform) self.assertTrue(platform2.GetWorkingDirectory().endswith("bar"), platform2.GetWorkingDirectory()) + + def test_SetDestroyCallback(self): + destroy_dbg_id = None + def foo(dbg_id): + # Need nonlocal to modify closure variable. + nonlocal destroy_dbg_id + destroy_dbg_id = dbg_id + + self.dbg.SetDestroyCallback(foo) + + original_dbg_id = self.dbg.GetID() + self.dbg.Destroy(self.dbg) + self.assertEqual(destroy_dbg_id, original_dbg_id) |
