[Lldb-commits] [lldb] 47c4c6a - [lldb] Use assertState in more tests (NFC)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 9 16:18:15 PDT 2022


Author: Dave Lee
Date: 2022-06-09T16:18:07-07:00
New Revision: 47c4c6a7469f3fd3e364a9b3669838686d4f1de6

URL: https://github.com/llvm/llvm-project/commit/47c4c6a7469f3fd3e364a9b3669838686d4f1de6
DIFF: https://github.com/llvm/llvm-project/commit/47c4c6a7469f3fd3e364a9b3669838686d4f1de6.diff

LOG: [lldb] Use assertState in more tests (NFC)

Follow to D127355, converting more `assertEquals` to `assertState`.

Differential Revision: https://reviews.llvm.org/D127378

Added: 
    

Modified: 
    lldb/test/API/commands/register/register/register_command/TestRegisters.py
    lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
    lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
    lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
    lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py
    lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
    lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
    lldb/test/API/functionalities/exec/TestExec.py
    lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
    lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py
    lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
    lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py
    lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
    lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
    lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
    lldb/test/API/functionalities/signal/raise/TestRaise.py
    lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py
    lldb/test/API/functionalities/step_scripted/TestStepScripted.py
    lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
    lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py
    lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py
    lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
    lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
    lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
    lldb/test/API/python_api/frame/TestFrames.py
    lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
    lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
    lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
    lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
    lldb/test/API/python_api/target/TestTargetAPI.py
    lldb/test/API/python_api/thread/TestThreadAPI.py
    lldb/test/API/python_api/type/TestTypeList.py
    lldb/test/API/python_api/value/TestValueAPI.py
    lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
    lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
    lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
    lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
    lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
    lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
    lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/commands/register/register/register_command/TestRegisters.py b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
index 083f56c300f6a..0fd90dc973d2b 100644
--- a/lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -221,8 +221,8 @@ def fp_special_purpose_register_read(self):
         self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL)
 
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         thread = process.GetThreadAtIndex(0)
         self.assertTrue(thread.IsValid(), "current thread is valid")

diff  --git a/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py b/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
index c0633360137a0..86f896dbb2e27 100644
--- a/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
+++ b/lldb/test/API/commands/watchpoints/multiple_hits/TestMultipleHits.py
@@ -26,7 +26,7 @@ def test(self):
 
         process = target.LaunchSimple(None, None,
                 self.get_process_working_directory())
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
 
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertIsNotNone(thread)
@@ -46,6 +46,6 @@ def test(self):
             self.assertSuccess(error)
 
         process.Continue();
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         self.assertEqual(thread.GetStopReason(), lldb.eStopReasonWatchpoint)
 

diff  --git a/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py b/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
index 262f718f2ade9..62807b8937e9d 100644
--- a/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
+++ b/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
@@ -66,7 +66,7 @@ def auto_continue_with_command(self):
         bpno = self.make_target_and_bkpt("-N BKPT -C 'break modify --auto-continue 0 BKPT'")
         process = self.launch_it(lldb.eStateStopped)
         state = process.GetState()
-        self.assertEqual(state, lldb.eStateStopped, "Process should be stopped")
+        self.assertState(state, lldb.eStateStopped, "Process should be stopped")
         bkpt = self.target.FindBreakpointByID(bpno)
         threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt)
         self.assertEqual(len(threads), 1, "There was a thread stopped at our breakpoint")

diff  --git a/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py b/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
index 0e958bd2943d1..9c02347d68ed8 100644
--- a/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
+++ b/lldb/test/API/functionalities/breakpoint/debugbreak/TestDebugBreak.py
@@ -26,7 +26,7 @@ def test_asm_int_3(self):
             None, None, self.get_process_working_directory())
 
         # We've hit the first stop, so grab the frame.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         stop_reason = lldb.eStopReasonException if (lldbplatformutil.getPlatform(
         ) == "windows" or lldbplatformutil.getPlatform() == "macosx") else lldb.eStopReasonSignal
         thread = lldbutil.get_stopped_thread(process, stop_reason)

diff  --git a/lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py b/lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py
index 56ae6a5ade914..cb3d32e8e0aca 100644
--- a/lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py
+++ b/lldb/test/API/functionalities/conditional_break/TestConditionalBreak.py
@@ -48,8 +48,8 @@ def do_conditional_break(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         # Find the line number where a's parent frame function is c.
         line = line_number(

diff  --git a/lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py b/lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
index 2696ae1838249..567bc5344a6ad 100644
--- a/lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
+++ b/lldb/test/API/functionalities/dyld-exec-linux/TestDyldExecLinux.py
@@ -56,6 +56,6 @@ def test(self):
         process.Continue();
 
         # Stopped on main here.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = process.GetSelectedThread()
         self.assertIn("main", thread.GetFrameAtIndex(0).GetDisplayFunctionName())

diff  --git a/lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py b/lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
index 7782f9739e71e..ceaae3a97eb3f 100644
--- a/lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
+++ b/lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py
@@ -43,17 +43,17 @@ def test(self):
         self.assertSuccess(error)
 
         # Stopped on main here.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = process.GetSelectedThread()
         self.assertIn("main", thread.GetFrameAtIndex(0).GetDisplayFunctionName())
         process.Continue()
 
         # Stopped on get_signal_crash function here.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         self.assertIn("get_signal_crash", thread.GetFrameAtIndex(0).GetDisplayFunctionName())
         process.Continue()
 
         # Stopped because of generated signal.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         self.assertIn("raise", thread.GetFrameAtIndex(0).GetDisplayFunctionName())
         self.assertIn("get_signal_crash", thread.GetFrameAtIndex(1).GetDisplayFunctionName())

diff  --git a/lldb/test/API/functionalities/exec/TestExec.py b/lldb/test/API/functionalities/exec/TestExec.py
index 5d0665986dc6f..91dc72df85777 100644
--- a/lldb/test/API/functionalities/exec/TestExec.py
+++ b/lldb/test/API/functionalities/exec/TestExec.py
@@ -69,8 +69,8 @@ def cleanup():
             self.addTearDownHook(cleanup)
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
         process, breakpoint1)
@@ -94,7 +94,7 @@ def cleanup():
         if not skip_exec:
             self.assertNotEqual(process.GetState(), lldb.eStateExited,
                                 "Process should not have exited!")
-            self.assertEqual(process.GetState(), lldb.eStateStopped,
+            self.assertState(process.GetState(), lldb.eStateStopped,
                              "Process should be stopped at __dyld_start")
 
             threads = lldbutil.get_stopped_threads(
@@ -137,8 +137,8 @@ def test_correct_thread_plan_state_before_exec(self):
             self, 'Set breakpoint 1 here', lldb.SBFileSpec('main.cpp', False))
 
         # The stop reason of the thread should be breakpoint.
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        STOPPED_DUE_TO_BREAKPOINT)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         STOPPED_DUE_TO_BREAKPOINT)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(process, breakpoint1)
         self.assertEqual(len(threads), 1)
@@ -164,7 +164,7 @@ def test_correct_thread_plan_state_before_exec(self):
 
         self.assertNotEqual(process.GetState(), lldb.eStateExited,
                             "Process should not have exited!")
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
+        self.assertState(process.GetState(), lldb.eStateStopped,
                          "Process should be stopped at __dyld_start")
 
         threads = lldbutil.get_stopped_threads(

diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py b/lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
index 44873f39628c8..969b535850ab7 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
@@ -101,6 +101,6 @@ def qProcessInfo(self):
         process = target.Launch(launch_info, error)
 
         self.assertSuccess(error, "Successfully launched.")
-        self.assertEqual(process.GetState(), lldb.eStateStopped, "Should be stopped at entry")
+        self.assertState(process.GetState(), lldb.eStateStopped, "Should be stopped at entry")
         self.assertIsNotNone(self.a_packet_file, "A packet was sent")
         self.assertEqual(self.absent_file, self.a_packet_file, "The A packet file was correct")

diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py b/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py
index e03c47809854b..853e1138b9ef3 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestRestartBug.py
@@ -62,4 +62,4 @@ def cont(self):
         # auto-continue after setting the breakpoint.
         self.assertEqual(self.server.responder.continueCount, 1)
         # And the process should end up in the stopped state.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)

diff  --git a/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
index 6fbb59ad210d3..d14959a29e141 100644
--- a/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
+++ b/lldb/test/API/functionalities/postmortem/minidump/TestMiniDump.py
@@ -120,7 +120,7 @@ def test_deeper_stack_in_mini_dump(self):
             breakpoint = target.BreakpointCreateByName("bar")
             process = target.LaunchSimple(
                 None, None, self.get_process_working_directory())
-            self.assertEqual(process.GetState(), lldb.eStateStopped)
+            self.assertState(process.GetState(), lldb.eStateStopped)
             self.assertTrue(process.SaveCore(core))
             self.assertTrue(os.path.isfile(core))
             self.assertSuccess(process.Kill())
@@ -156,7 +156,7 @@ def test_local_variables_in_mini_dump(self):
             breakpoint = target.BreakpointCreateByName("bar")
             process = target.LaunchSimple(
                 None, None, self.get_process_working_directory())
-            self.assertEqual(process.GetState(), lldb.eStateStopped)
+            self.assertState(process.GetState(), lldb.eStateStopped)
             self.assertTrue(process.SaveCore(core))
             self.assertTrue(os.path.isfile(core))
             self.assertSuccess(process.Kill())

diff  --git a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py
index c7111db5d78b6..7da3884859908 100644
--- a/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py
+++ b/lldb/test/API/functionalities/process_save_core/TestProcessSaveCore.py
@@ -40,7 +40,7 @@ def test_save_windows_mini_dump(self):
             breakpoint = target.BreakpointCreateByName("bar")
             process = target.LaunchSimple(
                 None, None, self.get_process_working_directory())
-            self.assertEqual(process.GetState(), lldb.eStateStopped)
+            self.assertState(process.GetState(), lldb.eStateStopped)
             self.assertTrue(process.SaveCore(core))
             self.assertTrue(os.path.isfile(core))
             self.assertSuccess(process.Kill())
@@ -74,7 +74,7 @@ def test_save_core_via_process_plugin(self):
             breakpoint = target.BreakpointCreateByName("bar")
             process = target.LaunchSimple(
                 None, None, self.get_process_working_directory())
-            self.assertEqual(process.GetState(), lldb.eStateStopped)
+            self.assertState(process.GetState(), lldb.eStateStopped)
             self.assertTrue(process.SaveCore(core))
             self.assertTrue(os.path.isfile(core))
             self.assertSuccess(process.Kill())

diff  --git a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
index 4275c93aadd87..f2ea380751a77 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
+++ b/lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py
@@ -26,7 +26,7 @@ def test_save_linux_mini_dump(self):
             target = self.dbg.CreateTarget(exe)
             process = target.LaunchSimple(
                 None, None, self.get_process_working_directory())
-            self.assertEqual(process.GetState(), lldb.eStateStopped)
+            self.assertState(process.GetState(), lldb.eStateStopped)
 
             # get neccessary data for the verification phase
             process_info = process.GetProcessInfo()

diff  --git a/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py b/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
index 5f3eb31c83aee..d4b377bc14666 100644
--- a/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
+++ b/lldb/test/API/functionalities/signal/handle-abrt/TestHandleAbort.py
@@ -32,7 +32,7 @@ def test_inferior_handle_sigabrt(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         signo = process.GetUnixSignals().GetSignalNumberFromName("SIGABRT")
 
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)

diff  --git a/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py b/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
index 30ae201ed14f8..3cd7cbb5ce146 100644
--- a/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
+++ b/lldb/test/API/functionalities/signal/handle-segv/TestHandleSegv.py
@@ -28,7 +28,7 @@ def test_inferior_handle_sigsegv(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         signo = process.GetUnixSignals().GetSignalNumberFromName("SIGSEGV")
 
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)

diff  --git a/lldb/test/API/functionalities/signal/raise/TestRaise.py b/lldb/test/API/functionalities/signal/raise/TestRaise.py
index 4a81c69577537..dd7e9af58787e 100644
--- a/lldb/test/API/functionalities/signal/raise/TestRaise.py
+++ b/lldb/test/API/functionalities/signal/raise/TestRaise.py
@@ -43,7 +43,7 @@ def launch(self, target, signal):
         process = target.LaunchSimple(
             [signal], None, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -82,7 +82,7 @@ def signal_test(self, signal, test_passing):
         # Make sure we stop at the signal
         lldbutil.set_actions_for_signal(self, signal, "false", "true", "true")
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)
         self.assertTrue(
             thread.IsValid(),
@@ -135,7 +135,7 @@ def signal_test(self, signal, test_passing):
         # Make sure we stop at the signal
         lldbutil.set_actions_for_signal(self, signal, "true", "true", "true")
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)
         self.assertTrue(
             thread.IsValid(),

diff  --git a/lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py b/lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py
index 43fbcffc8e4ab..b3f8b3d7207d2 100644
--- a/lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py
+++ b/lldb/test/API/functionalities/step-vrs-interrupt/TestStepVrsInterruptTimeout.py
@@ -33,4 +33,4 @@ def sample_test(self):
         self.dbg.SetAsync(False)
         self.runCmd("settings set target.process.interrupt-timeout 1")
         thread.StepOver()
-        self.assertEqual(process.GetState(), lldb.eStateStopped, "Stopped like we should")
+        self.assertState(process.GetState(), lldb.eStateStopped, "Stopped like we should")

diff  --git a/lldb/test/API/functionalities/step_scripted/TestStepScripted.py b/lldb/test/API/functionalities/step_scripted/TestStepScripted.py
index fdd00861809d1..3aab76ea0e5b2 100644
--- a/lldb/test/API/functionalities/step_scripted/TestStepScripted.py
+++ b/lldb/test/API/functionalities/step_scripted/TestStepScripted.py
@@ -100,7 +100,7 @@ def do_test_checking_variable(self, use_cli):
             self.assertSuccess(err)
 
         # We should not have exited:
-        self.assertEqual(process.GetState(), lldb.eStateStopped, "We are stopped")
+        self.assertState(process.GetState(), lldb.eStateStopped, "We are stopped")
 
         # We should still be in foo:
         self.assertEqual("foo", frame.GetFunctionName())

diff  --git a/lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py b/lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
index 77d08fec37073..878e8694cb13a 100644
--- a/lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
+++ b/lldb/test/API/functionalities/stop-on-sharedlibrary-load/TestStopOnSharedlibraryEvents.py
@@ -58,7 +58,7 @@ def do_test(self, bkpt_modifier = None):
         self.assertGreater(backstop_bkpt_1.GetNumLocations(), 0, "Set our second breakpoint")
         
         process.Continue() 
-        self.assertEqual(process.GetState(), lldb.eStateStopped, "We didn't stop for the load")
+        self.assertState(process.GetState(), lldb.eStateStopped, "We didn't stop for the load")
         self.assertEqual(backstop_bkpt_1.GetHitCount(), 0, "Hit our backstop breakpoint")
         
         # We should be stopped after the library is loaded, check that:
@@ -82,14 +82,14 @@ def do_test(self, bkpt_modifier = None):
             
         if bkpt_modifier == None:
             process.Continue()
-            self.assertEqual(process.GetState(), lldb.eStateStopped, "We didn't stop for the load")
+            self.assertState(process.GetState(), lldb.eStateStopped, "We didn't stop for the load")
             self.assertEqual(backstop_bkpt_2.GetHitCount(), 0, "Hit our backstop breakpoint")
             self.assertEqual(thread.stop_reason, lldb.eStopReasonBreakpoint, "We attributed the stop to the breakpoint")
             self.assertEqual(load_bkpt.GetHitCount(), 1, "We hit our breakpoint at the load address")
         else:
             bkpt_modifier(load_bkpt)
             process.Continue()
-            self.assertEqual(process.GetState(), lldb.eStateStopped, "We didn't stop")
+            self.assertState(process.GetState(), lldb.eStateStopped, "We didn't stop")
             self.assertTrue(thread.IsValid(), "Our thread was no longer valid.")
             self.assertEqual(thread.stop_reason, lldb.eStopReasonBreakpoint, "We didn't hit some breakpoint")
             self.assertEqual(backstop_bkpt_2.GetHitCount(), 1, "We continued to the right breakpoint")

diff  --git a/lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py b/lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py
index 988d90a7bb37f..ad63ba87fa099 100644
--- a/lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py
+++ b/lldb/test/API/lang/c/step_over_no_deadlock/TestStepOverDoesntBlock.py
@@ -27,4 +27,4 @@ def test_step_over(self):
         
         thread.StepOver()
         state = process.GetState()
-        self.assertEqual(state, lldb.eStateStopped)
+        self.assertState(state, lldb.eStateStopped)

diff  --git a/lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py b/lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py
index 561e68f9bcbfd..f37c33705f091 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestCppValueCast.py
@@ -63,8 +63,8 @@ def do_sbvalue_cast(self, exe_name):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         # Find DerivedA and DerivedB types.
         typeA = target.FindFirstType('DerivedA')

diff  --git a/lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py b/lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
index 090210d447c35..f974b298c4f1d 100644
--- a/lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
+++ b/lldb/test/API/lang/objc/objc-checker/TestObjCCheckers.py
@@ -49,8 +49,8 @@ def test_objc_checker(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
 
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         threads = lldbutil.get_threads_stopped_at_breakpoint(
             process, main_bkpt)

diff  --git a/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py b/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
index 8104428c54d07..9d09694f290ac 100644
--- a/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
+++ b/lldb/test/API/linux/aarch64/unwind_signal/TestUnwindSignal.py
@@ -29,7 +29,7 @@ def test_unwind_signal(self):
         process = target.LaunchSimple(
             None, None, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         signo = process.GetUnixSignals().GetSignalNumberFromName("SIGILL")
 
         thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)

diff  --git a/lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py b/lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
index 288602199e2e4..990a225512b40 100644
--- a/lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
+++ b/lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py
@@ -41,7 +41,7 @@ def suspended_thread_test(self):
         self.assertEqual(return_bkpt.GetNumLocations(), 1, "Found return breakpoint")
         # Now continue, and we should stop with a stop reason of SIGBUS:
         process.Continue()
-        self.assertEqual(process.state, lldb.eStateStopped, "Stopped after continue to SIGBUS")
+        self.assertState(process.state, lldb.eStateStopped, "Stopped after continue to SIGBUS")
         if thread.stop_reason == lldb.eStopReasonBreakpoint:
             id = thread.GetStopReasonDataAtIndex(0)
             name = thread.frame[0].name

diff  --git a/lldb/test/API/python_api/frame/TestFrames.py b/lldb/test/API/python_api/frame/TestFrames.py
index f02257a3056a9..bf2b990ccfdb5 100644
--- a/lldb/test/API/python_api/frame/TestFrames.py
+++ b/lldb/test/API/python_api/frame/TestFrames.py
@@ -37,8 +37,8 @@ def test_get_arg_vals_for_call_stack(self):
             None, None, self.get_process_working_directory())
 
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         # Keeps track of the number of times 'a' is called where it is within a
         # depth of 3 of the 'c' leaf function.
@@ -140,8 +140,8 @@ def test_frame_api_boundary_condition(self):
             None, None, self.get_process_working_directory())
 
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
@@ -181,8 +181,8 @@ def test_frame_api_IsEqual(self):
             None, None, self.get_process_working_directory())
 
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)

diff  --git a/lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py b/lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
index aa8c9c378127d..bd1dead9979c3 100644
--- a/lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
+++ b/lldb/test/API/python_api/frame/inlines/TestInlinedFrame.py
@@ -46,8 +46,8 @@ def test_stop_at_outer_inline(self):
             None, None, self.get_process_working_directory())
 
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         import lldbsuite.test.lldbutil as lldbutil
         stack_traces1 = lldbutil.print_stacktraces(process, string_buffer=True)
@@ -78,8 +78,8 @@ def test_stop_at_outer_inline(self):
 
             # Expect to break again for the second time.
             process.Continue()
-            self.assertEqual(process.GetState(), lldb.eStateStopped,
-                            PROCESS_STOPPED)
+            self.assertState(process.GetState(), lldb.eStateStopped,
+                             PROCESS_STOPPED)
             stack_traces2 = lldbutil.print_stacktraces(
                 process, string_buffer=True)
             if self.TraceOn():

diff  --git a/lldb/test/API/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
index c884241f33d49..7eb3333c139e2 100644
--- a/lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
+++ b/lldb/test/API/python_api/function_symbol/TestDisasmAPI.py
@@ -52,7 +52,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -75,7 +75,7 @@ def test(self):
 
         # Continue the inferior, the breakpoint 2 should be hit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
index 14b01d557b617..fe9063950d512 100644
--- a/lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
+++ b/lldb/test/API/python_api/function_symbol/TestSymbolAPI.py
@@ -52,7 +52,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -69,7 +69,7 @@ def test(self):
 
         # Continue the inferior, the breakpoint 2 should be hit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
index 9c69bd90161bd..2660f1a6d2798 100644
--- a/lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
+++ b/lldb/test/API/python_api/lldbutil/frame/TestFrameUtils.py
@@ -39,8 +39,8 @@ def test_frame_utils(self):
 
         if not process:
             self.fail("SBTarget.LaunchProcess() failed")
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
 
         import lldbsuite.test.lldbutil as lldbutil
         thread = lldbutil.get_stopped_thread(

diff  --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py
index c5ca42a894703..2ae9d44263038 100644
--- a/lldb/test/API/python_api/target/TestTargetAPI.py
+++ b/lldb/test/API/python_api/target/TestTargetAPI.py
@@ -428,7 +428,7 @@ def resolve_symbol_context_with_address(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.line1.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
@@ -443,7 +443,7 @@ def resolve_symbol_context_with_address(self):
 
         # Continue the inferior, the breakpoint 2 should be hit.
         process.Continue()
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/thread/TestThreadAPI.py b/lldb/test/API/python_api/thread/TestThreadAPI.py
index b8416ebba9b88..91e635c3994ac 100644
--- a/lldb/test/API/python_api/thread/TestThreadAPI.py
+++ b/lldb/test/API/python_api/thread/TestThreadAPI.py
@@ -197,7 +197,7 @@ def step_over_3_times(self, exe_name):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.step_out_of_malloc.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
             thread.IsValid(),
@@ -243,7 +243,7 @@ def run_to_address(self, exe_name):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Frame #0 should be on self.step_out_of_malloc.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
         self.assertTrue(
             thread.IsValid(),

diff  --git a/lldb/test/API/python_api/type/TestTypeList.py b/lldb/test/API/python_api/type/TestTypeList.py
index 1e71de072c4f1..41c249bfd7190 100644
--- a/lldb/test/API/python_api/type/TestTypeList.py
+++ b/lldb/test/API/python_api/type/TestTypeList.py
@@ -46,7 +46,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/value/TestValueAPI.py b/lldb/test/API/python_api/value/TestValueAPI.py
index 543186c1e31fb..7ba9c44bb8eb4 100644
--- a/lldb/test/API/python_api/value/TestValueAPI.py
+++ b/lldb/test/API/python_api/value/TestValueAPI.py
@@ -45,7 +45,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
index afd25bda879a3..5bc7475bacd2b 100644
--- a/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
+++ b/lldb/test/API/python_api/value/linked_list/TestValueAPILinkedList.py
@@ -49,7 +49,7 @@ def test(self):
         self.assertTrue(process, PROCESS_IS_VALID)
 
         # Get Frame #0.
-        self.assertEqual(process.GetState(), lldb.eStateStopped)
+        self.assertState(process.GetState(), lldb.eStateStopped)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         self.assertTrue(

diff  --git a/lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py b/lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
index b1a41a4a709cd..8d06b3dbab0e6 100644
--- a/lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
+++ b/lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
@@ -48,8 +48,8 @@ def test_watch_val(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)

diff  --git a/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
index dd0defd784503..750e3dcef4b90 100644
--- a/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ b/lldb/test/API/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -55,8 +55,8 @@ def test_set_watch_ignore_count(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)

diff  --git a/lldb/test/API/python_api/watchpoint/TestWatchpointIter.py b/lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
index 6ca99993bcd1c..0dc3f49a3ebb3 100644
--- a/lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
+++ b/lldb/test/API/python_api/watchpoint/TestWatchpointIter.py
@@ -51,8 +51,8 @@ def test_watch_iter(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)

diff  --git a/lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
index 847f6782404a4..5230f16b41ba6 100644
--- a/lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
+++ b/lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
@@ -54,8 +54,8 @@ def test_watchpoint_cond_api(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)

diff  --git a/lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
index 9f1c6776d4a68..8b2682a3bc74e 100644
--- a/lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ b/lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -50,8 +50,8 @@ def test_watch_location(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)

diff  --git a/lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
index 15d9b2a5abe99..ca32300054c36 100644
--- a/lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ b/lldb/test/API/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -48,8 +48,8 @@ def test_watch_address(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)
@@ -122,8 +122,8 @@ def test_watch_address_with_invalid_watch_size(self):
 
         # We should be stopped due to the breakpoint.  Get frame #0.
         process = target.GetProcess()
-        self.assertEqual(process.GetState(), lldb.eStateStopped,
-                        PROCESS_STOPPED)
+        self.assertState(process.GetState(), lldb.eStateStopped,
+                         PROCESS_STOPPED)
         thread = lldbutil.get_stopped_thread(
             process, lldb.eStopReasonBreakpoint)
         frame0 = thread.GetFrameAtIndex(0)


        


More information about the lldb-commits mailing list