From 779bbbf27fe631154bdfaac7a443f198d4654688 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Fri, 11 Feb 2022 21:23:16 -0800 Subject: [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 --- .../functionalities/scripted_process/TestStackCoreScriptedProcess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py') 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) -- cgit v1.2.3