diff options
| author | Dave Lee <davelee.com@gmail.com> | 2022-02-11 21:23:16 -0800 |
|---|---|---|
| committer | Dave Lee <davelee.com@gmail.com> | 2022-02-14 08:31:17 -0800 |
| commit | 779bbbf27fe631154bdfaac7a443f198d4654688 (patch) | |
| tree | fde0e9527bc0d5a37f487bffc9964738222b3418 /lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py | |
| parent | 3c8d2aa87c1701ca16e13f06aea484637e03d005 (diff) | |
[lldb] Replace asserts on .Success() with assertSuccess()
Replace forms of `assertTrue(err.Success())` with `assertSuccess(err)` (added in D82759).
* `assertSuccess` prints out the error's message
* `assertSuccess` expresses explicit higher level semantics, both to the reader and for test failure output
* `assertSuccess` seems not to be well known, using it where possible will help spread knowledge
* `assertSuccess` statements are more succinct
Differential Revision: https://reviews.llvm.org/D119616
Diffstat (limited to 'lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py')
| -rw-r--r-- | lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py b/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py index 61b0c4fd16b1..3f4222fe3b79 100644 --- a/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py +++ b/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py @@ -48,7 +48,7 @@ class StackCoreScriptedProcesTestCase(TestBase): self.assertTrue(main_module, "Invalid main module.") error = target.SetModuleLoadAddress(main_module, 0) - self.assertTrue(error.Success(), "Reloading main module at offset 0 failed.") + self.assertSuccess(error, "Reloading main module at offset 0 failed.") os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1' def cleanup(): @@ -77,7 +77,7 @@ class StackCoreScriptedProcesTestCase(TestBase): error = lldb.SBError() process = target.Launch(launch_info, error) - self.assertTrue(error.Success(), error.GetCString()) + self.assertSuccess(error) self.assertTrue(process, PROCESS_IS_VALID) self.assertEqual(process.GetProcessID(), 42) |
